query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
/ postEditResources Checks to see if the user data is valid if so it will update the DB if the user data is invalid will reload the edit user page.
public function postEditResources() { $id = $this->_params['id']; $errors = validateEditResource($id); if(!($errors === true)) { $database = new Database(); $resource = $database->getResourceById($id); /*construct($resourceID = "0", $resourceName = "Resource", $description = "Info", $contactName ="",$contactEmail = "",$contactPhone = "",$link = "", $active = "1" )*/ $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description'] , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] , $resource['Link'], $resource['Active']); $this->_f3->set('Resource', $availableResource); $this->_f3->set('errors', $errors); echo Template::instance()->render('view/include/head.php'); echo Template::instance()->render('view/include/top-nav.php'); echo Template::instance()->render('view/edit-resources.php'); echo Template::instance()->render('view/include/footer.php'); } else { // fixme add routing $this->_f3->reroute('/Admin'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function post_edit() {\n //try to edit the user\n if (AuxUser::editUser()) {\n //if the edit process worked, redirect to the profile page\n echo '<script>alert(\"User data edited\");</script>';\n Response::redirect('/profile');\n } else {\n //if not, print the error message\n echo '<script>alert(\"No data was updated, Please confirm that you change at least one field\");</script>';\n Response::redirect('/user/edit', 'refresh');\n }\n }", "public function p_edit() { if(!$this->user) {\n Router::redirect('/');\n }\n \n $this->user->user_id = DB::instance(DB_NAME)->sanitize($this->user->user_id);\n $q = 'SELECT first_name, last_name, email\n FROM users\n WHERE user_id = \"'.$this->user->user_id.'\"';\n $user = DB::instance(DB_NAME)->select_row($q);\n \n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n \n $_POST['first_name'] = htmlspecialchars($_POST['first_name'], ENT_QUOTES, 'UTF-8');\n $_POST['last_name'] = htmlspecialchars($_POST['last_name'], ENT_QUOTES, 'UTF-8');\n \n $q = 'SELECT count(*)\n FROM users\n WHERE email = \"'.$_POST['email'].'\"'; \n $count = DB::instance(DB_NAME)->select_rows($q); \n //if the user enters an email which already exists in the data base kick them back\n if(intval($count[0]['count(*)']) >= 1) {\n Router::redirect('/users/edit/error');\n } else {\n \n if($_POST['first_name'] != NULL)\n {\n $user['first_name'] = $_POST['first_name'];\n }\n if($_POST['last_name'] != NULL )\n {\n $user['last_name'] = $_POST['last_name'];\n }\n if($_POST['email'] != NULL )\n {\n $user['email'] = $_POST['email'];\n }\n \n \n \n DB::instance(DB_NAME)->update(\"users\", $user, \"WHERE user_id =\".$this->user->user_id);\n Router::redirect('/users/profile/'.$this->user->user_id);\n }\n \n \n }", "public function getPostEditUser()\n {\n // Render login page if not logged in.\n if (!$this->di->get(\"session\")->has(\"account\")) {\n $this->di->get(\"response\")->redirect(\"user/login\");\n }\n\n $title = \"Edit\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n\n $user = new User();\n $username = $this->di->get(\"session\")->get(\"account\");\n $user->setDb($this->di->get(\"db\"));\n $user->find(\"username\", $username);\n\n $form = new EditUserForm($this->di, $user);\n\n $form->check();\n\n $data = [\n \"form\" => $form->getHTML(),\n ];\n\n $view->add(\"user/edit\", $data);\n\n $pageRender->renderPage([\"title\" => $title]);\n }", "public function postEdit()\n {\n // If we are not authentified, redirect to the login page.\n if(Auth::guest()) return Redirect::action('frontend\\UserController@getLogin');\n\n $loggedUser = Auth::user();\n\n $user = API::put('api/v1/user/' . $loggedUser->id, Input::all());\n\n // If the API throws a ValidationException $user will be a JSON string with our errors.\n if(is_string($user)) {\n $errors = json_decode($user, true);\n return Redirect::action('frontend\\UserController@getIndex')\n ->withErrors($errors);\n } else {\n return Redirect::action('frontend\\UserController@getIndex')\n ->with('success', 'Profile edited!');\n }\n }", "public function actionEdit()\n {\n $userId = User::checkLogged();\n if ($userId == true) {\n $user = User::getUserById($userId);\n } else {\n header (\"Location: /login\");\n }\n\n // Variables for the form\n $firstName = $user['first_name'];\n $lastName = $user['last_name'];\n $email = $user['email'];\n $password = md5($user['password']);\n $birth = $user['birth'];\n $company = $user['company'];\n $address = $user['address'];\n $city = $user['city'];\n $state = $user['state'];\n $postcode = $user['postcode'];\n $country = $user['country'];\n $phone = $user['phone'];\n \n $result = false;\n \n if (isset($_POST['submit'])) {\n $firstName = $_POST['firstName'];\n $lastName = $_POST['lastName'];\n $email = $_POST['email'];\n $password = md5($_POST['password']);\n $birth = $_POST['birth'];\n $company = $_POST['company'];\n $address = $_POST['address'];\n $city = $_POST['city'];\n $state = $_POST['state'];\n $postcode = $_POST['postcode'];\n $country = $_POST['country'];\n $info = $_POST['info'];\n $phone = $_POST['phone'];\n \n // Flag of errors\n $errors = false;\n\n // Validation the fields\n if (!User::checkFirstName($firstName)) {\n $errors[] = 'First name must be at least 2 characters';\n }\n if (!User::checkLastName($lastName)) {\n $errors[] = 'Last name must be at least 2 characters';\n }\n if (!User::checkEmail($email)) {\n $errors[] = 'Email is wrong';\n }\n if (!User::checkPassword($password)) {\n $errors[] = 'Password must be at least 6 characters';\n }\n if (!User::checkPhone($phone)) {\n $errors[] = 'Phone must be at least 10 characters';\n }\n \n if ($errors == false) {\n // If there are no errors\n // Registrate a new user\n $result = User::update($userId, $firstName, $lastName, $email,\n $password, $birth, $company, $address, $city, \n $state, $postcode, $country, $info, $phone);\n } \n }\n \n require_once(ROOT . '/views/cabinet/edit.php');\n return true;\n }", "function editUserAction()\n {\n $userRp = new UserRepository();\n $validateF = new ValidateFunctions();\n $user = $userRp->getOneFromDB($validateF->sanitize($_GET['id']));\n if ($user != 0) {\n $obj_array = json_decode($user[3], true);\n $pass = $obj_array['user_password'];\n $addedBy = $obj_array['user_added'];\n\n if (!empty($_POST)) {\n $requiredFields = [$_POST['user_name'], $_POST['user_street1'], $_POST['user_city'], $_POST['user_country'], $_POST['user_phone'], $_POST['user_email']];\n\n if ($_SESSION['id'] == $_GET['id']) {\n $requiredFields = [$_POST['user_name'], $_POST['user_street1'], $_POST['user_city'], $_POST['user_country'], $_POST['user_phone'], $_POST['user_email'], $_POST['user_password'], $_POST['user_confirm']];\n }\n if ($this->checkUserInfo($_POST, $_FILES, $requiredFields)) {\n $file = $this->uploadUserImage($_FILES);\n $userInfo = $this->buildUserObject($_POST, $file, $pass, $addedBy);\n $email = $validateF->sanitize($_POST['user_email']);\n $this->updateUserToDatabase($userInfo, $validateF->sanitize($_GET['id']), $email);\n $_SESSION['success'] = ['User edited successfully.'];\n header('Location:index.php?action=index');\n } else{\n header('Location:index.php?action=index');\n }\n } else{\n $modelF = new ModelFunctions();\n $modelF->getAddUserForm();\n }\n } else {\n $_SESSION['error'] = ['User not found.'];\n header('Location:index.php?action=adminUsers');\n }\n\n }", "function editsubmit() \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\t\ttry\n\t\t{\n\t\t\n\t\t\tif (!empty($_POST['username'])&& !empty($_POST['firstname']) && !empty( $_POST['role']) && !empty($_POST['email']))\n\t\t\t{\n\t\t\t\t$userId=$_POST['userid'];\n\t\t\t\t$userName=$_POST['username'];\n\t\t\t\t$email=$_POST['email'];\n\t\t\t\n\t\t\t\t$firstname=$_POST['firstname'];\n\t\t\t\t$middlename=$_POST['middlename'];\n\t\t\t\t$lastname=$_POST['lastname'];\n\t\t\t\t$role=$_POST['role'];\n\t\t\t\t$phoneres=$_POST['phoneres'];\n\t\t\t\t$phonecell=$_POST['phonecell'];\n\t\t\t\t$isActive=$_POST['status'];\n\t\t\t\t$isLocked=$_POST['locked'];\n\t\t\t\t$comments=$_POST['comments'];\n\t\t\t\t\n\t\t\t \n\t\t\t\tUserModel::Create()->UpdateUser( $userId, $userName,$email, $firstname, $middlename, $lastname, $role, $phoneres, $phonecell, $isActive, $isLocked, $comments);\n\t\t\t\t\n\t\t\t\t$this->renderWithTemplate('users/editsubmit', 'AdminPageBaseTemplate');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->viewData['module']=\"Edit User\";\n\t\t\t\t$this->viewData['error']= \"Please Enter all the Required Fields and submit\"; \n\t\t\t\t$this->renderWithTemplate('common/error', 'AdminPageBaseTemplate');\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $ex)\n\t\t{\n\t\t\t$this->viewData['module']=\"Edit User\";\n\t\t\t$this->viewData['error']= $ex->getMessage(); \n\t\t\t$this->renderWithTemplate('users/error', 'AdminPageBaseTemplate');\n\t\t}\n\t\t\t\n\t\t\t\n\t}", "public function edit(){\n\t\t\tif(isset($_POST['submit'])){\n\t\t\t\t//MAP DATA\n\t\t\t\t$user = $this->_map_posted_data();\n\t\t\t\t$user->set_user_id($_POST['id']);\n\t\t\t\t$this->userrepository->update($user);\n\t\t\t\theader(\"Location: index.php/admin/index/edit\");\n\t\t\t}else{\n\t\t\t\t$view_page = \"adminusersview/edit\";\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$user = $this->userrepository->get_by_id($id);\n\t\t\t\tif(is_null($user)){\n\t\t\t\t\theader(\"Location: index.php/admin/index\");\n\t\t\t\t}\n\t\t\t\tinclude_once(ROOT_PATH.\"admin/views/admin/container.php\");\n\t\t\t}\n\t\t}", "private function editResource($request, $resourceForm, $post, $version, $isLastVersion)\n {\n $coAuthors = null;\n $sendNotif = true;\n if (count($post->getCoAuthors())) {\n $coAuthors = clone $post->getCoAuthors();\n }\n if ($request->isMethod('POST')) {\n if ($resourceForm->handleRequest($request)->isValid()) {\n $em = $this->getOEM();\n $em->getConnection()->beginTransaction();\n $postDate = new \\DateTime();\n $create = true;\n\n $postContent = $post->getContent();\n // Purify HTML Content (remove scripts, onclick, etc.)\n $config = \\HTMLPurifier_Config::createDefault();\n // $config->set('HTML.TargetBlank', true);\n $config->set('Attr.AllowedFrameTargets', array('_blank'));\n $config->set('HTML.SafeIframe', true);\n $config->set('URI.SafeIframeRegexp', '%^(http:|https:)?//(www.youtube.com/embed/|player.vimeo.com/video/|www.flickr.com/services/oembed|www.hulu.com/embed|www.google.com/maps/embed|www.dailymotion.com/embed|w.soundcloud.com/player|www.slideshare.net|prezi.com|webtv.ac-versailles.fr|scolawebtv.crdp-versailles.fr|www.audio-lingua.eu|www.xmind.net)%');\n $config->set('Cache.SerializerPermissions', 0775);\n $config->set('Cache.SerializerPath', $this->get('kernel')->getCacheDir().'/htmlpurifier');\n $purifier = new \\HTMLPurifier($config);\n $cleanPostContent = $purifier->purify($postContent);\n\n // User\n $user = $this->getUser();\n\n // Post\n $post\n ->setContent($cleanPostContent)\n ->setStatus($resourceForm->get('submit_draft')->isClicked() ? PostVersion::STATUS_DRAFTING : PostVersion::STATUS_PUBLISHED);\n // reset coauthor if not author of post\n if ($user != $post->getAuthor()) {\n foreach ($coAuthors as $coAuthor) {\n $post->addCoAuthor($coAuthor);\n }\n }\n\n // New version or current ( current if last edit done less than 30 min ago)\n $recentUpdate = ($postDate->getTimestamp() - $version->getUpdateDate()->getTimestamp()) <= 1800;\n if ($isLastVersion && $recentUpdate && $version->getAuthor() == $user) {\n $postVersion = $version;\n $create = false;\n $sendNotif = false;\n } else {\n $postVersion = $this->createObject('post_version');\n }\n $postVersion\n ->setAuthor($user)\n ->setStatus($post->getStatus())\n ->setName($post->getName())\n ->setContent($cleanPostContent)\n ->setUpdateDate($postDate)\n ->setPost($post)\n ;\n\n if ($create) {\n $postVersion->setCreateDate($postDate);\n }\n\n // Group\n $group = false;\n $type = $resourceForm->get('where')->getData();\n\n switch ($type) {\n case Post::TYPE_WALL:\n $post\n ->setType(Post::TYPE_WALL)\n// ->setTargetUser($user)\n ->setPublishedGroup(null)\n ->setPublishedBlog(null)\n ->setPublishedEditor(null)\n ;\n break;\n\n case Post::TYPE_EDITOR:\n if (null !== $editor = $user->getEditor()) {\n $editor->addPost($post);\n $post\n ->setType(Post::TYPE_BLOG)\n ->setPublishedGroup(null)\n ->setPublishedBlog(null)\n ->setPublishedEditor($editor)\n ;\n } else {\n return $this->redirect($this->generateUrl('publish_publications'));\n }\n break;\n\n case Post::TYPE_BLOG:\n if (null !== $blog = $user->getBlog()) {\n $blog->addPost($post);\n $post\n ->setType(Post::TYPE_BLOG)\n ->setPublishedGroup(null)\n ->setPublishedBlog($blog)\n ->setPublishedEditor(null)\n ;\n } else {\n return $this->redirect($this->generateUrl('publication_edit', array('id' => $post->getId())));\n }\n break;\n\n case Post::TYPE_GROUP:\n if (null !== $group = $post->getPublishedGroup()) {\n $post\n ->setType(Post::TYPE_GROUP)\n ->setPublishedBlog(null)\n ->setPublishedEditor(null)\n ;\n $group->addPost($post);\n $this->persist($group);\n\n $this->get('rpe.logs')->create($user, Log::TYPE_POST_RESOURCE, $user, $group);\n } else {\n return $this->redirect($this->generateUrl('publication_edit', array('id' => $post->getId())));\n }\n break;\n\n default:\n return $this->redirect($this->generateUrl('publication_edit', array('id' => $post->getId())));\n }\n\n // MEDIAS\n // if (!$create) {\n // foreach ($postVersion->getMedias() as $media) {\n // $postVersion->removeMedia($media);\n // }\n // }\n\n foreach ($post->getMedias() as $media) {\n // Post\n $media\n ->setUser($user)\n ->setType(RpeMedia::TYPE_POST)\n ->setDate($postDate)\n // ->setDescription($post->getName())\n ;\n\n if (false === $media->getPosts()->contains($post)) {\n $media->addPost($post);\n // Version\n }\n $media->addPostVersion($postVersion);\n if (false === $user->getMedias()->contains($media)) {\n $user->addMedia($media);\n }\n };\n\n // Medias added from Library\n $libraryMedias = array_unique($resourceForm->get('library_medias')->getData());\n $userLibraryMedias = $user->getMediasFromIDs($libraryMedias);\n\n foreach ($userLibraryMedias as $media) {\n $media\n ->addPost($post)\n ->addPostVersion($postVersion)\n ;\n };\n\n $post->setUpdateDate($postDate);\n\n if ($post->isCollaborative()) {\n // close or re-open pad editing\n if ($resourceForm->get('pad_close')->getData() or true) {\n // Send \"close\" notifications to members of the group\n $this->get('rpe.notifications')->wait(Notification::TYPE_RESOURCE_PAD_CLOSE, $user, $post);\n } elseif ($padOldStatus = $post->getMeta('pad_is_closed')) {\n if ($padOldStatus->getValue()) {\n // Send \"re-open\" notifications to members of the group\n $this->get('rpe.notifications')->wait(Notification::TYPE_RESOURCE_PAD_REOPEN, $user, $post);\n }\n }\n $this->setPostMeta($post, 'pad_is_closed', $resourceForm->get('pad_close')->getData(), 'etherpad');\n }\n\n // Persis & Flush\n $this->persist($user, $post, $postVersion)->flush();\n\n // check media quota\n $user_quota = $user->getDiskQuota();\n foreach ($post->getMedias() as $media) {\n $check_media = $this->checkMediaSize($media, $user_quota);\n if ($check_media === false) {\n $em->getConnection()->rollback();\n return false;\n } else {\n $user_quota += $check_media;\n }\n }\n $this->setUserMeta($user, User::META_MEDIA_DISK_QUOTA, $user_quota);\n $em->getConnection()->commit();\n\n if (false === $resourceForm->get('submit_draft')->isClicked() && $create && $sendNotif) {\n $this->get('rpe.notifications')->wait(Notification::TYPE_RESOURCE_EDIT, $user, $post);\n }\n return $this->redirect($this->generateUrl('publication', array('id' => $post->getId())));\n\n } else {\n throw new \\RuntimeException('Form is not valid...');\n }\n }\n return false;\n }", "public function editAction()\n {\n\n $id = $this->params()->fromRoute('id');\n $viewModel = new ViewModel(['title' => 'edit a user','id' => $id]);\n $entity = $this->params()->fromRoute('entity', 'user');\n /** @var InterpretersOffice\\Entity\\Repository\\UserRepository $repo */\n $repo = $this->entityManager->getRepository('InterpretersOffice\\Entity\\User');\n $user = $repo->getUser($id, $entity);\n if (! $user) {\n return $viewModel->setVariables(['errorMessage' =>\n \"user with id $id was not found in your database.\"]);\n }\n $this->getEventManager()->trigger('load-user', $this, ['user' => $user,]);\n $form = new UserForm($this->entityManager, [\n 'action' => 'update',\n 'auth_user_role' => $this->auth_user_role,\n 'user' => $user,'constrain_email' => true,\n ]);\n /** @var $person \\InterpretersOffice\\Entity\\Person */\n $person = $user->getPerson();\n\n /** @todo do this initialization somewhere else? */\n $form->get('user')->get('person')->setObject($person);\n /* -------------------------- */\n $viewModel->form = $form;\n $has_related_entities = $this->entityManager\n ->getRepository(Entity\\Person::class)\n ->hasRelatedEntities($person->getId());\n $viewModel->has_related_entities = $has_related_entities;\n\n if ($has_related_entities) {\n $user_input = $form->getInputFilter()->get('user');\n $user_input->get('person')->get('hat')->setRequired(false);\n $user_input->get('role')->setRequired(false);\n }\n $form->bind($user);\n $request = $this->getRequest();\n if ($request->isPost()) {\n $was_disabled = ! $user->isActive();\n $form->setData($request->getPost());\n if (! $form->isValid()) {\n return new JsonModel(['status' => 'error',\n 'validation_errors' => $form->getMessages()]);\n }\n // if they re-enabled the account\n if ($was_disabled && $user->isActive()) {\n $user->setFailedLogins(0);\n }\n $this->entityManager->flush();\n $this->flashMessenger()\n ->addSuccessMessage(sprintf(\n 'The user account for <strong>%s %s</strong> has been updated.',\n $person->getFirstname(),\n $person->getLastname()\n ));\n return new JsonModel(['status' => 'success','validation_errors' => null]);\n }\n\n return $viewModel;\n }", "public function edit()\n {\n $userId = Helper::getIdFromUrl('user');\n\n Helper::checkUrlIdAgainstLoginId($userId);\n\n View::render('users/edit.view', [\n 'method' => 'POST',\n 'action' => '/user/' . $userId . '/update',\n 'user' => UserModel::load()->get($userId),\n 'roles' => RoleModel::load()->all(),\n ]);\n }", "private function editAccount()\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 //country\n if(!isset($request['country']) || $request['country']==\"\")\n throw_error_msg(\"provide country\");\n\n //sex\n if(!isset($request['sex']) || $request['sex']==\"\")\n throw_error_msg(\"provide sex\");\n\n if(!in_array($request['sex'], array('male','female')))\n throw_error_msg(\"sex must be male/female\");\n\n //dob\n if(!isset($request['dob']) || $request['dob']==\"\")\n throw_error_msg(\"provide dob\");\n\n if(!isset($request['dob']) || $request['dob']==\"\")\n throw_error_msg(\"provide dob\");\n\n $is_valid_date = DateTime::createFromFormat('Y-m-d', $request['dob']);\n\n if(!$is_valid_date)\n throw_error_msg(\"dob must be in Y-m-d like 1990-11-18 format\");\n\n if(!isset($request['category']) || $request['category']==\"\")\n throw_error_msg(\"provide category\");\n\n $request['userid'] = userid();\n $userquery->update_user($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $user_info = format_users($request['userid']);\n \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 edit_postAction() {\n $info = $this->getPost(array('uid', 'groupid', 'password', 'r_password', 'status'));\n if ($info['password']) {\n //if ($info['password'] == '') $this->output(-1, '密码不能为空.');\n if (strlen($info['password']) < 5 || strlen($info['password']) > 16) $this->output(-1, '用户密码长度5-16位之间');\n if ($info['password'] !== $info['r_password']) $this->output(-1, '两次密码输入不一致');\n }else {\n unset($info['password']);\n }\n $ret = Admin_Service_User::updateUser($info, intval($info['uid']));\n if (!$ret) $this->output(-1, '更新用户失败');\n $this->output(0, '更新用户成功.');\n }", "function wp_editUser( $args ) {\n\n global $wp_xmlrpc_server, $wp_roles;\n $wp_xmlrpc_server->escape( $args );\n\n $blog_ID = (int) $args[0];\n $user_ID = (int) $args[1];\n $username = $args[2];\n $password = $args[3];\n $content_struct = $args[4];\n\n if ( ! $user = $wp_xmlrpc_server->login( $username, $password ) )\n return $wp_xmlrpc_server->error;\n\n $user_info = get_userdata( $user_ID );\n\n if( ! $user_info )\n return new IXR_Error(404, __('Invalid user ID'));\n\n if( ! ( $user_ID == $user->ID || current_user_can( 'edit_users' ) ) )\n return new IXR_Error(401, __('Sorry, you cannot edit this user.'));\n\n // holds data of the user\n $user_data = array();\n $user_data['ID'] = $user_ID;\n\n if ( isset( $content_struct['user_login'] ) )\n return new IXR_Error(401, __('Username cannot be changed'));\n\n if ( isset( $content_struct['user_email'] ) ) {\n\n if( ! is_email( $content_struct['user_email'] ) )\n return new IXR_Error( 403, __( 'Email id is not valid' ) );\n // check whether it is already registered\n if( email_exists( $content_struct['user_email'] ) )\n return new IXR_Error( 403, __( 'This email address is already registered' ) );\n $user_data['user_email'] = $content_struct['user_email'];\n \n }\n\n if( isset ( $content_struct['role'] ) ) {\n\n if ( ! current_user_can( 'edit_users' ) )\n return new IXR_Error( 401, __( 'You are not allowed to change roles for this user' ) );\n\n if( ! isset ( $wp_roles ) )\n $wp_roles = new WP_Roles ();\n if( !array_key_exists( $content_struct['role'], $wp_roles->get_names() ) )\n return new IXR_Error( 403, __( 'The role specified is not valid' ) );\n $user_data['role'] = $content_struct['role'];\n \n }\n\n // only set the user details if it was given\n if ( isset( $content_struct['first_name'] ) )\n $user_data['first_name'] = $content_struct['first_name'];\n\n if ( isset( $content_struct['last_name'] ) )\n $user_data['last_name'] = $content_struct['last_name'];\n\n if ( isset( $content_struct['user_url'] ) )\n $user_data['user_url'] = $content_struct['user_url'];\n\n if ( isset( $content_struct['nickname'] ) )\n $user_data['nickname'] = $content_struct['nickname'];\n\n if ( isset( $content_struct['user_nicename'] ) )\n $user_data['user_nicename'] = $content_struct['user_nicename'];\n\n if ( isset( $content_struct['description'] ) )\n $user_data['description'] = $content_struct['description'];\n\n if( isset ( $content_struct['usercontacts'] ) ) {\n\n $user_contacts = _wp_get_user_contactmethods( $user_data );\n foreach( $content_struct['usercontacts'] as $key => $value ) {\n\n if( ! array_key_exists( $key, $user_contacts ) )\n return new IXR_Error( 401, __( 'One of the contact method specified is not valid' ) );\n $user_data[ $key ] = $value;\n\n }\n\n }\n\n if( isset ( $content_struct['user_pass'] ) )\n $user_data['user_pass'] = $content_struct['user_pass'];\n\n $result = wp_update_user( $user_data );\n\n if ( is_wp_error( $result ) )\n return new IXR_Error( 500, $result->get_error_message() );\n\n if ( ! $result )\n return new IXR_Error( 500, __( 'Sorry, the user cannot be updated. Something wrong happened.' ) );\n\n return $result;\n \n}", "public function actionEdit() {\n\n\t\t$userId = User::checkLogged();\n\t\t$user = User::getUserById($userId);\n\t\t$first_name = $user['first_name'];\n\t\t$last_name = $user['last_name'];\n\t\t$result = false;\n\n\t\tif (isset($_POST['submit'])) {\n\t\t\t$first_name = $_POST['first_name'];\n\t\t\t$last_name = $_POST['last_name'];\n\n\t\t\t$errors = array();\n\n\t\t\tif ($error = Validator::checkName($first_name)) $errors['first_name'] = $error;\n\t\t\tif ($error = Validator::checkName($last_name)) $errors['last_name'] = $error;\n\n\t\t\tif (empty($errors)) {\n\t\t\t\t$result = User::edit($userId, $first_name, $last_name);\n\t\t\t}\n\t\t}\n\t\t$pageTitle = \"Edit Details\";\n\t\trequire_once(ROOT . '/views/account/edit.php');\n\n\t\treturn true;\n\t}", "public function edit_post($user_id)\n {\n $auth_token = $this->post('auth_token');\n //$user_id = $this->post('user_id');\n $userData['fname'] = $this->post('fname');\n $userData['lname'] = $this->post('lname');\n $userData['dob'] = $this->post('dob');\n $userData['gender'] = $this->post('gender'); /* Male/Female */\n $userData['address'] = $this->post('address');\n $userData['contact_no'] = $this->post('contact_no');\n $userData['about'] = $this->post('about');\n $userData['updated_date']= time();\n \n //checking auth token\n $record = $this->artists_model->is_valid_token($user_id,$auth_token);\n if($record == 0){\n //redirect to login\n $this->response([\n 'status' => FALSE,\n 'message' => 'Unauthorize user,please login again',\n 'status_code' => 401\n ], REST_Controller::HTTP_UNAUTHORIZED); // UNAUTHORIZED (401) being the HTTP response code\n }\n \n \n \n if( $user_id != '' && $userData['fname'] != '' && $userData['lname'] != '' && $userData['dob'] != '' && $userData['gender'] != '' \n && $userData['address'] != '' && $userData['contact_no'] != '' && $userData['about'] != '')\n {\n $record = $this->artists_model->update_user($user_id,$userData);\n $user_data = $this->artists_model->get_user_details($user_id);\n $message = [\n 'status' => TRUE,\n 'message' => 'User information updated successfully',\n 'user_data' => $user_data,\n 'status_code'=> 200 \n ];\n $this->set_response($message, REST_Controller::HTTP_OK);\n }\n else\n {\n $message = [\n 'status' => FALSE,\n 'message' => 'User information not updated,please enter required fields properly',\n 'status_code'=> 400\n ];\n $this->set_response($message, REST_Controller::HTTP_BAD_REQUEST); \n }\n }", "public function p_editProfile() {\n\t$_POST['modified'] = Time::now();\n \n $w = \"WHERE user_id = \".$this->user->user_id;\n\t\t\n\t# Insert\n\tDB::instance(DB_NAME)->update(\"users\", $_POST, $w);\n \n Router::redirect(\"/users/profile\");\n\n }", "protected function edit() {\n\t\t// Make sure a user exists.\n\t\tif (empty($this->user)) {\n\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t$_SESSION['data'] = array(\n\t\t\t\t'error' => 'The selected user was invalid.',\n\t\t\t\t'link' => 'management/users'\n\t\t\t);\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\n\t\t// Prepare data for contents.\n\t\tnonce_generate();\n\t\t$data = array(\n\t\t\t'user' =>& $this->user\n\t\t);\n\t\t$this->title = 'Edit User: ' . $this->user['username'];\n\t\t$this->content = $this->View->getHtml('content-users-edit', $data, $this->title);\n\t}", "public function actioneditProfile()\n\t{\t\n\t\t$data = array();\n\t\t$data['city'] = $_POST['city'];\n\t\t\n\t\t\n\t\t$userObj = new Users();\n\t\t$userObj->setData($data);\n\t\t$userObj->insertData($_POST['userId']);\n\t\tYii::app()->user->setFlash('success',\"Successfully updated\");\n\t\t$this->redirect('admin/users');\n\t\t//Yii::app()->user->setFlash('error',\"Please update your profile\");\n\t\t//$this->render('userProfile',$profileData);\n\t\n\t}", "public function testEditPostBadDataForHrAndAdmin() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t\t'data' => [\n\t\t\t\t'BAD_MODEL' => []\n\t\t\t]\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'edit',\n\t\t\t\t'2'\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkFlashMessage(__('The deferred save not be saved. Please, try again.'));\n\t\t}\n\t}", "public function postUserupdate(){\n \n $uid = Input::get('user_id');\n $user = User::find($uid);\n if($user != ''){\n $user->email = Input::get('useremail');\n $user->fullname = Input::get('fullname');\n $user->category = Input::get('category');\n $user->language = Input::get('language');\n $user->enable = Input::get('enable');\n $user->save();\n return Redirect::to('admin/edituser/'.$uid)\n ->with('message', 'User data updated!');\n }else{\n return Redirect::to('admin/edituser/'.$uid)\n ->with('message', 'No such user!');\n }\n\n }", "public function postAddResource()\n {\n\n $errors = validateAddResources();\n\n if(!($errors === true)) {\n\n $this->_f3->set('errors', $errors);\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 } else {\n $this->_f3->reroute('/Admin');\n }\n\n }", "public function edituserActionPost(): object\n {\n // Connects to db\n $this->app->db->connect();\n\n // Retrieves contentId\n $username = getPost(\"username\");\n\n if (hasKeyPost(\"doDelete\")) {\n return $this->app->response->redirect(\"admin/deleteuser&username=$username\");\n }\n\n if (hasKeyPost(\"doSave\")) {\n $params = getPost([\n \"firstname\",\n \"lastname\",\n \"email\",\n \"password\",\n \"username\"\n ]);\n\n // Calls editUser method\n $this->admin->editUser($params);\n\n // Redirects\n return $this->app->response->redirect(\"admin/users\");\n }\n }", "function edit(){\n if (!empty($this->data)){\n if ($this->User->save($this->data)){\n $this->Session->setFlash(\"Your account has been updated successfully\");\n $this->go_back();\n } \n }else{\n $this->User->id = $this->Session->read(\"Auth.User.id\");\n $this->data = $this->User->read();\n }\n }", "public function editprofile_action()\n {\n Auth::checkAuthentication();\n \n \n $postname = Request::post('user_name');\n $postemail = Request::post('user_email');\n $postbio = Request::post('user_bio');\n\n\n if(Session::get('user_name') != $postname && $postname != null)\n {\n UserModel::editUserName($postname);\n }\n \n if(Session::get('user_email') != $postemail && $postemail != null)\n {\n UserModel::editUserEmail($postemail);\n }\n \n //null is checked in this method\n AvatarModel::createAvatar();\n \n if(Session::get('user_bio') != $postbio && $postbio != null)\n {\n UserModel::editBio($postbio);\n }\n\n return true;\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n\n $loggedUser = $this\n ->getEntityManager()\n ->getRepository('Core\\Entity\\User')\n ->find( $this->getIdentity()->getId() );\n\n $editedUser = $this\n ->getEntityManager()\n ->getRepository('Core\\Entity\\User')\n ->find( $id );\n\n $form = $this->createForm('\\Panel\\Form\\User\\User', array(\n 'loggedUserRole' => $loggedUser->getRole(),\n 'editedUserRole' => $editedUser->getRole(),\n ));\n\n if($id)\n {\n $form = $form->bindObjectById($id);\n }\n\n $request = $this->getRequest();\n if ($request->isPost())\n {\n $data = array(\n 'name' => $request->getPost()->name,\n 'email' => $request->getPost()->email,\n 'phone' => $request->getPost()->phone,\n 'birthDate' => $request->getPost()->birthDate,\n 'height' => $request->getPost()->height,\n 'tmrModifier' => $request->getPost()->tmrModifier,\n 'goalWeight' => $request->getPost()->goalWeight,\n 'personality' => $request->getPost()->personality,\n 'activityLevel' => $request->getPost()->activityLevel,\n 'isFemale' => $request->getPost()->isFemale,\n 'status' => $request->getPost()->status,\n 'role' => $request->getPost()->role,\n );\n\n if($request->getPost()->password!='')\n {\n $data['password'] = $request->getPost()->password;\n }\n\n $form->setData($data);\n\n if ($form->isValid())\n {\n $entityManager = $this->getEntityManager();\n\n $user = $form->getObject();\n\n if($request->getPost()->password!='')\n {\n $user->setPassword($request->getPost()->password);\n }\n\n $userFromEmail = $entityManager\n ->getRepository('Core\\Entity\\User')\n ->findOneBy(array('email' => $user->getEmail()));\n\n if($userFromEmail==null || $userFromEmail->getId()==$user->getId())\n {\n $entityManager->persist($user);\n $entityManager->flush();\n\n $this->flashMessenger()->addSuccessMessage(\n $this->getServiceLocator()->get('translator')\n ->translate(\"User has been modified.\")\n );\n\n if( $id)\n {\n return $this->redirect()->toRoute(\n 'panel/user/:id', array('id' => $id)\n );\n }\n else\n {\n return $this->redirect()->toRoute('panel/user');\n }\n }\n else\n {\n $form->setData($request->getPost());\n\n $this->flashMessenger()->addErrorMessage(\n $this->getServiceLocator()->get('translator')\n ->translate(\"User hasn't been modified. E-mail already exists.\")\n );\n }\n }\n }\n\n $view = new ViewModel();\n $view->setVariable('user', $form->getObject());\n $view->setVariable('form', $form);\n\n return $view;\n }", "function update ( $post ) {\n if ( !isset($post['id']) || !User::exists($post['id']) ) {\n \t$_SESSION['fail'] = \"You must select a user\";\n \theader( 'Location: index.php?action=index');\n \texit;\n }\n \n // get the existing user\n $user = User::find( 'first', $post['id']);\n \n // update the values\n $user->first_name = $post['first_name'];\n $user->last_name = $post['last_name'];\n $user->email = $post['email'];\n \n // if the password has been set\n if ( !empty($post['password'])) {\n \t$user->password = $post['password'];\n \t$user->confirm_password = $post['confirm_password'];\n }\n \n \n $user->role = $post['role'];\n \n //save the user\n $user->save(false);\n \n // check if save method\n if ($user->is_invalid()) {\n \t// set the massage\n \t$_SESSION['fail'][] = $user->error->full_messagr();\n \t$_SESSION['fail'][] = 'The user could not be updated.';\n \t\n \t// redirect\n \theader( 'Location: index.php?action=edit&id=' . $user->id);\n \texit;\n }\n \n // refresh session (when login user and updated user are same user)\n if ($user->id == $_SESSION['id']) {\n \t$_SESSION['role'] = $user->role;\n \t$_SESSION['email'] = $user->email;\n }\n \n // set the success message and redirect\n $_SESSION['success'] = 'User was updated successfully.';\n header('Location: index.php?action=index');\n }", "private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}", "function actionEditUser($templateVars) {\n\n\t$currentProperty = propertiesGetCurrent();\n\t$currentDivision = divisionsGetCurrent();\n\t$currentDepartment = departmentsGetCurrent();\n\t$currentUser = usersGetCurrent();\n\t\n\tif(!empty($_POST) && isset($_POST['editPropertyForm'])) {\n\t\t\n\t\t$validForm = true;\n\n\t\t$currentUser['firstname'] = $_POST['firstname'];\n\t\tif(empty($currentUser['firstname'])) {\n\t\t\t$templateVars['userFirstnameError'] = 'Please enter a first name for this user';\n\t\t\t$validForm = false;\n\t\t}\n\n\t\t$currentUser['lastname'] = $_POST['lastname'];\n\t\tif(empty($currentUser['lastname'])) {\n\t\t\t$templateVars['userLastnameError'] = 'Please enter a last name for this user';\n\t\t\t$validForm = false;\n\t\t}\n\n\t\t$currentUser['email'] = $_POST['emailname'];\n\t\tif(empty($currentUser['email'])) {\n\t\t\t$templateVars['userEmailError'] = 'Please enter an email for this user';\n\t\t\t$validForm = false;\n\t\t}\n\n\t\tif($validForm == true) {\n\t\t\t$property['name'] = $newPropertyName;\n\t\t\tpropertiesUpdateRecord($property);\n\t\t\tredirectToPage('settings/properties/listing');\n\t\t}\n\t}\n\n\t$templateVars['accessLevels'] = accessLevelsGetAll();\n\t$templateVars['currentProperty'] = $currentProperty;\n\t$templateVars['currentDivision'] = $currentDivision;\n\t$templateVars['currentDepartment'] = $currentDepartment;\n\t$templateVars['currentUser'] = $currentUser;\n\n\treturn $templateVars;\n}", "public function actionEdit()\r\n {\r\n $userId = User::checkLogged();\r\n\r\n $user = User::getUserById($userId);\r\n\r\n // new user info valiables\r\n $name = $user['name'];\r\n $password = $user['password'];\r\n\r\n $result = false;\r\n\r\n // form processing\r\n if (isset($_POST['submit'])) {\r\n $name = $_POST['name'];\r\n $password = $_POST['password'];\r\n\r\n $errors = false;\r\n\r\n // validate fields\r\n if (!User::checkName($name))\r\n $errors[] = 'Имя должно быть длиннее 3-х символов';\r\n\r\n if (!User::checkPassword($password))\r\n $errors[] = 'Пароль должен быть длиннее 5-ти символов';\r\n\r\n // save new data \r\n if ($errors == false)\r\n\r\n $result = User::edit($userId, $name, $password);\r\n }\r\n\r\n // attach specified view\r\n require_once(ROOT . '/app/views/cabinet/edit.php');\r\n return true;\r\n }", "function editUser()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n else\n {\n $this->load->library('form_validation');\n \n $userId = $this->input->post('userId');\n \n $this->form_validation->set_rules('fname','Full Name','trim|required|max_length[128]');\n $this->form_validation->set_rules('email','Email','trim|required|valid_email|max_length[128]');\n $this->form_validation->set_rules('password','Password','matches[cpassword]|max_length[20]');\n $this->form_validation->set_rules('cpassword','Confirm Password','matches[password]|max_length[20]');\n $this->form_validation->set_rules('role','Role','trim|required|numeric');\n $this->form_validation->set_rules('mobile','Mobile Number','required|min_length[10]');\n \n if($this->form_validation->run() == FALSE)\n {\n $this->editOld($userId);\n }\n else\n {\n $name = ucwords(strtolower($this->security->xss_clean($this->input->post('fname'))));\n $email = $this->security->xss_clean($this->input->post('email'));\n $password = $this->input->post('password');\n $roleId = $this->input->post('role');\n $mobile = $this->security->xss_clean($this->input->post('mobile'));\n \n $userInfo = array();\n \n if(empty($password))\n {\n $userInfo = array('email'=>$email, 'roleId'=>$roleId, 'name'=>$name,\n 'mobile'=>$mobile, 'updatedBy'=>$this->vendorId, 'updatedDtm'=>date('Y-m-d H:i:s'));\n }\n else\n {\n $userInfo = array('email'=>$email, 'password'=>getHashedPassword($password), 'roleId'=>$roleId,\n 'name'=>ucwords($name), 'mobile'=>$mobile, 'updatedBy'=>$this->vendorId, \n 'updatedDtm'=>date('Y-m-d H:i:s'));\n }\n \n $result = $this->user_model->editUser($userInfo, $userId);\n \n if($result == true)\n {\n $this->session->set_flashdata('success', 'User updated successfully');\n }\n else\n {\n $this->session->set_flashdata('error', 'User updation failed');\n }\n \n redirect('userListing');\n }\n }\n }", "public function edit($id = false){\n\t\tif(!empty($id)){\n\t\t\t$selectDataByID = $this->_model->selectDataByID($id);\n\t\t\tif(isset($selectDataByID[0]['id']) && !empty($selectDataByID[0]['id'])){\n $this->_view->stored_data = $selectDataByID[0];\n if(isset($_POST['is_active']) && ($_POST['is_active'] == 1 || $_POST['is_active'] == 0)){\n $this->_view->stored_data['is_active'] = $_POST['is_active'];\n }\n\t\t\t}else{\n $this->_view->flash[] = \"No Users matches this id\";\n Session::set('backofficeFlash', array($this->_view->flash, 'failure'));\n\t\t\t\tUrl::redirect('users/');\n\t\t\t}\n\t\t}else{\n $this->_view->flash[] = \"No ID was provided\";\n Session::set('backofficeFlash', array($this->_view->flash, 'failure'));\n\t\t\tUrl::redirect('users/');\n\t\t}\n\n\t\t// Set the Page Title ('pageName', 'pageSection', 'areaName')\n\t\t$this->_view->pageTitle = array('Edit User', 'Users');\n\t\t// Set Page Description\n\t\t$this->_view->pageDescription = '';\n\t\t// Set Page Section\n\t\t$this->_view->pageSection = 'Users';\n\t\t// Set Page Sub Section\n\t\t$this->_view->pageSubSection = 'Edit User';\n\n\n\t\t// Set default variables\n\t\t$this->_view->error = array();\n\n // If Form has been submitted process it\n\t\tif(!empty($_POST['save'])){\n $_POST['id'] = $id;\n $_POST['salt'] = $selectDataByID[0]['salt'];\n $_POST['user_pass'] = $selectDataByID[0]['password'];\n $_POST['stored_user_email'] = $selectDataByID[0]['email'];\n\n // Update user details\n $updateData = $this->_model->updateData($_POST);\n\n if(isset($updateData['error']) && $updateData['error'] != null){\n foreach($updateData['error'] as $key => $error) {\n $this->_view->error[$key] = $error;\n }\n } else {\n $this->_view->flash[] = \"User updated successfully.\";\n Session::set('backofficeFlash', array($this->_view->flash, 'success'));\n Url::redirect('users/');\n }\n\t\t}\n\n\t\tif(!empty($_POST['cancel'])){\n\t\t\tUrl::redirect('users/');\n\t\t}\n\n\t\t// Render the view ($renderBody, $layout, $area)\n\t\t$this->_view->render('users/add', 'layout');\n\t}", "function edit($iAccountNo=0) {\n\n\n\t\t$this->authentication->is_admin_logged_in(true);\n\n\t\tif( !$this->mcontents['oUser'] = $this->user_model->getUserBy('account_no', $iAccountNo) ) {\n\n\t\t\tsf('error_message', 'Invalid user');\n\t\t\tredirect('user/listing');\n\n\t\t}\n\n\t\tisAdminSection();\n\n\t\t$this->mcontents['page_heading'] = $this->mcontents['page_title'] = 'Edit User';\n\t\t$this->mcontents['aExistingRoles'] = getUserRoles( $this->mcontents['oUser']->account_no );\n\n\t\tif ( isset($_POST) && !empty($_POST)) {\n\n\n\t\t\t$this->form_validation->set_rules('status', 'Status', 'trim|required');\n\t\t\t//$this->form_validation->set_rules('user_roles','User Roles', '');\n\t\t\tif ($this->form_validation->run() == TRUE) {\n\n\t\t\t\t$aData = array(\n\t\t\t\t\t\t\t'email_id' => safeText('email_id'),\n\t\t\t\t\t\t\t'status' => safeText('status'),\n\t\t\t\t\t\t\t'gender' => safeText('gender'),\n\t\t\t\t\t\t);\n\n\t\t\t\t$this->db->where('account_no', $iAccountNo);\n\t\t\t\t$this->db->update('users', $aData);\n\n\t\t\t\t//update roles.\n\t\t\t\t$aRoles \t\t\t= array_trim( safeText('user_roles') );\n\n\t\t\t\t$aDeletedRoles \t= array_diff($this->mcontents['aExistingRoles'], $aRoles);\n\t\t\t\t$aNewRoles \t\t= array_diff($aRoles, $this->mcontents['aExistingRoles']);\n\n\n\t\t\t\t//echo 'EXISTING : ';p( $this->mcontents['aExistingRoles']);\n\t\t\t\t//echo 'DELETED : ';p( $aDeletedRoles );\n\t\t\t\t//echo 'NEW : ';p( $aNewRoles );\n\n\t\t\t\t//p($aNewRoles);\n\t\t\t\t$this->_createRoles($aNewRoles, $this->mcontents['oUser']->account_no);\n\t\t\t\t$this->_deleteRoles($aDeletedRoles, $this->mcontents['oUser']->account_no);\n\n\t\t\t\tsf('success_message', 'The user data has been updated');\n\t\t\t\tredirect('user/edit/'.$iAccountNo);\n\n\t\t\t}\n\t\t}\n\n\t\t//p($this->mcontents['aExistingRoles']);\n\n\t\t$this->mcontents['aUserRolesTitles'] \t= $this->config->item('user_roles_title');\n\t\t$this->mcontents['iTotalNumRoles'] \t\t= count( $this->mcontents['aUserRolesTitles'] );\n\t\t$this->mcontents['aUserStatusFlipped'] \t= array_flip( $this->config->item('user_status') );\n\t\t$this->mcontents['iAccountNo'] \t\t\t= $iAccountNo;\n\n\t\tloadAdminTemplate('user/edit');\n\t}", "public function editAction()\n {\n // Check logged\n $userId = UserModel::checkLogged();\n \n //We get user data\n $user = UserModel::getUserById($userId);\n \n \n $name = $user['name'];\n \n \n $result = false;\n \n // Form processing\n if (isset($_POST['submit'])) {\n \n // Getting data from the form\n $name = $_POST['name'];\n $password = $_POST['password'];\n \n \n // Form error flag\n $errors = false;\n \n // If necessary, you can validate the values as needed\n if (!UserModel::checkName($name)) {\n $errors[] = 'The name must not be shorter than 2 characters';\n }\n \n if (!UserModel::checkPassword($password)) {\n $errors[] = 'Password must not be shorter than 6 characters';\n }\n \n if ($errors == false) {\n $result = UserModel::edit($userId, $name, $password);\n }\n }\n \n // Connect the view\n $this->view('header.tpl');\n $this->view('view.tpl', ['user' => $user,\n 'result' => $result]\n );\n $this->view('footer.tpl');\n \n return true;\n }", "public function edit($userId = null, $postData = null) {\n\t\t$user = $this->getUserForEditing($userId);\n\t\t$this->set($user);\n\t\tif (empty($user)) {\n\t\t\tthrow new NotFoundException(__d('users', 'Invalid User'));\n\t\t}\n\n\t\tif (!empty($postData)) {\n\t\t\t$this->set($postData);\n\t\t\t$result = $this->save(null, true);\n\t\t\tif ($result) {\n\t\t\t\t$this->data = $result;\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn $postData;\n\t\t\t}\n\t\t}\n\t}", "function user_action_user_edit($env, $vars) {\n $response_json = UserFactory::requestAction($env, $vars['data']['action'], $vars['data']);\n exit($response_json);\n}", "public function edit($id = false){\n\t\tif(!empty($id)){\n\t\t\t$selectDataByID = $this->_model->selectDataByID($id);\n\t\t\tif(isset($selectDataByID[0]['id']) && !empty($selectDataByID[0]['id'])){\n $this->_view->stored_data = $selectDataByID[0];\n if(isset($_POST['is_active']) && ($_POST['is_active'] == 1 || $_POST['is_active'] == 0)){\n $this->_view->stored_data['is_active'] = $_POST['is_active'];\n }\n\t\t\t}else{\n $this->_view->flash[] = \"No Users matches this id\";\n Session::set('backofficeFlash', array($this->_view->flash, 'failure'));\n\t\t\t\tUrl::redirect('backoffice/users/');\n\t\t\t}\n\t\t}else{\n $this->_view->flash[] = \"No ID was provided\";\n Session::set('backofficeFlash', array($this->_view->flash, 'failure'));\n\t\t\tUrl::redirect('backoffice/users/');\n\t\t}\n\n\t\t// Set the Page Title ('pageName', 'pageSection', 'areaName')\n\t\t$this->_view->pageTitle = array('Edit User', 'Users');\n\t\t// Set Page Description\n\t\t$this->_view->pageDescription = '';\n\t\t// Set Page Section\n\t\t$this->_view->pageSection = 'Users';\n\t\t// Set Page Sub Section\n\t\t$this->_view->pageSubSection = 'Users';\n\n\t\t// Set default variables\n\t\t$this->_view->error = array();\n\n\t\t$userTypes = explode(',', USERS);\n $userTypesStore = array_pop($userTypes);\n\t\t$this->_view->userTypes = $userTypes;\n\n // If Form has been submitted process it\n\t\tif(!empty($_POST['save'])){\n $_POST['id'] = $id;\n $_POST['salt'] = $selectDataByID[0]['salt'];\n $_POST['user_pass'] = $selectDataByID[0]['password'];\n $_POST['stored_user_email'] = $selectDataByID[0]['email'];\n\n if(!isset($_FILES) || $_FILES['image']['name'] == null) {\n $_POST['image'][0] = $this->_view->stored_data['logo_image'];\n }else{\n //calls function that moves resourced documents\n $this->uploadFile($_FILES);\n }\n\n // Update user details\n $updateData = $this->_model->updateData($_POST);\n\n if(isset($updateData['error']) && $updateData['error'] != null){\n foreach($updateData['error'] as $key => $error) {\n $this->_view->error[$key] = $error;\n }\n } else {\n \tif (isset($_FILES) && $_FILES['image']['name'] != null) {\n //remove old file\n unlink(ROOT . UPLOAD_DIR . '/' . $this->_view->stored_data['logo_image']);\n }\n $this->_view->flash[] = \"User updated successfully.\";\n Session::set('backofficeFlash', array($this->_view->flash, 'success'));\n Url::redirect('backoffice/users/');\n }\n\t\t}\n\n\t\tif(!empty($_POST['cancel'])){\n\t\t\tUrl::redirect('backoffice/users/');\n\t\t}\n\n\t\t// Render the view ($renderBody, $layout, $area)\n\t\t$this->_view->render('users/add', 'layout', 'backoffice');\n\t}", "public function updateProfile(){\n\n\t\t$user_id = Auth::user()->get()->id;\n\t\t$user = User::with('consultant')->find($user_id);\n\t\t\n\t\t$consultant = Consultant::find(Auth::user()->get()->id);\n\t\t$website_url = $consultant['website_url'];\n\n\t\t$user_name = $consultant['other_names'];\n\t\t$user_surname = $consultant['surname'];\n\t\n\t\t$post_data = Input::all();\n\n\t\t$nationalities = Input::get('nationality');\n\t\t\n\t\t$skills = Input::get('skill', array());\n\t\t$specializations = Input::get('specialization',array());\n\t\t$worked_countries = Input::get('country_worked',array());\n\t\t$consultant_agencies = Input::get('consultant_agencies',array());\n\t\t$languages = $post_data['languages']['languages'];\n\n\t\t$rules = Consultant::editRules();\n\n\t\tif ($consultant->resume == null) {\n\t\t\tif (!Input::hasFile('resume')) {\n\t\t\t\t$rules['linkedin_url'] = 'url|required_without_all:resume,website_url';\n\t\t\t\t$rules['website_url'] = 'url|required_without_all:resume,linkedin_url';\n\t\t\t}\n\t\t\t$rules['resume'] = 'mimes:doc,docx,txt,pdf|max:1024|extension:txt,doc,docx,pdf|required_without_all:linkedin_url,website_url';\n\t\t}\n\n\t\t$validation = Validator::make($post_data, $rules,Consultant::$messages);\n\n\t\tif ($validation->passes()){\n\n\t\t\t$old_resume = $consultant->resume;\n\n\t\t\t$consultant->fill(Input::except('resume','terms_conditions','email'));\n\t\t\t\n\t\t\tif(Input::hasFile('resume')){\n\n\t \t$destinationPath = public_path().'/upload/resume/';\n\n\t \tif($old_resume != \"\"){\n\t \t\t$resume_to_delete = $destinationPath . $old_resume;\n\t \t\t@unlink($resume_to_delete);\n\t \t}\n\n\t $file = Input::file('resume');\n\t \n\t $extension = $file->getClientOriginalExtension();\n\t $user_fullname = $user_name.\" \".$user_surname;\n\t \t$user_fullname = $user_name.\" \".$user_surname;\n\t\t\t\t$file_name = Str::slug($user_fullname,'_');\n\t $doc_name = $file_name.'.'.$extension;\n\n\t $file->move($destinationPath,$doc_name);\n\t \n\t $consultant->resume = $doc_name;\n\t\t\t}\n\t\t\t$consultant->save();\n\n\t\t\tif($languages)\n\t\t\t{\n\n\t\t\t\tConsultantLanguage::where('consultant_id', $user_id)->delete();\n\t\t\t\tforeach ($languages as $key => $language) \n\t\t\t\t{\n\t\t\t\t\tif($language['language'] != \"\"){\n\n\t\t\t\t\t\t$consultant_language = new ConsultantLanguage();\n\t\t\t\t\t\t$consultant_language->consultant_id = $user->id;\n\t\t\t\t\t\t$consultant_language->language_id = $language['language'];\n\t\t\t\t\t\t// $consultant_language->language_level = $language['lang_level'];\n\t\t\t\t\t\t$consultant_language->speaking_level = $language['speaking_level'];\n\t\t\t\t\t\t$consultant_language->reading_level = $language['reading_level'];\n\t\t\t\t\t\t$consultant_language->writing_level = $language['writing_level'];\n\t\t\t\t\t\t$consultant_language->understanding_level = $language['understanding_level'];\n\t\t\t\t\t\t$consultant_language->save();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$nationality_list = array();\n\t\t\t\n\t\t\tif( count($nationalities) > 0 ){\n\n\t\t\t\tforeach ($nationalities as $nationality_id) {\n\t\t\t\t\t$nationality['country_id'] = $nationality_id;\n\t\t\t\t\tarray_push($nationality_list, $nationality);\n\t\t\t\t}\n\n\t\t\t\tConsultantNationality::where('consultant_id', $user_id)->delete();\n\t\t\t\t$user->consultantNationality()->createMany($nationality_list);\n\t\n\t\t\t}\n\t\t\t\n\t\t\t$skill_list = array();\n\t\t\t\n\t\t\tif( count($skills) > 0 ){\n\n\t\t\t\tforeach ($skills as $skill_id) {\n\t\t\t\t\t$skill['skill_id'] = $skill_id;\n\t\t\t\t\tarray_push($skill_list, $skill);\n\t\t\t\t}\n\n\t\t\t\tConsultantSkill::where('consultant_id', $user_id)->delete();\n\t\t\t\t$user->consultantSkill()->createMany($skill_list);\n\t\t\t}\n\t\t\t\n\n\t\t\t$specialization_list = array();\n\t\t\t\n\t\t\tif( count($specializations) > 0 ){\n\n\t\t\t\tforeach ($specializations as $specialization_id) {\n\t\t\t\t\t$specialization['specialization_id'] = $specialization_id;\n\t\t\t\t\tarray_push($specialization_list, $specialization);\n\t\t\t\t}\n\n\t\t\t\tConsultantSpecialization::where('consultant_id', $user_id)->delete();\n\t\t\t\t$user->consultantSpecialization()->createMany($specialization_list);\n\t\t\t}\n\t\t\t\n\n\t\t\t$worked_country_list = array();\n\t\t\t\n\t\t\tif( count($worked_countries) > 0 ){\n\n\t\t\t\tforeach ($worked_countries as $worked_country_id) {\n\t\t\t\t\t$worked_country['country_id'] = $worked_country_id;\n\t\t\t\t\tarray_push($worked_country_list, $worked_country);\n\t\t\t\t}\n\t\t\t\tConsultantWorkedCountry::where('consultant_id', $user_id)->delete();\n\t\t\t\t$user->consultantWorkedCountry()->createMany($worked_country_list);\n\t\t\t}\n\n\t\t\t$consultant_agency_list = array();\n\t\t\t\n\t\t\tif( count($consultant_agencies) > 0 ){\n\n\t\t\t\tforeach ($consultant_agencies as $consultant_agency_id) {\n\t\t\t\t\t$consultant_agency['agency_id'] = $consultant_agency_id;\n\t\t\t\t\tarray_push($consultant_agency_list, $consultant_agency);\n\t\t\t\t}\n\t\t\t\tConsultantAgency::where('consultant_id', $user_id)->delete();\n\t\t\t\t$user->consultantAgencies()->createMany($consultant_agency_list);\n\t\t\t}\n\n\t\t\treturn Redirect::route('user.profile')->with('message', 'You have successfully updated your profile')\n\t\t\t\t\t\t\t\t ->with('message_type', 'success');\n\t\t }else{\n\n\t\t\t\t$errors = $validation->errors()->toArray();\n\t\t\t\t// echo \"<pre>\";\n\t\t\t\t// print_r($errors);exit;\n\t\t\t\treturn Redirect::back()\n\t\t\t\t->withInput(Input::all())\n\t\t\t\t->withErrors($validation)\n\t\t\t\t->with('message', 'Some required field(s) have been left blank. Please correct the error(s)!')\n\t\t\t\t->with('message_type', 'danger');\n\t\t}\n\t}", "public function actionUpdate()\n\t{\n\t if (!Yii::app()->user->checkAccess('admin')){\n\t\t\treturn $this->actionView();\n\t }\n\t\t$this->model = DrcUser::loadModel();\n\t\tif($this->model===null)\n\t\t\tthrow new CHttpException(404,'The requested user does not exist.');\n\t\t$this->renderView(array(\n\t\t\t'contentView' => '../drcUser/_edit',\n\t\t\t'contentTitle' => 'Update User Data',\n\t\t\t'createNew'=>false,\n\t\t\t'titleNavRight' => '<a href=\"' . $this->createUrl('base/user/create') . '\"><i class=\"icon-plus\"></i> Add User </a>',\n\t\t\t'action'=>Yii::app()->createUrl(\"user/save\", array('username'=>$this->model->username)),\n\t\t));\n\t}", "public function adminEditUserProfile($id,$title,$full_name,$dob,$gender,$address,$phone)\n {\n $title = $this->secureInput($title);\n $full_name = $this->secureInput($full_name);\n $dob = $this->secureInput($dob);\n $gender = $this->secureInput($gender);\n $address = $this->secureInput($address);\n //$city = $this->secureInput($city);\n //$state = $this->secureInput($state);\n //$country = $this->secureInput($country);\n $phone = $this->secureInput($phone);\n\n//$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', city = '\" . $city . \"', state = '\" . $state . \"', country = '\" . $country . \"', phone = '\" . $phone . \"', level_access = '\" . $level_access . \"' WHERE id = '\" . $id . \"'\";\n\n$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', phone = '\" . $phone . \"' WHERE id = '\" . $id . \"'\";\n\n $res = $this->processSql($sql);\n if(!$res) return 4;\n return 99;\n }", "public function testPostUpdateUserPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$user = Orchestra\\Model\\User::create(array(\n\t\t\t'email' => '[email protected]',\n\t\t\t'fullname' => 'Mior Muhammad Zaki',\n\t\t\t'password' => '123456',\n\t\t));\n\t\t$user->roles()->sync(array(2));\n\n\t\t$response = $this->call('orchestra::users@view', array($user->id), 'POST', array(\n\t\t\t'id' => $user->id,\n\t\t\t'email' => '[email protected]',\n\t\t\t'fullname' => 'crynobone',\n\t\t\t'password' => '345678',\n\t\t\t'roles' => array(2),\n\t\t));\n\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::users'), \n\t\t\t$response->foundation->headers->get('location'));\n\n\t\t$updated_user = Orchestra\\Model\\User::find($user->id);\n\n\t\t$this->assertEquals('[email protected]', $updated_user->email);\n\t\t$this->assertEquals('crynobone', $updated_user->fullname);\n\t\t$this->assertTrue(Hash::check('345678', $updated_user->password));\n\n\t\t$updated_user->delete();\n\t}", "public function editUser()\n {\n\n $this->displayAllEmployees();\n $new_data = [];\n $id = readline(\"Unesite broj ispred zaposlenika čije podatke želite izmjeniti: \");\n\n $this->displayOneEmployees( $id);\n\n foreach ( $this->employeeStorage->getEmployeeScheme() as $key => $singleUser) { //input is same as addUser method\n\n $userInput = readline(\"$singleUser : \");\n $validate = $this->validateInput($userInput, $key);\n\n while (!$validate)\n {\n $userInput = readline(\"Unesite ispravan format : \");\n $validate = $this->validateInput($userInput, $key);\n\n }\n if ($key === 'income'){\n $userInput = number_format((float)$userInput, 2, '.', '');\n }\n\n $new_data[$key] = $userInput;\n\n }\n $this->employeeStorage->updateEmployee($id, $new_data); //sends both id and data to updateEmployee so the chosen employee can be updated with new data\n\n echo \"\\033[32m\". \"## Izmjene za \". $new_data['name'].\" \". $new_data['lastname'].\" su upisane! \\n\\n\".\"\\033[0m\";\n\n }", "public function editUser($id=0){\n\t if(Input::isMethod('post')){\n\t\t\t$rules = array(\n\t\t\t'first_name' \t=> 'required',\n\t\t\t'last_name' \t\t=> 'required',\n\t\t\t'username' \t=> 'required',\n\t\t\t'email' \t\t=> 'required|email|unique:users,id',\n\t\t\t'phone' \t\t\t=> 'required',\n\t\t\t);\n\t\t$validator = Validator::make(Input::all(),$rules);\n\t\t if ($validator->fails()) {\n\t\t\t$messages = $validator->messages();\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t } else {\n\t\t\t\t\t\t\tif(Input::file('image')){\n\t\t\t\t\t\t\t\t$image \t\t\t\t\t= \tInput::file('image');\n\t\t\t\t\t\t\t\t$filename \t\t\t= \ttime() . '_'.$image->getClientOriginalName();\n\t\t\t\t\t\t\t\t$path \t\t\t\t\t= \tpublic_path('uploads/users/' . $filename);\n\t\t\t\t\t\t\t\t$path2 \t\t\t\t\t= \tpublic_path('uploads/users/50x50/' . $filename);\n\t\t\t\t\t\t\t\tImage::make($image->getRealPath())->resize(50,50)->save($path2);\n\t\t\t\t\t\t\t\tImage::make($image->getRealPath())->save($path);\n\t\t\t\t\t\t\t\t\t$x \t\t= \t100;\n\t\t\t\t\t\t\t\t\t$y \t\t= \t100;\n\t\t\t\t\t\t\t\tfor($i=1;$i<6;$i++){\n\t\t\t\t\t\t\t\t\t$path \t=\tpublic_path('uploads/users/'.$x.'x'.$y.'/'. $filename);\n\t\t\t\t\t\t\t\t\tImage::make($image->getRealPath())->resize($x,$y)->save($path);\n\t\t\t\t\t\t\t\t\t$x = $x+100;\n\t\t\t\t\t\t\t\t\t$y = $y+100;\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$user\t\t\t=\tAdminUser::GetById($id); // getting user data by id.\n\t\t\t\t\t\t\t\t$filename\t=\t$user->image;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$update_user = AdminUser::UpdateUser($id,$filename); // calls function for update user data.\n\t\t\t\t\t\t\t\tif($update_user){\n\t\t\t\t\t\t\t\t\tSession::flash('flash_success', trans(\"User successfully updated.\"));\n\t\t\t\t\t\t\t\t\treturn redirect()->route('userslist');\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tSession::flash('flash_error', trans(\"Technical error while updating user.\"));\n\t\t\t\t\t\t\t\t\treturn redirect()->route('userslist');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t }else{\n\t\t\t\t\t\t$user = AdminUser::GetById($id); // calls function for getting user data by id.\n\t\t\t\t\t\treturn view('admin.pages.users.edit', ['user' => $user]);\n\t }\n\t}", "public function editAction()\n {\n $request = $this->getRequest();\n $pageId = $user_id = $this->_getParam('pageId'); \n /*echo \"<pre>ooo\";\n\t\tprint_r($_POST); die;*/\n $model = new User_Models_UserUser(); \n $rrr = $model->getRecord($pageId); \n $form = new User_Form_UserUser(); \n foreach ($form->getElements() as $value) {\n $nnn = $value->getName();\n $value->setValue($rrr->$nnn);\n }\n $modelInfo = new User_Models_UserInfo();\n $ooo = $modelInfo->getUserInfo($pageId);\n $formInfo = new User_Form_UserInfo();\n $formInfo->removeElement('vip');\n foreach ($formInfo->getElements() as $value) {\n $nnn = $value->getName();\n $value->setValue($ooo->$nnn);\n }\n /*$form->email->addValidator(new Zend_Validate_Db_NoRecordExists(\n array(\n 'table' => 'total_user',\n 'field' => 'email',\n 'exclude' => array(\n 'field' => 'id',\n 'value' => $user_id\n )\n )\n ));*/\t\t\n\t\t$uLogin = $form->login->getValue();\n $form->removeElement('password');\n $form->removeElement('verifypassword');\n $form->removeElement('salt');\n $form->removeElement('creation_date');\n $form->removeElement('login');\n $form->removeElement('manager');\n $form->removeElement('user_hash');\n if ($request->isPost()) {\t\t\t\n if ($form->isValid($request->getPost())) {\n $form->type->setValue($rrr->type);\t\t\t\t\n $model->save($form->getElements(), $pageId);\n $formInfo->removeElement('user_id');\n $formInfo->populate($request->getPost());\n $modelInfo->save($formInfo->getElements(), $ooo->id/*$pageId*/);\n\t\t\t\tif ($_POST['manager_id'] != \"\") {\n\t\t\t\t\t//echo $form->login->getValue(); die;\n\t\t\t\t\t$modelOrder = new Shop_Models_OrderOrder();\n\t\t\t\t\t$orders = $modelOrder->getUserOrders($uLogin);\n\t\t\t\t\tforeach ($orders as $order) {\n\t\t\t\t\t\t$modelOrder->setSmsStatus($order['id']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$accHref = \"?\";\n\t\t\t\tif (isset($_GET['account'])) \n\t\t\t\t\t$accHref .= \"account=\" . $_GET['account'];\n\t\t\t\tif (isset($_GET['page'])) \n\t\t\t\t\t$accHref .= \"&page=\" . $_GET['page'];\n\t\t\t\tif(isset($_POST['_continue'])) {\n\t\t\t\t\t$this->_redirector->gotoActionUrl('/admin/', $pageId . $accHref);\n\t\t\t\t} else {\t\t\t\t\t\n\t\t\t\t\t$this->_redirect('/admin/user/' . $accHref);\t\t\t\t\n\t\t\t\t}\t\t\t\t\t\n }\n }\n $this->view->module = $this->_getParam('module');\n $this->view->id = $pageId;\n $this->view->elements = $form->getElements();\n $this->view->form = $form;\n $this->view->elementsInfo = $formInfo->getElements();\n }", "public function adminEditProfile($id,$title,$full_name,$dob,$gender,$address,$phone)\n\t{\n $title = $this->secureInput($title);\n $full_name = $this->secureInput($full_name);\n $dob = $this->secureInput($dob);\n $gender = $this->secureInput($gender);\n $address = $this->secureInput($address);\n //$city = $this->secureInput($city);\n //$state = $this->secureInput($state);\n //$country = $this->secureInput($country);\n $phone = $this->secureInput($phone);\n\n//$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', city = '\" . $city . \"', state = '\" . $state . \"', country = '\" . $country . \"', phone = '\" . $phone . \"' WHERE id = '\" . $id . \"'\";\n\n$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', phone = '\" . $phone . \"' WHERE id = '\" . $id . \"'\";\n\n \t$res = $this->processSql($sql);\n\t\t\tif(!$res) return 4;\n\t\t\treturn 99;\n\t}", "public function edituserAction($id){\n\t\t$user = $this->getUser(); if ($user == '') { return $this->redirect($this->generateUrl('LIHotelBundle_homepage')); }\n\t\t$session = $this->get('session');\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$entity = $em->getRepository('LIHotelBundle:Reserva')->find($id);\n\n\t\tif (!$entity) {\n\t\t\t$session->getFlashBag()->add('usuario_malos', 'No existe esta reserva.');\n\t\t\treturn $this->redirect($this->generateUrl('_user'));\n\t\t}\n\n\t\tif ($entity->getCliente()->getId() != $user->getId()) {\n\t\t\t$session->getFlashBag()->add('usuario_malos', 'No tiene permisos para ver las reservas de otros usuarios. Este incidente será reportado.');\n\t\t\treturn $this->redirect($this->generateUrl('_user'));\n\t\t}\n\n\t\t/* VERIFICAR SI NO HA PASADO LA FECHA DE CULMINADO, PORQUE SI NO NO SE PUEDE EDITAR */\n\t\t$dias_reserva = $entity->getDiasReserva() - 1;\n\t\t$fecha_reserva = $entity->getFechaDesde();\n\t\t$fecha_inicio_ = new \\DateTime($fecha_reserva->format('Y-m-d'));\n\t\t$fecha_final_ = new \\DateTime($fecha_inicio_->format('Y-m-d'));\n\t\t$fecha_final_->add(new \\DateInterval('P'.$dias_reserva.'D'));\n\t\t$hoy = new \\DateTime('today');\n\n\t\tif ($hoy > $fecha_final_) {\n\t\t\t$session->getFlashBag()->add('reserva_malos', 'Esta reserva ya ha culminado y no se puede modificar.');\n\t\t\treturn $this->showuserAction($entity->getId());\n\t\t}else{\n\n\t\t\t$editForm = $this->createEditForm($entity);\n\t\t\t$deleteForm = $this->createDeleteForm($id);\n\t\t\t$user = $this->getUser();\n\n\t\t\treturn $this->render('LIHotelBundle:Reserva:edituser.html.twig', array(\n\t\t\t\t'entity' => $entity,\n\t\t\t\t'edit_form' => $editForm->createView(),\n\t\t\t\t'delete_form' => $deleteForm->createView(),\n\t\t\t\t'user' => $user,\n\t\t\t));\n\t\t}\n\t}", "function edit()\n\t{\n\t\t// Find the logged-in client details\n\t\t$userId = $this->Auth->user('id');\n\t\t$user = $this->User->findById($userId);\n\n\t\t// Save the POSTed data\n\t\tif (!empty($this->data)) {\n\t\t\t$this->data['User']['id'] = $userId;\n\t\t\tif ($this->User->save($this->data)) {\n\t\t\t\t$this->Session->setFlash(__('Profile has been updated', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Profile could not be saved. Please, try again.', true));\n\t\t\t}\n\t\t} else {\n\t\t\t// Set the form data (display prefilled data) \n\t\t\t$this->data = $user;\n\t\t}\n\n\t\t// Set the view variable\n\t\t$this->set(compact('user'));\n\t}", "function editUser($argArrPost) {\n\n // pre($argArrPost);\n //@extract($argArrPost);\n $objCore = new Core;\n $varName = $argArrPost['frmName'];\n $varEmail = $argArrPost['frmUserEmail'];\n $logisticUserName = addslashes($argArrPost['frmName']);\n $varUserWhere = \" logisticportalid != \" . $argArrPost['frmUserID'] . \" AND ( logisticTitle='\" . $argArrPost['frmTitle'] . \"' OR logisticEmail='\" . $argArrPost['frmUserEmail'] . \"'OR logisticUserName='\" . $argArrPost['frmName'] . \"')\";\n //$varUserWhere = \" logisticTitle='\" . $varName . \"' OR logisticEmail='\" . $argArrPost['frmUserEmail'] . \"'OR logisticUserName='\" . $argArrPost['frmName'] . \"'\";\n $arrClms = array('logisticportalid', 'logisticTitle', 'logisticEmail', 'logisticUserName');\n $arrUserList = $this->select(TABLE_LOGISTICPORTAL, $arrClms, $varUserWhere);\n\n // pre($arrUserList);\n //echo '<pre>';print_r($arrUserList);die;\n if (isset($arrUserList[0]['logisticportalid']) && $arrUserList[0]['logisticportalid'] <> '') {\n\n //pre('here');\n $arrUserName = array();\n $arrUserEmail = array();\n $arrUserNames = array();\n foreach ($arrUserList as $key => $val) {\n if ($val['logisticTitle'] == $varName) {\n $arrUserName[] = $val['logisticTitle'];\n }\n if ($val['logisticEmail'] == $varEmail) {\n $arrUserEmail[] = $val['logisticEmail'];\n }\n if ($val['logisticUserName'] == $logisticUserName) {\n $arrUserNames[] = $val['$logisticUserName'];\n }\n }\n $varCountName = count($arrUserName);\n $varCountEmail = count($arrUserEmail);\n $varCountusername = count($arrUserNames);\n if ($varCountName > 0) {\n $_SESSION['sessArrUsers'] = $argArrPost;\n $objCore->setErrorMsg('Logistic Portal Company Name Already Exist ');\n return false;\n } else if ($varCountEmail > 0) {\n $_SESSION['sessArrUsers'] = $argArrPost;\n $objCore->setErrorMsg('Logistic Portal Email Already Exist ');\n return false;\n } else if ($varCountusername > 0) {\n $_SESSION['sessArrUsers'] = $argArrPost;\n $objCore->setErrorMsg('Logistic Portal User Name Already Exist ');\n return false;\n }\n } else {\n //$varPass = trim($argArrPost['frmPassword']);\n //$varUserPass = $arrUserList[0]['oldPass'];\n if (trim($argArrPost['frmPassword']))\n $varUsersWhere = ' logisticportalid =' . $argArrPost['frmUserID'];\n $arrUser = $this->select(TABLE_LOGISTICPORTAL, array('logisticPassword', 'logisticOldPass'), $varUsersWhere);\n// pre($arrUser);\n\n if ($arrUser[0]['logisticPassword'] == $argArrPost['frmPassword']) {\n $adminPassword = $arrUser[0]['logisticPassword'];\n $adminOldPass = $arrUser[0]['logisticOldPass'];\n $finalPass = '';\n } else {\n $adminPassword = md5(trim($argArrPost['frmPassword']));\n $adminOldPass = $argArrPost['frmPassword'];\n $finalPass = $argArrPost['frmPassword'];\n }\n\n\n\n $arrColumnAdd = array(\n 'logisticTitle' => trim($argArrPost['frmTitle']),\n 'logisticUserName' => trim(stripslashes($argArrPost['frmName'])),\n 'logisticEmail' => trim(stripslashes($argArrPost['frmUserEmail'])),\n 'logisticPassword' => $adminPassword,\n 'logisticportal' => trim($argArrPost['CountryPortalID']),\n 'logisticStatus' => trim($argArrPost['frmStatus']),\n 'logisticOldPass' => $adminOldPass,\n );\n// pre($arrColumnAdd);\n\n $this->update(TABLE_LOGISTICPORTAL, $arrColumnAdd, $varUsersWhere);\n\n if ($_SERVER[HTTP_HOST] != '192.168.100.97') {\n //Send Mail To User\n $varPath = '<img src=\"' . SITE_ROOT_URL . 'common/images/logo.png' . '\"/>';\n $varToUser = $argArrPost['frmUserEmail'];\n $varFromUser = SITE_EMAIL_ADDRESS;\n $sitelink = SITE_ROOT_URL . 'logistic/';\n $varSubject = SITE_NAME . ':Login Details for Logistic Portal';\n $varBody = '\n \t\t<table width=\"700\" cellspacing=\"0\" cellpadding=\"5\" border=\"0\">\n\t\t\t\t\t\t\t <tbody>\n\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t <td width=\"600\" style=\"padding-left:10px;\">\n\t\t\t\t\t\t\t <p>\n\t\t\t\t\t\t\tWelcome! <br/><br/>\n\t\t\t\t\t\t\t<strong>Dear ' . $varName . ',</strong>\n\t\t\t\t\t\t\t <br />\n\t\t\t\t\t\t\t <br />\n\t\t\t\t\t\t\tYour Logistic Portal account has been successfully updated with ' . $sitelink . '. \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t <br />\n\t\t\t\t\t\t\t <br />Here is your access information:\n\t\t\t\t\t\t\t <br />Username/Email : ' . $varEmail . ' ';\n if (!empty($finalPass)) {\n $varBody .= '<br />Password : ' . $finalPass;\n }\n\n $varBody .= '<br /><br />\n\t\t\t\t\t\t\tIf there is anything that we can do to enhance your Tela Mela experience, please feel free to <a href=\"{CONTACT_US_LINK}\">contact us</a>.\n\t\t\t\t\t\t\t<br/><br/>\n\t\t\t\t\t\t\t </p>\n\t\t\t\t\t\t\t </td>\n\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t </tbody>\n\t\t\t\t\t\t\t </table>\n \t\t';\n// $varOutput = file_get_contents(SITE_ROOT_URL . 'common/email_template/html/admin_user_registration.html');\n// $varUnsubscribeLink = 'Click <a href=\"' . SITE_ROOT_URL . 'unsubscribe.php?user=' . md5($argArrPost['frmUserEmail']) . '\" target=\"_blank\">here</a> to unsubscribe.';\n// $varActivationLink = '';\n// $arrBodyKeywords = array('{USER}', '{USER_NAME}', '{PASSWORD}', '{EMAIL}', '{ROLE}', '{SITE_NAME}', '{ACTIVATION_LINK}', '{IMAGE_PATH}', '{UNSUBSCRIBE_LINK}');\n// $arrBodyKeywordsValues = array(trim(stripslashes($argArrPost['frmName'])), trim(stripslashes($argArrPost['frmName'])), trim($argArrPost['frmPassword']), trim(stripslashes($argArrPost['frmUserEmail'])), 'Country Portal', SITE_NAME, $varActivationLink, $varPath); //,$varUnsubscribeLink\n// $varBody = str_replace($arrBodyKeywords, $arrBodyKeywordsValues, $varOutput);\n $objCore->sendMail($varToUser, $varFromUser, $varSubject, $varBody);\n $_SESSION['sessArrUsers'] = '';\n }\n\n $objCore->setSuccessMsg(\"Logistic Portal details have been updated successfully.\");\n return true;\n }\n }", "public function editAction()\n\t {\n\t \t$id \t\t\t= (int) $this->getRequest()->getParam('id');\n\t \t$userService \t= new User_Service_User();\n\t \t$user\t\t\t= $userService->read( $id );\n\t \tif( !$user instanceof User_Model_User){\n\t \t\t$this->addSystemError('L\\'utilisateur n\\'existe pas');\n\t \t\t$this->_redirect( '/User/index/list');\n\t \t}\n\t \t$form \t\t\t= new User_Form_Edituser();\n\t \t$form->setAction( '/User/index/edit/id/' . $id);\n\t \tif( $this->getRequest()->isPost() ){\n\t \t\tif( $form->isValid( $this->getRequest()->getPost() ) ){\n\t\t\t\tif( $userService->update( $id, $form->getValues() )){\n\t\t\t\t\t$this->addSystemSuccess('Utilisateur mis à jour');\n\t\t\t\t} else {\n\t\t\t\t\t$this->addSystemError('Echec de la mise à jour');\n\t\t\t\t}\n\t \t\t} else {\n\t \t\t\t$this->addSystemError('Le formulaire contient des erreurs');\n\t \t\t}\n\t \t} else {\n\t\t\t$userData \t\t= array( 'login' => $user->getLogin(),\n\t\t\t\t\t\t\t\t\t 'nom' => $user->getNom(),\n\t\t\t\t\t\t\t\t\t 'prenom' => $user->getPrenom(),\n\t\t\t\t\t\t\t\t\t 'email' => $user->getEmail(),\n\t\t\t\t\t\t\t\t\t 'telephone' => $user->geTtelephone(),\n\t\t\t\t\t\t\t\t\t 'civilite' => $user->getcivilite() \n\t\t\t\t\t\t\t\t\t);\n\t\t\t$form->populate( $userData );\n\t \t}\n\t\t$this->view->form = $form;\n\t }", "public function edit($edit_id = NULL) { \r\n $page_title = 'Edit User Info';\r\n $page_link = 'users/addnew';\r\n $breadcrumb = array(\r\n 'User Info Edit' => '',\r\n 'Edit' => $page_link\r\n );\r\n $data = array();\r\n $data['class'] = 'users';\r\n $data['method'] = 'edit';\r\n/************************************** Form validation of the form ***********************************/ \r\n if($_POST){\r\n $this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\r\n $this->form_validation->set_rules('user_role', 'User Role', 'trim|required');\r\n $this->form_validation->set_rules('user_email', 'User Email', 'trim|required');\r\n $this->form_validation->set_rules('user_first_name', 'User First Name', 'trim|required');\r\n $this->form_validation->set_rules('user_last_name', 'User Last Name', 'trim|required');\r\n $this->form_validation->set_rules('user_company_name', 'User Company Name', 'trim|required');\r\n $this->form_validation->set_rules('user_address', 'User Address', 'trim|required');\r\n $this->form_validation->set_rules('user_zipcode', 'User Zip Code', 'trim|required');\r\n $this->form_validation->set_rules('user_city', 'User City', 'trim|required');\r\n $this->form_validation->set_rules('user_country', 'User Country', 'trim|required');\r\n $this->form_validation->set_rules('user_password', 'User Password', 'trim|required');\r\n\r\n if ( $this->form_validation->run() == FALSE ) {\r\n\r\n $data['error'] = \"error occured\";\r\n } else {\r\n\r\n $post_data = Array(\r\n 'user_role' => $this->input->post('user_role'),\r\n 'user_email' => $this->input->post('user_email'),\r\n 'user_first_name' => $this->input->post('user_first_name'),\r\n 'user_last_name' => $this->input->post('user_last_name'),\r\n 'user_company_name' => $this->input->post('user_company_name'),\r\n 'user_address' => $this->input->post('user_address'),\r\n 'user_zipcode' => $this->input->post('user_zipcode'),\r\n 'user_city' => $this->input->post('user_city'),\r\n 'user_country' => $this->input->post('user_country'),\r\n 'user_password' => $this->input->post('user_password'),\r\n 'created_by' => $this->session->userdata['logged_in']['user_id'],\r\n 'created_at' => date(\"Y-m-d H:i:s \")\r\n );\r\n\r\n $this->common_model->update_data(\"user_id\",$edit_id,\"uc_users\", $post_data);\r\n $this->session->set_flashdata('success','Information updated successfully' );\r\n redirect(\"users/index\", 'refresh');\r\n }\r\n }\r\n $data['all_data'] = $this->common_model->query_all_data(\"uc_users\",'user_id',$edit_id);\r\n $data_param = array( 'page_title' => $page_title, 'breadcrumb' => $breadcrumb, 'data' => $data );\r\n $this->be_page->generate(true, $page_link, $data_param, $response);\r\n }", "public function editAction()\n {\n $identity = Zend_Auth::getInstance()->getIdentity();\n $users = new Users_Model_User_Table();\n $row = $users->getById($identity->id);\n\n $form = new Users_Form_Users_Profile();\n $form->setUser($row);\n\n if ($this->_request->isPost()\n && $form->isValid($this->_getAllParams())) {\n\n $row->setFromArray($form->getValues());\n $row->save();\n\n $row->login(false);\n\n $this->_helper->flashMessenger('Profile Updated');\n $this->_helper->redirector('index');\n }\n $this->view->form = $form;\n }", "public function editRecord() {\n \n $permissions = $this->permission();\n $access = FALSE;\n foreach ($permissions as $per) {\n if ($per->permission == 'user-edit') {\n $access = TRUE;\n break;\n }\n }\n if ($access) {\n $id = $this->uri->segment(3);\n $user = $this->UserModel->getRecord($id);\n $permission_group = $this->UserModel->getUserType($user->id);\n $user->user_role = $permission_group->user_type;\n $this->data['result'] = $user;\n $this->set_view('user/edit_record_page',$this->data);\n } else {\n echo \"access denied\";\n }\n }", "public function edituser(){\n\t\t$id = $this->uri->segment(3);\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/edit_londontec_users';\n\t\t$mainData = array(\n\t\t\t'pagetitle' => 'Edit Londontec users',\n\t\t\t'londontec_users' => $this->setting_model->Get_Single('londontec_users','user_id',$id)\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "public function editAccountAction()\n {\n //Current customer Data.\n $cst = $this->model->getByUserName($_SESSION['userName']);\n if (empty($_POST) === false) {\n //User want to Update his Data.\n if (isset($_POST['update'])) {\n $message = \"\";\n $currentUserName = $cst->getuserName();\n //Check if customer`s new User Name or \n //new Email exists in Data Base.\n if ($currentUserName != $_POST['userName'])\n $message = $this->checkIfExists($_POST['userName'], \"\");\n if (!$message)\n if ($cst->getemail() != $_POST['email'])\n $message = $this->checkIfExists(\"\", $_POST['email']);\n if ($message != \"\")\n $this->regMassage($message);\n //Upadating Customer`s Data.\n else {\n $cst = $this->customerCreate();\n $this->update($cst, $currentUserName);\n $_SESSION['userName'] = $_POST['userName'];\n }\n }\n }\n\n $vars['update'] = \"\";\n $vars['customer'] = $cst;\n $this->view->render('edit profile', $vars);\n }", "public function actionEdit()\r\n\t{\r\n\t\t//disable jquery autoload\r\n\t\tYii::app()->clientScript->scriptMap=array(\r\n\t\t\t'jquery.js'=>false,\r\n\t\t);\r\n\t\t$model = $this->loadUser();\r\n\t\t$profile=$model->profile;\r\n\t\t\r\n\t\t// ajax validator\r\n\t\tif(isset($_POST['ajax']) && $_POST['ajax']==='profile-form')\r\n\t\t{\r\n\t\t\techo UActiveForm::validate(array($model,$profile));\r\n\t\t\tYii::app()->end();\r\n\t\t}\r\n\t\t\r\n\t\tif(isset($_POST['User']))\r\n\t\t{\r\n\t\t\t\r\n \r\n\t\t\t$model->attributes=$_POST['User'];\r\n\t\t\t$profile->attributes=$_POST['Profile'];\r\n\t\t\tif($model->validate()&&$profile->validate()) {\r\n\t\t\t\t$model->save();\r\n\t\t\t\t$profile->save();\r\n \r\n $usermodel= $this->Usermodel();\r\n if($usermodel)\r\n {\r\n if($usermodel==1)\r\n {\r\n $usr_model= Guardians::model()->findByAttributes(array('uid'=> Yii::app()->user->id));\r\n $usr_model->email= $model->email; \r\n $usr_model->save();\r\n }\r\n if($usermodel==2)\r\n {\r\n $usr_model= Students::model()->findByAttributes(array('uid'=> Yii::app()->user->id));\r\n $usr_model->email=$model->email;\r\n $usr_model->save();\r\n }\r\n if($usermodel==3)\r\n {\r\n $usr_model= Employees::model()->findByAttributes(array('uid'=> Yii::app()->user->id));\r\n $usr_model->email= $model->email;\r\n $usr_model->save();\r\n }\r\n }\r\n \r\n //Yii::app()->user->updateSession();\r\n\t\t\t\tYii::app()->user->setFlash('profileMessage',Yii::t('app',\"Changes is saved.\"));\r\n\t\t\t\t$this->redirect(array('/user/accountProfile'));\r\n\t\t\t} else $profile->validate();\r\n\t\t}\r\n\r\n\t\t$this->render('edit',array(\r\n\t\t\t'model'=>$model,\r\n\t\t\t'profile'=>$profile,\r\n\t\t));\r\n\t}", "public function postEdit(GenUserEditRequest $gen_user_edit_request, $id) {\n $gen_user = GenUser::find($id);\n $gen_user->confirmed = $gen_user_edit_request->confirmed;\n\n //check if the user changes the existing email\n if($gen_user->username !== $gen_user_edit_request->username){\n //check if the new email is already present in the database\n if(GenUser::where('username','=',$gen_user_edit_request->username)->first() != null){\n //create error message here\n }\n else{\n $gen_user->username = $gen_user_edit_request->username;\n } \n }\n\n $password = $gen_user_edit_request->password;\n\n if (!empty($password)) {\n $gen_user->password = Hash::make($password);\n $gen_user->secret = $password; }\n //var_dump($gen_user_edit_request);\n $gen_user -> save();\n \n // GenUserRole::where('gen_user_id','=',$gen_user->id)->delete();\n // foreach($gen_user_edit_request->roles as $item)\n // {\n // $gen_user_role = new GenUserRole;\n // $gen_user_role->gen_role_id = $item;\n // $gen_user_role->gen_user_id = $gen_user->id;\n // $gen_user_role-> save();\n // }\n\n // return redirect('gen_user');\n\n\n\n $value = $gen_user_edit_request->roles;\n if($value)\n {\n foreach($gen_user_edit_request->roles as $item)\n {\n $gen_user_role = new GenUserRole();\n $gen_user_role->gen_role_id = $item;\n $gen_user_role->gen_user_id = $gen_user->id;\n $gen_user_role->save();\n }\n }\n\n $success_edit = \\Lang::get('gen_user.edit_success').' : '.$gen_user->username ; \n return redirect('gen_user/'.$id.'/edit')->withSuccess( $success_edit);\n \n // $success_edit = \\Lang::get('registrar.create_success_edit_guardian').' : '.$gen_user->username ; \n // return redirect('registrar/register_guardian/'.$id.'/edit')->withSuccess( $success_edit);\n // return redirect('registrar/register_guardian/'.$id.'/edit');\n }", "public function afterValidation($inputs) {\n if (!User::canAdminPersonas()) {\n $id = (int)Input::get('id');\n if ($id > 0) {\n //if the user to be modified is not the current one, then abort\n if ($id != Auth::user()->paciente->id) {\n return false;\n }\n } else {\n //if creating a new profile it needs to be for the current one only\n if (!Auth::user()->admin && Input::get('usuario_id') != Auth::user()->id) {\n return false;\n }\n }\n }\n return true;\n }", "public function updateAction($userId) {\r\n\t\t// When submit information of user\r\n\t\tif ($this->request->isPost ()) {\r\n\t\t\t$updateUser = Users::findFirst ( $this->request->get ( \"id\" ) );\r\n\t\t\t$updateUser->firstname = $this->request->get ( \"first_name\" );\r\n\t\t\t$updateUser->lastname = $this->request->get ( \"last_name\" );\r\n\t\t\t$updateUser->bithday = $this->request->get ( \"date\" );\r\n\t\t\t$updateUser->save ();\r\n\t\t\treturn $this->dispatcher->forward ( array (\r\n\t\t\t\t\t'action' => 'index' \r\n\t\t\t) );\r\n\t\t} else {\r\n\t\t\t// When click to select user to update\r\n\t\t\t$this->view->user = Users::findFirst ( $userId );\r\n\t\t}\r\n\t}", "function users_beforeForm($data,$db){\n\tif(empty($data->user['id'])){\n\t\tcommon_loadPhrases($data,$db,'users');\n\t\t$data->output['responseMessage']=\n\t\t\tsprintf($data->phrases['users']['requiresLogin'],$data->phrases['users']['updateProfile']);\n\t\treturn FALSE;\n\t}\n\t$data->output['editingField']=TRUE;\n}", "public function edit($user_id)\n\t{\n\t\t//\n\t}", "public function manageroleandresourceAction()\n {\n if ($this->_request->isPost()) {\n $rid = (int)$this->_request->getPost('rid');\n $aryChecked = $this->_request->getPost('chkRes');\n\n require_once 'Admin/Bll/Role.php';\n $bllRole = Admin_Bll_Role::getDefaultInstance();\n $result = $bllRole->updateRoleOfResource($rid, $aryChecked);\n\n echo $result ? 'true' : 'false';\n }\n }", "function EditModeratorUser($argArrPost) {\n// pre($argArrPost);\n //@extract($argArrPost);\n $objCore = new Core;\n $varName = $argArrPost['frmName'];\n $varEmail = $argArrPost['frmUserEmail'];\n\n $varUserWhere = \" pkAdminID != \" . $argArrPost['frmUserID'] . \" AND ( AdminUserName='\" . $argArrPost['frmName'] . \"' OR AdminEmail='\" . $argArrPost['frmUserEmail'] . \"')\";\n $arrClms = array('pkAdminID', 'AdminUserName', 'AdminPassword', 'AdminEmail', 'AdminOldPass', 'AdminCountry', 'AdminRegion');\n $arrUserList = $this->select(TABLE_ADMIN, $arrClms, $varUserWhere);\n //echo '<pre>';print_r($arrUserList);die;\n if (isset($arrUserList[0]['pkAdminID']) && $arrUserList[0]['pkAdminID'] <> '') {\n $arrUserName = array();\n $arrUserEmail = array();\n foreach ($arrUserList as $key => $val) {\n if ($val['AdminUserName'] == $varName) {\n $arrUserName[] = $val['AdminUserName'];\n }\n if ($val['AdminEmail'] == $varEmail) {\n $arrUserEmail[] = $val['AdminEmail'];\n }\n }\n $varCountName = count($arrUserName);\n $varCountEmail = count($arrUserEmail);\n if ($varCountName > 0) {\n //$_SESSION['sessArrUsers'] = $argArrPost;\n $objCore->setErrorMsg(ADMIN_USER_NAME_ALREADY_EXIST);\n return false;\n } else if ($varCountEmail > 0) {\n //$_SESSION['sessArrUsers'] = $argArrPost;\n $objCore->setErrorMsg(ADMIN_USE_EMAIL_ALREADY_EXIST);\n return false;\n }\n } else {\n //$varPass = trim($argArrPost['frmPassword']);\n //$varUserPass = $arrUserList[0]['oldPass'];\n if (trim($argArrPost['frmPassword']))\n $varUsersWhere = ' pkAdminID =' . $argArrPost['frmUserID'];\n $arrUser = $this->select(TABLE_ADMIN, array('AdminPassword', 'AdminOldPass'), $varUsersWhere);\n //pre($arrUser);\n\n if ($arrUser[0]['AdminPassword'] == $argArrPost['frmPassword']) {\n $adminPassword = $arrUser[0]['AdminPassword'];\n $adminOldPass = $arrUser[0]['AdminOldPass'];\n $finalPass = '';\n } else {\n $adminPassword = md5(trim($argArrPost['frmPassword']));\n $adminOldPass = $arrUser[0]['AdminPassword'];\n $finalPass = $argArrPost['frmPassword'];\n }\n\n $varUserWhere = \" pkAdminRoleId='\" . $argArrPost['frmAdminRoll'] . \"'\";\n $arrClms = array('AdminRoleName');\n $arrRoleName = $this->select(TABLE_ADMIN_ROLL, $arrClms, $varUserWhere);\n //pre($arrRoleName[0]['AdminRoleName']);\n\n $arrColumnAdd = array(\n 'AdminTitle' => trim($argArrPost['frmTitle']),\n 'AdminUserName' => trim(stripslashes($argArrPost['frmName'])),\n 'AdminEmail' => trim(stripslashes($argArrPost['frmUserEmail'])),\n 'AdminPassword' => $adminPassword,\n 'fkAdminRollId' => $argArrPost['frmAdminRoll'],\n 'AdminOldPass' => $adminOldPass,\n 'AdminCountry' => trim($argArrPost['frmCountry']),\n );\n //pre($arrColumnAdd);\n $this->update(TABLE_ADMIN, $arrColumnAdd, $varUsersWhere);\n\n if ($_SERVER[HTTP_HOST] != '192.168.100.97') {\n //Send Mail To User\n $varPath = '<img src=\"' . SITE_ROOT_URL . 'common/images/logo.png' . '\"/>';\n $varToUser = $argArrPost['frmUserEmail'];\n $varFromUser = SITE_EMAIL_ADDRESS;\n $varSubject = SITE_NAME . ':Updated Login Details';\n $varOutput = file_get_contents(SITE_ROOT_URL . 'common/email_template/html/admin_user_edit.html');\n $varUnsubscribeLink = 'Click <a href=\"' . SITE_ROOT_URL . 'unsubscribe.php?user=' . md5($argArrPost['frmUserEmail']) . '\" target=\"_blank\">here</a> to unsubscribe.';\n $arrBodyKeywords = array('{USER}', '{USER_NAME}', '{PASSWORD}', '{EMAIL}', '{ROLE}', '{SITE_NAME}', '{ACTIVATION_LINK}', '{IMAGE_PATH}', '{UNSUBSCRIBE_LINK}');\n $arrBodyKeywordsValues = array(trim(stripslashes($argArrPost['frmName'])), trim(stripslashes($argArrPost['frmName'])), trim($finalPass), trim(stripslashes($argArrPost['frmUserEmail'])), $arrRoleName[0]['AdminRoleName'], SITE_NAME, $varActivationLink, $varPath); //,$varUnsubscribeLink\n $varBody = str_replace($arrBodyKeywords, $arrBodyKeywordsValues, $varOutput);\n $objCore->sendMail($varToUser, $varFromUser, $varSubject, $varBody);\n $_SESSION['sessArrUsers'] = '';\n }\n $objCore->setSuccessMsg(ADMIN_USER_UPDATE_SUCCUSS);\n return true;\n }\n }", "public function act_edit_user()\n {\n $id = strip_tags($this->input->post('id'));\n $email = strip_tags($this->input->post('email'));\n $pass = strip_tags(hash('sha256',$this->input->post('password')));\n\n\n if (validation_edit_admin()) {\n $update_user = $this->dashboard->update('m_admin', array('id' => $id), array('email' => $email, 'password' => $pass));\n if ($update_user) {\n $response = array('error'=>false,'title'=>'Update Berhasil','pesan'=>'');\n echo json_encode($response);\n }\n\n }else{\n $response = array('error'=>true,'title'=>'Update Gagal!','pesan'=>strip_tags(validation_errors()));\n echo json_encode($response);\n }\n }", "function editOld($userId = NULL)\n {\n if($this->isAdmin() == TRUE || $userId == 1)\n {\n $this->loadThis();\n }\n else\n {\n if($userId == null)\n {\n redirect('userListing');\n }\n \n $data['roles'] = $this->user_model->getUserRoles();\n $data['userInfo'] = $this->user_model->getUserInfo($userId);\n \n $this->global['pageTitle'] = 'Garuda Informatics : Edit User';\n \n $this->loadViews($this->view.\"editOld\", $this->global, $data, NULL);\n }\n }", "function validate_user_edit(array $inputs, array &$form): bool\n{\n if (App::$db->getRowById('wall', $_GET['id'])['poster'] !== $_SESSION['email']) {\n $form['error'] = 'ERROR YOU\\'RE NOT ALLOWED TO EDIT THAT';\n return false;\n }\n\n return true;\n}", "public function edit($user_id) {\n if ($_POST){\n #izmena vrednosti\n #redirekcija na listu\n \n $username = filter_input(INPUT_POST, 'username');\n $lastname = filter_input(INPUT_POST, 'lastname');\n $email = filter_input(INPUT_POST, 'email');\n \n if (!preg_match('/^[a-z0-9]{4,}$/', $username) or !preg_match('[A-z 0-9\\-]+', $fullname) or $email == '') {\n $this->setData('message', 'Izmene nisu tačno unete.');\n } else {\n $res = HomeModel::editById($user_id, $username, $lastname, $email);\n if ($res){\n Misc::redirect('homepage');\n } else {\n $this->setData('message', 'Došlo je do greške prilikom izmene.');\n }\n }\n \n }\n \n $user = HomeModel::getById($user_id);\n $this->setData('korisnik', $user);\n }", "static public function ctrEditUser(){\n\t\t\tif(isset($_POST[\"editarUsuario\"])){\n\t\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/',$_POST[\"editarNombre\"]) ){\n\n\t\t\t\t\t/*==========================================================\n\t\t\t\t\t\tV A L I D A R I M A G E N\n\t\t\t\t\t==========================================================*/\n\t\t\t\t\t$ruta = $_POST[\"fotoActual\"];\n\t\t\t\t\tif(isset($_FILES[\"editarFoto\"][\"tmp_name\"]) && $_FILES[\"editarFoto\"][\"tmp_name\"] != \"\"){\n\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t\t/*---------------------------------------------\n\t\t\t\t\t\t\tCREAR DIRECTORIO DONDE SE GUARDA LA FOTO\n\t\t\t\t\t\t---------------------------------------------*/\n\t\t\t\t\t\t$directorio = \"view/img/usuarios/\".$_POST[\"editarUsuario\"];\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--------------------------------------------\n\t\t\t\t\t\t\tPREGUNTAR SI EXISTE FOTO EN LA DB\n\t\t\t\t\t\t--------------------------------------------*/\n\t\t\t\t\t\tif(!empty($_POST[\"fotoActual\"])){\n\t\t\t\t\t\t\tunlink($_POST[\"fotoActual\"]);\n\t\t\t\t\t\t}else{//Creamos Directorio\n\t\t\t\t\t\t\tmkdir($directorio, 0755);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/*---------------------------------------------\n\t\t\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN ACCIONES\n\t\t\t\t\t\t---------------------------------------------*/\n\t\t\t\t\t\t$rand = mt_rand(100, 999);\n\n\t\t\t\t\t\t//------------------ IMAGEN JPEG ------------------\n\t\t\t\t\t\tif($_FILES[\"editarFoto\"][\"type\"] == \"image/jpeg\"){\n\t\t\t\t\t\t\t//Guardamos Imagen en el Directorio\n\t\t\t\t\t\t\t$ruta = \"view/img/usuarios/\".$_POST[\"editarUsuario\"].\"/\".$rand.\".jpeg\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t\t\t\t\timagejpeg($destino, $ruta);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($_FILES[\"editarFoto\"][\"type\"] == \"image/png\"){\n\t\t\t\t\t\t\t//Guardamos Imagen en el Directorio\n\t\t\t\t\t\t\t$ruta = \"view/img/usuarios/\".$_POST[\"editarUsuario\"].\"/\".$rand.\".png\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t\t\t\t\timagepng($destino, $ruta);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t\t//Posible Cambio de Contraseña\n\t\t\t\t\t$crPassword = \"\";\n\t\t\t\t\tif($_POST[\"editarPassword\"] != \"\"){\n\t\t\t\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/',$_POST[\"editarPassword\"])){\n\t\t\t\t\t\t\t$crPassword = crypt($_POST[\"editarPassword\"], '$2a$08$abb55asfrga85df8g42g8fDDAS58olf973adfacmY28n05$');\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"La contraseña no puede llevar caracteres especiales\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\t//Editar Password viene vacio, no se modificara contraseña\n\t\t\t\t\t\t$crPassword = $_POST[\"passwordActual\"];\n\t\t\t\t\t}\n\t\t\t\t\t$tabla = \"usuarios\";\n\t\t\t\t\t$datos = array(\n\t\t\t\t\t\t\"nombre\"=>$_POST[\"editarNombre\"],\n\t\t\t\t\t\t\"usuario\" => $_POST[\"editarUsuario\"],\n\t\t\t\t\t\t\"password\" => $crPassword,\n\t\t\t\t\t\t\"perfil\" => $_POST[\"editarPerfil\"],\n\t\t\t\t\t\t\"foto\" => $ruta);\n\t\t\t\t\t\n\t\t\t\t\t$respuesta = ModelUsers::mdlEditarUsuario($tabla, $datos);\n\n\t\t\t\t\tif($respuesta){//Usuario guardado con exito\n\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Usuario guardado con exito\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t}else{//Error al guardar usuario\n\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Error al guardar usuario '.$respuesta.'\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t}\n\t\t\t\t}else{//Nombre no valido\n\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Nombre no puede ir vacio o llevar caracteres especiales\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t</script>';\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function editUser(){\n\n\t\t$username = filter_input(INPUT_POST, 'newusername', FILTER_SANITIZE_STRING);\n\t\t$id = $_POST[\"id\"];\n\t\ttry {\n\t\t\trequire CONTROLLER_DIR . '/dbConnecterController.php';\n\t\t\t$result = $db->query('SELECT * FROM users WHERE id=\"'.$id.'\"');\n\n\t\t\t$row = $result->fetchColumn();\n\t\t\t\tif(!$row == 0){\n\t\t\t\t\t$statement = $db->prepare(\"UPDATE users SET username=:username WHERE id=:id\");\n\t\t\t\t\t$statement->bindParam(':username', $username, PDO::PARAM_STR);\n\t\t\t\t\t$statement->bindParam(':id', $id, PDO::PARAM_INT);\n\t\t\t\t\t$statement->execute();\n\t\t\t\t\t$db = null;\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tdie(\"No data present.\");\n\t\t\t\t}\t\n\n\t\t} catch (PDOException $e) {\n\t\t\tprint \"Error!: \" . $e->getMessage() . \"<br/>\";\n\t\t\tdie();\n\t\t}\n\t}", "function updateUser(){\n\t\t\tif($this->rest->getRequestMethod() != \"PUT\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t\texit;\n\t\t\t}\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\tif (isset($_POST['user_name']) && isset($_POST['password']) && isset($_POST['_id'])){\n\t\t\t\t\t$user_id = $_POST['_id'];\n\t\t\t\t\t$array['user_name'] = $_POST['user_name'];\n\t\t\t\t\t$array['password'] = $_POST['password'];\n\t\t\t\t\t$result = $this->model->setUser($array, \"_id='\".$user_id.\"'\");\n\t\t\t\t\tif($result) {\n\t\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t\t$response_array['message']='One record updated.';\n\t\t\t\t\t\t$update = $this->model->getUser('*',\"_id = \".\"'\".$user_id.\"'\");\n\t\t\t\t\t\t$response_array['data']=$update;\n\t\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t\t$response_array['message']='no record updated';\n\t\t\t\t\t\t$response_array['data']='';\n\t\t\t\t\t\t$this->rest->response($response_array, 304);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$this->rest->response('No parameters given',204);\t// If no records \"No Content\" status\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\t\n\t\t\t}\n\t\t\t\n\n\t\t}", "public function edit() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }", "public function update()\n {\n $userId = Helper::getIdFromUrl('user');\n\n // Save post data in $user\n $user = $_POST;\n \n // Save record to database\n UserModel::load()->update($user, $userId);\n\n View::redirect('user/' . $userId);\n }", "public function edit() {\n\n\t\t\t\t// Si on reçoit des données post\n\t\t\t\tif(!empty($this->request->data)){\n\t\t\t\t\t$this->User->id = $this->Session->read('Auth.User.id'); // On associe l'id du bac à l'objet \n\n\t\t\t\t\t// On valide les champs envoyés\n\t\t\t\t\tif($this->User->validates() ){\n\n\n\t\t\t\t\t\t$this->Session->setFlash('Données correctement sauvegardées', 'alert', array('class' => 'success'));\n\n\t\t\t\t\t\t// On enregistre les données\n\t\t\t\t\t\t$this->User->save(array(\n\t\t\t\t\t\t\t'email'\t\t\t=> $this->request->data['Users']['email'],\n\t\t\t\t\t\t\t'password' \t\t=> $this->Auth->password($this->request->data['Users']['password']),\n\t\t\t\t\t\t));\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// On affiche les données déjà entré par l'user\n\t\t\t\t$user= $this->User->find('first',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'conditions' =>\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id' => $this->Session->read('Auth.User.id'),\n\t\t\t\t\t\t\t\t)\n\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t$this->set(compact('user'));\n\t\t}", "protected function process() {\n\t\t// Build error link.\n\t\tif (empty($_POST['user_id'])) {\n\t\t\t$link = 'management/users/create';\n\t\t} else {\n\t\t\t$link = 'management/users/edit/' . $this->user['username'];\n\t\t}\n\n\t\t// Validate.\n\t\tif (!$this->validateForm()) {\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\t\tnonce_generate();\n\n\t\t// Validate required fields.\n\t\tif (empty($_POST['username'])) {\n\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t$_SESSION['data'] = array(\n\t\t\t\t'error' => 'A username must be entered.',\n\t\t\t\t'link' => $link\n\t\t\t);\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\t\tif (empty($_POST['user_id']) && empty($_POST['password'])) {\n\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t$_SESSION['data'] = array(\n\t\t\t\t'error' => 'A password must be entered.',\n\t\t\t\t'link' => $link\n\t\t\t);\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\t\tif ($_POST['password'] !== $_POST['password_confirm']) {\n\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t$_SESSION['data'] = array(\n\t\t\t\t'error' => 'The passwords did not match.',\n\t\t\t\t'link' => $link\n\t\t\t);\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\t\tif (empty($_POST['email'])) {\n\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t$_SESSION['data'] = array(\n\t\t\t\t'error' => 'An email address must be entered.',\n\t\t\t\t'link' => $link\n\t\t\t);\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\n\t\t// Build array of user information to update.\n\t\t$user = array(\n\t\t\t'username' => $_POST['username'],\n\t\t\t'email' => $_POST['email'],\n\t\t\t'first_name' => $_POST['first_name'],\n\t\t\t'last_name' => $_POST['last_name'],\n\t\t\t'expires_on' => $_POST['expires_on']\n\t\t);\n\t\tif (!empty($_POST['password'])) {\n\t\t\t$user['password'] = password_hash($_POST['password'], PASSWORD_DEFAULT);\n\t\t}\n\n\t\tif (empty($_POST['user_id'])) {\n\t\t\t// Create the user.\n\t\t\t$this->Users->create($user);\n\t\t} else {\n\t\t\t// Update the user.\n\t\t\t$this->Users->update($_POST['user_id'], $user);\n\t\t}\n\n\t\t// Forward to the users page.\n\t\tredirect(ABSURL . 'management/users');\n\t}", "public function processAction() {\n $post = $this->request->getPost();\n $userTable = $this->getServiceLocator()->get('UserTable');\n// Load User entity\n $user = $userTable->getUser($post->id);\n// Bind User entity to Form\n $form = $this->getServiceLocator()->get('UserEditForm');\n $form->bind($user);\n $form->setData($post);\n// Save user\n $this->getServiceLocator()->get('UserTable')->saveUser($user);\n }", "public function editAction($userId)\n {\n $request = $this->get('request');\n $service = $this->get('users.users_list_service');\n\n try {\n $userDetails = $service->getUserDetails($userId);\n } catch (\\Exception $ex) {\n throw $ex;\n }\n\n $user = new User();\n $user->setFirstName($userDetails['first_name']);\n $user->setLastName($userDetails['last_name']);\n\n $form = $this->createFormBuilder($user)\n ->add('first_name', 'text')\n ->add('last_name', 'text')\n ->add('save', 'submit', array('label' => 'Update'))\n ->getForm();\n if ($request->getMethod() == 'POST') {\n $form->handleRequest($request);\n if ($form->isSubmitted() && $form->isValid()) {\n $user = new User;\n $user->setId($userId);\n $user->setFirstName($form[\"first_name\"]->getData());\n $user->setLastName($form[\"last_name\"]->getData());\n $service->updateUser($user);\n\n return $this->redirectToRoute('users_homepage');\n }\n }\n\n return $this->render('UsersBundle:Users:list_edit.html.twig', array(\n 'form' => $form->createView(),\n ));\n }", "public function update()\n {\n $headerscripts['header_scripts'] = array(\n ''\n );\n\n $footerscripts['footer_scripts'] = array(\n '<script src=\"'.base_url().'assets/appjs/Users/users.js\"></script>'\n );\n\n // Samo Admin moze mjenjat i kreirat nove usere\n if(!$this->user->checkIfAdmin())\n {\n redirect('/home');\n }\n else\n {\n $viewData['empty'] = '';\n\n $this->load->helper('form');\n $this->load->library('form_validation');\n\n $this->form_validation->set_rules('avatar', 'Avatar', 'trim|required');\n $this->form_validation->set_rules('name', 'Ime', 'trim|required');\n $this->form_validation->set_rules('username', 'Ime', 'trim|required');\n $this->form_validation->set_rules('surname', 'Prezime', 'trim|required');\n $this->form_validation->set_rules('email', 'Email', 'trim|required');\n $this->form_validation->set_rules('username', 'KorisnickoIme', 'trim|required');\n // $this->form_validation->set_rules('password', 'Lozinka', 'trim|required');\n $this->form_validation->set_rules('user_type', 'Tip Korisnika', 'trim|required');\n\n if ($this->form_validation->run() === FALSE)\n {\n $viewData['avatars'] = $this->dbQueries->getAvatarImages();\n $viewData['userTypes'] = $this->dbQueries->getUserTypes();\n $id = $this->input->post('id');\n $viewData['user'] = $this->user->get($id);\n $this->load_views($headerscripts, $footerscripts, $viewData, 'Users/edit_view');\n }\n else\n {\n //Uredjuje se postojeci korisnik, informacije se dobivaju iz POST metode servera\n $this->user->update();\n\n redirect('/users');\n }\n }\n }", "public function actionUpdate() {\r\n\r\n //common view data\r\n $mainCategories = $this->mainCategories;\r\n $brands = $this->brands;\r\n \r\n $errors = [];\r\n $success = null;\r\n \r\n //check if the user is logged in and get User $user properties from the database\r\n $userID = $this->checkLogged();\r\n \r\n $user = new User;\r\n $user = $user->getUserById($userID);\r\n \r\n if(!$user) {\r\n $errors['firstname'][0] = 'Unable to find user. Please, try again later';\r\n } else {\r\n //user properties\r\n $firstname = $user->firstname;\r\n $lastname = $user->lastname;\r\n $email = $user->email;\r\n } \r\n \r\n //check if the form has been submitted\r\n if($_SERVER['REQUEST_METHOD'] == 'POST') {\r\n \r\n $firstname = $this->test_input($_POST['firstname']);\r\n $lastname = $this->test_input($_POST['lastname']);\r\n $email = $this->test_input($_POST['email']);\r\n \r\n //create form model, validate it and if success - update user profile\r\n $model = new EditProfileForm($userID, $firstname, $lastname, $email);\r\n \r\n if(!$model->validate()) {\r\n $errors = $model->errors;\r\n } else {\r\n #!!!!!!!!!!!!!\r\n $success = $model->updateProfile() ? 'USER DATA SUCCESFULLY UPDATED': 'UNABLE TO UPDATE USER PROFILE. TRY AGAIN LATER';\r\n }\r\n }\r\n \r\n include_once ROOT . '/views/profile/update.php';\r\n }", "public function editUser(UserEditForm $form, User $user);", "public function edit() {\n // without an id we just redirect to the error page as we need the post id to find it in the database\n if (!isset($_GET['id']))\n return call('pages', 'error404');\n\n \n $schools= School::find($_GET['id']);\n require_once('views/school/edit.php');\n\n\n if (isset($_POST['mail']) and $_POST['mail']!= \"\")\n {\n $schools = School::update_mail($_GET['id'],$_POST['mail']); \n }\n \n if (isset($_POST['street']) and $_POST['street']!= \"\")\n {\n $schools = School::update_street($_GET['id'],$_POST['street']); \n } \n\n if (isset($_POST['town']) and $_POST['town']!= \"\")\n {\n $schools = School::update_town($_GET['id'],$_POST['town']); \n }\n\n if (isset($_POST['continent']) and $_POST['continent']!= \"\")\n {\n $schools = School::update_continent($_GET['id'],$_POST['continent']); \n }\n\n if (isset($_POST['postcode']) and $_POST['postcode']!= \"\")\n {\n $schools = School::update_postcode($_GET['id'],$_POST['postcode']); \n }\n\n if (isset($_POST['phone_num']) and $_POST['phone_num']!= \"DEFAULT\")\n {\n $schools = School::update_phone_num($_GET['id'],$_POST['phone_num']); \n }\n\n if (isset($_POST['director']) and $_POST['director']!= \"\")\n {\n $schools = School::update_director($_GET['id'],$_POST['director']); \n } \n\n print_r($_POST); \n\n if (isset($_POST['password'])){\n\n if (isset($_POST['password']) and $_POST['password']!= \"DEFAULT\")\n {\n $schools = School::update_password($_GET['id'],$_POST['password']); \n } \n }\n \n }", "public function edit()\n {\n $userId = Helper::getIdFromUrl('user');\n \n $user = UserModel::load()->get($userId);\n\n return View::render('users/edit.view', [\n 'method' => 'POST',\n 'action' => '/user/' . $userId . '/update',\n 'user' => $user,\n 'roles' => RoleModel::load()->all(),\n ]);\n }", "function a_edit() {\n\t\tif (isset($_POST[\"btSubmit\"])) {\n\t\t\t$_POST['use_passw']=password_hash($_POST['use_passw'], PASSWORD_DEFAULT);\n\t\t\t$u=new User();\n\t\t\t$u->chargerDepuisTableau($_POST);\n\t\t\t$u->sauver();\n\t\t\theader(\"location:index.php?m=documents\");\n\t\t} else {\t\t\t\t\n\t\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t\t$u=new User($id);\n\t\t\textract($u->data);\t\n\t\t\trequire $this->gabarit;\n\t\t}\n\t}", "public function update($userID)\n\t{\n\t\n\t\t$this->data['page'] = \"users\";\n\t\t\n\t\t//get all users\n\t\t$this->data['users'] = $this->usermodel->getAll();\n\t\t\n\t\t//get roles\n\t\t$this->data['roles'] = $this->rolemodel->getAll();\n\t\t\n\t\t$this->data['theUser'] = $this->usermodel->getUser($userID);\n\t\t\n\t\t$this->form_validation->set_rules('firstname', 'First name', 'trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('lastname', 'Last name', 'trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('group', 'User role', 'trim|required|xss_clean');\n\t\t\n\t\tif ($this->form_validation->run() == FALSE) {\n\t\t\n\t\t\t$this->load->view('users/users', $this->data);\n\t\t\t\n\t\t} else {\n\t\t\n\t\t\t$data = array(\n\t\t\t\t'first_name' => $_POST['firstname'],\n\t\t\t\t'last_name' => $_POST['lastname'],\n\t\t\t\t'company' => $_POST['company'],\n\t\t\t\t'phone' => $_POST['phone']\n\t\t\t);\n\t\t\t\n\t\t\t$this->ion_auth->update($userID, $data);\n\t\t\n\t\t\t//update user role/group\n\t\t\t$data = array(\n\t\t\t\t'group_id' => $_POST['group']\n\t\t\t);\n\t\t\t\n\t\t\t$this->db->where('user_id', $userID);\n\t\t\t$this->db->update('dbapp_users_groups', $data);\n\t\t\t\n\t\t\t//if the new role is Adminisiatrtor, we'll need to take of the MySQL site of things\n\t\t\t\n\t\t\tif( $_POST['group'] == 1 ) {\n\t\t\t\t\t\t\n\t\t\t\t$this->usermodel->makeAdmin($userID);\n\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\t//setup the permissions for the new user\n\t\t\t\t\n\t\t\t\t$temp = $this->db->from('dbapp_groups')->where('id', $_POST['group'])->get()->result();\n\t\t\t\t\n\t\t\t\t$permissions = json_decode( $temp[0]->permissions, true );\n\t\t\t\t\n\t\t\t\t$this->rolemodel->applyPermissions($permissions, $mysqlUser = $this->ion_auth->user($userID)->row()->mysql_user);\n\t\t\t\n\t\t\t}\n\t\t\n\t\t\t$this->session->set_flashdata('success_message', $this->lang->line('users_update_success'));\n\t\t\t\n\t\t\tredirect(\"/users/\".$userID, \"refresh\");\n\t\t\t\n\t\t}\n\t\n\t}", "public function editionAction() {\r\n //inactivate header/footer\r\n $this->_includeTemplate = false;\r\n\r\n if ($_GET['checkboxAd'] == 'false') {\r\n $typeU = \"child\";\r\n } else {\r\n $typeU = \"adult\";\r\n }\r\n\r\n if ($_GET['checkboxAdmin'] == 'false') {\r\n $admin = \"0\";\r\n } else {\r\n $admin = \"1\";\r\n }\r\n\r\n //test to know if the user already exists\r\n $cpt = true;\r\n foreach ($_SESSION['members'] as $member) {\r\n\r\n if (($_GET['Name'] == $member->getName()) && ($_GET['CurrName'] != $member->getName() )) {\r\n $cpt = false;\r\n }\r\n }\r\n\r\n //if user doesn't exist\r\n if ($cpt) {\r\n //sql connection\r\n\r\n if ($_SESSION['Name'] == $_GET['CurrName'])//Current edit current\r\n $_SESSION['Name'] = $_GET['Name'];\r\n\r\n $connect = connection::getInstance();\r\n $_GET['Name'] = Users::secure($_GET['Name']);\r\n $_GET['Pass'] = Users::secure($_GET['Pass']);\r\n $_GET['Id'] = Users::secure($_GET['Id']);\r\n\r\n $sql = \"UPDATE users SET nameU='\" . $_GET['Name'] . \"', typeU='\" . $typeU . \"',password='\" . $_GET['Pass'] . \"', admin='\" . $admin . \"' where IDU ='\" . $_GET['Id'] . \"'\"; //on recupere tout les utilisateurs\r\n //sending request\r\n $req = mysql_query($sql) or die('Erreur SQL !<br>' . $sql . '<br>' . mysql_error());\r\n\r\n \r\n $_SESSION['admin'] = $admin;\r\n $_SESSION['current'] = 'members';\r\n $this->members = Users::Getuser(); //give data to view\r\n } else {\r\n $this->members = $_SESSION['members']; //give data to view\r\n }\r\n }", "private function updateUser(){\n\t\t$data['datosUsuario'] = $this->users->get($_REQUEST[\"idusuario\"]);\n\t\t$data['tipoUsuario'] = Seguridad::getTipo(); \n\t\tView::show(\"user/updateForm\", $data);\n\t}", "public function edit() {\n $token = $this->require_authentication();\n $user = $token->getUser();\n require \"app/views/user/user_edit.phtml\";\n }", "function postEdit($request){\r\n global $context;\r\n $data=new $this->model;\r\n try\r\n {\r\n foreach($data->fields as $key=>$field){\r\n if($field['type']!='One2many' && $field['type']!='Many2many')\r\n $data->data[$key]=$request->post[$key];\r\n }\r\n\r\n //print_r($data);\r\n if(!$data->update()){\r\n\r\n if($request->isAjax()) return json_error($data->error);\r\n throw new \\Exception($data->error);\r\n\r\n }\r\n\r\n\r\n if($request->isAjax()) return json_success(\"Save Success !!\");\r\n\r\n\r\n redirectTo($context->controller_path.\"/all\");\r\n }\r\n catch (\\Exception $ex)\r\n {\r\n if($request->isAjax()) return json_error($ex->getMessage().$obj->error);\r\n return $this->view(\"Error/index\",['ErrorNumber'=>0,'ErrorMessage'=>$ex->getMessage().$obj->error]);\r\n }\r\n }", "public function updateRecord() {\n \n $permissions = $this->permission();\n $access = FALSE;\n foreach ($permissions as $per) {\n if ($per->permission == 'user-edit') {\n $access = TRUE;\n break;\n }\n }\n if ($access) {\n $id = trim($this->input->post('id'));\n $first_name = trim($this->input->post('first_name'));\n $last_name = trim($this->input->post('last_name'));\n $id_no = trim($this->input->post('id_no'));\n $user_role = trim($this->input->post('user_role'));\n $phone_no = trim($this->input->post('phone_no'));\n $email = trim($this->input->post('email'));\n $password = trim($this->input->post('password'));\n\n $user = $this->UserModel->getRecord($id);\n if ($id_no != $user->id_no) {\n $this->form_validation->set_rules('id_no', 'ID No',\n 'required|is_unique[users_tb.id_no]',\n array('is_unique' => 'This %s already exist.'));\n }\n \n $this->form_validation->set_rules('user_role','User Role',\n 'required');\n\n if ($this->form_validation->run() == FALSE) {\n $this->data['id'] = $id;\n $this->set_view('user/edit_record_page',$this->data);\n } else {\n if ($password == '') {\n $data = array(\n 'first_name' => $first_name,\n 'last_name' => $last_name,\n 'id_no' => $id_no,\n 'phone_no' => $phone_no,\n 'email' => $email,\n );\n }else{\n $hash = $this->bcrypt->hash_password($password);\n $data = array(\n 'first_name' => $first_name,\n 'last_name' => $last_name,\n 'id_no' => $id_no,\n 'phone_no' => $phone_no,\n 'email' => $email,\n 'password' => $hash\n );\n }\n $result = $this->UserModel->updateRecordData($id, $data);\n \n $permissions_group = $this->UserModel->getGroupId($user_role);\n \n $this->UserModel->updateUserPermission(array('group_id' => \n $permissions_group->id),$id);\n\n $this->session->set_flashdata('message', '1');\n redirect('UserCon/showAllRecordsPage');\n }\n } else {\n echo \"access denied\";\n }\n }", "public function formUserEdit($user_id){\n // Get the user to edit\n $target_user = UserLoader::fetch($user_id); \n \n // Access-controlled resource\n if (!$this->_app->user->checkAccess('uri_users') && !$this->_app->user->checkAccess('uri_group_users', ['primary_group_id' => $target_user->primary_group_id])){\n $this->_app->notFound();\n }\n \n $get = $this->_app->request->get();\n \n if (isset($get['render']))\n $render = $get['render'];\n else\n $render = \"modal\";\n \n // Get a list of all groups\n $groups = GroupLoader::fetchAll();\n \n // Get a list of all locales\n $locale_list = $this->_app->site->getLocales();\n \n // Determine which groups this user is a member of\n $user_groups = $target_user->getGroups();\n foreach ($groups as $group_id => $group){\n $group_list[$group_id] = $group->export();\n if (isset($user_groups[$group_id]))\n $group_list[$group_id]['member'] = true;\n else\n $group_list[$group_id]['member'] = false;\n }\n \n if ($render == \"modal\")\n $template = \"components/user-info-modal.html\";\n else\n $template = \"components/user-info-panel.html\";\n \n // Determine authorized fields\n $fields = ['display_name', 'email', 'title', 'password', 'locale', 'groups', 'primary_group_id'];\n $show_fields = [];\n $disabled_fields = [];\n $hidden_fields = [];\n foreach ($fields as $field){\n if ($this->_app->user->checkAccess(\"update_account_setting\", [\"user\" => $target_user, \"property\" => $field]))\n $show_fields[] = $field;\n else if ($this->_app->user->checkAccess(\"view_account_setting\", [\"user\" => $target_user, \"property\" => $field]))\n $disabled_fields[] = $field;\n else\n $hidden_fields[] = $field;\n }\n \n // Always disallow editing username\n $disabled_fields[] = \"user_name\";\n \n // Hide password fields for editing user\n $hidden_fields[] = \"password\";\n \n // Load validator rules\n $schema = new \\Fortress\\RequestSchema($this->_app->config('schema.path') . \"/forms/user-update.json\");\n $validators = new \\Fortress\\ClientSideValidator($schema, $this->_app->translator); \n \n $this->_app->render($template, [\n \"box_id\" => $get['box_id'],\n \"box_title\" => \"Edit User\",\n \"submit_button\" => \"Update user\",\n \"form_action\" => $this->_app->site->uri['public'] . \"/users/u/$user_id\",\n \"target_user\" => $target_user,\n \"groups\" => $group_list,\n \"locales\" => $locale_list,\n \"fields\" => [\n \"disabled\" => $disabled_fields,\n \"hidden\" => $hidden_fields\n ],\n \"buttons\" => [\n \"hidden\" => [\n \"edit\", \"enable\", \"delete\", \"activate\"\n ]\n ],\n \"validators\" => $validators->formValidationRulesJson()\n ]); \n }", "function user_can_edit_user($user_id, $other_user)\n {\n }", "public function updateRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getEditRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check owner\n\t\t\t\tif(!$this->isOwner($record))\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception('You are not the owner of the record');\n\t\t\t\t}\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// update\n\t\t\t\t$this->getHandler()->update($record);\n\n\n\t\t\t\t$msg = new Message('You have successful edit a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}", "public function edit(){\n\t\t# If user is blank, they're not logged in; redirect them to the login page\n\t\tif(!$this->user) {\n\t\t\tRouter::redirect('/users/login');\n\t\t}\n\n\t\t# If they weren't redirected away, continue:\n\t\t\n\t\t# Setup view\n\t\t$this->template->content = View::instance('v_posts_edit');\n\t\t$this->template->title = \"Posts of \".$this->user->first_name;\n\n\t\t#query to only show users posts\n\t\t$q = \"SELECT\n\t\t\t\tposts.content, \n\t\t\t\tposts.created, \n\t\t\t\tposts.post_id,\n\t\t\t\tusers.first_name, \n\t\t\t\tusers.last_name\n\t\t\tFROM posts\n\t\t\tINNER JOIN users\n\t\t\t\tON posts.user_id = users.user_id\n\t\t\tWHERE users.user_id =\".$this->user->user_id;\n\n\t\t# Execute the query to get all the posts. \n\t\t# Store the result array in the variable $posts\n\t\t# Run the query, store the results in the variable $posts\n\t\t$posts = DB::instance(DB_NAME)->select_rows($q);\n\n\t\t# Pass data (posts) to the view\n\t\t$this->template->content->posts = $posts;\n\n\t\t# Render template\n\t\techo $this->template;\n\t}", "public function edit_user()\n {\n //make sure user logged in or pending\n if (Session::has('user') || Session::has('pending_user'))\n {\n //check to make sure phone number in correct format\n $number = Input::get('phone_number');\n\n //took pattern from http://www.w3resource.com/javascript/form/phone-no-validation.php\n $pattern = \"/^\\(?([0-9]{3})\\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/\";\n\n //if phone entered correctly\n if (preg_match ($pattern, $number))\n {\n\n // Input doesn't return zero for unchecked boxes, so change these to zero\n $hours_notification = (Input::get('hours_notification') ? 1 : 0);\n $deals_notification = (Input::get('deals_notification') ? 1 : 0);\n\n //strip any punctuation from phone number, if exists\n $phone = str_replace(array(\"-\",\".\",\"(\",\")\",\" \"), \"\", Input::get('phone_number'));\n\n //if user already logged in\n if (Session::has('user'))\n {\n $user_session = Session::get('user');\n $user = User::find($user_session->id);\n $user->preferred_name = Input::get('preferred_name');\n $user->phone_number = $phone;\n $user->hours_notification = $hours_notification;\n $user->deals_notification = $deals_notification;\n $user->save();\n\n //put updated user on to session\n\n Session::put('user', $user);\n\n }\n //else create new user\n else\n {\n //create user based on session data and input\n $pending = Session::get('pending_user');\n\n $user = new User();\n $user->cs50_id = $pending[\"cs50_id\"];\n $user->name = $pending[\"fullname\"];\n $user->preferred_name = Input::get('preferred_name');\n $user->email = $pending[\"email\"];\n $user->phone_number = $phone;\n $user->hours_notification = $hours_notification;\n $user->deals_notification = $deals_notification;\n $user->save();\n\n //remove pending user from session\n Session::forget('pending_user');\n\n //log user in\n Session::put('user', $user);\n Auth::loginUsingId($user->id);\n\n //send user text message about signing up\n\n $grille_name = Grille::where('id', $this->grille_id)->pluck('name');\n $message = \"Thanks for signing up for \" . $grille_name . \"'s online ordering!\n If you received this message by accident, reply 'STOP'\";\n\n Sms::send_sms($phone, $message);\n }\n\n //redirect to most recent page\n $url = Session::get('redirect');\n Session::forget('redirect');\n return Redirect::to($url);\n }\n //else alert user to enter correct phone number\n else\n {\n $failure = 'Please enter a 10-digit phone number';\n\n //if user already has account\n if (Session::has('user'))\n {\n $user = Session::get('user');\n $user->new = 0;\n $user->grille_number = Grille::where('id', $this->grille_id)->pluck('phone_number');\n $this->layout->content = View::make('users.edit', ['user' => $user, 'failure' => $failure]);\n }\n\n //if user is logging in for first time\n else\n {\n $user = Session::get('pending_user');\n $this->layout->content = View::make('users.edit', ['user' => $user, 'failure' => $failure]);\n }\n\n }\n }\n\n //if not user or pending user, redirect\n else\n {\n try {\n return Redirect::back();\n }\n catch (Exception $e) {\n return Redirect::to('/');\n }\n }\n\n }", "public function editUser($id) {\n $postData = Input::all();\n$user_permission = '';\n if (!empty($postData)) {\n\n $username = trim(Input::get('username'));\n $user_result = DB::table('hr_login_credentials')->select('username')->where('username', '=', $username)->where('id', \"!=\", $id)->get();\n if ($user_result) {\n return Redirect::back()->with('erroralert', 'Username already exist.Please try with different username.');\n } else {\n if (Input::has('password_change')) {\n $user_pass = md5(trim(Input::get('old_password')));\n $password = DB::table('hr_login_credentials')->select('password')->where('id', \"=\", $id)->first();\n\n if ($password->password == $user_pass) {\n\n $pass_update = DB::table('hr_login_credentials')->where('id', \"=\", $id)->update(array('password' => md5(Input::get('new_password'))));\n } else {\n return Redirect::back()->with('erroralert', 'Old password did not match.');\n }\n }\n\t\t\t\n\t\t\t\n\t\t\t\t$permission = isset($postData['check']) ? 1 : 2 ;\n\n if (Input::has('company_name')) {\n $updatedBy = 2;\n } else {\n $updatedBy = 1;\n }\n if (Input::has('ac_type')) {\n $acct_types = Input::get('ac_type');\n } else {\n $acct_types = Input::get('hidden_account_type');\n }\nif (isset($postData['permission'])) {\n $user_permission = serialize($postData['permission']);\n }\n\n if (!Input::has('company_name')) {\n $update_array = array('fkCompany_id' => Input::get('company'), 'username' => Input::get('username'), 'muliple_option' => isset($postData['muliple_option']) ? $postData['muliple_option'] : 0, 'account_type' => $acct_types, 'updated_by' => $updatedBy ,'permission'=>$permission, 'user_permission' => $user_permission);\n } else {\n $update_array = array('username' => Input::get('username'), 'account_type' => $acct_types, 'muliple_option' => $postData['muliple_option'], 'updated_by' => $updatedBy,'permission'=>$permission, 'user_permission' => $user_permission);\n }\n\n\n $result = DB::table('hr_login_credentials')->where('id', '=', $id)->update($update_array);\n $getUserDetails = DB::table('hr_login_credentials as t1')\n ->join('hr_company_database as t2', 't2.fkCompany_id', '=', 't1.fkCompany_id')\n ->select('t2.host_address', 't2.db_name', 't2.user_name', 't2.password', 't1.fkUserId')\n ->where('t1.id', $id)\n ->first();\n\n $this->db2->table('hr_emp_info')->where('id', $getUserDetails->fkUserId)->update(array('email_id' => Input::get('username')));\n\n\n if (!Input::has('company_name')) {\n return Redirect::to('config/company-user-settings')->with('successalert', 'User updated Successfully');\n } else {\n return Redirect::to('config/company-user-settings')->with('successalert', 'User updated Successfully');\n }\n }\n }\n\n\n $companies = DB::table('hr_company_dtls as cmp')->select('id', 'company_name', 'customize_approve')->where(array('is_active' => 1, 'delete_status' => 0))->get();\n $user = DB::table('hr_login_credentials as user')\n ->join('hr_company_dtls as comp', 'comp.id', \"=\", 'user.fkCompany_id')\n ->select('user.id', 'user.username', 'user.password', 'user.muliple_option', 'user.ml_settings','user.permission', 'user.account_type', 'comp.id as comp_id')->where('account_status', 1)->where('user.id', '=', $id)->get();\n\n $role = array(1, 2, 3, 4, 5);\n $role_type = Session::has('proxy_user_role') ? Session::get('proxy_user_role') : Session::get('user_role');\n $user_permission = DB::table('hr_login_credentials')\n ->select('user_permission')\n ->where('account_status', 1)->where('id', '=', $id)->first();\n if ($user_permission) {\n $user_permission = unserialize($user_permission->user_permission);\n }\n $cmpny_Id = Session::has('proxy_cpy_id') ? Session::get('proxy_cpy_id') : Session::get('cpy_id');\n $users = DB::table('hr_login_credentials')->select('fkUserId as uid')->whereIn('account_type', $role)->where('account_status', 1)->where('fkCompany_id', $cmpny_Id)->orderBy('fkUserId')->get();\n\n $auth = array();\n if (!empty($users)) {\n foreach ($users as $u) {\n if ($u->uid != 0) {\n $auth[] = $u->uid;\n }\n }\n }\n\n if (in_array($role_type, $role)) {\n if ($auth) {\n $reportTo = $this->db2->table('hr_emp_info')->select('hr_emp_info.id', 'hr_emp_info.first_name', 'hr_emp_info.last_name')->whereIn('id', $auth)->where('local_del', 0)->get();\n } else {\n $reportTo = '';\n }\n } else {\n $reportTo = $this->db2->table('hr_emp_info')->select('hr_emp_info.id', 'hr_emp_info.first_name', 'hr_emp_info.last_name')->where('id', '!=', $id)->whereIn('id', $auth)->where('local_del', 0)->get();\n }\n\t\t$approve = $this->db2->table('hr_multi_approve')->select('approve_module')->orderBy('sort_order')->get();\n\n return View::make('settings.company.editUser')->with(array('user' => $user, 'company' => $companies, 'report' => $reportTo, 'multi'=>$approve, 'user_permission' => $user_permission));\n //return View::make('settings.company.editUser')->with(array('company' => $companies, 'user' => $user));\n }", "function editTableRow($tableName)\n{\n\n if ($tableName == \"userdata\") {\n $errorUpdate = $errorFirstName = $errorLastName = $errorEmail = \"\";\n global $dataRights;\n //$result = database::getConnections()->viewByID($_POST[\"tableName\"], $_POST[\"userId\"]);\n $result = database::getConnections()->view('userdata INNER JOIN userinfo ON userdata.id=userinfo.userid', 'userdata.id=:userid', [':userid' => $_POST[\"userId\"]]);\n\n $tokenClass = new token();\n $xsrfType = \"AdminUpdateUserForm\";\n $xsrfExpires = date(\"Y-m-d H:i:s\", strtotime(date(\"Y-m-d H:i:s\") . \" +8 minutes\"));\n\n $xsrfToken = $tokenClass->generateXSRFToken();\n database::getConnections()->tokenInsert($xsrfToken, $xsrfType, $xsrfExpires, $xsrfId = null);\n\n if ($dataRights[\"rights\"] >= 90) {\n global $errorUpdate;\n echo '<div class=\"formAdminUpdate\"><form method=\"post\" enctype=\"multipart/form-data\">\n <input type=\"hidden\" name=\"userId\" value=\"' . $result['userid'] . '\">\n <input type=\"hidden\" name=\"tableName\" value=\"userdata\">\n <input type=\"hidden\" name=\"rights\" value=\"' . $result['rights'] . '\">\n <input type=\"hidden\" name=\"xsrfToken\" value=\"' . $xsrfToken . '\">\n <div>\n <div>' . $errorUpdate . '</div>\n <h1>Editieren</h1>\n </div>\n <div class=\"field\">\n <label for=\"firstname\">Vorname:</label>\n <input type=\"text\" name=\"firstname\" id=\"firstname\" placeholder=\"Max\" autofocus maxlength=\"75\" value=\"' . $result['firstname'] . '\">\n <div>' . $errorFirstName . '</div>\n </div>\n <div class=\"field\">\n <label for=\"lastname\">Nachname:</label>\n <input type=\"text\" name=\"lastname\" id=\"lastname\" placeholder=\"Mustermann\" maxlength=\"75\" value=\"' . $result['lastname'] . '\">\n <div>' . $errorLastName . '</div>\n </div>\n <div class=\"field\">\n <label for=\"email\">E-Mail Adresse:</label>\n <input type=\"email\" name=\"email\" id=\"email\" placeholder=\"[email protected]\" maxlength=\"255\" value=\"' . $result['email'] . '\">\n <div>' . $errorEmail . '</div>\n </div>\n <div class=\"field\">\n <label for=\"rights\">Rechte:</label>\n <select class=\"\" name=\"editRights\">\n\t\t\t\t <optgroug name=\"editRights\">\n <option value=\"\" disabled selected>' . $result['rights'] . '</option>\n <option value=\"0\">Freie Nutzung/User</option>\n <option value=\"10\">Vollversion/User</option>\n <option value=\"20\">NLP Coach</option>\n <option value=\"30\">NLP Moderator</option>\n <option value=\"50\">Support</option>\n <option value=\"60\">Admin</option>\n <option value=\"99\">Besitzer</option>\n\t\t\t\t </optgroup>\n\t\t\t </select>\n </div>\n\n <input class=\"btn btnSecondary\" type=\"submit\" name=\"edit\" value=\"Aktualisieren\">\n </form></div><br>';\n }\n\n } else {\n $errorUpdate = $errorAutor = $errorTitle = $errorDescription = $errorTextMessage = $errorSoundcloudLink = $errorYouTubeLink = $errorImage = \"\";\n global $dataRights, $userid;\n\n $result = database::getConnections()->viewByID($_POST[\"tableName\"], $_POST[\"userId\"]);\n\n $tokenClass = new token();\n $xsrfType = \"AdminUpdateNLPForm\";\n $xsrfExpires = date(\"Y-m-d H:i:s\", strtotime(date(\"Y-m-d H:i:s\") . \" +8 minutes\"));\n\n $xsrfToken = $tokenClass->generateXSRFToken();\n database::getConnections()->tokenInsert($xsrfToken, $xsrfType, $xsrfExpires, $xsrfId = null);\n\n $profilPic = database::getConnections()->view(\"images\", \"nlpid=:nlpid AND tablename=:tablename\", [':nlpid' => $_POST[\"userId\"], ':tablename' => 'Nlp']);\n\n\n if ($dataRights[\"rights\"] >= 30) {\n global $errorUpdate;\n echo '<div class=\"formAdminUpdate\"><form method=\"post\" enctype=\"multipart/form-data\">\n <input type=\"hidden\" name=\"userId\" value=\"' . $result['id'] . '\">\n <input type=\"hidden\" name=\"tableName\" value=\"nlp\">\n <input type=\"hidden\" name=\"valueNlpImage\" value=\"' . $profilPic['src'] . '\">\n <input type=\"hidden\" name=\"valueGenre\" value=\"' . $result['genre'] . '\">\n <input type=\"hidden\" name=\"unlocked\" value=\"' . $result['unlocked'] . '\">\n <input type=\"hidden\" name=\"xsrfToken\" value=\"' . $xsrfToken . '\">\n <div>\n <div>' . $errorUpdate . '</div>\n <h1>Editieren</h1>\n </div>\n <div class=\"field\">\n <label for=\"nlpImage\">Übungsbild:</label>\n <input type=\"file\" accept=\"image/*\" name=\"appImage\" id=\"nlpImage\">\n <div>' . $errorImage . '</div>\n </div>\n <div class=\"field\">\n <label for=\"title\">Titel:</label>\n <input type=\"text\" name=\"title\" id=\"title\" placeholder=\"Titel\" autofocus maxlength=\"75\" value=\"' . $result['title'] . '\">\n <div>' . $errorTitle . '</div>\n </div>\n <div class=\"field\">\n <label for=\"description\">Beschreibung:</label>\n <input name=\"description\" id=\"description\" placeholder=\"Beschreibung\" maxlength=\"150\" value=\"' . $result['description'] . '\">\n <div>' . $errorDescription . '</div>\n </div>\n <div class=\"field\">\n <label for=\"text\">Text:</label>\n <textarea name=\"text\" id=\"text\" placeholder=\"Text\" rows=\"4\" cols=\"60\" value=\"\">' . $result['text'] . '</textarea>\n <div>' . $errorTextMessage . '</div>\n </div>\n <div class=\"field\">\n <label for=\"rights\">Genre:</label>\n <select class=\"\" name=\"editGenre\">\n\t\t\t\t <optgroug name=\"editGenre\">\n <option value=\"\" disabled selected>' . $result['genre'] . '</option>\n <option value=\"A\">A</option>\n <option value=\"B\">B</option>\n <option value=\"C\">C</option>\n <option value=\"D\">D</option>\n <option value=\"E\">E</option>\n <option value=\"F\">F</option>\n <option value=\"G\">G</option>\n\t\t\t\t </optgroup>\n\t\t\t </select>\n </div>\n <div class=\"field\">\n <label for=\"soundcloudLink\">Soundcloud Link:</label>\n <input type=\"url\" name=\"soundcloudLink\" id=\"soundcloudLink\" placeholder=\"Soundcloud Link\" maxlength=\"255\" value=\"' . $result['soundcloud'] . '\">\n <div>' . $errorSoundcloudLink . '</div>\n </div>\n <div class=\"field\">\n <label for=\"youtubeLink\">YouTube Link:</label>\n <input type=\"url\" name=\"youtubeLink\" id=\"youtubeLink\" placeholder=\"YouTube Link\" maxlength=\"255\" value=\"' . $result['youtube'] . '\">\n <div>' . $errorYouTubeLink . '</div>\n </div>\n <div class=\"field\">\n <label for=\"editUnlocked\">Freischalten:</label>\n <select class=\"\" name=\"editUnlocked\">\n <optgroug name=\"editUnlocked\">\n <option value=\"' . $result['unlocked'] . '\" disabled selected>' . $result['unlocked'] . '</option>\n <option value=\"1\">ONLINE</option>\n <option value=\"0\">OFFLINE</option>\n </optgroup>\n </select>\n </div>\n\n <input class=\"btn btnSecondary\" type=\"submit\" name=\"edit\" value=\"Aktualisieren\">\n </form></div><br>';\n } else {\n global $errorUpdate;\n echo '<div class=\"formAdminUpdate\"><form method=\"post\" enctype=\"multipart/form-data\">\n <input type=\"hidden\" name=\"userId\" value=\"' . $result['id'] . '\">\n <input type=\"hidden\" name=\"tableName\" value=\"nlp\">\n <input type=\"hidden\" name=\"valueNlpImage\" value=\"' . $profilPic['src'] . '\">\n <input type=\"hidden\" name=\"valueGenre\" value=\"' . $result['genre'] . '\">\n <input type=\"hidden\" name=\"unlocked\" value=\"' . $result['unlocked'] . '\">\n <input type=\"hidden\" name=\"xsrfToken\" value=\"' . $xsrfToken . '\">\n <div>\n <div>' . $errorUpdate . '</div>\n <h1>Editieren</h1>\n </div>\n <div class=\"field\">\n <label for=\"title\">Titel:</label>\n <input type=\"text\" name=\"title\" id=\"title\" placeholder=\"Titel\" autofocus maxlength=\"75\" value=\"' . $result['title'] . '\">\n <div>' . $errorTitle . '</div>\n </div>\n <div class=\"field\">\n <label for=\"description\">Beschreibung:</label>\n <input name=\"description\" id=\"description\" placeholder=\"Beschreibung\" maxlength=\"150\" value=\"' . $result['description'] . '\">\n <div>' . $errorDescription . '</div>\n </div>\n <div class=\"field\">\n <label for=\"text\">Text:</label>\n <textarea name=\"text\" id=\"text\" placeholder=\"Text\" value=\"\">' . $result['text'] . '</textarea>\n <div>' . $errorTextMessage . '</div>\n </div>\n <div class=\"field\">\n <label for=\"rights\">Genre:</label>\n <select class=\"\" name=\"editGenre\">\n\t\t\t\t <optgroug name=\"editGenre\">\n <option value=\"\" disabled selected>' . $result['genre'] . '</option>\n <option value=\"A\">A</option>\n <option value=\"B\">B</option>\n <option value=\"C\">C</option>\n <option value=\"D\">D</option>\n <option value=\"E\">E</option>\n <option value=\"F\">F</option>\n <option value=\"G\">G</option>\n\t\t\t\t </optgroup>\n\t\t\t </select>\n </div>\n <div class=\"field\">\n <label for=\"title\">Soundcloud Link:</label>\n <input type=\"url\" name=\"soundcloudLink\" id=\"soundcloudLink\" placeholder=\"Soundcloud Link\" maxlength=\"255\" value=\"' . $result['soundcloud'] . '\">\n <div>' . $errorSoundcloudLink . '</div>\n </div>\n <div class=\"field\">\n <label for=\"title\">YouTube Link:</label>\n <input type=\"url\" name=\"youtubeLink\" id=\"youtubeLink\" placeholder=\"YouTube Link\" maxlength=\"255\" value=\"' . $result['youtube'] . '\">\n <div>' . $errorYouTubeLink . '</div>\n </div>\n <input class=\"btn-input\" type=\"submit\" name=\"edit\" value=\"Aktualisieren\">\n </form></div><br>';\n }\n }\n\n}", "public function edit()\n {\n $user = User::findOne(Yii::$app->user->id);\n $user->username = $this->username;\n $user->email = $this->email;\n try {\n $user->save();\n return true;\n } catch(IntegrityException $e) {\n return false;\n }\n }", "public function editAction() {\n $uid = $this->getInput('uid');\n $userInfo = Admin_Service_User::getUser(intval($uid));\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('userInfo', $userInfo);\n $this->assign('groups', $groups);\n $this->assign('status', $this->status);\n $this->assign(\"meunOn\", \"sys_user\");\n }", "public function edit(){\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 edituserAction(): object\n {\n // Sets webpage title\n $title = \"Edit user\";\n\n // Sets extended webpage title\n $titleExtended = \" | Eshop\";\n\n // Framework variables\n $response = $this->app->response;\n $session = $this->app->session;\n\n // Verifies if user is logged in\n if (!$session->get(\"loggedIn\")) {\n $response->redirect(\"eshop/login\");\n };\n\n\n // Connects to db\n $this->app->db->connect();\n\n // Retrieve content id\n $username = getGet(\"username\");\n\n // SQL statement\n $sql = \"SELECT * FROM users WHERE username = ?;\";\n\n // Fetches data from db and stores in $resultset\n $content = $this->app->db->executeFetch($sql, [$username]);\n\n // Data array\n $data = [\n \"title\" => $title,\n \"titleExtended\" => $titleExtended,\n \"username\" => $username,\n \"content\" => $content\n ];\n\n // Includes admin header\n $this->app->page->add(\"content/header_admin\");\n\n // Adds route and sends data array to view\n $this->app->page->add(\"content/edit_user\", $data);\n\n // Renders page\n return $this->app->page->render($data);\n }", "public function edit(User $user)\n {\n $this->authorize('haveaccess','misdatos');\n\n\n $adicional = Adicional::where('user_id', $user->id)->orderBy('id', 'DESC')\n ->first();\n $direactual = DB::table('usercontacto')\n ->where('user_id', $user->id)\n ->orderBy('id', 'DESC')\n ->first();\n $soportes = Soporte::where('user_id', $user->id)\n ->orderBy('vencimiento', 'ASC')\n ->orderBy('estado', 'ASC')\n ->paginate(50);\n $salarios = Salario::where('user_id', $user->id)\n ->orderBy('created_at', 'DESC')\n ->paginate(20);\n $empresas = DB::table('empresa_users')\n ->join('empresas', 'empresa_users.empresa_id', '=', 'empresas.id')\n ->join('roles', 'empresa_users.role_id', '=', 'roles.id')\n ->join('sucursales', 'empresa_users.sucursal_id', '=', 'sucursales.id')\n ->join('areas', 'empresa_users.area_id', '=', 'areas.id')\n ->select(\n 'empresas.id as emid', 'empresas.nombre as emnombre', 'empresas.logo', 'roles.id as rolid',\n 'roles.name', 'sucursales.id as sucid', 'sucursales.nombre as sucnombre',\n 'areas.id as areaid', 'areas.area'\n )\n ->where('empresa_users.user_id', $user->id)\n ->get();\n $disponibles = Empresa::where('estado', '1' )\n ->select('id as dispoid', 'nombre')\n ->orderBy('nombre', 'ASC')\n ->get();\n\n $roles = Role::select('id', 'name')\n ->where('id', '>', '2')\n ->orderBy('id', 'ASC')\n ->get();\n\n $ubicacion = DB::table('empresa_users')\n ->join('empresas', 'empresa_users.empresa_id', '=', 'empresas.id')\n ->join('roles', 'empresa_users.role_id', '=', 'roles.id')\n //->join('sucursales', 'empresa_users.sucursal_id', '=', 'sucursales.id')\n //->join('areas', 'empresa_users.area_id', '=', 'areas.id')\n ->select(\n 'empresas.id as emid', 'empresas.nombre as emnombre', 'roles.id as rolid',\n 'roles.name', 'empresa_users.sucursal_id as sucid', 'empresa_users.sucursal as sucnombre',\n 'empresa_users.area_id as areaid', 'empresa_users.area'\n )\n ->where('empresa_users.user_id', $user->id)\n ->where('empresa_users.empresa_id', $user->empresa)\n ->first();\n\n $sucursales = DB::table('sucursales')\n ->where('empresa_id', $user->empresa)\n ->where('estado', '1')\n ->orderBy('nombre', 'ASC')\n ->get();\n\n $areas = DB::table('areas')\n ->where('empresa_id', $user->empresa)\n ->where('estado', '1')\n ->orderBy('area', 'ASC')\n ->get();\n\n\n\n //return compact('user', 'adicional', 'soportes', 'salarios', 'empresas', 'roles', 'disponibles', 'ubicacion');\n return view('user.edit', compact(\n 'user', 'adicional', 'direactual', 'soportes', 'salarios', 'empresas', 'disponibles', 'roles', 'ubicacion', 'sucursales', 'areas'\n ));\n }", "function render_edit($user)\n {\n }" ]
[ "0.6944832", "0.6506544", "0.64835507", "0.6443123", "0.63922614", "0.637695", "0.63103336", "0.6148198", "0.61414236", "0.6123014", "0.6107582", "0.6100233", "0.6037071", "0.60338557", "0.6010923", "0.5978386", "0.59742177", "0.5962707", "0.5936845", "0.59142584", "0.5901627", "0.58937055", "0.58858156", "0.58852243", "0.5874045", "0.58686537", "0.5856295", "0.57973945", "0.5794734", "0.57757527", "0.5760305", "0.5759078", "0.5756632", "0.574416", "0.5728667", "0.5725562", "0.5689976", "0.56841713", "0.56838757", "0.5682225", "0.5674613", "0.56703", "0.56696725", "0.5668876", "0.5653872", "0.5645779", "0.56384754", "0.56233346", "0.56228316", "0.5621272", "0.5613203", "0.56043965", "0.56028104", "0.56024915", "0.5591672", "0.55895627", "0.5587346", "0.5585433", "0.5584822", "0.55774784", "0.55762464", "0.5571623", "0.55702746", "0.556929", "0.55671567", "0.55652153", "0.5563632", "0.5561789", "0.5561374", "0.55565023", "0.5555966", "0.55379564", "0.5533857", "0.5533698", "0.5517949", "0.5517035", "0.5512276", "0.55104655", "0.55004007", "0.5494276", "0.54937637", "0.5493211", "0.54801244", "0.5478749", "0.5477958", "0.5475517", "0.5473485", "0.54656756", "0.5465522", "0.54578817", "0.54571134", "0.54543424", "0.54479647", "0.54459673", "0.5445115", "0.5440947", "0.5438728", "0.54382426", "0.54377365", "0.54375094" ]
0.71640736
0
/ deleteResource Does not delete resource rather deactivates the resources
public function deleteResource() { $database = new Database(); $id = $this->_params['id']; $database->deleteResource($id); $this->_f3->reroute('/Admin'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isDeleteResource();", "protected function _postDelete()\n {\n $this->clearResources();\n }", "public function deleteAllResources() {\n\t\t$this->resources = array();\n\t}", "public function destroy(Resource $resource)\n {\n //\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\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 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 }", "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}", "function deletableResources(){\n\n return $this->resourcesByPermission('delete');\n }", "public function reactivateResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->reactivateResource($id);\n $this->_f3->reroute('/Admin');\n }", "public function undeleteAction(){\n\t}", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\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 processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "protected function entityDelete(){\n // TODO: deal with errors\n // delete from api\n $deleted = $this->resourceService()->delete($this->getId());\n }", "public function deleteResources($id) {\r\n\t\t$stmt = $this->db->prepare(\"DELETE FROM resources_activity WHERE actividad=?\");\r\n\t\t$stmt->execute(array($id));\r\n\t}", "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();", "protected function _postDelete()\n {\n $this->getResource()->delete();\n\n $this->getIssue()->compileHorizontalPdfs();\n }", "protected function DELETE(ResourceObject $resource) {\n\t\tif ($this->request->headers['Depth'] != null &&\n\t\t $this->request->headers['Depth'] != 'infinity')\n\t\t\tthrow new HTTPStatusException(400, 'Bad Request');\n\n#[TODO]\t\t// check lock status\n#\t\tif (!$this->_check_lock_status($this->path))\n#\t\t\tthrow new HTTPStatusException(423, 'Locked');\n\n\t\t// delete the resource\n\t\tif (!$resource->getParent()->deleteChild(basename($resource->getPath())))\n\t\t\tthrow new HTTPStatusException(424, 'Failed Dependency');\n\t\t// return no content\n\t\t$this->response->status->set(204);\n\t}", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "protected function delete() {\n\t}", "public function onPreDelete(ResourceEventInterface $event): void\n {\n $member = $this->getMemberFromEvent($event);\n\n $this->getGateway($member->getAudience()->getGateway(), GatewayInterface::DELETE_MEMBER);\n }", "public function deleteAction() {\n\t\t$this->_notImplemented();\n\t}", "public function delete()\n\t{\n\t\t$this->hard_delete();\n\t}", "function delete() {\n $this->that->delete($this->id, $this->name);\n $this->put_id();\n }", "function deleteResourceRoot(){\n // Load the appropriate helpers\n $ci =& get_instance(); $ci->load->helper('error_code');\n return array(\n \"code\" => PROHIBITED,\n \"message\"=>\"Deleting a resource collection is prohibited.\"\n );\n}", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "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 clean() {\n $this->requires = array();\n $this->getResource()->clear();\n }", "public static function delete() {\n\n\n\t\t}", "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 }", "protected function _preDelete() {}", "function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }", "function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }", "public function delete()\n {\n $this->abilities()->detach();\n parent::delete();\n }", "protected function _delete()\n\t{\n\t}", "public function delete() {\n\t\t$this->deleted = true;\n\t}", "protected function deleteAction()\n {\n }", "function deleteResourceByID($id)\n{\n\t$sql = \"DELETE FROM `\".DB_NAME.\"`.`resources` WHERE `resources`.`rid` = \".$id;\n\t\n\t$result = mysql_query($sql);\n\t\n\treturn $result;\n}", "public function deleteAction() {\n \n }", "protected function _delete()\r\n {\r\n parent::_delete();\r\n }", "function delete() ;", "function delete() ;", "function delete() {\n\t\n\t\t$this->getMapper()->delete($this);\n\t\t\n\t}", "abstract public function delete();", "abstract public function delete();", "abstract public function delete();", "abstract public function delete();", "public static function delete() {\r\n\t\t\r\n\t}", "public function erase()\n {\n ActionHandler::getInstance()->deleteAction($this->deleteAction);\n ActionHandler::getInstance()->deleteAction($this->deleteActionf);\n $this->saveButton->destroy();\n $this->loadButton->destroy();\n $this->frame->clearComponents();\n $this->frame->destroy();\n $this->destroyComponents();\n\n parent::destroy();\n }", "function delete()\n {\n }", "public function delete(): void;", "public function delete() { // Page::destroy($this->pages()->select('id')->get());\n $this->pages()->detach();\n parent::delete();\n }", "public final function delete() {\n }", "public abstract function delete();", "private function delete(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check if there are permission to execute delete command.\n\t\t$result = $this->clsAccessPermission->toDelete();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to delete!\");\n\t\t\treturn;\n\t\t}\n\t\tif(!$this->objAccessCrud->delete($id)){\n\t\t\t$this->msg->setError (\"There was an issue to delete, because this register has some relation with another one!\");\n\t\t\treturn;\n\t\t}\n\t\t// Cleaner all class values.\n\t\t$this->objAccessCrud->setAccessCrud(null);\n\t\t// Cleaner session primary key.\n\t\t$_SESSION['PK']['ACCESSCRUD'] = null;\n\n\t\t$this->msg->setSuccess (\"Delete the record with success!\");\n\t\treturn;\n\t}", "public function delete() {\r\n }", "public function taskDelete(): void\n {\n $directory = $this->getDirectory();\n if (!$directory) {\n throw new RuntimeException('Not Found', 404);\n }\n\n $object = null;\n try {\n $object = $this->getObject();\n if ($object && $object->exists()) {\n $authorized = $object instanceof FlexAuthorizeInterface\n ? $object->isAuthorized('delete', 'admin', $this->user)\n : $directory->isAuthorized('delete', 'admin', $this->user);\n\n if (!$authorized) {\n throw new RuntimeException($this->admin::translate('PLUGIN_ADMIN.INSUFFICIENT_PERMISSIONS_FOR_TASK') . ' delete.', 403);\n }\n\n $object->delete();\n\n $this->admin->setMessage($this->admin::translate('PLUGIN_FLEX_OBJECTS.CONTROLLER.TASK_DELETE_SUCCESS'));\n if ($this->currentRoute->withoutGravParams()->getRoute() === $this->referrerRoute->getRoute()) {\n $redirect = dirname($this->currentRoute->withoutGravParams()->toString(true));\n } else {\n $redirect = $this->referrerRoute->toString(true);\n }\n\n $this->setRedirect($redirect);\n\n $this->grav->fireEvent('onFlexAfterDelete', new Event(['type' => 'flex', 'object' => $object]));\n }\n } catch (RuntimeException $e) {\n $this->admin->setMessage($this->admin::translate(['PLUGIN_FLEX_OBJECTS.CONTROLLER.TASK_DELETE_FAILURE', $e->getMessage()]), 'error');\n\n $this->setRedirect($this->referrerRoute->toString(true), 302);\n }\n }", "public function deleteAction()\n {\n }", "public function delete()\r\n\t{\r\n\t}", "public function deleteResourceRelations($resourceID) {\n\n $query = \"UPDATE related_resource set is_deleted = 't' WHERE resource_id = $1\";\n $result = $this->sdb->query($query, array( $resourceID ));\n\n return true;\n }", "public function deleting()\n {\n # code...\n }", "function sendDeleteCmd($resource) {\n $url = $this->baseURL . $resource;\n\n $request = curl_init($url);\n curl_setopt($request, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n curl_setopt($request, CURLOPT_FAILONERROR, true);\n curl_setopt($request, CURLOPT_RETURNTRANSFER, true);\n\n $result = curl_exec($request);\n return json_decode($result, true);\n }", "public function destroy($id)\n {\n $action=Action::find($id);\n $existingInPivot=Action::with('getResources')->where('id',$action->id)->get();\n foreach ($existingInPivot as $e) {\n $existingResources=[];\n foreach ($e->getResources as $existingResource) {\n $existingResources[]=$existingResource->id;\n }\n }\n\n try {\n DB::transaction(function () use ($action,$existingResources) {\n $action->delete();\n for ($i=0; $i <count($existingResources) ; $i++) { \n $action->getResources()->detach($existingResources[$i]);\n }\n });\n } catch (Exception $exc) {\n session()->flash('message.type', 'danger');\n session()->flash('message.content', 'Erreur lors de la suppression');\n// echo $exc->getTraceAsString();\n }\n session()->flash('message.type', 'success');\n session()->flash('message.content', 'Action supprimer avec succès!');\n return redirect()->route('actions.index');\n}", "public function delete(){\n\t if(!isset($this->attributes['id'])) \n\t\t\tthrow new Exception(\"Cannot delete new objects\");\n\t\t$this->do_callback(\"before_delete\");\n\t\treturn self::do_query(\"DELETE FROM \".self::table_for(get_class($this)).\n\t\t \" WHERE id=\".self::make_value($this->attributes['id']));\t\n\t}", "public function delete()\n {\n $this->invalidateCache();\n parent::delete();\n }", "public function delete()\n {\n $this->invalidateCache();\n parent::delete();\n }", "public static function delete(){\r\n }", "public function actionDelete() {}", "public function actionDelete() {}", "public function cleanup() {\r\n\t\t$this->resource->cleanup();\r\n\t}", "public function deleteAction()\n {\n \n }", "public function deleteAction()\n {\n // delete file resources via Post array\n if ($this->_request->isPost()) {\n foreach ($this->_request->getPost('selectedFiles') as $fileUri) {\n $fileUri = rawurldecode($fileUri);\n $this->_deleteFile($fileUri);\n }\n\n $url = new OntoWiki_Url(array('controller' => 'files', 'action' => 'manage'), array());\n $this->_redirect((string)$url);\n } else if (isset($this->_request->setResource)) {\n // delete a resource via get setResource parameter\n $fileUri = rawurldecode($this->_request->setResource);\n $this->_deleteFile($this->_request->setResource);\n $this->_owApp->appendMessage(\n new OntoWiki_Message('File attachment deleted', OntoWiki_Message::SUCCESS)\n );\n $resourceUri = new OntoWiki_Url(array('route' => 'properties'), array('r'));\n $resourceUri->setParam('r', $this->_request->setResource, true);\n $this->_redirect((string)$resourceUri);\n } else {\n // action just requested without anything\n $this->_forward('manage', 'files');\n }\n }", "public function __destruct() {\n\t\t\tparent::__destruct();\n\t\t\tunset($this->resource);\n\t\t\tunset($this->methods);\n\t\t\tunset($this->name);\n\t\t}", "public function destroy($id)\n {\n /*// Get article\n $article = Article::findOrFail($id);\n\n if($article->delete()) {\n return new ArticleResource($article);\n }*/ \n }", "public function delete()\n\t{\n\t}", "function destroy(){\n\t\tif(!$this->id)\n\t\t\tthrow new APortalException(\"Can't destroy object does not exist in database\",$this);\n\n\t\t$this->hook('destroy'); // can be used for access control or cache deletion\n\n\t\t// STEP1 - destroy relations\n\t\t$this->api->deleteRel($this,null);\n\t\t$this->api->deleteRel(null,$this);\n\n\t\t// STEP2 - destroy supplimentary table entry\n\t\t$this->api->db->dsql()\n\t\t\t->table($this->table_name)\n\t\t\t->where('id',$this->id)\n\t\t\t->do_delete();\n\n\t\t// STEP3 - delete obj table entry\n\t\t$this->api->db->dsql()\n\t\t\t->table('obj')\n\t\t\t->where('id',$this->id)\n\t\t\t->do_delete();\n\t}", "function testDeleteHard() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\r\n\t\t$obj = new CAntObject($dbh, \"customer\");\r\n\t\t$obj->setValue(\"name\", \"my test\");\r\n\t\t$cid = $obj->save(false);\r\n\t\t$obj->remove(); // Soft delete\r\n\t\tunset($obj);\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid);\r\n\t\t$obj->remove(); // Hard delete\r\n\r\n\t\tif (!$dbh->GetNumberRows($dbh->Query(\"select id from customers where id='$cid'\")))\r\n\t\t\t$this->assertFalse(false);\r\n\t\telse\r\n\t\t\t$this->assertFalse(true);\r\n\t}", "public function forceDelete();", "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}" ]
[ "0.7185629", "0.6980644", "0.66985935", "0.6495744", "0.64732426", "0.6464758", "0.6454451", "0.63758194", "0.63742036", "0.6359977", "0.62655574", "0.6264933", "0.6247014", "0.61904836", "0.61854434", "0.6162815", "0.61621654", "0.6136099", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.61252105", "0.60952383", "0.60841507", "0.606476", "0.6051856", "0.60326695", "0.60222876", "0.60202885", "0.60185766", "0.5995643", "0.59944695", "0.5993605", "0.59926695", "0.59926015", "0.59926015", "0.5981016", "0.59568405", "0.59482306", "0.5944841", "0.5933248", "0.59059054", "0.59059054", "0.5891479", "0.5886918", "0.58841777", "0.5878271", "0.5876752", "0.58757806", "0.5863605", "0.582153", "0.582153", "0.5814864", "0.5814061", "0.5814061", "0.5814061", "0.5814061", "0.580964", "0.58090436", "0.58086574", "0.578154", "0.5780844", "0.5779181", "0.57694757", "0.5764186", "0.5760238", "0.57552344", "0.57544696", "0.5743851", "0.57393485", "0.5734905", "0.5727449", "0.5726768", "0.5722062", "0.57193613", "0.57193613", "0.57133734", "0.5711241", "0.5711241", "0.5711212", "0.57058984", "0.5684402", "0.5683509", "0.56806356", "0.567805", "0.56761694", "0.5669041", "0.5666816", "0.5666052" ]
0.7421805
0
/ reactivateResource reactivates resources
public function reactivateResource() { $database = new Database(); $id = $this->_params['id']; $database->reactivateResource($id); $this->_f3->reroute('/Admin'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reactivateAction()\n {\n $this->reactivateParameters = $this->reactivateParameters + $this->_reactivateExtraParameters;\n\n parent::reactivateAction();\n }", "public function reactivate()\n {\n $project = $this->getProject();\n $recovery_plan_id = $this->request->getIntegerParam('recovery_plan_id', 0);\n\n\n $this->response->html($this->template->render('status:recoveryPlanDetail/makeActive', array(\n 'title' => t('Reactivate recovery plan'),\n 'project_id' => $project['id'],\n 'values' => array('id' => $recovery_plan_id)\n )));\n }", "function _deactivate() {}", "public function deactivate_resource($resource_id, $page)\n\t{\n\t\tif($this->resource_model->deactivate_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been disabled');\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 disabled');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function _deactivate() {\r\n\t\t// Add deactivation cleanup functionality here.\r\n\t}", "public function recycle(){\n $qry = new InvokePostMethodQuery($this->getResourcePath(),\"recycle\");\n $this->getContext()->addQuery($qry);\n }", "private function activateResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->activateResource($resource);\n $this->validateActivatedResource($blueprint, $resource);\n }", "public function deactivate(): void;", "public function deactivate();", "public static function deactivate(){\n }", "public static function deactivate(){\n }", "abstract public function deactivate();", "public static function deactivate() {\n\t}", "public static function deactivate() {\n\n }", "public static function deactivate()\n\t{\n\n\t}", "public static function deactivate ()\n\t{\n\t}", "function deactivate() {\n\t}", "public function deactivate() {\n\n }", "public function deactivate() {\n\n }", "function deactivate() {\n \n $this->reset_caches();\n $this->ext->update_option( 'livefyre_deactivated', 'Deactivated: ' . time() );\n\n }", "public static function deactivate()\n {\n }", "public function deactivate() {\n\t\t\t// just in case I want to do anyting on deactivate\n\t\t}", "public function refresh()\n {\n // Several refresh() calls might happen during one request. If that is the case, the Resource Manager can't know\n // that the first created resource object doesn't have to be persisted / published anymore. Thus we need to\n // delete the resource manually in order to avoid orphaned resource objects:\n if ($this->resource !== null) {\n $this->resourceManager->deleteResource($this->resource);\n }\n\n parent::refresh();\n $this->renderResource();\n }", "public static function activate() {\n\t\t\tdelete_site_transient('update_themes');\n\t\t\tdelete_site_transient('storefront_latest_tag');\n\t\t}", "protected function deactivateSelf() {}", "public function deactivateAction()\n {\n $this->deactivateParameters = $this->deactivateParameters + $this->_deactivateExtraParameters;\n\n parent::deactivateAction();\n }", "public function deleteAllResources() {\n\t\t$this->resources = array();\n\t}", "public function register_deactivation();", "public function deallocate_resource_from_user($resource_id) {\n $sql = 'UPDATE resources\n SET is_allocated = :is_allocated\n WHERE id = :id';\n\n $data = [\n ':id' => $resource_id,\n ':is_allocated' => false,\n ];\n\n $query = $this->pdo->prepare($sql);\n $query->execute($data);\n }", "function revoke()\n\t{\n\t}", "function sunrail_api_deactivation() {\n global $wp_rewrite;\n $wp_rewrite->flush_rules();\n}", "public static function deactivate(){\n // Do nothing\n }", "public function manageroleandresourceAction()\n {\n if ($this->_request->isPost()) {\n $rid = (int)$this->_request->getPost('rid');\n $aryChecked = $this->_request->getPost('chkRes');\n\n require_once 'Admin/Bll/Role.php';\n $bllRole = Admin_Bll_Role::getDefaultInstance();\n $result = $bllRole->updateRoleOfResource($rid, $aryChecked);\n\n echo $result ? 'true' : 'false';\n }\n }", "public static function deactivate() {\n\t\t// Do nothing.\n\t}", "function deactivate() {\n // actualizar las reglas de escritura para que observen la nueva taxonomia\n flush_rewrite_rules();\n }", "public function activate()\n {\n $this->op->request('POST', '/api/prom/configs/restore', [\n 'headers' => [\n 'X-Scope-OrgID' => $this->consumerId,\n ]\n ]);\n }", "public function desactivar()\n {\n $this->estatus = 0;\n $this->save();\n }", "public function activate_resource($resource_id, $page)\n\t{\n\t\tif($this->resource_model->activate_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been activated');\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 activated');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function postEditResources()\n {\n $id = $this->_params['id'];\n\n $errors = validateEditResource($id);\n\n if(!($errors === true)) {\n $database = new Database();\n\n $resource = $database->getResourceById($id);\n /*construct($resourceID = \"0\", $resourceName = \"Resource\", $description = \"Info\",\n $contactName =\"\",$contactEmail = \"\",$contactPhone = \"\",$link = \"\", $active = \"1\" )*/\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 $this->_f3->set('errors', $errors);\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 } else {\n // fixme add routing\n $this->_f3->reroute('/Admin');\n }\n\n }", "public function deactivate(): void\n {\n if ($this->selectedRowsQuery->count() > 0) {\n Role::whereIn('id', $this->selectedKeys())->update(['is_active' => 0]);\n }\n\n $this->resetSelected();\n }", "public function deactivate()\n {\n $this->op->request('DELETE', '/api/prom/configs/deactivate', [\n 'headers' => [\n 'X-Scope-OrgID' => $this->consumerId,\n ]\n ]);\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 static function deactivate()\n\t\t{\n\t\t\t// Do nothing\n\t\t}", "public static function deactivate()\n\t\t{\n\t\t\t// Do nothing\n\t\t}", "public static function deactivate() {\n\t\t\t// Do nothing\n\t\t}", "public function reactivate(Deshabilitar_horarios_especialista $deshabilitar_horarios_especialista)\n\t{\n\t\t$deshabilitar_horarios_especialista->active_flag = 1;\n\t\t$deshabilitar_horarios_especialista->save();\n\n\t\treturn redirect()->route('deshabilitar_horarios_especialistas.index');\n\t}", "function emp_activate() {\n\tglobal $wp_rewrite;\n \t$wp_rewrite->flush_rules();\n}", "public function deactivateService() {}", "public function setResource($resource);", "function recycle()\n\t{\n\t\t$table_linked_resources = Database :: get_course_table(TABLE_LINKED_RESOURCES, $this->course->destination_db);\n\t\t$table_item_properties = Database::get_course_table(TABLE_ITEM_PROPERTY);\n\t\tforeach ($this->course->resources as $type => $resources)\n\t\t{\n\t\t\tforeach ($resources as $id => $resource)\n\t\t\t{\n\t\t\t\t$sql = \"DELETE FROM \".$table_linked_resources.\" WHERE (source_type = '\".$type.\"' AND source_id = '\".$id.\"') OR (resource_type = '\".$type.\"' AND resource_id = '\".$id.\"') \";\n\t\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t\t$sql = \"DELETE FROM \".$table_item_properties.\" WHERE tool ='\".$resource->get_tool().\"' AND ref=\".$id;\n\t\t\t\tapi_sql_query($sql);\n\t\t\t}\n\t\t}\n\t\t$this->recycle_links();\n\t\t$this->recycle_link_categories();\n\t\t$this->recycle_events();\n\t\t$this->recycle_announcements();\n\t\t$this->recycle_documents();\n\t\t//$this->recycle_forums();\n\t\t//$this->recycle_forum_categories();\n\t\t$this->recycle_quizzes();\n\t\t$this->recycle_surveys();\n\t\t$this->recycle_learnpaths();\n\t\t$this->recycle_cours_description();\n\t}", "private static function single_deactivate() {\n\t\t// @TODO: Define deactivation functionality here\n\t}", "private static function single_deactivate() {\n\t\t// @TODO: Define deactivation functionality here\n\t}", "public function revert(){\n\t}", "public function deactivate($id)\n {\n // Get the resource\n $object = $this->find($id);\n // Make sure we can deactivate\n if (! $object->isDeactivationAllowed()) {\n $this->throwException($this->error('deactivation_not_allowed'));\n }\n\n // Fire before listeners\n $this->eventUntil('deactivating', [$object]);\n\n // Deactivate the resource\n $object->active = false;\n $object->activated_at = null;\n\n // Validate the resource\n if ($object->isInvalid('deactivating') || !$object->save()) {\n $this->throwException($object->getErrors(), $this->error('deactivate'));\n }\n\n // Fire after listeners\n $this->eventFire('deactivated', [$object]);\n\n return $object;\n }", "public static function deactivate() {\n\n\t\tflush_rewrite_rules();\n\n\t}", "function desactivar(){\n\t\t// $rs = $this->ejecuta($sql);\n\t\t// if($this->como_va()){\n\t\t// \treturn false;\n\t\t// }else{\n\t\t \t$sql = \"UPDATE proveedor SET status='0' WHERE id_prov='$this->cod_prov'\";\n\t\t\t$this->ejecuta($sql);\n\t}", "public static function deactivate()\n {\n // Do nothing\n }", "public function deactivate()\n {\n $project = $this->getProject();\n $recovery_plan_id = $this->request->getIntegerParam('recovery_plan_id', 0);\n\n\n $this->response->html($this->template->render('status:recoveryPlanDetail/makeInactive', array(\n 'title' => t('Remove recovery plan'),\n 'project_id' => $project['id'],\n 'values' => array('id' => $recovery_plan_id)\n )));\n }", "function deactivate_wp_book() {\n Inc\\Base\\Deactivate::deactivate();\n}", "public function deactivate($id = null, $delete_superfluous_associations = false)\n { \n // Find the requested item\n $recipe = $this->find('first', array('conditions' => array('Recipe.id' => $id)));\n\n // Does the item exist?\n if(empty($recipe))\n {\n // Tell the user that the requested item did not exist \n SessionComponent::setFlash(' Denne opskrift findes ikke. '.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n // Is the item active?\n else if(!$recipe['Recipe']['is_active'])\n {\n // Tell the user that the requested item already is inactive\n SessionComponent::setFlash(' Denne opskrift er allerede inaktivt. '.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n\n // Was the save a failure?\n $this->id = $recipe['Recipe']['id'];\n\n if(!$this->saveField('is_active', 0))\n { \n // Tell the user that the is_active property was not changed.\n SessionComponent::setFlash(' Opskriften blev ikke sat som inaktivt. '.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n\n // Delete all associations that are superfluous\n if($delete_superfluous_associations)\n {\n if(!$this->RecipesYarn->deleteAll(array('RecipesYarn.recipe_id' => $id), false))\n {\n // Tell the user that the relations to care_labels was not delted\n SessionComponent::setFlash(' Relationen fra den inaktive opskrift til garnkvaliteterne blev ikke slettet. '.SessionComponent::read('Message.error.message'), null, array(), 'error');\n }\n }\n\n // If the image of this recipe exists_delete it\n if(FileComponent::fileExists($recipe['Recipe']['id'], 'png', true , 'recipes'))\n {\n if(!FileComponent::deleteFile($recipe['Recipe']['id'], 'png', true , 'recipes'))\n {\n // Inform the user that the file is still on the server\n SessionComponent::setFlash('Billedet til dette opskrift blev ikke slettet og ligger stadig på serveren.'.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n } \n }\n\n // If the file of this recipe exists_delete it\n if(FileComponent::fileExists($recipe['Recipe']['id'], 'pdf', false , 'recipes'))\n {\n if(!FileComponent::deleteFile($recipe['Recipe']['id'], 'pdf', false , 'recipes'))\n {\n // Inform the user that the file is still on the server\n SessionComponent::setFlash('PDF-filen til dette opskrift blev ikke slettet og ligger stadig på serveren.'.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n } \n }\n\n // It went well\n return true;\n }", "public function reinit()\n {\n }", "function egsr_deactivation(){\n egsr_add_default_wp_roles();\n}", "public function plugin_deactivate(){\n\t\t//flush permalinks\n\t\tflush_rewrite_rules();\n\t}", "public function plugin_deactivate(){\n\t\t//flush permalinks\n\t\tflush_rewrite_rules();\n\t}", "public static function es_deactivation() {\n\t}", "public function reactivateUser($userId)\n {\n return $this->start()->uri(\"/api/user\")\n ->urlSegment($userId)\n ->urlParameter(\"reactivate\", true)\n ->put()\n ->go();\n }", "function deactivate() {\n\t$scheduler = new CSL_Feed_Import_Scheduler;\n\t$scheduler->clear();\n}", "public function deactivate($username);", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function deactivate() {\n\t\tflush_rewrite_rules();\n\t}", "public function reActivate()\n {\n $response = $this->response();\n $config = [\n ['field' => 'userid', 'label' => '', 'rules' => 'trim|required|integer'],\n ['field' => 'activationemail', 'label' => '', 'rules' => 'trim|required|min_length[4]|max_length[100]|valid_email']\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 $userID = $this->input->post('userid');\n $email = $this->input->post('activationemail');\n if ($this->oauth_web->reActivate($userID, $email) === true) {\n $response[\"status\"] = true;\n $response[\"msg\"] = $this->lang->line(\"reActivate_ok\");\n }\n $this->output->set_output(json_encode($response));\n }", "public function clearCache() {\n\t\tYii::app()->user->setState('nlsLoadedResources', array());\n\t}", "public static function reassign() {\n\n\t\t}", "function deactivate_aws_qrc() {\n\trequire_once plugin_dir_path( __FILE__ ) . 'includes/class_aws_qrc_deactivator.php';\n\tAws_Qrc_Deactivator::deactivate();\n}", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "public function clean() {\n $this->requires = array();\n $this->getResource()->clear();\n }", "public function revert();", "function recycle_surveys()\n\t{\n\t\tif ($this->course->has_resources(RESOURCE_SURVEY))\n\t\t{\n\t\t\t$table_survey = Database :: get_course_table(TABLE_SURVEY);\n\t\t\t$table_survey_q = Database :: get_course_table(TABLE_SURVEY_QUESTION);\n\t\t\t$table_survey_q_o = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);\n\t\t\t$table_survey_a = Database :: get_course_Table(TABLE_SURVEY_ANSWER);\n\t\t\t$table_survey_i = Database :: get_course_table(TABLE_SURVEY_INVITATION);\n\t\t\t$ids = implode(',', (array_keys($this->course->resources[RESOURCE_SURVEY])));\n\t\t\t$sql = \"DELETE FROM \".$table_survey_i.\" \";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_a.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_q_o.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_q.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t}\n\t}", "function activate() {\n\t\tregister_uninstall_hook( __FILE__, array( __CLASS__, 'uninstall' ) );\n\t}", "function deactivator()\n{\n require_once plugin_dir_path( __FILE__ ) . 'includes/Deactivator.php';\n\tDeactivator::deactivate();\n}", "public function plugin_deactivate() {\r\n\r\n\t}", "public function deactivate($id = null)\n { \n // Find the requested item\n $yarn = $this->find('first', array('conditions' => array('Yarn.id' => $id)));\n\n // Does the item exist?\n if(empty($yarn))\n {\n // Tell the user that the requested item did not exist \n SessionComponent::setFlash(' Denne garnkvalitet findes ikke. '.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n // Is the item active?\n else if(!$yarn['Yarn']['is_active'])\n {\n // Tell the user that the requested item already is inactive\n SessionComponent::setFlash(' Denne garnkvalitet er allerede inaktivt. '.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n\n // Was the save a failure?\n $this->id = $yarn['Yarn']['id'];\n\n if(!$this->saveField('is_active', 0))\n { \n // Tell the user that the is_active property was not changed.\n SessionComponent::setFlash(' Garnkvaliteten blev ikke sat som inaktivt. '.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n\n // Deactivate its children\n if(!empty($yarn['YarnVariant']))\n { \n // Run through every relation\n foreach ($yarn['YarnVariant'] as $i => $yarn_variant)\n { \n // Check if the yarn_variant is active\n if($yarn_variant['is_active'] == 1)\n { \n $this->YarnVariant->deactivate($yarn_variant['id']); \n }\n } \n }\n\n\n if(!$this->CareLabelsYarn->deleteAll(array('CareLabelsYarn.yarn_id' => $id), false))\n {\n // Tell the user that the relations to care_labels was not delted\n SessionComponent::setFlash(' Relationen fra den inaktive garnkvalitet til vaskemærker blev ikke slettet. '.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n\n if(!$this->YarnPart->deleteAll(array('YarnPart.yarn_id' => $id)))\n {\n // Tell the user that the relations to yarn_parts was not delted\n SessionComponent::setFlash(' Relationen fra den inaktive garnkvalitet til dets bestanddele blev ikke slettet. '.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n\n if(!$this->RecipesYarn->deleteAll(array('RecipesYarn.yarn_id' => $id), false))\n {\n // Tell the user that the relations to care_labels was not delted\n SessionComponent::setFlash(' Relationen fra den inaktive opskrift til garnkvaliteterne blev ikke slettet. '.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n \n\n // It went well\n return true;\n }", "public function restored(SecKillAppliesRegister $secKillAppliesRegister)\n {\n //\n }", "public function restoreOriginalService(): void;", "public function setReactivated(\\DateTime $reactivated) {\n\n $this->reactivated = $reactivated->format('Y-m-d H:i:s');\n\n }", "function deactivation_hook() {\n\n\t}", "protected function releaseResource($process, $resource)\n {\n $processLoc = $process;\n $resourceLoc = ($this->np - 1) + $resource;\n\n // $this->graph->removeEdge($processLoc, $resourceLoc);\n $this->graph->removeEdge($resourceLoc, $processLoc);\n\n }", "public function deactivate()\n {\n $this->setTheme(null);\n $this->removeSymlink();\n }", "private function releaseResource(DrydockResource $resource) {\n $viewer = $this->getViewer();\n $drydock_phid = id(new PhabricatorDrydockApplication())->getPHID();\n\n $resource->openTransaction();\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_RELEASED)\n ->save();\n\n // TODO: Hold slot locks until destruction?\n DrydockSlotLock::releaseLocks($resource->getPHID());\n $resource->saveTransaction();\n\n $statuses = array(\n DrydockLeaseStatus::STATUS_PENDING,\n DrydockLeaseStatus::STATUS_ACQUIRED,\n DrydockLeaseStatus::STATUS_ACTIVE,\n );\n\n $leases = id(new DrydockLeaseQuery())\n ->setViewer($viewer)\n ->withResourcePHIDs(array($resource->getPHID()))\n ->withStatuses($statuses)\n ->execute();\n\n foreach ($leases as $lease) {\n $command = DrydockCommand::initializeNewCommand($viewer)\n ->setTargetPHID($lease->getPHID())\n ->setAuthorPHID($drydock_phid)\n ->setCommand(DrydockCommand::COMMAND_RELEASE)\n ->save();\n\n $lease->scheduleUpdate();\n }\n\n $this->destroyResource($resource);\n }", "function desactivar(){\n\t\t// $rs = $this->ejecuta($sql);\n\t\t// if($this->como_va()){\n\t\t// \treturn false;\n\t\t// }else{\n\t\t\t$sql=\"UPDATE motivo_movimiento SET status='0' WHERE id_motivo_mov='$this->id_motivo'\";\n\t\t\t$this->ejecuta($sql);\n\t\t//}\n\t}", "function urt_deactivate() {\n remove_role( 'urt_secretary' );\n}", "function activate() {\n }", "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}", "protected function _postDelete()\n {\n $this->clearResources();\n }", "public function activate(): void\n {\n if ($this->selectedRowsQuery->count() > 0) {\n Role::whereIn('id', $this->selectedKeys())->update(['is_active' => 1]);\n }\n\n $this->resetSelected();\n }", "public function setOriginalResource($originalResource) {\n\t\t$this->originalResource = $originalResource;\n\t}", "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 rollback() {\n if (!$this->changed())\n return;\n\n $this->tags = array('new' => array(), 'del' => array());\n $this->inited = false;\n }", "public static function setCurrentAclResources(array $resources)\n {\n self::$currentAclResources = $resources; \n }", "public function fix_after_deactivation() {\n\t\t$exs = new Util_Environment_Exceptions();\n\n\t\ttry {\n\t\t\t$this->delete_addin();\n\t\t} catch ( Util_WpFile_FilesystemOperationException $ex ) {\n\t\t\t$exs->push( $ex );\n\t\t}\n\n\t\t$this->unschedule();\n\n\t\tif ( count( $exs->exceptions() ) > 0 )\n\t\t\tthrow $exs;\n\t}" ]
[ "0.64953566", "0.6302144", "0.60357034", "0.589782", "0.5866548", "0.58366936", "0.5817751", "0.5729667", "0.5701669", "0.5700907", "0.5700907", "0.5695641", "0.569047", "0.56877214", "0.5616308", "0.559881", "0.5586113", "0.55649954", "0.55649954", "0.554401", "0.55416965", "0.5470191", "0.5430438", "0.54117596", "0.5391087", "0.5388591", "0.5374472", "0.53197235", "0.53017205", "0.52997714", "0.52931684", "0.5266092", "0.5251839", "0.52337635", "0.52303475", "0.520124", "0.5195637", "0.5193949", "0.5192909", "0.5182277", "0.5182224", "0.5181582", "0.5179078", "0.5179078", "0.517859", "0.5156866", "0.5153019", "0.5145458", "0.5138998", "0.5096731", "0.5086186", "0.5086186", "0.50687486", "0.5064011", "0.5036331", "0.5027125", "0.50206363", "0.5016872", "0.5006951", "0.50022906", "0.49854895", "0.49641564", "0.4964036", "0.4964036", "0.49549073", "0.49511454", "0.49480116", "0.4933769", "0.49304503", "0.49226084", "0.4912256", "0.49107212", "0.49047133", "0.49046046", "0.4903227", "0.49007264", "0.49001396", "0.48964897", "0.48947206", "0.48862344", "0.48845476", "0.48347872", "0.48142397", "0.48056987", "0.4800549", "0.479662", "0.47925672", "0.47878525", "0.47855765", "0.4785162", "0.47780725", "0.47743112", "0.47738603", "0.474662", "0.47451574", "0.47366762", "0.47332478", "0.47311535", "0.4731134", "0.47181845" ]
0.8236729
0
/ viewResources Loads from the db all active AND current events and renders the resources page
public function viewResources() { $database = new Database(); $resources = $database->getAllActiveResourcesNoLimit(); $resourceArray = array(); $i = 1; foreach ($resources as $resource) { $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description'] , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] , $resource['Link'], $resource['active']); array_push($resourceArray, $availableResource); $i += 1; } $resourceSize = sizeof($resourceArray); $this->_f3->set('resourcesByActive', $resourceArray); $this->_f3->set('resourcesSize', $resourceSize); echo Template::instance()->render('view/include/head.php'); echo Template::instance()->render('view/include/top-nav.php'); echo Template::instance()->render('view/resources.php'); echo Template::instance()->render('view/include/footer.php'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction() {\n $this->view->events = $this->_events->getEventsAdmin($this->_getParam('page'));\n }", "public function events()\n {\n $eventdata = $this->Event->find('all', \n array(\n 'order' => array('Event.time' => 'DESC'),\n 'condition' => array('type' => 'Event')\n ));\n \n $this->set('events', $eventdata);\n \n $this->assignUserToView($this->Auth->user('id'));\n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Info');\n }", "public function LoadAction()\n {\n $em = $this->getDoctrine()->getManager();\n $events = $em->getRepository('ClassBundle:Events')->findAll();\n return $this->render('events/updatesAjax.html.twig', array(\n 'events' => $events,\n ));\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 loadEvents() {\n $events = Event::orderBy('date', 'desc')->paginate(10);\n \n return view('cms.events', ['events' => $events]);\n }", "public function actionEvents()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('events');\n\t}", "public function indexAction() {\n\t\t$this->view->viewer = $viewer = Engine_Api::_()->user()->getViewer();\n\t\tif (!Engine_Api::_()->core()->hasSubject()) {\n\t\t\treturn $this->setNoRender();\n\t\t}\n\t\t// Get subject and check auth\n\t\t$subject = Engine_Api::_()->core()->getSubject('event');\n\t\tif (!$subject->authorization()->isAllowed($viewer, 'view')) {\n\t\t\treturn $this->setNoRender();\n\t\t}\n\n\t\t// Prepare data\n\t\t$this->view->event = $event = $subject;\n\t\t$limit =$this->_getParam('max',5);\n\t\t$currentDay = date('Y') . '-' . date('m') . '-' . date('d');\n\t\t\n\t\t$table = Engine_Api::_()->getItemTable('event');\n\t\t$select = $table->select()\n ->where('category_id = ?', $event->category_id)\n ->where('event_id != ?', $event->getIdentity())\n ->order(\"DATEDIFF('{$currentDay}', starttime) DESC\")\n ->limit($limit);\n\n\t\t$showedEvents = $table->fetchAll($select);\n\t\t$this->view->showedEvents = $showedEvents;\n\t\t// Hide if nothing to show\n\t\tif( count($showedEvents) <= 0 ) {\n\t return $this->setNoRender();\n\t }\n }", "public function viewAllEvents();", "public function index()\n {\n \n return EventResource::collection(Event::all());\n\n\n }", "function events(){\n if(!$this->session->userdata('logged_in') || $this->session->userdata('role') != 'student'):\n redirect('/');\n endif;\n\n $data = array(\n 'events' => $this->admin_model->browse(array('module' => 'events'))\n );\n //load content\n $this->template->content->view('/students/content/events', $data);\n\n //add js file\n $this->template->publish('layouts/app');\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('ClassBundle:Events')->findAll();\n\n return $this->render('events/index.html.twig', array(\n 'events' => $events,\n ));\n }", "public function eventsAction()\n {\n $events = $this->manager->getRepository('Event\\Doctrine\\Orm\\Event')->findBy(array(), array('date' => 'ASC'));\n\n return $this->renderView('events', array(\n 'title' => 'Zusammenfassung der Grillveranstaltungen',\n 'events' => $events,\n 'meals' => $this->createMealsList($events),\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 viewEvents();", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('AppBundle:Event')->findBy(\n ['archived' => '0'],\n ['startDate' => 'DESC']\n );\n\n return $this->render(\n 'event/index.html.twig',\n [\n 'events' => $events,\n ]\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $events = $em->getRepository('MALrmBundle:CalendarEvent')->findAll();\n\n\n return $this->render('MALrmBundle:event:index.html.twig', array(\n 'events' => $events,\n ));\n }", "public function index() {\n $this->seo(array(\n \"title\" => \"All Events List\",\n \"keywords\" => \"events, new events, event management, create event, event tickets, book event tickets\",\n \"description\" => \"Display all the latest events. Filter the events by categories, location and much more. Register yourself to turn your passion into your business\",\n \"view\" => $this->getLayoutView()\n ));\n $view = $this->getActionView();\n\n $title = RequestMethods::get(\"title\", \"\");\n $category = RequestMethods::get(\"category\", \"\");\n $type = RequestMethods::get(\"type\", \"\");\n $limit = RequestMethods::get(\"limit\", 10);\n $page = RequestMethods::get(\"page\", 1);\n $where = array(\n \"title LIKE ?\" => \"%{$title}%\",\n \"category LIKE ?\" => \"%{$category}%\",\n \"type LIKE ?\" => \"%{$type}%\",\n \"live = ?\" => true\n );\n $events = Event::all($where, array(\"*\"), \"created\", \"desc\", $limit, $page);\n $count = Event::count($where);\n\n $view->set(\"events\", $events);\n $view->set(\"limit\", $limit);\n $view->set(\"page\", $page);\n $view->set(\"count\", $count);\n $view->set(\"title\", $title);\n $view->set(\"type\", $type);\n $view->set(\"category\", $category);\n }", "public function index() {\n\t\t$this->load->helper('date');\n\t\t$data['events'] = $this->event_model->get();\n\t\tfor($iii = 0; $iii < sizeof($data['events']); $iii++) {\n\t\t\t$event_info = $this->event_info_model->get_event($data['events'][$iii]['event_id']);\n\t\t\t$data['events'][$iii]['info'] = $event_info;\n\t\t\tif($event_info != NULL) {\n\t\t\t\t$data['events'][$iii]['account'] = $this->account_model->get($event_info->event_accounts_account_id);\n\t\t\t} else {\n\t\t\t\t$data['events'][$iii]['account'] = NULL;\n\t\t\t}\n\t\t}\n\n\t\t$data['content'] = 'events/index';\n\t\t$data['stylesheets'] = 'events/index_stylesheets';\n\t\t$data['scripts'] = 'events/index_scripts';\n\t\t$data['title'] = 'Events';\n\t\t$data['sub_title'] = 'The page for the events';\n\t\t$this->load->view($this->layout, $data);\n\t}", "public function viewAction() {\n if (!Engine_Api::_()->core()->hasSubject('siteevent_organizer'))\n $this->respondWithError('unauthorized');\n\n $showEvents = $this->_getParam('showEvents', 1);\n $profileTabs = $this->_getParam('profileTabs', 1);\n $getInfo = $this->_getParam('getInfo', null);\n\n\n $viewtype = $this->_getParam('viewType', 'upcoming');\n\n //GET EVENT SUBJECT\n $organizer = Engine_Api::_()->core()->getSubject();\n if (empty($organizer)) {\n return $this->respondWithError('no_record');\n }\n $response = $organizer->toArray();\n\n $suffix = '';\n if (strpos($response['web_url'], \"http\") === false)\n $suffix = \"http://\";\n if (isset($response['facebook_url']) && !empty($response['facebook_url']))\n $response['facebook_url'] = 'https://facebook.com/' . $response['facebook_url'];\n if (isset($response['twitter_url']) && !empty($response['twitter_url']))\n $response['twitter_url'] = 'https://twitter.com/' . $response['twitter_url'];\n if (isset($response['web_url']) && !empty($response['web_url']))\n $response['web_url'] = $suffix . $response['web_url'];\n\n $contentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($organizer);\n $response = array_merge($response, $contentImages);\n $response['countOrganizedEvent'] = $organizer->countOrganizedEvent();\n $response['addedBy'] = $organizer->getOwner()->displayname;\n\n if (isset($getInfo) && !empty($getInfo)) {\n $getInfoArray['Added By'] = $response['addedBy'];\n $getInfoArray['Events Hosted '] = $organizer->countOrganizedEvent();\n\n $allowedInfo = Engine_Api::_()->getApi('settings', 'core')->getSetting('siteevent.hostinfo', array('body', 'sociallinks'));\n\n if (in_array('body', $allowedInfo)) {\n if (isset($response['description']) && !empty($response['description']))\n $getInfoArray['Description'] = strip_tags($response['description']);\n }\n\n if (in_array('sociallinks', $allowedInfo)) {\n if (isset($response['facebook_url']) && !empty($response['facebook_url']))\n $getInfoArray['Facebook URL'] = $response['facebook_url'];\n if (isset($response['twitter_url']) && !empty($response['twitter_url']))\n $getInfoArray['Twitter URL'] = $response['twitter_url'];\n if (isset($response['web_url']) && !empty($response['web_url']))\n $getInfoArray['Web URL'] = $response['web_url'];\n }\n\n $ratingEnable = Engine_Api::_()->getApi('settings', 'core')->getSetting('siteevent.reviews', 2);\n if ($ratingEnable) {\n $tempRating = Engine_Api::_()->getDbtable('events', 'siteevent')->avgTotalRating(\n array('host_type' => $organizer->getType(), 'host_id' => $organizer->getIdentity(), 'more_than' => 0));\n\n // Added variable for rating to show rating bar\n if (_CLIENT_TYPE && ((_CLIENT_TYPE == 'ios') && _IOS_VERSION && _IOS_VERSION >= '1.5.3') || (_CLIENT_TYPE == 'android') && _ANDROID_VERSION && _ANDROID_VERSION >= '1.7') {\n if (isset($tempRating) && !empty($tempRating))\n $getInfoArray['total_rating'] = $tempRating;\n } else {\n if (isset($tempRating) && !empty($tempRating))\n $getInfoArray['Total Rating'] = $tempRating;\n }\n }\n\n // Added variable for description to show full description\n if (_CLIENT_TYPE && ((_CLIENT_TYPE == 'ios') && _IOS_VERSION && _IOS_VERSION >= '1.5.3') || (_CLIENT_TYPE == 'android') && _ANDROID_VERSION && _ANDROID_VERSION >= '1.7') {\n if (in_array('body', $allowedInfo)) {\n if (isset($response['description']) && !empty($response['description'])) {\n $getInfoArray['description'] = strip_tags($response['description']);\n if (isset($getInfoArray['Description']) && !empty($getInfoArray['Description']))\n unset($getInfoArray['Description']);\n }\n }\n }\n\n if (isset($getInfoArray) && !empty($getInfoArray))\n $this->respondWithSuccess($getInfoArray, true);\n }\n\n// //GET EVENTS PAGINATOR\n// $paginator = Engine_Api::_()->getDbTable('events', 'siteevent')->getSiteeventsPaginator($values, $customProfileFields);\n// $paginator->setItemCountPerPage($this->getRequestParam(\"limit\", 20));\n// $paginator->setCurrentPageNumber($this->getRequestParam(\"page\", 1));\n//\n// //SET VIEW\n// Engine_Api::_()->getApi('Core', 'siteapi')->setView();\n// $response['canCreate'] = Engine_Api::_()->authorization()->isAllowed('siteevent_event', $viewer, 'create');\n// $response[\"getTotalItemCount\"] = $getTotalItemCount = $paginator->getTotalItemCount();\n//\n//\n// if (isset($showEvents) && !empty($showEvents) && empty($getInfo)) {\n// try {\n// $values['viewType'] = $viewtype;\n// $values['host_type'] = 'siteevent_organizer';\n// $values['host_id'] = $organizer->getIdentity();\n//\n//\n// if (!empty($getTotalItemCount)) {\n// foreach ($paginator as $eventObj) {\n// $event = $eventObj->toArray();\n//\n// // ADD OWNER IMAGES\n// $getContentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($eventObj, true);\n// $event = array_merge($event, $getContentImages);\n// $event[\"owner_title\"] = $eventObj->getOwner()->getTitle();\n//\n// // ADD EVENT IMAGES\n// $getContentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($eventObj);\n// $event = array_merge($event, $getContentImages);\n// $tempResponse[] = $event;\n// }\n// $response['events'] = $tempResponse;\n// }\n// } catch (Exception $e) {\n// \n// }\n// }\n\n\n if (isset($profileTabs) && !empty($profileTabs) && empty($getInfo)) {\n $profileTabsArray[] = array(\n 'name' => 'organizer_info',\n 'label' => $this->translate('Info'),\n 'url' => 'advancedevents/organizer/' . $organizer->getIdentity(),\n 'urlParams' => array(\n 'getInfo' => 1\n )\n );\n\n if ($organizer->countOrganizedEvent() > 0) {\n $profileTabsArray[] = array(\n 'name' => 'organizer_events',\n 'label' => $this->translate('Events'),\n 'url' => 'advancedevents/',\n 'totalItemCount' => $organizer->countOrganizedEvent(),\n 'urlParams' => array(\n 'host_type' => 'siteevent_organizer',\n 'host_id' => $organizer->getIdentity()\n )\n );\n }\n\n $response['profileTabs'] = $profileTabsArray;\n }\n $this->respondWithSuccess($response, true);\n }", "public function viewAddResources()\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 actionIndex()\n {\n if(\\Yii::$app->user->can('verMarcacaoConsulta')) {\n $tempVariable = Medicos::dataByUser(Yii::$app->user->id);\n $times = MarcacaoConsulta::dataByUserBack($tempVariable['id']);\n\n $events = [];\n foreach ($times as $time) {\n\n $temp = Especialidade::dataByEspecialidade($time['id_especialidade']);\n\n\n $Event = new Event();\n $Event->id = $time['id'];\n $Event->backgroundColor = $this->chooseColor($time['status']);\n $Event->title = $temp['tipo'];\n $Event->start = date(($time['date']));\n $Event->url = 'index.php?r=marcacao-consulta/view&id=' . $time['id'];\n $events[] = $Event;\n\n }\n\n return $this->render('index', [\n 'events' => $events,\n ]);\n }\n }", "public function resources(){\n\t\t$this->verify();\n\t\t$data['title']=\"Resources\";\n\t\t$data['category']=$this->admin_model->fetch_rescources_cat();\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('resources/resources', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}", "public function actionIndex() {\n // renders the view file 'protected/views/site/index.php'\n // using the default layout 'protected/views/layouts/main.php'\n $dataProvider = new CActiveDataProvider(\n Events::model()->upcoming()->active()\n );\n //$events = Events::model()->findAll(\"start_date>= '\" . date('Y-m-d') . \"' AND is_active=1\");\n $this->render('//events/index', array('dataProvider' => $dataProvider));\n }", "public function listEventsAction()\n {\n $events = $this->getDoctrine()->getRepository('AppBundle:Event')->findEventsByManager($this->getUser());\n\n return $this->render('AppBundle:frontend/manager:event_list.html.twig', [\n 'events' => $events,\n ]);\n }", "public function actionIndex()\r\n {\r\n $events = Events::find()->all();\r\n\t\t$tasks = [];\r\n\t\tforeach ($events as $eve) {\r\n\t\t $event = new \\yii2fullcalendar\\models\\Event();\r\n\t\t $event->id = $eve->id;\r\n\t\t $event->title = $eve->title;\r\n\t\t $event->start = $eve->date_created;\r\n\t\t $tasks[] = $event;\t\t\r\n\t\t}\r\n\t\t\r\n return $this->render('index', [\r\n 'events' => $tasks,\r\n ]);\r\n }", "public function index()\n {\n return view(\"admin.event\")->with([\n \"events\" => Event::query()->orderBy(\"created_at\", \"desc\")->paginate()\n ]);\n }", "function ReadEvents()\n {\n $this->ApplicationObj()->Events=\n $this->Sql_Select_Hashes\n (\n $this->ApplicationObj()->HtmlEventsWhere(),\n array(),\n array(\"StartDate\",\"ID\")\n );\n \n $this->ApplicationObj()->Events=array_reverse($this->ApplicationObj()->Events);\n }", "public function action_index()\n\t{\n\t\t$this->template = View::forge('template-admin');\n\n\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t//return Response::forge(View::forge('event/index',$data));\n\t\t$this->template->title = \"イベント一覧\";\n\t\t$this->template->content = View::forge('event/index', $data);\n\t}", "public function indexAction()\n {\n /* $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('EventBundle:Event')->findAll();\n\n return array(\n 'events' => $events,\n );*/\n return array();\n }", "public function events()\n {\n $config = SchoolYearConfig::where('is_active', 1)->first();\n\n $events = Update::where('school_year', $config->school_year)->get();\n return view('welcome')->with('events', $events);\n }", "public function getAllAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $thisEventDate = $em->getRepository('AtkRegistrationBundle:EventDate')->findAll();\n \n if (!$thisEventDate) {\n throw $this->createNotFoundException('Unable to find EventDate entity.');\n }\n \n return $this->render('AtkRegistrationBundle:EventDate:eventdate.html.twig', array('eventdate' => $thisEventDate));\n }", "public function actionEventManagement(){\n $accessUser = [role::ADMIN, role::MEMBER]; // which user(role_id) has permission to join the page\n User::checkUserPermissionForPage($accessUser);\n\n\n $this->_params['title'] = 'Eventverwaltung';\n\n if(isset($_GET['eventId'])) {\n $dataDir = 'assets/images/upload/events/';\n unlink($dataDir . $_GET['pictureName']);\n Booking::deleteWhere('EVENT_ID = '.$_GET['eventId']);\n Event::deleteWhere('ID = ' . $_GET['eventId']);\n sendHeaderByControllerAndAction('event', 'EventManagement');\n }\n\n\n $sortEvent = 'ORDER BY DATE';\n $sortEventOld = 'ORDER BY DATE';\n\n if(isset($_GET['sortEvent'])) {\n $sortEvent = Event::generateSortClauseForEvent($_GET['sortEvent']);\n }\n\n if(isset($_GET['sortEventOld'])) {\n $sortEventOld = Event::generateSortClauseForEvent($_GET['sortEventOld']);\n }\n\n\n $this->_params['eventList'] = Event::find('DATE >= CURDATE()', null, $sortEvent);\n $this->_params['eventListOld'] = Event::find('DATE < CURDATE()', null, $sortEventOld);\n\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 actionIndex()\n {\n $featured = Event::find()->where(['is_featured' => 1])->all();\n return $this->render('index', compact('featured'));\n }", "public function viewAction()\n {\n \t$idEmployee = EmployeeCatalog::getInstance()->getIdEmployeeByIdUser($this->getUser()->getBean()->getIdUser());\n \t$projects = ProjectCatalog::getInstance()->getIdProjectByIdEmployee($idEmployee); \t\n \tforeach ($projects as $project)\n \t{\n \t\t$tmp[]=$project['id_project'];\n\t\t}\n\t\t$stringProjects = implode(\",\",$tmp);\n\t\t$strProjects='\"';\t\n\t\t$strProjects.= implode(\",\",$tmp);\n\t\t$strProjects.='\"';\t\n\t\t$dates = TimetableHourCatalog::getInstance()->getDisctinctDateByIdProjects($stringProjects);\n \tforeach ($dates as $date)\n \t{\n \t\t$date = $date['date'];\n \t\t$statusTask= TimetableHourCatalog::getInstance()->getStatusByDate($date);\n \t\tif ($statusTask == 2)\n \t\t\t$dateArray2[] = $date;\n \t\tif ($statusTask == 3)\n \t\t\t$dateArray3[] = $date;\n \t\tif ($statusTask == 4)\n \t\t\t$dateArray4[] = $date;\n \t\tif ($statusTask == 1)\n \t\t\t$dateArray1[] = $date;\n\t\t}\t\t\n\t\t$datesStatus2=CalendarDayManager::getInstance()->getCalendarDays($dateArray2);\n\t\t$datesStatus3=CalendarDayManager::getInstance()->getCalendarDays($dateArray3);\n\t\t$datesStatus4=CalendarDayManager::getInstance()->getCalendarDays($dateArray4);\n\t\t$datesStatus1=CalendarDayManager::getInstance()->getCalendarDays($dateArray1);\n\t\t$this->view->daysStaus2= json_encode($datesStatus2);\n\t\t$this->view->daysStaus3= json_encode($datesStatus3);\n\t\t$this->view->daysStaus4= json_encode($datesStatus4);\n\t\t$this->view->daysStaus1= json_encode($datesStatus1); \n\t\t$this->view->projects = $strProjects; \t\t\n $this->setTitle('Calendario de Tareas');\n }", "public function eventsAction()\n {\n $year = $this->params()->fromQuery('year', date('Y'));\n $container = $this->getEvent()->getApplication()->getServiceManager();\n $adapter = $container->get('Application\\Service\\Adapter');\n $sql = \"SELECT * FROM events WHERE event_date LIKE ? ORDER BY event_date\";\n $events = $adapter->query($sql, Adapter::QUERY_MODE_PREPARE);\n $events->execute([$year . '%']);\n return new ViewModel(['events' => $events, 'year' => $year]);\n }", "public function index()\n\t{\n\n\t\t$data['events'] = Event_Manager::paginate(15);\n\t\t$data['page_title'] = 'Events';\n\t\treturn View::make('clientside.events.index',$data);\n\t\t\n\t}", "function showEvents() {\r\n\r\n\t// Lets import some globals, shall we?\r\n\tglobal $MySelf;\r\n\tglobal $DB;\r\n\tglobal $TIMEMARK;\r\n\t$delta = $TIMEMARK -259200;\r\n\t\r\n\t// is the events module active?\r\n\tif (!getConfig(\"events\")) {\r\n\t\tmakeNotice(\"The admin has deactivated the events module.\", \"warning\", \"Module not active\");\r\n\t}\r\n\r\n\t// Load all events.\r\n\t$EVENTS_DS = $DB->query(\"SELECT * FROM events WHERE starttime >= '\" . $delta . \"' ORDER BY starttime ASC\");\r\n\r\n\t// .. right?\r\n\tif ($EVENTS_DS->numRows() >= 1) {\r\n\r\n\t\t// Lets keep in mind: We have events.\r\n\t\t$haveEvents = true;\r\n\r\n\t\twhile ($event = $EVENTS_DS->fetchRow()) {\r\n\r\n\t\t\t// get the date.\r\n\t\t\t$date = date(\"d.m.y\", $event[starttime]);\r\n\r\n\t\t\t// open up a new table for each day.\r\n\t\t\tif ($date != $previousdate) {\r\n\r\n\t\t\t\t$workday = date(\"l\", $event[starttime]);\r\n\r\n\t\t\t\tif ($beenhere) {\r\n\t\t\t\t\t$html .= $temp->flush();\r\n\t\t\t\t\t$html .= \"<br>\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$beenhere = true;\r\n\r\n\t\t\t\t// We need an additional row if we are allowed to delete events.\r\n\t\t\t\tif ($MySelf->canDeleteEvents()) {\r\n\t\t\t\t\t$temp = new table(8, true);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$temp = new table(7, true);\r\n\t\t\t\t}\r\n\t\t\t\t$temp->addHeader(\">> Events for \" . $workday . \", the \" . $date);\r\n\t\t\t\t$previousdate = $date;\r\n\r\n\t\t\t\t$temp->addRow(\"#060622\");\r\n\t\t\t\t$temp->addCol(\"ID\");\r\n\t\t\t\t$temp->addCol(\"Starttime\");\r\n\t\t\t\t$temp->addCol(\"Starts in / Runs for\");\r\n\t\t\t\t$temp->addCol(\"Mission Type\");\r\n\t\t\t\t$temp->addCol(\"Short Description\");\r\n\t\t\t\t$temp->addCol(\"System\");\r\n\t\t\t\t$temp->addCol(\"Security\");\r\n\t\t\t\tif ($MySelf->canDeleteEvents()) {\r\n\t\t\t\t\t$temp->addCol(\"Delete\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Add Event to the current database.\r\n\t\t\t$temp->addRow();\r\n\t\t\t$temp->addCol(\"<a href=\\\"index.php?action=showevent&id=\" . $event[id] . \"\\\">\" . str_pad($event[id], 4, \"0\", STR_PAD_LEFT) . \"</a>\");\r\n\t\t\t$temp->addCol(date(\"d.m.y H:i\", $event[starttime]));\r\n\r\n\t\t\t$delta = $TIMEMARK - $event[starttime];\r\n\t\t\tif ($TIMEMARK > $event[starttime]) {\r\n\t\t\t\t// Event underway.\r\n\t\t\t\t$temp->addCol(\"<font color=\\\"#00ff00\\\">\" . numberToString($delta) . \"</font>\");\r\n\t\t\t} else {\r\n\t\t\t\t// Event not started yet.\r\n\t\t\t\t$delta = $delta * -1;\r\n\t\t\t\t$temp->addCol(\"<font color=\\\"#ffff00\\\">\" . numberToString($delta) . \"</font>\");\r\n\t\t\t}\r\n\r\n\t\t\t$temp->addCol($event[type]);\r\n\t\t\t$temp->addCol($event[sdesc]);\r\n\t\t\t$temp->addCol($event[system]);\r\n\t\t\t$temp->addCol($event[security]);\r\n\t\t\t\r\n\t\t\tif ($MySelf->canDeleteEvents()) {\r\n\t\t\t\t$temp->addCol(\"<a href=\\\"index.php?action=deleteevent&id=$event[id]\\\">delete event</a>\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Lets recall, did we have events scheduled?\r\n\tif ($haveEvents) {\r\n\t\t// We do!\t\t\t\r\n\t\t$html = \"<h2>Scheduled Events</h2>\" . $html . $temp->flush();\r\n\t} else {\r\n\t\t// We dont!\t\t\t\r\n\t\t$html = \"<h2>Scheduled Events</h2><b>There are currently no scheduled events in the database.</b>\";\r\n\t}\r\n\t// Return what we got.\r\n\treturn ($html);\r\n\r\n}", "public function actionIndex()\r\n\t{\r\n\t\t$account_id = Yii::app()->user->id;\r\n\r\n\t\tif($account_id != null)\r\n\t\t{\r\n\t\t\t$events = Event::model()->findAll(\"status_id = 1\");\r\n\t\t\t\t\r\n\t\t\t$eventsDP = new CArrayDataProvider($events, array(\r\n\t\t\t\t\t'pagination' => array(\r\n\t\t\t\t\t\t'pageSize' => 10,\r\n\t\t\t\t\t)\r\n\t\t\t));\r\n\r\n\t\t\t$this->render('index',array(\r\n\t\t\t\t'eventsDP'=>$eventsDP,\r\n\t\t\t\t'events'=>$events,\r\n\t\t\t));\r\n\t\t}\r\n\t\telse\r\n\t\t\t$this->redirect(array('site/login'));\r\n\r\n\t}", "function studentResources(){\n // show the student resources page\n echo Template::instance()->render('views/studentResources.php');\n}", "public function index()\n {\n $events = Event::get();\n return response()->view('admin.events.index', ['events' => $events ]);\n }", "public function index($resourceId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n return view('events.eventables.index', compact('eventable', 'routes'));\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n $events = Event::all();\n return view('events::list_events',compact('events'));\n\n }", "public function index()\n {\n\n $sidebar_items = array(\n \"List Events\" => array('url' => URL::route('event.index'), 'icon' => '<i class=\"fa fa-users\"></i>'),\n );\n $FillableDropdown = new FillableDropdown();\n $active = $FillableDropdown->active($default = 2);\n $accessibility = $FillableDropdown->accessibility($default = 2);\n $operations = $FillableDropdown->eventOperations($default = 2);\n\n $authentication = \\App::make('authenticator');\n $user = $authentication->getLoggedUser();\n\n if (isset($user)) {\n\n $user_id = $user->id;\n }\n\n if (isset($user_id)) {\n\n $users = User::findOrFail($user_id);\n }\n $events = Events::orderBy('name', 'asc')->paginate(20);\n\n return view('events.event_listing_page', compact('events', 'users', 'active', 'accessibility', 'operations', 'sidebar_items'));\n\n }", "public function actionIndex()\n {\n $query_event = Event::find()->where(['>', 'start_date', date('Y-m-d')]);\n\n $data['total_event'] = $query_event->count();\n $data['events'] = $query_event->limit(10)->orderBy(['start_date'=>SORT_ASC])->all();\n\n $data['total_speaker'] = Speaker::find()->count();\n\n $data['total_joined_event'] = EventJoin::find()->where(['user_id' => Yii::$app->user->id])->count();\n\n\n return $this->render('index', $data);\n }", "public function index()\n {\n Event::all();\n }", "function displayLatestEvents()\n\t{\n\t\t$viewname = $this->getTheme();\n\n\t\t$cfg = JEVConfig::getInstance();\n\n\t\t// override global start now setting so that timelimit plugin can use it!\n\t\t$compparams = ComponentHelper::getParams(JEV_COM_COMPONENT);\n\t\t$startnow = $compparams->get(\"startnow\", 0);\n\t\t$compparams->set(\"startnow\", $this->modparams->get(\"startnow\", 0));\n\t\t$this->getLatestEventsData();\n\t\t$compparams->set(\"startnow\", $startnow);\n\n\t\t$content = \"\";\n\n\t\t$k = 0;\n\t\tif (isset($this->eventsByRelDay) && count($this->eventsByRelDay))\n\t\t{\n\t\t\t$content .= $this->getModuleHeader('<table class=\"mod_events_latest_table jevbootstrap\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">');\n\n\t\t\t// Now to display these events, we just start at the smallest index of the $this->eventsByRelDay array\n\t\t\t// and work our way up.\n\n\t\t\t$firstTime = true;\n\n\t\t\t// initialize name of com_jevents module and task defined to view\n\t\t\t// event detail. Note that these could change in future com_event\n\t\t\t// component revisions!! Note that the '$this->itemId' can be left out in\n\t\t\t// the link parameters for event details below since the event.php\n\t\t\t// component handler will fetch its own id from the db menu table\n\t\t\t// anyways as far as I understand it.\n\n\t\t\t$this->processFormatString();\n\n\t\t\tforeach ($this->eventsByRelDay as $relDay => $daysEvents)\n\t\t\t{\n\n\t\t\t\treset($daysEvents);\n\n\t\t\t\t// get all of the events for this day\n\t\t\t\tforeach ($daysEvents as $dayEvent)\n\t\t\t\t{\n\n\t\t\t\t\tif ($this->processTemplate($content, $dayEvent))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$eventcontent = \"\";\n\n\t\t\t\t\t// generate output according custom string\n\t\t\t\t\tforeach ($this->splitCustomFormat as $condtoken)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tif (isset($condtoken['cond']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($condtoken['cond'] == 'a' && !$dayEvent->alldayevent())\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\telse if ($condtoken['cond'] == '!a' && $dayEvent->alldayevent())\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\telse if ($condtoken['cond'] == 'e' && !($dayEvent->noendtime() || $dayEvent->alldayevent()))\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\telse if ($condtoken['cond'] == '!e' && ($dayEvent->noendtime() || $dayEvent->alldayevent()))\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\telse if ($condtoken['cond'] == '!m' && $dayEvent->getUnixStartDate() != $dayEvent->getUnixEndDate())\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\telse if ($condtoken['cond'] == 'm' && $dayEvent->getUnixStartDate() == $dayEvent->getUnixEndDate())\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach ($condtoken['data'] as $token)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($match);\n\t\t\t\t\t\t\tunset($dateParm);\n\t\t\t\t\t\t\t$dateParm = \"\";\n\t\t\t\t\t\t\t$match = '';\n\t\t\t\t\t\t\tif (is_array($token))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$match = $token['keyword'];\n\t\t\t\t\t\t\t\t$dateParm = isset($token['dateParm']) ? trim($token['dateParm']) : \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (strpos($token, '${') !== false)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$match = $token;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$eventcontent .= $token;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->processMatch($eventcontent, $match, $dayEvent, $dateParm, $relDay);\n\t\t\t\t\t\t} // end of foreach\n\t\t\t\t\t} // end of foreach\n\n\t\t\t\t\tif ($firstTime)\n\t\t\t\t\t\t$eventrow = '<tr class=\"jevrow' . $k . '\"><td class=\"mod_events_latest_first\">%s' . \"</td></tr>\\n\";\n\t\t\t\t\telse\n\t\t\t\t\t\t$eventrow = '<tr class=\"jevrow' . $k . '\"><td class=\"mod_events_latest\">%s' . \"</td></tr>\\n\";\n\n\t\t\t\t\t$templaterow = $this->modparams->get(\"modlatest_templaterow\") ? $this->modparams->get(\"modlatest_templaterow\") : $eventrow;\n\t\t\t\t\t$content .= str_replace(\"%s\", $eventcontent, $templaterow);\n\n\t\t\t\t\t$firstTime = false;\n\t\t\t\t} // end of foreach\n\t\t\t\t$k++;\n\t\t\t\t$k %= 2;\n\t\t\t} // end of foreach\n\t\t\t$content .= $this->getModuleFooter(\"</table>\\n\");\n\t\t}\n\t\telse if ($this->modparams->get(\"modlatest_NoEvents\", 1))\n\t\t{\n\t\t\t$content .= $this->modparams->get(\"modlatest_templatetop\") || $this->modparams->get(\"modlatest_templatetop\") ? $this->modparams->get(\"modlatest_templatetop\") : '<table class=\"mod_events_latest_table jevbootstrap\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">';\n\t\t\t$templaterow = $this->modparams->get(\"modlatest_templaterow\") ? $this->modparams->get(\"modlatest_templaterow\") : '<tr><td class=\"mod_events_latest_noevents\">%s</td></tr>' . \"\\n\";\n\t\t\t$content .= str_replace(\"%s\", Text::_('JEV_NO_EVENTS'), $templaterow);\n\t\t\t$content .= $this->modparams->get(\"modlatest_templatebottom\") ? $this->modparams->get(\"modlatest_templatebottom\") : \"</table>\\n\";\n\t\t}\n\n\t\t$callink_HTML = '<div class=\"mod_events_latest_callink\">'\n\t\t\t. $this->getCalendarLink()\n\t\t\t. '</div>';\n\n\t\tif ($this->linkToCal == 1)\n\t\t\t$content = $callink_HTML . $content;\n\t\tif ($this->linkToCal == 2)\n\t\t\t$content .= $callink_HTML;\n\n\t\tif ($this->displayRSS)\n\t\t{\n\t\t\t$rssimg = Uri::root() . \"media/system/images/livemarks.png\";\n\t\t\t$callink_HTML = '<div class=\"mod_events_latest_rsslink\">'\n\t\t\t\t. '<a href=\"' . $this->rsslink . '\" title=\"' . Text::_(\"RSS_FEED\") . '\" target=\"_blank\">'\n\t\t\t\t. '<img src=\"' . $rssimg . '\" alt=\"' . Text::_(\"RSS_FEED\") . '\" />'\n\t\t\t\t. Text::_(\"SUBSCRIBE_TO_RSS_FEED\")\n\t\t\t\t. '</a>'\n\t\t\t\t. '</div>';\n\t\t\t$content .= $callink_HTML;\n\t\t}\n\n\t\tif ($this->modparams->get(\"contentplugins\", 0))\n\t\t{\n\t\t\t$eventdata = new stdClass();\n\t\t\t$eventdata->text = $content;\n\t\t\tFactory::getApplication()->triggerEvent('onContentPrepare', array('com_jevents', &$eventdata, &$this->modparams, 0));\n\t\t\t$content = $eventdata->text;\n\t\t}\n\n\t\treturn $content;\n\n\t}", "function ShowEvents()\n {\n $this->ReadEvents();\n echo\n $this->H(1,$this->MyLanguage_GetMessage(\"Events_Table_Title\")).\n $this->EventsHtmlTable(),\n \"\";\n }", "public function index()\n {\n\n $events = DB::table('events')\n ->where('event_date', '>', date('Y-m-d').' 00:00:00')\n ->orderBy('event_date', 'asc')\n ->take(8)\n ->get();\n\n return view('events.index')->withEvents($events);\n\n }", "function showGetEventSources() {\n\t\t$this->getEngine()->assign('oModel', utilityOutputWrapper::wrap($this->getModel()));\n\t\t$this->render($this->getTpl('sourceList', '/account'));\n\t}", "public function user_event() {\n $this->loadModel('Image');\n $id = $this->Auth->user('id');\n $this->layout = 'front_end';\n $allImage = $this->Image->getAllimage($id);\n $this->set('image', $allImage);\n $data = $this->User->userData($id);\n $this->set('user', $data);\n $this->loadModel('Event');\n $event = $this->Event->eventList();\n $this->set('events', $event);\n $this->render('/Users/user_event');\n }", "public function index()\n {\n \n $events = Event::all();\n return view('pages.events.index')->with(compact('events'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $ressources = $em->getRepository('AppBundle:Ressource')->findAll();\n\n return $this->render('ressource/index.html.twig', array(\n 'ressources' => $ressources,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $eventInscriptions = $em->getRepository('EHSBundle:EventInscription')->findAll();\n\n return $this->render('eventinscription/index.html.twig', array(\n 'eventInscriptions' => $eventInscriptions,\n ));\n }", "public function manage_resources($event) {\n global $DB;\n switch($event->eventname) {\n case '\\core\\event\\course_category_updated':\n $this->course_category_updated($event);\n break;\n case '\\core\\event\\course_updated':\n $this->course_updated($event);\n break;\n case '\\core\\event\\course_content_deleted':\n $this->course_content_deleted($event);\n break;\n case '\\core\\event\\course_restored':\n $this->course_restored($event);\n break;\n case '\\core\\event\\course_section_updated':\n $this->course_section_updated($event);\n break;\n case '\\core\\event\\course_module_created':\n $this->course_module_created($event);\n break;\n case '\\core\\event\\course_module_updated':\n $this->course_module_updated($event);\n break;\n case '\\core\\event\\course_module_deleted':\n $this->course_module_deleted($event);\n break;\n case '\\tool_recyclebin\\event\\course_bin_item_restored':\n $this->course_bin_item_restored($event);\n break;\n case '\\core\\event\\role_assigned':\n $this->role_assigned($event);\n break;\n case '\\core\\event\\role_unassigned':\n $this->role_unassigned($event);\n break;\n case '\\core\\event\\role_capabilities_updated':\n $this->role_capabilities_updated($event);\n break;\n case '\\core\\event\\group_member_added':\n case '\\core\\event\\group_member_removed':\n $this->group_member_added($event);\n break;\n case '\\core\\event\\grouping_group_assigned':\n case '\\core\\event\\grouping_group_unassigned':\n $this->grouping_group_assigned($event);\n break;\n case '\\core\\event\\user_enrolment_created':\n $this->user_enrolment_created($event);\n break;\n case '\\core\\event\\user_enrolment_updated':\n $this->user_enrolment_updated($event);\n break;\n case '\\core\\event\\user_enrolment_deleted':\n $this->user_enrolment_deleted($event);\n break;\n case '\\core\\event\\user_deleted':\n $this->user_deleted($event);\n break;\n case '\\repository_googledrive\\event\\repository_gdrive_tokens_created':\n break;\n case '\\repository_googledrive\\event\\repository_gdrive_tokens_deleted':\n break;\n default:\n return false;\n }\n return true;\n }", "public function index()\n {\n $eventTypeList = $this->EventType->getAll();\n $eventCategoryList = $this->EventCategory->getAll();\n $eventGroupList = $this->EventGroup->getAll();\n $eventPriorityList = $this->EventPriority->getAll();\n $statusList = $this->Status->getAll();\n $groupEmployee = $this->EmployeeGroup->getAll();\n $data = [\n 'eventTypeList' => $eventTypeList,\n 'eventCategoryList' => $eventCategoryList,\n 'eventGroupList' => $eventGroupList,\n 'eventPriorityList' => $eventPriorityList,\n 'statusList' => $statusList,\n 'groupEmployee' => $groupEmployee\n ];\n return view('event::index', $data);\n }", "public function index()\n {\n $data['events'] = Event::orderBy('id', 'DESC')->get();\n return view(\"Event::index\", $data);\n }", "public function onPageLoad() {\n $eventsForUser = DB::table('events')\n ->select()\n ->where('eventOrganiserId', Auth::id())\n ->get();\n return view('myEvents', array('events' => $eventsForUser));\n }", "public function indexAction() {\n\t\t$viewer = Engine_Api::_()->user()->getViewer();\n\t\tif (!Engine_Api::_()->core()->hasSubject()) {\n\t\t\treturn $this->setNoRender();\n\t\t}\n\t\t\n\t\t// Get subject and check auth\n\t\t$subject = Engine_Api::_()->core()->getSubject('event');\n\t\tif (!$subject->authorization()->isAllowed($viewer, 'view')) {\n\t\t\treturn $this->setNoRender();\n\t\t}\n\t\t\n\t\t// Prepare data\n\t\t$this->view->event = $event = $subject;\n\t\t\t\n\t //Get viewer, event, search form\n\t \t$viewer = Engine_Api::_() -> user() -> getViewer();\n\t \t$this -> view -> event = $event = Engine_Api::_() -> core() -> getSubject();\n\t\t$this -> view -> form = $form = new Ynevent_Form_Video_Search;\n\t\n\t\tif ( !$event->authorization()->isAllowed($viewer, 'view') ) { return; }\n\t \n\t // Check create video authorization\n\t\t$canCreate = $event -> authorization() -> isAllowed($viewer, 'video');\n\t\t$levelCreate = Engine_Api::_() -> authorization() -> getAdapter('levels') -> getAllowed('event', $viewer, 'video');\n\n\t\t//print_r($canCreate); exit;\n\t\t\n\t\tif ($canCreate && $levelCreate) {\n\t\t\t$this -> view -> canCreate = true;\n\t\t} else {\n\t\t\t$this -> view -> canCreate = false;\n\t\t}\n\t\n\t //Prepare data filer\n\t $params = array();\n\t $params = $this->_getAllParams();\n\t $params['title'] = '';\n\t $params['parent_type'] = 'event';\n\t $params['parent_id'] = $event->getIdentity();\n\t $params['search'] = 1;\n\t $params['limit'] = 12;\n\t $form->populate($params);\n\t $this->view->formValues = $form->getValues();\n\t //Get data\n\t //print_r($params); exit;\n\t $this -> view -> paginator = $paginator = Engine_Api::_() -> ynvideo() -> getVideosPaginator($params);\n\t if(!empty($params['orderby'])){\n\t switch($params['orderby']){\n\t case 'most_liked':\n\t $this->view->infoCol = 'like';\n\t break;\n\t case 'most_commented':\n\t $this->view->infoCol = 'comment';\n\t break;\n\t default:\n\t $this->view->infoCol = 'view';\n\t break;\n\t }\n\t }\n\t \n\t\t// Add count to title if configured\n\t if( $this->_getParam('titleCount', false) && $paginator->getTotalItemCount() > 0 ) {\n\t $this->_childCount = $paginator->getTotalItemCount();\n\t }\n\t}", "public function index()\n {\n $events = $this->eventRepository->all();\n return view('admin.event.index',compact('events'));\n }", "public function ajaxevents() {\n\t\t$pageTitle = 'Events';\n\t\t$this->autoRender = false;\n\t\t$this->viewBuilder()->setLayout(false);\n\t\t$this->loadModel('Events');\n\t\t$today = date(\"Y-m-d\");\n\t\tif ($this->request->is('ajax')) {\n\n\t\t\t$events = $this->Events->find()->where(['Events.published' => 1, 'DATE(Events.start_date) >' => $today])->order(['Events.start_date' => 'ASC'])->limit(3)->offset($this->request->getData()['offset'])->all();\n\t\t\techo json_encode(array(\"status\" => \"success\", \"data\" => $events));\n\t\t\texit;\n\n\t\t}\n\n\t}", "public function index()\n {\n $eventList = Event::all();\n return view('backEnd.events.events',compact('eventList'));\n }", "function index()\n\t\t{\n\t\t\t// get every event record\n\t\t\t$all_events = $this->calendar->get_calendar_data();\n\t\t\t\n\t\t\t$veiw_data['all_events'] = $all_events;\n\t\t\t\n\t\t\t// load the view and send the data\n\t\t\t$this->load->view('index', $veiw_data);\n\t\t}", "public function index()\n {\n $events = Event::latest()->paginate(10);\n return view('event.events', compact('events'));\n }", "public function index()\n {\n $events = Event::with('Teams', 'Teams.Members', 'Teams.Members.User', 'Teams.Members.User.Occupation', 'Teams.Members.Role', 'Teams.Category')->where([\n ['to', '>', Carbon::now()->format('Y-m-d H:m:s')],\n ['visibility', '!=', 'draft'],\n ])->get();\n $pastEvents = Event::with('Teams', 'Teams.Members', 'Teams.Category')->where([\n ['to', '<', Carbon::now()->format('Y-m-d H:m:s')],\n ['visibility', '!=', 'draft'],\n ])->get();\n\n return view('layouts.events', ['events' => $events, 'pastEvents' => $pastEvents]);\n }", "public function index()\n {\n // get all published event and 3 recent published event\n $events = Event::all()->where('status', '=', 1);\n $threeRecentEvent = Event::orderBy('created_at', 'desc')->where('status', '=', 1)->take(3)->get();\n\n return view('home')\n ->withEvents($events)\n ->withThreeRecentEvent($threeRecentEvent);\n }", "public function eventsAction(Request $request)\n {\n return $this->render('version0/events.html.twig');\n\n }", "public function index()\n {\n $navTitle = '<span class=\"micon dw dw-rocket mr-2\"></span>Event Internal';\n $eias = EventInternal::with('kategoriRef', 'tipePesertaRef')->where('ormawa_id', Session::get('id_ormawa'))->where('status', 1)->get();\n $eis = EventInternal::with('kategoriRef', 'tipePesertaRef')->where('ormawa_id', Session::get('id_ormawa'))->get();\n $eiss = EventInternal::with('kategoriRef', 'tipePesertaRef')->where('ormawa_id', Session::get('id_ormawa'))->where('status', 0)->get();\n\n return view('ormawa.event_internal.index', compact('eis', 'navTitle', 'eias', 'eiss'));\n }", "public function backend_resources()\n\t{\n\t\t$data['title'] = 'backend resources';\n\n\t\t$instructorId = $this->session->userdata('id');\n\n\t\t$data['instructorDetail'] = $this->scheduledCalendar_model->instructor_detail($instructorId);\n\t\t\n\t\t$this->load->view('instructor/include_calendar/backend_resources.php',$data);\n\t}", "public function index()\n\t{\n $events = $this->events->paginate(10);\n $no = $events->getFrom();\n return $this->view('events.index', compact('events', 'no'));\n\t}", "public function index()\n\t{\n\t\t$events = Event::orderBy('id', 'desc')->paginate(10);\n\n\t\treturn view('events.index', compact('events'));\n\t}", "public function index()\n {\n $events = Events::where([\n ['event_date', '>', Carbon::now()->toDateString()],\n ['status', '=', 'PUBLISHED']\n ])\n ->latest()\n ->get();\n $items = menu('guest', '_json');\n $segment = 'Events';\n return view('pages.events', [\n 'events' => $events,\n 'items' => $items,\n 'segment' => $segment,\n ]);\n }", "public function index()\n {\n if (! Gate::allows('event_access')) {\n return abort(401);\n }\n\n $events = Event::all();\n // foreach($events as $event){\n // dd($event->subcategories);\n // }\n\n return view('admin.events.index', compact('events'));\n }", "public function show(Events $events)\n {\n //\n }", "public function index()\n {\n $events = Event::get();\n\n return view('event.index', compact('events'));\n }", "public function index()\n\t{\n\t\t$events = Eventadd::orderBy('date', 'asc')->get();\n return View::make('events.index', compact('events'));\n\t}", "public function index()\n {\n $user = auth()->user();\n\n $userUpcomingEvents = $user->interestedEvents()->current()->orderBy('start_datetime')->get();\n\n return view('auth.residents.events.index', compact('events', 'userUpcomingEvents'));\n }", "public function index()\n {\n $events = \\App\\Event::orderBy('id','DESC')->paginate(10);\n return view('admin.events.index', ['events' => $events]);\n }", "public function index()\n {\n $e = Event::all();\n return view('admin.events.index' , compact('e'));\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n $dqlsurvey = \"SELECT sy.id,sy.title,sy.descriptions,sy.active,sy.createdOn,ev.title as event_title FROM DroidInfotechDroidBundle:Survey sy JOIN DroidInfotechDroidBundle:Events ev WITH sy.eventId=ev.id\";\n\n $surveys = $em->createQuery($dqlsurvey)->getResult();\n // print_r($surveys); \n //$surveys = $em->getRepository('DroidInfotechDroidBundle:Survey')->findAll();\n return $this->render('survey/index.html.twig', array(\n 'surveys' => $surveys,\n ));\n }", "public function index()\n\t{\n\t\treturn view('evento')->with('paginaAtual','evento');\n\t}", "public function view(){\n if (!isset($_GET[\"idactivity\"])) {\n throw new Exception(\"idactivity is mandatory\");\n }\n\n\n $activityid = $_GET[\"idactivity\"];\n\n // Recuperar distintas actividades según usuario.\n $activity = $this->activityMapper->findById($activityid);\n $activity_resources = $this->activity_resourceMapper->findAll($activityid);\n $resources = array();\n if ($activity_resources !=NULL){\n foreach ($activity_resources as $activity_resource) {\n if ($activity_resource->getId() != $activity->getPlace()){\n $resource = $this->resourceMapper->findById($activity_resource->getIdresource());\n if ($resource != NULL && ($resource->getType() == resourcetype::Resource)){\n array_push($resources, $resource);\n }\n }\n }\n }\n $place = $this->resourceMapper->findById($activity->getPlace());\n // Recupera el array de rutas a las imágenes.\n $images = json_decode($activity->getImage());\n //$trainer = $this->activityMapper->findTrainerById($activity->getIduser());\n $trainer = $this->userMapper->findById2($activity->getIduser());\n if ($activity == NULL) {\n throw new Exception(\"->no such activity with id: \".$activityid);\n }\n\n if (!isset($this->currentUser)) {\n $isReserved = 0;\n }else{\n if($this->user_activityMapper->countByIdActivityAndIdUser($activityid,$this->currentUser->getId()) != 0){\n $isReserved = 1;\n }else{\n $isReserved = 0;\n }\n }\n\n $plazasOcupadas = $this->user_activityMapper->countAllByIdActivity($activityid);\n $plazasDisponibles = $activity->getSeats() - $plazasOcupadas;\n\n // put the Activity object to the view\n $this->view->setVariable(\"isReserved\", $isReserved);\n $this->view->setVariable(\"activity\", $activity);\n $this->view->setVariable(\"images\", $images);\n $this->view->setVariable(\"trainer\", $trainer);\n $this->view->setVariable(\"place\", $place);\n $this->view->setVariable(\"resources\", $resources);\n $this->view->setVariable(\"plazasDisponibles\", $plazasDisponibles);\n\n // render the view (/view/activities/view.php)\n\n $this->view->render(\"activities\", \"view\");\n\n }", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function index()\n {\n $events = Event::all();\n return view('indexEvent')->with(compact('events'));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => EventsCategories::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function fetchEvents()\n {\n // TODO: Implement fetchEvents() method.\n }", "public function listAction()\r\n\t{\r\n\t\t$viewer = Engine_Api::_() -> user() -> getViewer();\r\n\t\t$this -> view -> business = $business = Engine_Api::_() -> core() -> getSubject();\r\n\t\t$this -> view -> form = $form = new Ynbusinesspages_Form_Event_Search;\r\n\t\t$val = $this -> _getAllParams();\r\n\t\t// Populate form data\r\n\t\tif (!$form -> isValid($val))\r\n\t\t{\r\n\t\t\t$form -> populate($defaultValues);\r\n\t\t\t$this -> view -> formValues = $values = array();\r\n\t\t\t$this -> view -> message = \"The search value is not valid !\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$values = $form -> getValues();\r\n\t\t$values['business_id'] = $business -> getIdentity();\r\n\t\t// Prepare data\r\n\t\t$this -> view -> formValues = $values = array_merge($values, $_GET);\r\n\t\t\r\n\t\t// Check create event authorization\r\n\t\t$this -> view -> canCreate = $business -> isAllowed('event_create');\r\n\t\t//Get data\r\n\t\t$this -> view -> paginator = $paginator = Engine_Api::_()->getDbTable('mappings', 'ynbusinesspages') -> getEventsPaginator($values);\r\n\t\t$paginator -> setCurrentPageNumber($this -> _getParam('page'));\r\n\t}", "public function getindex()\n\t{\n\t\t$id = Sentry::getUser()->id;\n\t\tif(!$id)\n\t\t{\n\t\t\techo \"please login first\";\n\n\t\t}\n\t\telse\n\t\t{\n\t\t$events = Calender::all(); \n\t\t\n\t\treturn View::make('event.index')->with('events',$events);\n\t}\n\t}", "public function index()\n {\n $events=Event::orderby('id','desc')->paginate(20);\n\n return view('backend.events.index',compact('events'));\n }", "public function eventsList()\n {\n $alumniId = session('alumni_id');\n $alumni = AlumniBasicInfo::find($alumniId);\n $events = Event::where('dept_info_id',$alumni->dept_info_id)->latest()->paginate(3);\n return view('frontend.events.events-list',compact('events'));\n }", "public function actionRenderDataEvents($claster,$start,$end)\n { \n $end_1 = strtotime($end);\n $dep_id1 = Yii::$app->getUserOpt->Profile_user()->emp->DEP_ID;\n $emp_email = Yii::$app->getUserOpt->Profile_user()->emp->EMP_EMAIL;\n $gf_id = Yii::$app->getUserOpt->Profile_user()->emp->GF_ID;\n\t\t\n if($gf_id <= 4)\n {\n\t\t\t $sql = \"select STATUS as status, COLOR as color, ID as resourceId, PLAN_DATE1 as start , PLAN_DATE2 as end, PILOT_NM as title from sc0001 where DEP_ID = '\".$dep_id1.\"' and TEMP_EVENT <>0 and ((date(PLAN_DATE1) BETWEEN '\".$start.\"' AND '\".$end.\"') or (date(PLAN_DATE2) BETWEEN '\".$start.\"' AND '\".$end.\"'))\";\n\t\t\t}else{\n\t\t\t\t$sql = \"select STATUS as status, COLOR as color, ID as resourceId, PLAN_DATE1 as start , PLAN_DATE2 as end, PILOT_NM as title from sc0001 where DEP_ID = '\".$emp_email.\"' and TEMP_EVENT <>0 and ((date(PLAN_DATE1) BETWEEN '\".$start.\"' AND '\".$end.\"') or (date(PLAN_DATE2) BETWEEN '\".$start.\"' AND '\".$end.\"'))\";\n }\n $aryEvent = Yii::$app->db_widget->createCommand($sql)->queryAll();\t\n\t\treturn Json::encode($aryEvent);\n\t}", "function view()\n {\n $data['title'] = 'Cadet Events';\n $this->load->model('cadetevent_model');\n $data['events'] = $this->cadetevent_model->get_all_cadetevents();\n \n // Loads the home page \n $this->load->view('templates/header', $data);\n $this->load->view('pages/attendance.php');\n $this->load->view('templates/footer'); \n }", "public function index()\n\t{\n\t\t$events = Events::all();\n\t\treturn view('admin.showTagamo3',array('events'=>$events));\n\t}", "public function index()\n {\n $sideevents = $this->event->take(3)->get();\n return view('front.home',compact('sideevents'));\n }", "public function index()\n {\n $aux = new Evento();\n $this->authorize('view', $aux);\n $eventos = Evento::orderBy('fecha', 'desc')->get();\n $estados = Evento::ESTADO;\n return view('evento.index')\n ->with('eventos', $eventos)\n ->with('estados', $estados)\n ->with('aux', $aux);\n }", "public function index()\n\t{\n\n\t\t$events = Vent::orderBy('date','desc')->paginate(10);\n\t\t\n\t\t\n\t\t//$files = File::files($public_path);\n\t\t$data = array(\n\t\t\t//'files'=> $images_path,\n\t\t\t'events'=> $events\n\n\t\t\t);\n\t\treturn View::make('events.index',$data);\n\t}", "public function index()\n {\n $listing=Event::all();\n return view('events.list', compact('listing'));\n }", "public function show(events $events)\n {\n //\n }", "public function index()\n {\n // $adminevent = Event::all();\n // return view('admin.adminevent.list')->with('adminevent', $adminevent);\n return view('admin/adminevent/list', ['adminevent' => Event::orderBy('start')->get()]);\n }", "public function actionIndex()\n\t{\n\t\t$selectedEvent=User::getUserSelectedEvent();\n\t\tif ($selectedEvent!=NULL)\n\t\t{\n\t\t\t// If the user has a selected event, retrieve that event\n\t\t\t$model=Event::model()->findByPk($selectedEvent);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// If the user does not have a selected event, choose the first event available\n\t\t\t$model=Event::model()->find();\n\t\t\t$user=User::model()->find('LOWER(username)=?',array(Yii::app()->user->name));\n\t\t\t$user->selectedevent=$model->id;\n\t\t\t$user->save();\n\t\t}\n\n\t\t// if there are no events, navigate back to splash screen\n\t\tif(is_null($model) || !isset($model))\n\t\t{\n\t\t\t$this->redirect('splash');\n\t\t}\n\t\telse\n\t\t$this->render('index',array('model'=>$model));\n\t}" ]
[ "0.68937624", "0.6832855", "0.6737387", "0.66969204", "0.6687211", "0.66647995", "0.6630551", "0.6605819", "0.65798235", "0.65522707", "0.6503299", "0.64920044", "0.64855295", "0.64187247", "0.6392682", "0.6380522", "0.6375011", "0.63708305", "0.6357326", "0.6346072", "0.6332452", "0.628499", "0.62772816", "0.62079144", "0.61855423", "0.6155567", "0.61506844", "0.6141002", "0.61260206", "0.6114621", "0.61138934", "0.6101915", "0.6095432", "0.60663545", "0.6064354", "0.60421973", "0.6003558", "0.59868526", "0.5986589", "0.598629", "0.59845763", "0.5983694", "0.59823495", "0.5968927", "0.59609735", "0.59569234", "0.5953661", "0.59510154", "0.59369326", "0.59229386", "0.5922769", "0.5921979", "0.5916957", "0.5907248", "0.5905819", "0.589625", "0.5889614", "0.5880806", "0.5879143", "0.5876326", "0.58750266", "0.5873922", "0.5858375", "0.5855937", "0.5852436", "0.5843217", "0.5841507", "0.584066", "0.5836016", "0.58241045", "0.5817706", "0.58090436", "0.5805316", "0.5801415", "0.57890856", "0.5775833", "0.5772307", "0.5772232", "0.57695204", "0.5756927", "0.57509655", "0.5746847", "0.5743148", "0.5742704", "0.57424104", "0.57409614", "0.57376295", "0.5735505", "0.5728384", "0.57253444", "0.57246274", "0.57240564", "0.57240164", "0.5722017", "0.5720709", "0.5718495", "0.571788", "0.57175", "0.57161325", "0.5715838" ]
0.7391225
0
/ WAS WRITTEN BY A TEAMMATE isLoggedIn Checks to see if a "user" is logged in and has access to resource loading edit/add resources page
public function isLoggedIn() { $database = new Database(); $loggedIn = $database->getAdminByUsername($_SESSION['user']); $admin = new Admin($loggedIn['adminId'], $loggedIn['username'], $loggedIn['adminLevel'], $loggedIn['active']); if(isset($_SESSION['user']) === true && strpos($admin->getAdminLevel(), Resources) !== false && $admin->getActive() == 1) { $testLogin = true; } else { $this->_f3->reroute('/Login'); } $this->_f3->set('login', $testLogin); $this->_f3->set('admin', $admin); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function isUserLoggedIn() {}", "protected function isUserLoggedIn() {}", "static public function isLoggedIn(){\n \treturn (self::getInstance()->getId()>1);\n }", "function isLoggedIn() {\n\t\t\tif(!$this->params['requested']) $this->cakeError('error404');\n\t\t\treturn $this->User->isLoggedIn();\n\t\t}", "function isLoggedIn()\n\t{\n\t\tif ( $this->_isAuthorized() ){\t\n\t\t\treturn true;\n\t\t} else return false;\n\t\n\t}", "function IsLoggedIn() {\t\tif( Member::currentUserID() ) {\r\n\t\t return true;\r\n\t\t}\r\n }", "abstract protected function isUserLoggedIn() ;", "public function isCurrentlyLoggedIn() {}", "public function isLoggedIn();", "public function isLoggedIn();", "function isLoggedIn(){\n return $this->auth->isLoggedIn();\n }", "public function isLoggedIn()\n {\n $database = new Database();\n $loggedIn = $database->getAdminByUsername($_SESSION['user']);\n $admin = new Admin($loggedIn['adminId'], $loggedIn['username'], $loggedIn['adminLevel'], $loggedIn['active']);\n if(isset($_SESSION['user']) === true && strpos($admin->getAdminLevel(), Partner) !== false && $admin->getActive() == 1) {\n $testLogin = true;\n } else {\n $this->_f3->reroute('/Login');\n }\n $this->_f3->set('login', $testLogin);\n $this->_f3->set('admin', $admin);\n }", "public function isLoggedIn()\n {\n return true;\n }", "function checkSessionAll(){\r\n \tif($this->Session->check('User')){\r\n \t\t//the user is logged in, allow the wiki edit featur\r\n \t\t//the layout will know more than we do now \r\n \t\t$cuser = $this->Session->read('User');\r\n \t\tif($cuser['account_type'] == 'admin'){\r\n \t\t\t$this->set('admin_enable', true);\r\n \t\t}else{\r\n \t\t\t$this->set('admin_enable', false);\r\n \t\t}\r\n \t\t\r\n \t}else{\r\n \t\t$this->set('admin_enabled', false);\r\n \t}\r\n }", "public static function isLoggedIn(){\n if(!self::exists('is_logged_in')&& self::get('is_logged_in')!==true){\n \n header('location:' . URL . 'user/login.php');\n exit;\n }\n }", "function logged_in() {\r\n\t\treturn isset($_SESSION[\"admin_id\"]);\r\n\t}", "function is_admin()\n {\n //is a user logged in?\n\n //if so, check admin status\n\n //returns true/false\n\n }", "public function is_logged_in() {\n return isset($this->admin_id) && $this->last_login_is_recent();\n \n }", "protected function isCurrentUserAdmin() {}", "protected function isCurrentUserAdmin() {}", "function isRestricted() {\t\n\n\t\tif (isset($_SESSION['logged-in']) && $_SESSION['isAdmin']) {\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader(\"Location: restricted.php\");//Instant Re direct to Restricted due to lack of permissions.\n\t\t}\t\t\t\n\t}", "function logged_in() {\n\t\tif (isset($_SESSION['admin_id'])) {\n\t\t\tif($_SESSION['username'] === \"main_admin\"){ \n\t\t\t\treturn 1; \n\t\t\t}\n\t\t}\n\t\treturn 0; \n\t}", "function loggedin() {return $this->login_state!=0;}", "function postasevent_limit_rest_view_to_logged_in_users( $is_allowed, $cmb_controller ) {\n\tif ( ! is_user_logged_in() ) {\n\t\t$is_allowed = false;\n\t}\n\n\treturn $is_allowed;\n}", "function logged_in() {\n\treturn isset($_SESSION['admin_id']);\n}", "protected function isLoggedIn()\n\t{\n\t\treturn is_user_logged_in();\n\t}", "function isLoggedIn(){\r\n APP::import('Component','Auth');\r\n $auth = new AuthComponent;\r\n $auth ->Session = $this->Session;\r\n $user = $auth->user();\r\n return !empty($user);\r\n \r\n }", "public function is_logged_in() {\n\n\t}", "function checkAccess () {\n if ($GLOBALS[\"pagedata\"][\"login\"] == 1) {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n }", "function checkAccess () {\n if ($GLOBALS[\"pagedata\"][\"login\"] == 1) {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n }", "public function authorize()\n {\n return (\\Auth::user()->hasRole('admin')) || (\\Auth::user()->hasRole('editor')) || \\Auth::user()->canDo('UPDATE_POLLS');\n }", "public function isBackendUserLoggedIn() {}", "function isAdmin() {\n //FIXME: This needs to (eventually) evaluate that the user is both logged in *and* has admin credentials.\n //Change to false to see nav and detail buttons auto-magically disappear.\n return true;\n}", "function is_admin_logged_in()\n{\n global $current_user;\n return ($current_user != NULL && $current_user['un'] == 'admin');\n}", "function check_permission()\r\n {\r\n // Ensure the user logs in\r\n require_login($this->course->id);\r\n if (isguestuser()) error(get_string('noguestaccess', 'sloodle'));\r\n add_to_log($this->course->id, 'course', 'view sloodle data', '', \"{$this->course->id}\");\r\n\r\n // Ensure the user is allowed to update information on this course\r\n $this->course_context = get_context_instance(CONTEXT_COURSE, $this->course->id);\r\n require_capability('moodle/course:update', $this->course_context);\r\n }", "private function _logged_in()\n {\n /*if(someone is logged in)\n RETURN TRUE;*/\n }", "public static function currentUserHasAccess() {\n return current_user_can('admin_access');\n }", "function is_logged_in()\n\t{\n\t\treturn require_login();\n\t}", "public function restricted()\n {\n $site = new SiteContainer($this->db);\n\n $site->printHeader();\n if (isset($_SESSION['type']))\n $site->printNav($_SESSION['type']);\n echo \"You are not allowed to access this resource. Return <a href=\\\"index.php\\\">Home</a>\";\n $site->printFooter();\n\n }", "function is_admin()\r\n{\r\n if(is_auth() && $_SESSION['user']['statut'] == 1)\r\n {\r\n return true;\r\n }\r\n return false;\r\n}", "private function _isLoggedIn() {\n \n if ( ! is_multisite() ) { \n if ( ! function_exists( 'is_user_logged_in' ) ) {\n include( ABSPATH . \"wp-includes/pluggable.php\" ); \n } \n return is_user_logged_in();\n }\n \n // For multi-sites\n return is_user_member_of_blog( get_current_user_id(), get_current_blog_id() );\n\n }", "private function isLoggedIn()\n {\n return isset($_SESSION['user']); \n }", "function wpc_client_checking_page_access() {\r\n global $wpc_client;\r\n //block not logged clients\r\n if ( !is_user_logged_in() ) {\r\n //Sorry, you do not have permission to see this page\r\n do_action( 'wp_client_redirect', $wpc_client->get_login_url() );\r\n exit;\r\n }\r\n\r\n\r\n if ( current_user_can( 'wpc_client' ) || current_user_can( 'administrator' ) )\r\n $client_id = get_current_user_id();\r\n else\r\n return false;\r\n\r\n return $client_id;\r\n }", "public function isLoggedIn() {\n if(isset($this->username)){\n return true;\n }\n return false;\n}", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_material/curriculumdoc');\n }", "function is_admin_logged_in()\n\t{\n\t\tif(isset($_SESSION['admin']['au_id']))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public function isLoggedIn()\n {\n if(Session::get('user_id') != '') {\n $this->user_id=Session::get('user_id');\n $this->role_id=Session::get('role_id');\n return true;\n }else {\n return false;\n }\n }", "public function isAuth() {\n $connector = Mage::getSingleton('vidtest/connector')->getApiModel($this->getApiModelCode());\n return $connector->isLoggedIn();\n }", "public function is_logged_in() {\n if(isset($_SESSION['shopping_cart'])){\n $loged_in = $_SESSION['shopping_cart']->is_admin();\n }else{\n $loged_in = false;\n }\n\n if (!$loged_in) {\n //$cred = $this->loadModel(\"model_login\")->get_admin_account_credentials();\n $this->LoadView(\"editors/login\");\n return false;\n } else {\n return true;\n }\n }", "function is_logged_in()\n\t{\n\t\t$is_logged_in = $this->session->userdata('login');\n\t\t$level=$this->session->userdata('level');\n\t\t//jika session tidak ada atau levelnya bukan user maka akan menampilkan pesan error\n\t\tif(!isset($is_logged_in) || $is_logged_in != true || $level != 'hrd' )\n\t\t{\n\t\t\techo 'You don\\'t have permission to access this page. <a href=\"../backend\">Login</a>';\n\t\t\tdie();\n\t\t}\n\t}", "function isLoggedIn()\n {\n $isLoggedIn = $this->session->userdata('isLoggedIn');\n \n if(!isset($isLoggedIn) || $isLoggedIn != TRUE)\n {\n redirect('/login');\n }\n else\n {\n $this->role = $this->session->userdata('role');\n $this->vendorId = $this->session->userdata('userId');\n $this->name = $this->session->userdata('name');\n $this->roleText = $this->session->userdata('roleText');\n $this->fotoProfil = $this->session->userdata('fotoProfil');\n \n $this->global['name'] = $this->name;\n $this->global['role'] = $this->role;\n $this->global['role_text'] = $this->roleText;\n $this->global['fotoProfil'] = $this->fotoProfil;\n }\n }", "function CheckAdminAsView($view, $context, $req, $res){\n if(isset($_SESSION['user'])){\n if($_SESSION['user']['Rol'] == 1){\n $res->render($view, $context);\n }\n else\n {\n echo \"Error, no administrator rol\";\n }\n }\n else\n {\n echo \"User not logged\";\n }\n}", "public function requireAdmin(){\n if( ! Authentifiacation::isAdmin()){\n Authentifiacation::rememberRequestedPage();\n Flash::addMessage('You need to have admin status to access this page', Flash::INFO);\n self::redirect('/login/new');\n }\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}", "private function _userLoggedIn()\n {\n $this->utility->redirect('write');\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isLoggedIn()\n {\n $isLoggedIn = $this->session->userdata('isLoggedIn');\n\n if (!isset($isLoggedIn) || $isLoggedIn != true) {\n redirect('/login');\n } else {\n $this->role = $this->session->userdata('role');\n $this->vendorId = $this->session->userdata('userId');\n $this->name = $this->session->userdata('name');\n $this->roleText = $this->session->userdata('roleText');\n $this->fotoProfil = $this->session->userdata('fotoProfil');\n\n $this->global['name'] = $this->name;\n $this->global['role'] = $this->role;\n $this->global['role_text'] = $this->roleText;\n $this->global['fotoProfil'] = $this->fotoProfil;\n }\n }", "public function authorize(): bool\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function isLoggedIn() {\n\t\treturn $this->loggedIn;\n\t}", "function checkAuthorised($just_check=FALSE)\n{\n global $page_level, $max_level;\n global $day, $month, $year, $area, $room;\n global $PHP_SELF;\n\n $page = this_page();\n \n // Get the minimum authorisation level for this page\n if (isset($page_level[$page]))\n {\n $required_level = $page_level[$page];\n }\n elseif (isset($max_level))\n {\n $required_level = $max_level;\n }\n else\n {\n $required_level = 2;\n }\n \n if ($just_check)\n {\n if ($required_level == 0)\n {\n return TRUE;\n }\n $user = getUserName();\n return (isset($user)) ? (authGetUserLevel($user) >= $required_level): FALSE;\n }\n \n // Check that the user has this level\n if (!getAuthorised($required_level))\n {\n // If we dont know the right date then use today's\n if (!isset($day) or !isset($month) or !isset($year))\n {\n $day = date(\"d\");\n $month = date(\"m\");\n $year = date(\"Y\");\n }\n if (empty($area))\n {\n $area = get_default_area();\n }\n showAccessDenied($day, $month, $year, $area, isset($room) ? $room : null);\n exit();\n }\n \n return TRUE;\n}", "public function isLoggedIn() {\n\t\treturn $this->isLoggedin;\n\t}", "function getUserIsLoggedIn() {\r\n\r\n // For now, just return false\r\n return false;\r\n}", "function user_can_access_admin_page()\n {\n }", "function isLoggedIn() {\n\n\tif (isset($_SESSION['role'])) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "public function isLoggedIn()\n {\n if($this->session->has('admin') && $this->session->has('token')){\n $admin = $this->session->get('admin');\n $token = $this->session->get('token');\n\n $admin = $this->adminRepo->findOneBy(array('login'=>$admin, 'token'=>$token));\n\n if(!empty($admin)){\n return true;\n }else{\n return false;\n }\n }\n return false; \n }", "public function isLoggedIn()\n {\n return $this->loggedIn;\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "function is_admin()\n{\n global $app;\n if (is_authenticated()) {\n $user = $app->auth->getUserData();\n return ($user['role'] === '1');\n } else {\n return false;\n }\n}", "public function isLoggedIn(): bool\n {\n return $this->getRights() > self::GUEST;\n }", "function isLoggedIn() {\n\treturn isset($_SESSION['user_id']);\n}", "public function isAuthorized($user) {\n if ($this->action === 'apply' || $this->action === 'saveProject'){\n if($user['role'] == 'student' || $user['role'] == 'staff'){\n return true; \n } \n }\n \n if ($this->action === 'applied' || $this->action === 'saved'){\n if($user['role'] == 'student' || $user['role'] == 'staff'){\n return true; \n }\n }\n \n if ($this->action === 'add' || $this->action === 'applicants') {\n if($user['role'] == 'research'){\n return true;\n }\n }\n \n if ($this->action === 'projects') {\n if($user['role'] == 'research'){\n return true;\n }\n }\n\n if (in_array($this->action, array('edit', 'delete'))) {\n $projectId = (int) $this->request->params['pass'][0];\n if ($this->Project->isOwnedBy($projectId, $user['id'])) {\n return true;\n }\n }\n\n return parent::isAuthorized($user);\n}", "public function loggedIn($resource = 'bekend')\n {\n return OAuth2Helper::isAuthorisedFor($resource);\n }", "public function isLoggedIn() {\r\n\t\treturn $this->isLoggedIn;\r\n\t}", "function isLoggedIn()\r\n{\r\n $currentUserId = 1;\r\n return $currentUserId;\r\n}", "function AdminVisible(){\n if(!LoggedIn()){\n if(isset($_SESSION['level'])){\n if($_SESSION['level'] == 1){\n return 1;\n }\n }\n }\n }", "function ifLoggedIn(){\n\t\n\tif(isset($_SESSION[\"userinfo\"])){\n\t\t\n\t\t\n\t\tif($_SESSION[\"userinfo\"][\"role\"]==1){\n\t\t\tredirect(\"admin.php\");\n\t\t}\n\n\t\tif($_SESSION[\"userinfo\"][\"role\"]==2){\n\t\t\tredirect(\"member.php\");\n\t\t}\n\t\t\n\t}\n}", "function is_course_modifiable($course_id) {\n if (is_admins())\n return true;\n if (is_manager()) {\n // This is a manager. \n $courseTbl = new CourseTbl($course_id);\n if (!$courseTbl->Get())\n return false;\n if (!$courseTbl->detail['avail'])\n return false;\n global $login_uid;\n return ($courseTbl->detail['owner'] == $login_uid);\n }\n return false;\n}", "public function canEdit()\n {\n if(!Auth::check())\n {\n return false;\n }\n //If the user is active/logged in, return true so that we can display user's specific objects\n if(Auth::user()->id===$this->user_id)\n {\n return true;\n }\n //By default\n return false;\n }", "public function checkAccess() {\n // if the user is not allowed access to the ACL, then redirect him\n if (!$this->user->isAllowed(ACL_RESOURCE, ACL_PRIVILEGE)) {\n // @todo change redirect to login page\n $this->redirect('Denied:');\n }\n }", "function isAppLoggedIn(){\n\treturn isset($_SESSION['uid']) && isset($_SESSION['username']) && isset($_SESSION['loggedIn']) && ($_SESSION['loggedIn']===true);\n}", "public function getIsLoggedIn()\n {\n return !$this->getIsGuest();\n }", "protected function isAuthorizedFrontendSession() {}", "public function drupalIsLoggedIn()\n {\n // TODO: implement without the client/crawler\n }", "function userCanEditPage()\n\t{\n\t\t// use Yawp::authUsername() instead of $this->username because\n\t\t// we need to know if the user is authenticated or not.\n\t\treturn $this->acl->pageEdit(Yawp::authUsername(), $this->area, \n\t\t\t$this->page);\n\t}", "function isUsersAccessable($path)\n\t{\n\t\t$AllArray =array('user/index',\n\t\t\t\t\t\t'user/listing',\n\t\t\t\t\t\t'user/add',\n\t\t\t\t\t\t'user/edit',\n\t\t\t\t\t\t'project/index',\n\t\t\t\t\t\t'project/listing',\n\t\t\t\t\t\t'project/add',\n\t\t\t\t\t\t'project/edit',\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/add',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/add',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'customer/surveys',\n\t\t\t\t\t\t'customer/survey',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'results/index',\n\t\t\t\t\t\t'results/listing',\n\t\t\t\t\t\t'results/general',\n\t\t\t\t\t\t'results/single',\n\t\t\t\t\t\t'generador/index',\n\t\t\t\t\t\t'generador/publish'\n\t\t\t\t\t\t);\n\t\t$customerArray =array(\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'customer/surveys',\n\t\t\t\t\t\t'customer/survey',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'results/index',\n\t\t\t\t\t\t'results/listing',\n\t\t\t\t\t\t'results/general',\n\t\t\t\t\t\t'results/single',\n\t\t\t\t\t\t'generador/index',\n\t\t\t\t\t\t'generador/publish'\n\t\t\t\t\t\t);\n\t\t\n\t\tif($_SESSION[\"SESS_USER_ROLE\"] == \"administrador\")\n\t\t{\n// \t\t\tif(!in_array($path,$AllArray))\n// \t\t\t{\n// \t\t\t\t$this->wtRedirect($_SESSION[\"ROLE_PATH\"]); \n// \t\t\t}\n\t\t}\n\t\t\n\t\telseif($_SESSION[\"SESS_USER_ROLE\"] == \"cliente\" )\n\t\t{\n\t\t\t//SI no esta en el arreglo, se redirecciona a su path original Controller home\n\t\t\tif(!in_array($path,$customerArray))\n\t\t\t{\n\t\t\t\t$this->wtRedirect($_SESSION[\"ROLE_PATH\"]); \n\t\t\t}\n\t\t}\n\t}", "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 isAuthorized($user){\n $this->set('current_user', $this->Auth->user());\n\n if ($this->action === 'add' || $this->action === 'about') {\n return true;\n }\n \n if(in_array($this->action, array('edit', 'delete'))){\n if($this->request->params['pass'][0] == $user['id'] || $user['role'] === 'admin'){ \n return true;\n } \n }\n return parent::isAuthorized($user); //gives permission to the admin to access everything\n }", "function beforeFilter() {\n\t\t// only for snaphappi user login, not rpxnow\n\t\tparent::beforeFilter();\n\t\t/*\n\t\t *\tThese actions are allowed for all users\n\t\t */\n\t\t$this->Auth->allow(\n\t\t/*\n\t\t * main\n\t\t */\n\t\t'home', 'groups', 'discussion', 'trends', 'hiddenShots', 'substitutes', 'neighbors', 'search', \n\t\t/*\n\t\t * all\n\t\t */'index', 'all', 'most_active', 'most_views', 'most_recent', 'top_rated', \n\t\t/*\n\t\t * actions\n\t\t */'get_asset_info', 'shot',\n\t\t/*\n\t\t * experimental\n\t\t */\n\t\t 'stories', // TODO: move to ACL\n\t\t 'test', 'addACL', 'updateExif'\n\t\t);\n\t\tAppController::$writeOk = $this->Asset->hasPermission('write', AppController::$uuid);\n\t}", "private function renderIsLoggedIn() {\n if ($this->isLoggedIn) {\n return '<h2>Logged in</h2>';\n }\n else {\n return '<h2>Not logged in</h2>';\n }\n }", "public static function checkAccess($resourceId) {\n $auth = Yii::app()->authManager;\n if ( $auth->checkAccess($resourceId, Yii::app()->user->id) || User::isAdmin()) {\n return true;\n } \n return false;\n }", "function isLoggedAdmin(){\n return (isset($_SESSION['id']) \n && isset($_SESSION['login']) \n && isset($_SESSION['admin']) \n && $_SESSION['admin'] == true);\n}", "public function authorize()\n {\n\n return true;\n\n if ($this->route('self_report')) { // If ID we must be changing an existing record\n return Auth::user()->can('self_report update');\n } else { // If not we must be adding one\n return Auth::user()->can('self_report add');\n }\n\n }" ]
[ "0.6789557", "0.6789557", "0.6721296", "0.67202145", "0.6572017", "0.65710735", "0.6539391", "0.6513537", "0.6506057", "0.6506057", "0.64774925", "0.64721805", "0.63732624", "0.6345719", "0.6341831", "0.6336483", "0.631939", "0.6312657", "0.63074297", "0.6304597", "0.63012326", "0.6276492", "0.62760854", "0.6267422", "0.62671393", "0.6242948", "0.6238465", "0.6237872", "0.62281257", "0.62281257", "0.6222191", "0.62189126", "0.6214729", "0.6211207", "0.61812544", "0.6180863", "0.61796826", "0.6179117", "0.61766136", "0.6164494", "0.61597407", "0.6159682", "0.61507505", "0.61415493", "0.6140775", "0.6136541", "0.6116334", "0.6113836", "0.61083186", "0.6107158", "0.61000216", "0.6093412", "0.60825515", "0.6075273", "0.60608315", "0.6057742", "0.6056933", "0.60537106", "0.6050278", "0.6048526", "0.60485053", "0.60446393", "0.60376495", "0.6036627", "0.6034835", "0.60313666", "0.60304886", "0.60304886", "0.60304886", "0.60304886", "0.60304886", "0.60304886", "0.60304886", "0.60304886", "0.60304886", "0.6026317", "0.60241085", "0.6023324", "0.60158974", "0.6015781", "0.60136074", "0.6011363", "0.6010462", "0.600988", "0.5994873", "0.59927905", "0.5991384", "0.59813523", "0.59801096", "0.5975532", "0.59724545", "0.5971537", "0.596759", "0.5964728", "0.5964068", "0.59623", "0.59595263", "0.5957505", "0.59557015", "0.595484" ]
0.68913954
0
/ WAS WRITTEN BY A TEAMMATE getAdmin Verifies that someone trying to access the admin page has logged in. If that someone is not login it will route them to the login page
public function getAdmin() { $database = new Database(); $loggedIn = $database->getAdminByUsername($_SESSION['user']); $admin = new Admin($loggedIn['adminId'], $loggedIn['username'], $loggedIn['adminLevel'], $loggedIn['active']); if(isset($_SESSION['user']) === true) { $this->_f3->set('admin', $admin); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function requireAdmin(){\n if( ! Authentifiacation::isAdmin()){\n Authentifiacation::rememberRequestedPage();\n Flash::addMessage('You need to have admin status to access this page', Flash::INFO);\n self::redirect('/login/new');\n }\n }", "static function adminGateKeeper() {\n if (!loggedIn() || !adminLoggedIn()) {\n new SystemMessage(translate(\"system_message:not_allowed_to_view\"));\n forward(\"home\");\n }\n }", "public function AdminAuthCheck()\n {\n \t$admin_id=Session::get('admin_id');\n \tif($admin_id){\n \t\treturn;\n \t}else{\n \t\treturn Redirect::to('/admin')->send();\n \t}\n }", "public function checkAdmin(){\n $data = [\n 'emailError' => '',\n 'passwordError' => ''\n ];\n if(!isset($_SESSION['adminID'])){\n $this->view('admins/loginAdmin',$data);\n }\n }", "public function adminAuthentication()\n {\n /* Get logined user informations */\n $user = Auth::user();\n if ($user[\"role\"] === 2)\n {\n /* give a admin session */\n return true;\n } else {\n return abort('404');\n }\n }", "public static function requireAdmin()\n {\n if(!SessionHelper::isAdmin()){\n header('location: ' . (string)getenv('URL') . '/');\n }\n }", "function requireLogin($isAdmin=FALSE)\n\t {\n \t\tif($isAdmin){\n\t\t\tif(!$this->checkAdmin())\n\t\t\t{\n\t\t \t\tredirect(DM00_ROUTE, \"Location\");\n\t\t\t\tdie();\n\t\t \t}\n \t\t}\n \t\telse\n \t\t{\n \t\t\tif(!$this->checkLogin())\n \t\t\t{\n\t\t \t\tredirect(DM00_ROUTE, \"Location\");\n\t\t\t\tdie();\n\t\t \t}\n \t\t}\n\t }", "public static function adminLoggedIn(){\n //Hvis en bruker ikke er logget inn eller han ikke er admin, vil han bli sent til login.php\n if (!isset($_SESSION['user']) || !$_SESSION['user']->isAdmin()) {\n //Lagrer siden brukeren er på nå slik at han kan bli redirigert hit etter han har logget inn\n $alert = new Alert(Alert::ERROR, \"Du er nødt til å være administrator for å se den siden. Du er ikke administrator.\");\n $alert->displayOnIndex();\n\n }\n }", "public function checkLoginAdmin() {\n $this->login = User::loginAdmin();\n $type = UserType::read($this->login->get('idUserType'));\n if ($type->get('managesPermissions')!='1') {\n $permissionsCheck = array('listAdmin'=>'permissionListAdmin',\n 'insertView'=>'permissionInsert',\n 'insert'=>'permissionInsert',\n 'insertCheck'=>'permissionInsert',\n 'modifyView'=>'permissionModify',\n 'modifyViewNested'=>'permissionModify',\n 'modify'=>'permissionModify',\n 'multiple-activate'=>'permissionModify',\n 'sortSave'=>'permissionModify',\n 'delete'=>'permissionDelete',\n 'multiple-delete'=>'permissionDelete');\n $permissionCheck = $permissionsCheck[$this->action];\n $permission = Permission::readFirst(array('where'=>'objectName=\"'.$this->type.'\" AND idUserType=\"'.$type->id().'\" AND '.$permissionCheck.'=\"1\"'));\n if ($permission->id()=='') {\n if ($this->mode == 'ajax') {\n return __('permissionsDeny');\n } else { \n header('Location: '.url('NavigationAdmin/permissions', true));\n exit();\n }\n }\n }\n }", "function is_admin()\r\n{\r\n\tif (!isset($_SESSION['admin']))\r\n\t{\r\n\t\theader(\"Location:index.php?controller=user&action=login\");exit;\r\n\t}\r\n}", "function checkAdminLogin() \n{\n\tif(checkNotLogin())\n\t{\n\t\treturn false;\n\t}\n\t\n\t$user = $_SESSION['current_user'];\n\t\n\tif($user->isAdmin())\n\t{\n\t\treturn true;\n\t}\n\telse \n\t{\n\t\treturn false;\n\t}\n}", "function isAdmin() {\n //FIXME: This needs to (eventually) evaluate that the user is both logged in *and* has admin credentials.\n //Change to false to see nav and detail buttons auto-magically disappear.\n return true;\n}", "protected function isAdminUser() {}", "public static function adminPage(){\n\t\tif(!self::isAdmin()){\n\t\t\theader(\"Location: index.php\");\n\t\t\texit;\n\t\t}\n\t}", "public function checkAdmin()\n {\n // there ..... need\n // END Check\n $auth = false;\n if($auth) {\n return true;\n }\n else{\n return false;\n }\n }", "function is_admin()\n {\n //is a user logged in?\n\n //if so, check admin status\n\n //returns true/false\n\n }", "public function adminCheck()\n {\n self::$base_url = asset('/');\n $admin = Auth::user()['original'];\n self::$admin = array('name' => $admin['name']);\n\n if (Auth::check()) {\n $id_user = Auth::user()->id;\n $admin_secure = Admin::where('id',$id_user)->where('email', '=', $admin['email'])->where('password', '=', $admin['password'])->first();\n // He is User but not admin\n if ($admin_secure == null){\n return redirect('/customers');\n }\n }else{\n Session::put('user_type', 'admin');\n return redirect('/user/login');\n }\n return true;\n }", "protected function isCurrentUserAdmin() {}", "protected function isCurrentUserAdmin() {}", "public function admin()\n\t{\n\t\tif (Auth::user()) \n\t\t{\n\t\t\t$user = Auth::user();\n\n\t\t\tif ($user['user_type'] === 0)\n\t\t\t{\n\t\t\t\treturn view('pages.admin');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn redirect('home');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn view('auth.login');\n\t\t}\n\t}", "function check_admin() {\n\t\t// check session exists\n\t\tif(!$this->Session->check('Admin')) {\n\t\t\t$this->Session->setFlash(__('ERROR: You must be logged in for that action.', true));\n\t\t\t$this->redirect(array('controller'=>'contenders', 'action'=>'index', 'admin'=>false));\n\t\t}\n\t}", "public function checkAuthentication() \n {\n if(!isset($this->userInfo['admin_id']) && empty($this->userInfo['admin_id'])) \n {\n redirect('login/loginPage');\n }\n }", "function check_if_admin_logged(){\n\t\tglobal $url_home;\n\t\tglobal $current;\n\t\tif(!isset($_SESSION['admin']) && $current != \"login.php\") header('Location: '.$url_home.'admin/login.php');\n\t\telse if(isset($_SESSION['admin']) && $current == \"login.php\") header('Location: '.$url_home.'admin');\n\t}", "public function adminLogin(){\n if(Auth::check()){\n $user = User::find(Auth::user()->id);\n if(empty($user) || $user->user_level == $this->customer_level)\n return view('admin.layout.login');\n return redirect()->route('index');\n }\n return view('admin.layout.login');\n }", "function is_admin_login()\r\n\t{\r\n\t\tif (!isset ($_SESSION[Seb_Adm_UsErId]))\r\n\t\t{\r\n\t\t\tprint '<script language=\"javascript\">window.location.href=\"index.php\"</script>';\r\n\t\t}\r\n\t}", "function Admin_authetic(){\n\t\t\t\n\t\tif(!$_SESSION['adminid']) {\n\t\t\t$this->redirectUrl(\"login.php\");\n\t\t}\n\t}", "public function testLoginWithAdminRedirect()\n {\n $this->visit('/admin')\n ->seePageIs('/auth/login')\n ->see('Login')\n ->type('[email protected]', 'email')\n ->type('password', 'password')\n ->press('Login')\n ->seePageIs('/admin');\n\n }", "public function AfterAdminloginCheck(){\n\t\t\tif(!isset($_SESSION['admin_loggedin']) && $_SESSION['admin_loggedin']==0){\n\t\t\t\t header(\"Location:\".SITEURL.\"app/admin/logout\");\n\t\t\t\t exit();\n\t\t\t}\n\t }", "function isAdmin() {\n\tif (!isLoggedIn()) {\n\t\tredirectTo(\"index.php\");\n\t} else if($_SESSION[\"type\"] != \"executive\") {\n\t\tredirectTo(\"myhome.php\");\n\t} \n\treturn true;\n}", "protected function isAdmin()\n {\n if($_SESSION['statut'] !== 'admin')\n {\n header('Location: index.php?route=front.connectionRegister&access=adminDenied');\n exit;\n }\n }", "public function Checklogin()\n\t{\n\t\tif ($this->session->userdata('admin_admin_email') == '')\n\t\t{\n\t\t\tredirect('admin');\n\t\t}\n\t\n\t}", "public function Checklogin()\n\t{\n\t\tif ($this->session->userdata('admin_admin_email') == '')\n\t\t{\n\t\t\tredirect('admin');\n\t\t}\n\t\n\t}", "private function checkAdmin()\n {\n $admin = false;\n if (isset($_SESSION['admin'])) {\n F::set('admin', 1);\n $admin = true;\n }\n F::view()->assign(array('admin' => $admin));\n }", "public function BeforeAdminloginCheck(){\n\t\t\t$email=isset($_SESSION['email']) ? $_SESSION['email'] : '';\n\t\t\t$token=isset($_SESSION['admintoken']) ? $_SESSION['admintoken'] : '';\n\t\t\t$checkvalid=$this->CheckValidToken($token);\n\t\t\t$check=$this->db->prepare(\"SELECT email,user_type FROM admin_users WHERE email=:email AND status=1\");\n\t\t\t$check->execute(array(\"email\"=>$email));\n\t\t\t$rowchk=$check->fetch(PDO::FETCH_ASSOC);\n\t\t\t$admin_loggedin=isset($_SESSION['admin_loggedin']) ? $_SESSION['admin_loggedin'] : '';\n\n\t\t\tif($admin_loggedin == 1 && isset($admin_loggedin) && $checkvalid['status']==1 ){\n\t\t\t\theader(\"Location:\".SITEURL.\"app/admin/dashboard\");\n\t\t\t\texit();\n\t\t\t}\n\t }", "function check_admin()\n{\n global $app;\n\n if (!is_admin()) {\n $app->render('error.html', [\n 'page' => mkPage(getMessageString('error'), 0, 0),\n 'error' => getMessageString('error_no_access')]);\n }\n}", "protected function _login_admin()\n\t{\n\t\tif ( $this->auth->logged_in('login') AND $this->auth->get_user()->has_permission('admin_ui'))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "public function checkAdmin();", "function requireAdminLogin($specific_permission_required = \"\"){\n if($this->requireLogin()){\n if(!isset($_SESSION['_admin'])){ //user not staff, send them to home\n $_SESSION['statusCode'] = 1038;\n session_write_close();\n header(\"Location: ../index\");\n }\n else if(!empty($specific_permission_required))\n {\n if(!($_SESSION['_admin'][$specific_permission_required])){ //user is staff, but not with that token\n $_SESSION['statusCode'] = 1039;\n session_write_close();\n header(\"Location: ../index\");\n }\n }\n }\n else\n {\n return 0;\n }\n }", "public static function check_admin () {\n if (! Person::user_is_admin()) {\n View::make('main/error.html');\n }\n }", "function adminCheck($adminPW) {\n\t\t\t// if yes redirect admin to the admin page\n\t\t\tif ($_POST['password'] == $adminPW) {\n\t\t\t\theader('Location: admin.php'); \n\t\t\t} else {\n\t\t\t\t$submitErr = \"Invailed login.\";\n\t\t\t}\n\t\t}", "public function showAdmin() {\n\n\t\tif(!isset($_SESSION)) \n\t\t{ \n\t\t\tsession_start(); \n\t\t} \n\t\tif(isset($_SESSION['nickname']))\n\t\t{\n\n\t\t\t$user_manager = new UserManager();\n\t\t\t$session_user = $user_manager->get($_SESSION['nickname']);\n\t\t\t$session_user_role = $session_user->role();\n\t\t\t// You're an admin\n\t\t\tif ($session_user_role === 'admin') {\n\n\t\t\t\t$comments = array();\n\n\t\t\t\t$comment_manager = new CommentManager();\n\t\t\t\t$post_manager = new PostManager();\n\n\t\t\t\t$posts = $post_manager->getList();\n\t\t\t\t$users = $user_manager->getList();\n\n\t\t\t\t$myView = new View('admin');\n\t\t\t\t$myView->render(array(\n\n\t\t\t\t\t'posts' \t\t\t=> $posts, \n\t\t\t\t\t'post_manager' \t\t=> $post_manager, \n\t\t\t\t\t'comment_manager' \t=> $comment_manager,\n\t\t\t\t\t'users'\t\t\t\t=> $users,\n\t\t\t\t\t'comments'\t\t\t=> $comments,\n\t\t\t\t));\n\t\t\t}else { // You're not an admin\n\t\t\t\t\t\techo \"PAS ADMINISTRATEUR\";\n\t\t\t\theader('Location: '.HOST.'home.html');\n\t\t\t}\n\n\t\t}else { // You're not connected\n\t\t\theader('Location: '.HOST.'home.html');\n\t\t}\n\t}", "public static function sessionAndAdminLoggedIn(){\n Verify::session();\n Verify::adminLoggedIn();\n }", "function checkadminlogin() {\n\t\tConfigure::write('debug', 0);\n\t\t$this->autoRender = false;\n\t\t\n\t\tif ($this->RequestHandler->isAjax()) {\n\t\t\t$username = $this->data['Member']['username'];\n\t\t\t$password = $this->data['Member']['pwd'];\n\t\t\t\n\t\t\t\n\t\t\t$user = $this->Member->find('count', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'Member.email' => $username,\n\t\t\t\t\t'Member.pwd' => md5($password),\n\t\t\t\t\t'Member.active' => '1'\n\t\t\t\t)\n\t\t\t));\n\t\t\t\n\t\t\t\n\t\t\tif ($user) {\n\t\t\t\t$getAdminData = $this->Member->find('first', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'Member.email' => $username,\n\t\t\t\t\t\t'Member.pwd' => md5($password),\n\t\t\t\t\t\t'Member.active' => '1'\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t\t\n\t\t\t\tif (!empty($getAdminData)) {\n\t\t\t\t\t$this->Session->write('Admin.email', $getAdminData['Member']['email']);\n\t\t\t\t\t$this->Session->write('Admin.id', $getAdminData['Member']['id']);\n\t\t\t\t\t$this->Session->write('Admin.loginStatus', $getAdminData['Member']['login_status']);\n\t\t\t\t\t$this->Session->write('Admin.group_id', $getAdminData['Member']['group_id']);\n\t\t\t\t\t$this->Session->write('Admin.school_id', $getAdminData['Member']['school_id']);\n\t\t\t\t\t\n\t\t\t\t\techo \"authorized\";\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//echo $html->link('Forgot Password ?',array('controller'=>'Users','action'=>'requestPassword'));\n\t\t\t\techo \"Username and/or Password not matched !\";\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "function adminLogin()\n{\n\tglobal $twig; \n\t$navTop = true; \n\t$navBottomAdmin=true;\n\n\t# checkif the user is already authenticated.\n\t# If so display the list of faults instead of the login screen\n\t/*if(isset($_SESSION['isLoggedIn']))\n\t{\n\t\theader('Location: ./adminSelectRegion');\n\t\texit;\n\t}*/\n\n clearUserSession();\n\n\t# otherwise the user is presented with the login form\n\t$args_array=array(\n\t\t'navTop' => $navTop,\n\t\t'navBottomAdmin' => $navBottomAdmin,\n\t);\n\t\n\t$template='adminLogin';\n\techo $twig->render($template.'.html.twig',$args_array);\n}", "function admin_index()\n {\n if(!$this->Session->check('Admin'))\n {\n $this->redirect('/admin/login');\n }\n\n\n }", "public static function authAdmin() {\n if (Yii::$app->user->can(\"administrator\") || Yii::$app->user->can(\"adminsite\")) {\n return TRUE; //admin ใหญ่\n }\n }", "private function checkLogin() {\n\t\t\n\t\tif ( ! $this->user_model->isLoggedIn() )\n\t\t\tredirect( base_url() . 'admin' );\n\n\t}", "public function index()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url() . 'login', 'refresh');\n }", "function restrictedToAdmin(\n $redirectPage\n) {\n restrictedToAuthorized($redirectPage);\n $authUser = Authorizer::getAuthorizedUser();\n if ($authUser == null || ! $authUser->isAdmin()) {\n header(\"Location: \" . $redirectPage);\n exit();\n }\n}", "function checkAdmin()\n\t {\n\t \tif(!$this->checkLogin())\n\t \t{\n\t \t\treturn FALSE;\n\t \t}\n\t \treturn TRUE;\n\t }", "function redirect_invalid_admin() {\r\n\t// Check if the person is not the admin\r\n\r\n\t$destination = 'login.php?err=1';\r\n\t$current_page_URL =(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://';\r\n\t$current_page_URL .= $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];\r\n\t//check if the $_SESSION client_type is set\r\n\tif (!((isset($_SESSION['name'])) && ($_SESSION['name'] != \"\"))){\r\n\t\t$url = BASE_URL.$destination.'&continue='.$current_page_URL; // Define the URL.\r\n\t\theader(\"Location: $url\");\r\n\t\texit(); // Quit the script.\r\n\t}\r\n\r\n}", "function _is_admin_or_return($configuration){\n $lc = new Login($configuration);\n if(!$lc->isLoggedIn($configuration->admin_user_role_id)){\n echo json_encode(Status::errorStatus(\"not sufficient permissions\"));\n exit;\n }\n }", "function is_user_admin()\n {\n }", "public function isAdmin(){\n $user = Auth::guard('web') -> user();\n if ($user -> state != 1) {\n return 0;\n }\n else {\n return 1;\n }\n }", "function checkadminlogin() {\n\t\tConfigure::write('debug', 0);\n\t\t$this->autoRender = false;\n\t\t$this->layout = \"\";\n\t\t\n\t\tif ($this->RequestHandler->isAjax()) {\n\t\t\t$username = $this->data['Member']['username'];\n\t\t\t$password = $this->data['Member']['pwd'];\n\t\t\t\n\t\t\t\n\t\t\t$groupId = array('1','2','3','4','5');\n\t\t\t\n\t\t\t\n\t\t\t$user = $this->Member->find('count', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'Member.email' => $username,\n\t\t\t\t\t'Member.pwd' => md5($password),\n\t\t\t\t\t'Member.active' => '1',\n\t\t\t\t\t'Member.group_id' => $groupId,\n\t\t\t\t)\n\t\t\t));\n\t\t\t\n\t\t\t\n\t\t\tif ($user) {\n\t\t\t\t$getAdminData = $this->Member->find('first', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'Member.email' => $username,\n\t\t\t\t\t\t'Member.pwd' => md5($password),\n\t\t\t\t\t\t'Member.active' => '1',\n\t\t\t\t\t\t'Member.group_id' => $groupId,\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t\t\n\t\t\t\tif (!empty($getAdminData)) {\n\t\t\t\t\t$this->Session->write('Admin.email', $getAdminData['Member']['email']);\n\t\t\t\t\t$this->Session->write('Admin.id', $getAdminData['Member']['id']);\n\t\t\t\t\t$this->Session->write('Admin.loginStatus', $getAdminData['Member']['login_status']);\n\t\t\t\t\t$this->Session->write('Admin.group_id', $getAdminData['Member']['group_id']);\n\t\t\t\t\t$this->Session->write('Admin.school_id', $getAdminData['Member']['school_id']);\n\t\t\t\t\t\n\t\t\t\t\techo \"authorized\";\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//echo $html->link('Forgot Password ?',array('controller'=>'Users','action'=>'requestPassword'));\n\t\t\t\techo \"Username and/or Password not matched !\";\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "function auth_check()\n {\n $ci =& get_instance();\n if(!$ci->session->has_userdata('is_admin_login'))\n {\n redirect('admin/auth/login', 'refresh');\n }\n }", "function auth_check()\n {\n $ci =& get_instance();\n if(!$ci->session->has_userdata('is_admin_login'))\n {\n redirect('admin/auth/login', 'refresh');\n }\n }", "public function isAdmin();", "public function isAdmin() {}", "function admin_check($redirect = \"index.php\")\n\t{\n\t\t// makes sure they are logged in:\n\t\trequire_login($redirect);\n\t\t\n\t\t// makes sure they are admin\n\t\t$sql = sprintf(\"SELECT admin FROM users WHERE uid=%d\", \n\t\t$_SESSION[\"uid\"]);\n\t\t\n\t\t// apologize if they are not.\n\t\t$admin = mysql_fetch_row(mysql_query($sql));\n\t\tif ($admin[0] == 0)\n\t\t\tapologize(\"You do not have administrator priveleges\");\n\t}", "public function AuthLogin()\n {\n $admin_id = Session::get('admin_id');\n if ($admin_id) {\n return Redirect()->route('admin_dashboard');\n }else{\n return Redirect()->route('admin_login')->send();\n }\n }", "function user_can_access_admin_page()\n {\n }", "function checkPermissionAdmin() \n\t{\n\t \n\t if(!isset($_SESSION['admin']['id']))\n\t {\n $this->Session->setFlash('Please sign in to view this page.');\n \t//$this->flash(__('Session Expired!!', true), array('controller'=>'admins','action'=>'adminLogin'));\n\t\t $this->redirect(array('controller'=>'admins','action'=>'login'), null, true);\n\t }\n\t}", "public function Checklogin()\n\t{\n\t\tif ($this->session->userdata('admin_email') == '')\n\t\t{\n\t\t\tredirect('head/');\n\t\t}\n\t\n\t}", "public function Checklogin()\n\t{\n\t\tif ($this->session->userdata('admin_email') == '')\n\t\t{\n\t\t\tredirect('head/');\n\t\t}\n\t\n\t}", "function is_adminlogin()\r\n{\r\n $ci = & get_instance();\r\n if (!$ci->session->userdata('admin_ID') && !$ci->session->userdata('admin_username')\r\n && !$ci->session->userdata('user_jabid') && $ci->uri->segment(2) != 'login') :\r\n redirect('backend/login');\r\n elseif ($ci->session->userdata('user_id') && $ci->session->userdata('user_nama')\r\n && $ci->session->userdata('user_jabid') && $ci->uri->segment(2) == 'login') :\r\n\t\tredirect('backend');\r\n endif;\r\n}", "public function mustbeadmin()\n {\n if (!$this->hasadmin())\n {\n $this->web()->noaccess();\n }\n }", "public function isLoginAdmin()\n\t{\n\t\treturn (Bn::getValue('loginAuth') == 'A');\n\t}", "public function checkAdmin() {\n if (self::redirectIfNotLoggedIn()) {\n return TRUE;\n }\n\n if (!LoggedInUserDetails::isCrew() && !LoggedInUserDetails::hasFullRights()) {\n if (\\Drupal::moduleHandler()->moduleExists('iish_conference_login_logout')) {\n $link = Link::fromTextAndUrl(\n iish_t('log out and login'),\n Url::fromRoute(\n 'iish_conference_login_logout.login_form',\n array(),\n array('query' => \\Drupal::destination()->getAsArray())\n )\n );\n\n drupal_set_message(new ConferenceHTML(\n iish_t('Access denied.') . '<br>' .\n iish_t('Current user ( @user ) is not a conference crew member.',\n array('@user' => LoggedInUserDetails::getUser())) . '<br>' .\n iish_t('Please @login as a crew member.',\n array('@login' => $link->toString())), TRUE\n ), 'error');\n }\n else {\n drupal_set_message(iish_t('Access denied.') . '<br>' .\n iish_t('Current user ( @user ) is not a conference crew member.',\n array('@user' => LoggedInUserDetails::getUser())), 'error');\n }\n\n return TRUE;\n }\n\n return FALSE;\n }", "function checkPermissionAdmin() {\n\t\tif ($_SESSION['log_admin']!=='1'){\n\t\t\theader('Location: start.php');\n\t\t\tdie();\n\t\t}\n\t}", "public function index() {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url() . 'index.php?login', 'refresh');\n if ($this->session->userdata('admin_login') == 1)\n redirect(base_url() . 'index.php?admin/dashboard', 'refresh');\n }", "public function index() {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url() . 'index.php?login', 'refresh');\n if ($this->session->userdata('admin_login') == 1)\n redirect(base_url() . 'index.php?admin/dashboard', 'refresh');\n }", "public function index() {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url() . 'index.php?login', 'refresh');\n if ($this->session->userdata('admin_login') == 1)\n redirect(base_url() . 'index.php?admin/dashboard', 'refresh');\n }", "function admin()\n{\n # clear the user session by default upon reaching this page\n clearUserSession();\n\n header('Location: ./adminLogin');\n exit;\n}", "function authorizedAdminOnly(){\n global $authenticatedUser;\n if(!$authenticatedUser['admin']){\n header(\"HTTP/1.1 403 Forbidden\");\n header(\"Location: https://eso.vse.cz/~frim00/marvelous-movies/error-403\");\n exit();\n }\n }", "function is_admin()\n{\n global $app;\n if (is_authenticated()) {\n $user = $app->auth->getUserData();\n return ($user['role'] === '1');\n } else {\n return false;\n }\n}", "public function loginAsAdmin()\n {\n $I = $this;\n $I->amOnPage('/admin');\n $I->see('Sign In');\n $I->fillField('email', '[email protected]');\n $I->fillField('password', 'admin123');\n $I->dontSee('The \"Email\" field is required.');\n $I->dontSee('The \"Password\" field is required.');\n $I->click('Sign In');\n $I->see('Dashboard', '//h1');\n }", "function isLogin() {\n if (isset(Yii::app()->session['adminUser'])) {\n return true;\n } else {\n Yii::app()->user->setFlash(\"error\", \"Username or password required\");\n header(\"Location: \" . Yii::app()->params->base_path . \"admin\");\n exit;\n }\n }", "function admin()\n{\n global $app;\n\n $app->render('admin.html', [\n 'page' => mkPage(getMessageString('admin'), 0, 1),\n 'isadmin' => is_admin()]);\n}", "function CheckAdminAsView($view, $context, $req, $res){\n if(isset($_SESSION['user'])){\n if($_SESSION['user']['Rol'] == 1){\n $res->render($view, $context);\n }\n else\n {\n echo \"Error, no administrator rol\";\n }\n }\n else\n {\n echo \"User not logged\";\n }\n}", "public function checkLogin()\n {\n if (!Auth::check())\n {\n return redirect()->route('admin_login');\n }\n }", "public function index()\n {\n if(!Session::has('admin_id'))\n return view('admin.login');\n else\n return redirect()->route('admin_home');\n }", "function isLoggedAdmin(){\n return (isset($_SESSION['id']) \n && isset($_SESSION['login']) \n && isset($_SESSION['admin']) \n && $_SESSION['admin'] == true);\n}", "public function index()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url() . 'index.php?login', 'refresh');\n if ($this->session->userdata('admin_login') == 1)\n redirect(base_url() . 'index.php?admin/dashboard', 'refresh');\n }", "function is_admin_logged_in()\n{\n global $current_user;\n return ($current_user != NULL && $current_user['un'] == 'admin');\n}", "public function index() {\n if ($this->session->userdata('adminLogged') != 'yes') {\n redirect(SITE_ADMIN_URL.'index_admin/index');\n } else {\n redirect(SITE_ADMIN_URL.'index_admin/index');\n }\n }", "function getLoggedAdmin(){\n // if not, it returns FALSE\n // if logged, it returns the user id\n\n $adminConfig = config('adminConfig');\n\n if($_SESSION['adminUsername']!=''){\n return $_SESSION['adminUsername'];\n }elseif($_SESSION['memberID']==$adminConfig['adminUsername']){\n $_SESSION['adminUsername']=$_SESSION['memberID'];\n return $_SESSION['adminUsername'];\n }else{\n return FALSE;\n }\n}", "function adminLogin()\n {\n require('view/frontend/adminLoginView.php');\n }", "public function index() {\n if (Auth::check()) {\n return view('admin');\n } else {\n return view('login');\n }\n }", "private function isAdmin() {\n\t\tif (Auth::user()->user == 1) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}", "public function isAdmin()\n {\n }", "public function index() {\n\n\n if ($this->session->userdata('admin_login') == 1)\n $this->dashboard();\n\n if ($this->session->userdata('admin_login') != 1)\n $this->load->view('login');\n }", "public function admin()\n {\n if (Auth::check()) {\n return view('admin');\n } else {\n return redirect('/');\n }\n }", "public function login_page()\n\t{\n\t\t$this->redirect( EagleAdminRoute::get_login_route() );\n\t}", "function admin()\n\t{\t\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\t\t\n\t\t} else {\t\n\t\t$this->form_validation->set_rules('login_admin', 'Login', 'trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('h-password_admin', 'Password', 'trim|required|xss_clean');\t\t\n\t\t/*if ($this->config->item('login_count_attempts', 'tank_auth') AND\n\t\t\t\t($login = $this->input->post('login_admin'))) {\n\t\t\t$login = $this->security->xss_clean($login);\n\t\t} else {*/\n\t\t\t$login = '';\n\t\t//}\n\t\t// Get login for counting attempts to login\n\t\t$data['use_recaptcha'] = $this->config->item('use_recaptcha', 'tank_auth');\n\t\t/*if ($this->tank_auth->is_max_login_attempts_exceeded($login)) {\n\t\t\tif ($data['use_recaptcha'])\n\t\t\t\t$this->form_validation->set_rules('recaptcha_response_field', 'Confirmation Code', 'trim|xss_clean|required|callback__check_recaptcha');\n\t\t\telse\n\t\t\t\t$this->form_validation->set_rules('captcha', 'Confirmation Code', 'trim|xss_clean|required|callback__check_captcha');\n\t\t}*/\n\t\t$data['errors'] = array();\n\t\n\t\tif ($this->form_validation->run()) {\t\t\t\t\t\t\t\t// validation ok\t\n\t\t\n\t\t\tif ($this->tank_auth->login_admin(\n\t\t\t\t\t$this->form_validation->set_value('login_admin'),\n\t\t\t\t\t$this->form_validation->set_value('h-password_admin')\t\t\t\t\t\n\t\t\t\t\t)) {\t\t// success\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tif($this->form_validation->set_value('login_admin') == \"admin\") {\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tredirect('/admin/main');\n\t\t\t\t} elseif($this->form_validation->set_value('login_admin') == \"service\") {\n\t\t\t\t\tredirect('admin/main_service');\n\t\t\t\t} elseif($this->form_validation->set_value('login_admin') == \"number\") {\n\t\t\t\t\tredirect('admin/main_number');\n\t\t\t\t} elseif($this->form_validation->set_value('login_admin') == \"report\") {\n\t\t\t\t\tredirect('admin/main_report');\n\t\t\t\t} elseif($this->form_validation->set_value('login_admin') == \"enkhamgalan\") {\n\t\t\t\t\tredirect('admin/main_sms');\n\t\t\t\t} elseif($this->form_validation->set_value('login_admin') == \"polls\") {\n\t\t\t\t\tredirect('admin/main_poll');\n\t\t\t\t}\n\t\t\t\tredirect('admin/main');\t\n\t\t\t} else {\n\t\t\t\t$errors = $this->tank_auth->get_error_message();\n\t\t\t\tforeach ($errors as $k => $v)\t$data['errors'][$k] = $this->lang->line($v);\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t$data['show_captcha'] = FALSE;\n\t\t/*if ($this->tank_auth->is_max_login_attempts_exceeded($login)) {\n\t\t\t$data['show_captcha'] = TRUE;\n\t\t\tif ($data['use_recaptcha']) {\n\t\t\t\t$data['recaptcha_html'] = $this->_create_recaptcha();\n\t\t\t} else {\n\t\t\t\t$data['captcha_html'] = $this->_create_captcha();\n\t\t\t}\n\t\t}*/\n\t\t$data['title'] = \"Админ хэсгийн удирдлага\";\n\t\t\n\t\t$this->load->view('admin/admin_branch', $data);\t\t\n\t\t}\n\t}", "public function adminPanel()\n {\n $userManager = new UserManager;\n $infoUser = $userManager->getInfo($_SESSION['id_user']);\n if ($_SESSION['id_user'] == $infoUser['id'] and $infoUser['rank_id'] == 1) {\n $postManager = new PostManager;\n $commentManager = new CommentManager;\n $findPost = $postManager->getPosts();\n $commentReport = $commentManager->getReport();\n $unpublished = $commentManager->getUnpublished();\n require('Views/Backend/panelAdminView.php');\n } else {\n throw new Exception('Vous n\\'êtes pas autorisé à faire cela');\n }\n }", "public function login(){\n\t\tif(Session::get('admin_user_id'))\n\t\t\treturn redirect('/admin');\n\t\telse\n\t\t\treturn view('admin.login');\n\t}", "function specialRedirect()\r\n { \r\n if \r\n (\r\n (!loggedin()) ||\r\n (!empty(GLOBALS[\"admin\"]) && !admin())\r\n )\r\n {\r\n header(\"Location: /home.php\");\r\n exit();\r\n }\r\n }", "public function _make_sure_admin_is_connected() {\n if(!$this->_is_admin_connected()){\n \n if($this->uri->uri_string() != \"autorisation-necessaire\"){\n $this->session->set_userdata('REDIRECT', $this->uri->uri_string());\n }\n redirect(base_url().'admin/identification');\n\t\t\tdie();\n }\n }", "public function index()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url() . 'login', 'refresh');\n if ($this->session->userdata('admin_login') == 1)\n redirect(base_url() . 'admin/question_list', 'refresh');\n \n \n }", "public function index()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(site_url('login'), 'refresh');\n if ($this->session->userdata('admin_login') == 1)\n redirect(site_url('admin/dashboard'), 'refresh');\n }" ]
[ "0.8054244", "0.7777837", "0.75882095", "0.7552186", "0.75491756", "0.74565184", "0.74287605", "0.7409076", "0.73957515", "0.7315286", "0.7308447", "0.73029226", "0.7275708", "0.7266576", "0.725833", "0.72552234", "0.72370064", "0.72073543", "0.72037816", "0.71794915", "0.7179352", "0.7176412", "0.7172578", "0.7169039", "0.71624327", "0.7157937", "0.7122041", "0.7105344", "0.70969796", "0.7080205", "0.7080063", "0.7080063", "0.7059277", "0.7051263", "0.70506155", "0.70500475", "0.7045929", "0.7017735", "0.70025444", "0.7002213", "0.69996864", "0.6992132", "0.69906217", "0.69860625", "0.6973987", "0.6954423", "0.69439006", "0.6935984", "0.6926042", "0.692182", "0.6919927", "0.6917387", "0.6905625", "0.6898209", "0.68943024", "0.6884917", "0.6884917", "0.68828666", "0.6874655", "0.68724763", "0.6858637", "0.6857264", "0.6850865", "0.68355185", "0.68355185", "0.6831905", "0.6815404", "0.68147546", "0.6813446", "0.6803415", "0.68014646", "0.6800333", "0.6800333", "0.6793558", "0.67897797", "0.67893595", "0.67719465", "0.6755274", "0.67537093", "0.6745821", "0.67422473", "0.6739524", "0.6738545", "0.6734152", "0.673364", "0.67306185", "0.67291147", "0.6727131", "0.67158985", "0.6713218", "0.6709741", "0.67076916", "0.670672", "0.67006075", "0.66996604", "0.6699293", "0.6698445", "0.6696346", "0.66918343", "0.6689866", "0.6685622" ]
0.0
-1
Handle an incoming request.
public function handle($request, Closure $next) { $token = JWTAuth::getToken(); if(! $token){ return response()->json('token_not_provided'); } try{ $user = JWTAuth::toUser($token); if($user){ return $next($request); } return response()->json("user_not_found"); } catch (TokenInvalidException $e) { return response()->json("token_invalid"); } catch (TokenExpiredException $e) { return response()->json("token_expired"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function handle_request();", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "protected abstract function handleRequest();", "abstract public function handleRequest($request);", "abstract public function handleRequest(Request $request);", "public function handle($request);", "public function handleRequest() {}", "function handleRequest() ;", "public function handle(Request $request);", "protected function handle(Request $request) {}", "public function handle(array $request);", "public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }", "public function handleRequest() {\n // Make sure the action parameter exists\n $this->requireParam('action');\n\n // Call the correct handler based on the action\n switch($this->requestBody['action']) {\n\n case 'checkoutLocker':\n $this->handleCheckoutLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'remindLocker':\n $this->handleRemindLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'returnLocker':\n $this->handleReturnLocker();\n\t\t\t\tbreak;\n\n default:\n $this->respond(new Response(Response::BAD_REQUEST, 'Invalid action on Locker resource'));\n }\n }", "abstract protected function process(Request $request);", "public function handleRequest($request)\n {\n list ($route, $params) = $request->resolve();\n $this->requestedRoute = $route;\n $result = $this->runAction($route, $params);\n\n if ($result instanceof Response) {\n return $result;\n } elseif ($result instanceof Looper){\n $result->loop();\n\n $response = $this->getResponse();\n $response->exitStatus = 0;\n\n return $response;\n } else {\n $response = $this->getResponse();\n $response->exitStatus = $result;\n\n return $response;\n }\n }", "abstract function handle(Request $request, $parameters);", "protected function handle_request() {\r\n global $wp;\r\n $film_query = $wp->query_vars['films'];\r\n \r\n if (!$film_query) { // send all films\r\n $raw_data = $this->get_all_films();\r\n }\r\n else if ($film_query == \"featured\") { // send featured films\r\n $raw_data = $this->get_featured_films();\r\n }\r\n else if (is_numeric($film_query)) { // send film of id\r\n $raw_data = $this->get_film_by_id($film_query);\r\n }\r\n else { // input error\r\n $this->send_response('Bad Input');\r\n }\r\n\r\n $all_data = $this->get_acf_data($raw_data);\r\n $this->send_response('200 OK', $all_data);\r\n }", "public function handle(ServerRequestInterface $request);", "public function handleRequest()\n {\n $route = $this->router->match();\n\n if ($route) {\n $controllerName = $route['target']['controllerName'];\n $methodName = $route['target']['methodName'];\n\n $controller = new $controllerName();\n\n $controller->$methodName($route['params']);\n } else {\n header(\"HTTP:1.0 404 not Found\");\n echo json_encode([\n \"error_code\" => 404,\n \"reason\" => \"page not found\"\n ]);\n }\n }", "function handle(Request $request = null, Response $response = null);", "public function processRequest();", "public abstract function processRequest();", "public function handleRequest(Request $request, Response $response);", "abstract public function processRequest();", "public function handle(array $request = []);", "public function handleRequest()\n {\n $router = new Router();\n $controllerClass = $router->resolve()->getController();\n $controllerAction = $router->getAction();\n\n \n\n if(!class_exists($controllerClass)\n || !method_exists($controllerClass,$controllerAction)\n ){\n header('Not found', true, 404);\n exit;\n }\n\n $controller = new $controllerClass();\n call_user_func([$controller, $controllerAction]);\n\n }", "public function handle(Request $request)\n {\n if ($request->header('X-GitHub-Event') === 'push') {\n return $this->handlePush($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'pull_request') {\n return $this->handlePullRequest($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'ping') {\n return $this->handlePing();\n }\n\n return $this->handleOther();\n }", "protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }", "public function processRequest() {\n $action = \"\";\n //retrieve action from client.\n if (filter_has_var(INPUT_GET, 'action')) {\n $action = filter_input(INPUT_GET, 'action');\n }\n\n switch ($action) {\n case 'login':\n $this->login(); \n break;\n case 'register':\n $this->register(); //list all articles\n break;\n case 'search':\n $this->search(); //show a form for an article\n break;\n case 'searchList':\n $this->searchList();\n break;\n case 'remove':\n $this->removeArticle();\n break;\n case 'modify':\n $this->modifyArticle();\n break;\n case 'listCategoryForm':\n $this->listCategoryForm();\n break;\n case 'listCategory':\n $this->listCategory();\n break;\n default :\n break;\n }\n }", "public static function handleRequest($request)\r\n {\r\n // Load controller for requested resource\r\n $controllerName = ucfirst($request->getRessourcePath()) . 'Controller';\r\n\r\n if (class_exists($controllerName))\r\n {\r\n $controller = new $controllerName();\r\n\r\n // Get requested action within controller\r\n $actionName = strtolower($request->getHTTPVerb()) . 'Action';\r\n\r\n if (method_exists($controller, $actionName))\r\n {\r\n // Do the action!\r\n $result = $controller->$actionName($request);\r\n\r\n // Send REST response to client\r\n $outputHandlerName = ucfirst($request->getFormat()) . 'OutputHandler';\r\n\r\n if (class_exists($outputHandlerName))\r\n {\r\n $outputHandler = new $outputHandlerName();\r\n $outputHandler->render($result);\r\n }\r\n }\r\n }\r\n }", "public function process(Request $request, Response $response, RequestHandlerInterface $handler);", "public function handle(Request $request)\n {\n $handler = $this->router->match($request);\n if (!$handler) {\n echo \"Could not find your resource!\\n\";\n return;\n }\n\n return $handler();\n }", "public function handleRequest() {\n\t\t\n\t\tif (is_null($this->itemObj)) {\n\t\t\t$this->itemObj = MovieServices::getVcdByID($this->getParam('vcd_id'));\n\t\t}\n\t\t\n\t\t$action = $this->getParam('action');\n\t\t\n\t\tswitch ($action) {\n\t\t\tcase 'upload':\n\t\t\t\t$this->uploadImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fetch':\n\t\t\t\t$this->fetchImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\tredirect();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function handle(Request $request): Response;", "public static function process_http_request()\n {\n }", "public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }", "abstract public function handle(ServerRequestInterface $request): ResponseInterface;", "public function processRequest()\n\t\t{\n\t\t\t$request_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t\tswitch ($request_method)\n\t\t\t{\n\t\t\t\tcase 'get':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request_parts = explode('/', $data);\n\t\t\t$controller = $request_parts[0];\n\t\t\tswitch ($controller)\n\t\t\t{\n\t\t\t\tcase 'ad':\n\t\t\t\t\tprocessAdRequest(substr($data, strlen('ad')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'category':\n\t\t\t\t\tprocessCategoryRequest(substr($data, strlen('category')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t\tprocessUserRequest(substr($data, strlen('user')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo \"Invalid Request!\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "function handleRequest (&$request, &$context) {\n\n\t\t/* cycle through our process callback queue. using each() vs.\n\t\t * foreach, etc. so we may add elements to the callback array\n\t\t * later. probably primarily used for conditional callbacks. */\n\t\treset ($this->_processCallbacks);\n\t\twhile ($c = each ($this->_processCallbacks)) {\n\n\t\t\t// test for a successful view dispatch\n\t\t\tif ($this->_processProcess ($this->_processCallbacks[$c['key']],\n\t\t\t $request,\n\t\t\t $context))\n\t\t\t\treturn;\n\t\t}\n\n\t\t// if no view has been found yet attempt our default\n\t\tif ($this->defaultViewExists ())\n\t\t\t$this->renderDefaultView ($request, $context);\n\t}", "public function handle($request, $next);", "public function handle(): void\n {\n $globals = $_SERVER;\n //$SlimPsrRequest = ServerRequestFactory::createFromGlobals();\n //it doesnt matters if the Request is of different class - no need to create Guzaba\\Http\\Request\n $PsrRequest = ServerRequestFactory::createFromGlobals();\n //the only thing that needs to be fixed is the update the parsedBody if it is NOT POST & form-fata or url-encoded\n\n\n //$GuzabaPsrRequest =\n\n //TODO - this may be reworked to reroute to a new route (provided in the constructor) instead of providing the actual response in the constructor\n $DefaultResponse = $this->DefaultResponse;\n //TODO - fix the below\n// if ($PsrRequest->getContentType() === ContentType::TYPE_JSON) {\n// $DefaultResponse->getBody()->rewind();\n// $structure = ['message' => $DefaultResponse->getBody()->getContents()];\n// $json_string = json_encode($structure, JSON_UNESCAPED_SLASHES);\n// $StreamBody = new Stream(null, $json_string);\n// $DefaultResponse = $DefaultResponse->\n// withBody($StreamBody)->\n// withHeader('Content-Type', ContentType::TYPES_MAP[ContentType::TYPE_JSON]['mime'])->\n// withHeader('Content-Length', (string) strlen($json_string));\n// }\n\n $FallbackHandler = new RequestHandler($DefaultResponse);//this will produce 404\n $QueueRequestHandler = new QueueRequestHandler($FallbackHandler);//the default response prototype is a 404 message\n foreach ($this->middlewares as $Middleware) {\n $QueueRequestHandler->add_middleware($Middleware);\n }\n $PsrResponse = $QueueRequestHandler->handle($PsrRequest);\n $this->emit($PsrResponse);\n\n }", "public function HandleRequest(Request $request)\r\n {\r\n $command = $this->_commandResolver->GetCommand($request);\t// Create command object for Request\r\n $response = $command->Execute($request);\t\t\t\t\t// Execute the command to get response\r\n $view = ApplicationController::GetView($response);\t\t\t\t\t// Send response to the appropriate view for display\r\n $view->Render();\t\t\t\t\t\t\t\t\t\t\t// Display the view\r\n }", "public function process($path, Request $request);", "public function handle(string $query, ServerRequestInterface $request);", "public function handleRequest()\n\t{\n\t\t$fp = $this->fromRequest();\n\t\treturn $fp->render();\n\t}", "private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n \n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t$this->hello($this->request->data);\n\t\t\t\tbreak;\n\t\t\tcase \"submit_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->submit_video($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"remove_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->remove_video($this->request);\n\t\t\t\tbreak;\n\t\t\tcase \"isSubmitted\":\n\t\t\t\t$this->isSubmitted($this->request);\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\n\t}", "public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}", "public function handle($request)\n {\n $this->setRouter($this->app->compose('Cygnite\\Base\\Router\\Router', $request), $request);\n\n try {\n $response = $this->sendRequestThroughRouter($request);\n /*\n * Check whether return value is a instance of Response,\n * otherwise we will try to fetch the response form container,\n * create a response and return to the browser.\n *\n */\n if (!$response instanceof ResponseInterface && !is_array($response)) {\n $r = $this->app->has('response') ? $this->app->get('response') : '';\n $response = Response::make($r);\n }\n } catch (\\Exception $e) {\n $this->handleException($e);\n } catch (Throwable $e) {\n $this->handleException($e);\n }\n\n return $response;\n }", "public function handleRequest()\n\t{\n $response = array();\n switch ($this->get_server_var('REQUEST_METHOD')) \n {\n case 'OPTIONS':\n case 'HEAD':\n $response = $this->head();\n break;\n case 'GET':\n $response = $this->get();\n break;\n case 'PATCH':\n case 'PUT':\n case 'POST':\n $response = $this->post();\n break;\n case 'DELETE':\n $response = $this->delete();\n break;\n default:\n $this->header('HTTP/1.1 405 Method Not Allowed');\n }\n\t\treturn $response;\n }", "public function handleRequest(Zend_Controller_Request_Http $request)\n {\n \n }", "final public function handle(Request $request)\n {\n $response = $this->process($request);\n if (($response === null) && ($this->successor !== null)) {\n $response = $this->successor->handle($request);\n }\n\n return $response;\n }", "public function process(Aloi_Serphlet_Application_HttpRequest $request, Aloi_Serphlet_Application_HttpResponse $response) {\r\n\r\n\t\ttry {\r\n\t\t\t// Identify the path component we will use to select a mapping\r\n\t\t\t$path = $this->processPath($request, $response);\r\n\t\t\tif (is_null($path)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (self::$log->isDebugEnabled()) {\r\n\t\t\t\tself::$log->debug('Processing a \"' . $request->getMethod() . '\" for path \"' . $path . '\"');\r\n\t\t\t}\r\n\r\n\t\t\t// Select a Locale for the current user if requested\r\n\t\t\t$this->processLocale($request, $response);\r\n\r\n\t\t\t// Set the content type and no-caching headers if requested\r\n\t\t\t$this->processContent($request, $response);\r\n\t\t\t$this->processNoCache($request, $response);\r\n\r\n\t\t\t// General purpose preprocessing hook\r\n\t\t\tif (!$this->processPreprocess($request, $response)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Identify the mapping for this request\r\n\t\t\t$mapping = $this->processMapping($request, $response, $path);\r\n\t\t\tif (is_null($mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Check for any role required to perform this action\r\n\t\t\tif (!$this->processRoles($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process any ActionForm bean related to this request\r\n\t\t\t$form = $this->processActionForm($request, $response, $mapping);\r\n\t\t\t$this->processPopulate($request, $response, $form, $mapping);\r\n\t\t\tif (!$this->processValidate($request, $response, $form, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process a forward or include specified by this mapping\r\n\t\t\tif (!$this->processForward($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!$this->processInclude($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Create or acquire the Action instance to process this request\r\n\t\t\t$action = $this->processActionCreate($request, $response, $mapping);\r\n\t\t\tif (is_null($action)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Call the Action instance itself\r\n\t\t\t$forward = $this->processActionPerform($request, $response, $action, $form, $mapping);\r\n\r\n\t\t\t// Process the returned ActionForward instance\r\n\t\t\t$this->processForwardConfig($request, $response, $forward);\r\n\t\t} catch (ServletException $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}", "function handleRequest() {\n // I. On récupère l'action demandée par l'utilisateur, avec retrocompatibilité\n // Controller et Entité\n $entityName = (isset($_GET['controller']) ? $_GET['controller'] : \"article\");\n // on retravaille le nom pour obtenir un nom de la forme \"Article\"\n $entityName = ucfirst(strtolower($entityName));\n\n // Action\n $actionName = (isset($_GET['action']) ? $_GET['action'] : \"index\");\n $actionName = strtolower($actionName);\n\n // II à IV sont maintenant dans loadDep\n $controller = $this->loadDependencies($entityName);\n\n // V. On regarde si l'action de controller existe, puis on la charge\n // on retravaille la var obtenue pour obtenir un nom de la forme \"indexAction\"\n $action = $actionName . \"Action\";\n\n // si la méthode demandée n'existe pas, remettre \"index\"\n if (!method_exists($controller, $action)) {\n $actionName = \"index\";\n $action = \"indexAction\";\n }\n\n // on stock le titre sous la forme \"Article - Index\"\n $this->title = $entityName . \" - \" . $actionName;\n\n // on appelle dynamiquement la méthode de controller\n $this->content = $controller->$action();\n }", "public function handle(RequestInterface $request): ResponseInterface;", "public function handleRequest() {\n $this->loadErrorHandler();\n\n $this->sanitizeRequest();\n $this->modx->invokeEvent('OnHandleRequest');\n if (!$this->modx->checkSiteStatus()) {\n header('HTTP/1.1 503 Service Unavailable');\n if (!$this->modx->getOption('site_unavailable_page',null,1)) {\n $this->modx->resource = $this->modx->newObject('modDocument');\n $this->modx->resource->template = 0;\n $this->modx->resource->content = $this->modx->getOption('site_unavailable_message');\n } else {\n $this->modx->resourceMethod = \"id\";\n $this->modx->resourceIdentifier = $this->modx->getOption('site_unavailable_page',null,1);\n }\n } else {\n $this->checkPublishStatus();\n $this->modx->resourceMethod = $this->getResourceMethod();\n $this->modx->resourceIdentifier = $this->getResourceIdentifier($this->modx->resourceMethod);\n if ($this->modx->resourceMethod == 'id' && $this->modx->getOption('friendly_urls', null, false) && !$this->modx->getOption('request_method_strict', null, false)) {\n $uri = $this->modx->context->getResourceURI($this->modx->resourceIdentifier);\n if (!empty($uri)) {\n if ((integer) $this->modx->resourceIdentifier === (integer) $this->modx->getOption('site_start', null, 1)) {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL);\n } else {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL) . $uri;\n }\n $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n }\n }\n }\n if (empty ($this->modx->resourceMethod)) {\n $this->modx->resourceMethod = \"id\";\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $this->modx->resourceIdentifier = $this->_cleanResourceIdentifier($this->modx->resourceIdentifier);\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $found = $this->findResource($this->modx->resourceIdentifier);\n if ($found) {\n $this->modx->resourceIdentifier = $found;\n $this->modx->resourceMethod = 'id';\n } else {\n $this->modx->sendErrorPage();\n }\n }\n $this->modx->beforeRequest();\n $this->modx->invokeEvent(\"OnWebPageInit\");\n\n if (!is_object($this->modx->resource)) {\n if (!$this->modx->resource = $this->getResource($this->modx->resourceMethod, $this->modx->resourceIdentifier)) {\n $this->modx->sendErrorPage();\n return true;\n }\n }\n\n return $this->prepareResponse();\n }", "public function process(\n ServerRequestInterface $request,\n RequestHandlerInterface $handler\n );", "protected function handleRequest() {\n\t\t// TODO: remove conditional when we have a dedicated error render\n\t\t// page and move addModule to Mustache#getResources\n\t\tif ( $this->adapter->getFormClass() === 'Gateway_Form_Mustache' ) {\n\t\t\t$modules = $this->adapter->getConfig( 'ui_modules' );\n\t\t\tif ( !empty( $modules['scripts'] ) ) {\n\t\t\t\t$this->getOutput()->addModules( $modules['scripts'] );\n\t\t\t}\n\t\t\tif ( $this->adapter->getGlobal( 'LogClientErrors' ) ) {\n\t\t\t\t$this->getOutput()->addModules( 'ext.donationInterface.errorLog' );\n\t\t\t}\n\t\t\tif ( !empty( $modules['styles'] ) ) {\n\t\t\t\t$this->getOutput()->addModuleStyles( $modules['styles'] );\n\t\t\t}\n\t\t}\n\t\t$this->handleDonationRequest();\n\t}", "public function handleHttpRequest($requestParams)\n\t{\n\t\t$action = strtolower(@$requestParams[self::REQ_PARAM_ACTION]);\t\t\n\t\t$methodName = $this->actionToMethod($action);\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$this->$methodName($requestParams);\n\t\t} catch(Exception $e)\n\t\t{\n\t\t\techo \"Error: \".$e->getMessage();\n\t\t}\n\t}", "public static function handleRequest()\n\t{\n\t\t// Load language strings\n\t\tself::loadLanguage();\n\n\t\t// Load the controller and let it run the show\n\t\trequire_once dirname(__FILE__).'/classes/controller.php';\n\t\t$controller = new LiveUpdateController();\n\t\t$controller->execute(JRequest::getCmd('task','overview'));\n\t\t$controller->redirect();\n\t}", "public function handle() {\n $this->initDb(((!isset(self::$_config['db']['type'])) ? 'mysql' : self::$_config['db']['type']));\n $request = new corelib_request(self::$_config['routing'], self::$_config['reg_routing']);\n $path = parse_url($_SERVER['REQUEST_URI']);\n\n if (self::$_config['home'] == \"/\" || self::$_config['home'] == \"\") {\n $uri = ltrim($path['path'], '/');\n } else {\n $uri = str_replace(self::$_config['home'], '', $path['path']);\n }\n\n if (\"\" == $uri || \"/\" == $uri) {\n $uri = self::$_config['routing']['default']['controller'] . '/' . self::$_config['routing']['default']['action'];\n }\n self::$isAjax = $request->isAjax();\n self::$request = $request->route($uri);\n self::$request['uri'] = $uri;\n\n if (self::$request['action'] == \"\")\n self::$request['action'] = self::$_config['routing']['default']['action'];\n\n $this->_run( self::$request['params'] );\n }", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "public function request_handler(){\r\n\t\t$route = new Router;\r\n\t\t$session = new Session;\r\n\t\t$segments = $route->urlRoute();\r\n\t\t#check if controller/action exist\r\n\t\t#if not use default_controller / default_action\r\n\t\tif( count($segments) == 0 || count($segments) == 1 ){\r\n\t\t\tinclude_class_method( default_controller , default_action );\r\n\t\t}else{\r\n\t\t#if controller/action exist in the url\r\n\t\t#then check the controller if it's existed in the file\r\n\t\t\tif( file_exists( CONTROLLER_DIR . $segments[0] . CONT_EXT ) )\r\n\t\t\t{\r\n\t\t\t\t#check for segments[1] = actions\r\n\t\t\t\t#if segments[1] exist, logically segments[0] which is the controller is also exist!!\r\n\t\t\t\t//if( isset($segments[1]) ){\r\n\t\t\t\t\tinclude_class_method( $segments[0], $segments[1] . 'Action' );\r\n\t\t\t\t//}\r\n\t\t\t}else{\r\n\t\t\t\terrorHandler(CONTROLLER_DIR . $segments[0] . CONT_EXT);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function handle() {\n if(method_exists($this->class, $this->function)) {\n echo $this->class->{$this->function}($this->request);\n }else {\n echo Response::response(['error' => 'function does not exist on ' . get_class($this->class)], 500);\n }\n }", "public function handle(ClientInterface $client, RequestInterface $request, HttpRequest $httpRequest);", "public function handleRequest() {\n $questions=$this->contactsService->getAllQuestions(\"date\");\n //load all the users\n $userList = User::loadUsers();\n //load all the topics\n \t\t$topics = $this->contactsService2->getAllTopics(\"name\");\n \t\t\n\t\t\t\trequire_once '../view/home.tpl';\n\t}", "public function serve_request()\n {\n }", "public static function process($request){\r\n\t\tcall_user_func($request -> action, $request -> params);\r\n\t}", "function process($request) {\n\t//$logFusion =& LoggerManager::getLogger('fusion');\n//PBXFusion begin\n\t$request=$this->mapRequestVars($request);\n $mode = $request->get('callstatus');\n\t//$logFusion->debug(\"PBX CONTROLLER PROCESS mode=\".$mode);\n//PBXFusion end\n switch ($mode) {\n\t//PBXFusion begin\n \t case \"CallStart\" :\n $this->processCallStart($request);\n break;\n\t//PBXFusion end\n case \"StartApp\" :\n $this->processStartupCallFusion($request);\n break;\n case \"DialAnswer\" :\n $this->processDialCallFusion($request);\n break;\n case \"Record\" :\n $this->processRecording($request);\n break;\n case \"EndCall\" :\n $this->processEndCallFusion($request);\n break;\n case \"Hangup\" :\n $callCause = $request->get('causetxt');\n if ($callCause == \"null\") {\n break;\n }\n $this->processHangupCall($request);\n break;\n }\n }", "public function handle() {\n\t\n\t\t$task = $this->request->getTask();\n\t\t$handler = $this->resolveHandler($task);\n\t\t$action = $this->request->getAction();\n\t\t$method = empty($action) ? $this->defaultActionMethod : $action.$this->actionMethodSuffix;\n\t\t\n\t\tif (! method_exists($handler, $method)) {\n\t\t\tthrow new Task\\NotHandledException(\"'{$method}' method not found on handler.\");\n\t\t}\n\t\t\n\t\t$handler->setRequest($this->request);\n\t\t$handler->setIo($this->io);\n\t\t\n\t\treturn $this->invokeHandler($handler, $method);\n\t}", "private function handleCall() { //$this->request\n $err = FALSE;\n // route call to method\n $this->logToFile($this->request['action']);\n switch($this->request['action']) {\n // Edit form submitted\n case \"edit\":\n // TODO: improve error handling\n try {\n $this->logToFile(\"case: edit\");\n $this->edit($this->request['filename']);\n //$this->save();\n } catch (Exception $e) {\n $err = \"Something went wrong: \";\n $err .= $e.getMessage();\n }\n break;\n }\n // TODO: set error var in response in case of exception / error\n // send JSON response\n if($err !== FALSE) {\n $this->request['error_msg'] = $err;\n }\n $this->giveJSONResponse($this->request);\n }", "function handle()\n {\n $this->verifyPost();\n\n $postTarget = $this->determinePostTarget();\n\n $this->filterPostData();\n\n switch ($postTarget) {\n case 'upload_media':\n $this->handleMediaFileUpload();\n break;\n case 'feed':\n $this->handleFeed();\n break;\n case 'feed_media':\n $this->handleFeedMedia();\n break;\n case 'feed_users':\n $this->handleFeedUsers();\n break;\n case 'delete_media':\n $this->handleDeleteMedia();\n break;\n }\n }", "public function run() {\n\t\t// If this particular request is not a hook, something is wrong.\n\t\tif (!isset($this->server[self::MERGADO_HOOK_AUTH_HEADER])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s is to be used only for handling hooks sent from Mergado.\n\t\t\t\tMergado-Apps-Hook-Auth is missing.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t}\n\n\t\tif (!$decoded = json_decode($this->rawRequest, true)) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle request, because the data to be handled is empty.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t} elseif (!isset($decoded['action'])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle the hook, because the hook action is undefined.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t};\n\n\t\t$this->handle($decoded['action'], $decoded);\n\n\t}", "public function handleRequest()\n {\n $version = $this->versionEngine->getVersion();\n $queryConfiguration = $version->parseRequest($this->columnConfigurations);\n $this->provider->prepareForProcessing($queryConfiguration, $this->columnConfigurations);\n $data = $this->provider->process();\n return $version->createResponse($data, $queryConfiguration, $this->columnConfigurations);\n }", "public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}", "public function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }", "final public function handle()\n {\n \n $this->_preHandle();\n \n if ($this->_request->getActionName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the action name.');\n }\n\n if ($this->_request->getProviderName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the provider name.');\n }\n \n ob_start();\n \n try {\n $dispatcher = new ZendL_Tool_Rpc_Endpoint_Dispatcher();\n $dispatcher->setRequest($this->_request)\n ->setResponse($this->_response)\n ->dispatch();\n \n } catch (Exception $e) {\n //@todo implement some sanity here\n die($e->getMessage());\n //$this->_response->setContent($e->getMessage());\n return;\n }\n \n if (($content = ob_get_clean()) != '') {\n $this->_response->setContent($content);\n }\n \n $this->_postHandle();\n }", "public function RouteRequest ();", "public function handle(ServerRequestInterface $request, $handler, array $vars): ?ResponseInterface;", "public function DispatchRequest ();", "protected function handleRequest() {\n\t\t// FIXME: is this necessary?\n\t\t$this->getOutput()->allowClickjacking();\n\t\tparent::handleRequest();\n\t}", "public function listen() {\n\t\t// Checks the user agents match\n\t\tif ( $this->user_agent == $this->request_user_agent ) {\n\t\t\t// Determine if a key request has been made\n\t\t\tif ( isset( $_GET['key'] ) ) {\n\t\t\t\t$this->download_update();\n\t\t\t} else {\n\t\t\t\t// Determine the action requested\n\t\t\t\t$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );\n\n\t\t\t\t// If that method exists, call it\n\t\t\t\tif ( method_exists( $this, $action ) )\n\t\t\t\t\t$this->{$action}();\n\t\t\t}\n\t\t}\n\t}", "abstract public function request();", "public function run() {\r\n $this->routeRequest(new Request());\r\n }", "public function processAction(Request $request)\n {\n // Get the request Vars\n $this->requestQuery = $request->query;\n\n // init the hybridAuth instance\n $provider = trim(strip_tags($this->requestQuery->get('hauth_start')));\n $cookieName = $this->get('azine_hybrid_auth_service')->getCookieName($provider);\n $this->hybridAuth = $this->get('azine_hybrid_auth_service')->getInstance($request->cookies->get($cookieName), $provider);\n\n // If openid_policy requested, we return our policy document\n if ($this->requestQuery->has('get') && 'openid_policy' == $this->requestQuery->get('get')) {\n return $this->processOpenidPolicy();\n }\n\n // If openid_xrds requested, we return our XRDS document\n if ($this->requestQuery->has('get') && 'openid_xrds' == $this->requestQuery->get('get')) {\n return $this->processOpenidXRDS();\n }\n\n // If we get a hauth.start\n if ($this->requestQuery->has('hauth_start') && $this->requestQuery->get('hauth_start')) {\n return $this->processAuthStart();\n }\n // Else if hauth.done\n elseif ($this->requestQuery->has('hauth_done') && $this->requestQuery->get('hauth_done')) {\n return $this->processAuthDone($request);\n }\n // Else we advertise our XRDS document, something supposed to be done from the Realm URL page\n\n return $this->processOpenidRealm();\n }", "public function run() {\n $base = $this->request->getNextRoute();\n if ($base !== BASE) {\n $this->response->notFound();\n }\n $start = $this->request->getNextRoute();\n if ($rs = $this->getRs($start)) {\n if ($this->request->isOptions()) {\n $this->response->okEmpty();\n return;\n }\n try {\n $this->response->ok($rs->handleRequest());\n\n } catch (UnauthorizedException $e) {\n $this->response->unauthorized();\n\n } catch (MethodNotAllowedException $e) {\n $this->response->methodNotAllowed();\n\n } catch (BadRequestExceptionInterface $e) {\n $this->response->badRequest($e->getMessage());\n\n } catch (UnavailableExceptionInterface $e) {\n $this->response->unavailable($e->getMessage());\n\n } catch (Exception $e) {\n $this->response->unavailable($e->getMessage());\n }\n } else {\n $this->response->badRequest();\n }\n }", "public function handle(Request $request, Response|JsonResponse|BinaryFileResponse|StreamedResponse $response, int $length);", "public function handle(Request $request, Closure $next);", "public function handleGetRequest($id);", "abstract function doExecute($request);", "public function parseCurrentRequest()\n {\n // If 'action' is post, data will only be read from 'post'\n if ($action = $this->request->post('action')) {\n die('\"post\" method action handling not implemented');\n }\n \n $action = $this->request->get('action') ?: 'home';\n \n if ($response = $this->actionHandler->trigger($action, $this)) {\n $this->getResponder()->send($response);\n } else {\n die('404 not implemented');\n }\n }", "abstract public function mapRequest($request);", "public function handle(ServerRequestInterface $request)\n {\n $router = $this->app->get(RouterInterface::class);\n $response = $router->route($request);\n\n if (! headers_sent()) {\n\n // Status\n header(sprintf(\n 'HTTP/%s %s %s',\n $response->getProtocolVersion(),\n $response->getStatusCode(),\n $response->getReasonPhrase()\n ));\n\n // Headers\n foreach ($response->getHeaders() as $name => $values) {\n foreach ($values as $value) {\n header(sprintf('%s: %s', $name, $value), false);\n }\n }\n }\n\n echo $response->getBody()->getContents();\n }", "abstract public function processRequest(PriceWaiter_NYPWidget_Controller_Endpoint_Request $request);", "private function handleRequest()\n {\n // we check the inputs validity\n $validator = Validator::make($this->request->only('rowsNumber', 'search', 'sortBy', 'sortDir'), [\n 'rowsNumber' => 'required|numeric',\n 'search' => 'nullable|string',\n 'sortBy' => 'nullable|string|in:' . $this->columns->implode('attribute', ','),\n 'sortDir' => 'nullable|string|in:asc,desc',\n ]);\n // if errors are found\n if ($validator->fails()) {\n // we log the errors\n Log::error($validator->errors());\n // we set back the default values\n $this->request->merge([\n 'rowsNumber' => $this->rowsNumber ? $this->rowsNumber : config('tablelist.default.rows_number'),\n 'search' => null,\n 'sortBy' => $this->sortBy,\n 'sortDir' => $this->sortDir,\n ]);\n } else {\n // we save the request values\n $this->setAttribute('rowsNumber', $this->request->rowsNumber);\n $this->setAttribute('search', $this->request->search);\n }\n }", "public function handle() {\n\t\t\n\t\t\n\t\t\n\t\theader('ApiVersion: 1.0');\n\t\tif (!isset($_COOKIE['lg_app_guid'])) {\n\t\t\t//error_log(\"NO COOKIE\");\n\t\t\t//setcookie(\"lg_app_guid\", uniqid(rand(),true),time()+(10*365*24*60*60));\n\t\t} else {\n\t\t\t//error_log(\"cookie: \".$_COOKIE['lg_app_guid']);\n\t\t\t\n\t\t}\n\t\t// checks if a JSON-RCP request has been received\n\t\t\n\t\tif (($_SERVER['REQUEST_METHOD'] != 'POST' && (empty($_SERVER['CONTENT_TYPE']) || strpos($_SERVER['CONTENT_TYPE'],'application/json')===false)) && !isset($_GET['d'])) {\n\t\t\t\techo \"INVALID REQUEST\";\n\t\t\t// This is not a JSON-RPC request\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\t// reads the input data\n\t\tif (isset($_GET['d'])) {\n\t\t\tdefine(\"WEB_REQUEST\",true);\n\t\t\t$request=urldecode($_GET['d']);\n\t\t\t$request = stripslashes($request);\n\t\t\t$request = json_decode($request, true);\n\t\t\t\n\t\t} else {\n\t\t\tdefine(\"WEB_REQUEST\",false);\n\t\t\t//error_log(file_get_contents('php://input'));\n\t\t\t$request = json_decode(file_get_contents('php://input'),true);\n\t\t\t//error_log(print_r(apache_request_headers(),true));\n\t\t}\n\t\t\n\t\terror_log(\"Method: \".$request['method']);\n\t\tif (!isset($this->exemptedMethods[$request['method']])) {\n\t\t\ttry {\n\t\t\t\t$this->authenticate();\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->authenticated = false;\n\t\t\t\t$this->handleError($e);\n\t\t\t}\n\t\t} else {\n\t\t\t//error_log('exempted');\n\t\t}\n\t\ttrack_call($request);\n\t\t//error_log(\"RPC Method Called: \".$request['method']);\n\t\t\n\t\t//include the document containing the function being called\n\t\tif (!function_exists($request['method'])) {\n\t\t\t$path_to_file = \"./../include/methods/\".$request['method'].\".php\";\n\t\t\tif (file_exists($path_to_file)) {\n\t\t\t\tinclude $path_to_file;\n\t\t\t} else {\n\t\t\t\t$e = new Exception('Unknown method. ('.$request['method'].')', 404, null);\n \t$this->handleError($e);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t// executes the task on local object\n\t\ttry {\n\t\t\t\n\t\t\t$result = @call_user_func($request['method'],$request['params']);\n\t\t\t\n\t\t\tif (!is_array($result) || !isset($result['result']) || $result['result']) {\n\t\t\t\t\n\t\t\t\tif (is_array($result) && isset($result['result'])) unset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'result' => $result,\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\t} else {\n\t\t\t\tunset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'error' => $result\n\t\t\t\t\t\t\t\t );\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t\t$response = array (\n\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t'result' => NULL,\n\t\t\t\t\t\t\t\t'error' => $e->getMessage()\n\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t}\n\t\t// output the response\n\t\tif (!empty($request['id'])) { // notifications don't want response\n\t\t\theader('content-type: text/javascript');\n\t\t\t//error_log(@print_r($response));\n\t\t\tif (isset($_GET['d'])) $str_response = $_GET['jsoncallback'].\"(\".str_replace('\\/','/',json_encode($response)).\")\";\n\t\t\telse $str_response = str_replace('\\/','/',json_encode($response));\n\t\t\t\n\t\t\tif ($_SERVER['SERVER_ADDR']=='192.168.1.6') {\n\t\t\t\t//error_log($str_response);\n\t\t\t}\n\t\t\techo $str_response;\n\t\t}\n\t\t\n\t\t\n\t\t// finish\n\t\treturn true;\n\t}", "protected function handle(Request $request)\n {\n return 1;\n }", "public function __invoke(Request $request, RequestHandler $handler) {\n R::setup('mysql:host=127.0.0.1;dbname=cellar','root','');\n \n $response = $handler->handle($request);\n R::close();\n return $response;\n }", "public function handle($req)\n {\n $params = $req->post ?: [];\n\n $files = $this->transformFiles($req->files);\n\n $cookies = $req->cookie ?: [];\n\n $server = $this->transformHeadersToServerVars(array_merge($req->header, [\n 'PATH_INFO' => array_get($req->server, 'path_info'),\n ]));\n $server['X_REQUEST_ID'] = Str::uuid()->toString();\n\n $requestUri = $req->server['request_uri'];\n if (isset($req->server['query_string']) && $req->server['query_string']) {\n $requestUri .= \"?\" . $req->server['query_string'];\n }\n\n $resp = $this->call(\n strtolower($req->server['request_method']),\n $requestUri, $params, $cookies, $files,\n $server, $req->rawContent()\n );\n\n return [\n 'status' => $resp->getStatusCode(),\n 'headers' => $resp->headers,\n 'body' => $resp->getContent(),\n ];\n }", "public function handle(Request $request)\n {\n $route_params = $this->_router->match($request->getUri());\n $route = $route_params['route'];\n $params = $route_params['params'];\n\n $func = reset($route) . self::CONTROLLER_METHOD_SUFIX;\n $class_name = key($route);\n $controller = new $class_name($request);\n\n $response = call_user_func_array(\n [\n $controller,\n $func,\n ],\n [$params]\n );\n\n if ($response instanceof Response) {\n return $response;\n } else {\n throw new InvalidHttpResponseException();\n }\n }" ]
[ "0.8299201", "0.8147294", "0.8147294", "0.8147294", "0.8127764", "0.7993589", "0.7927201", "0.7912899", "0.7899075", "0.76317674", "0.75089735", "0.7485808", "0.74074036", "0.7377414", "0.736802", "0.7294553", "0.72389543", "0.7230166", "0.72108", "0.71808434", "0.7170364", "0.71463037", "0.7126907", "0.7122795", "0.71225274", "0.7116879", "0.70607233", "0.6981947", "0.6966695", "0.69393975", "0.6912079", "0.68985975", "0.6887614", "0.68774897", "0.6806274", "0.67969805", "0.67778915", "0.6762979", "0.67565143", "0.67533374", "0.67192745", "0.6683243", "0.66487724", "0.66395754", "0.6634629", "0.66283566", "0.6617558", "0.6610097", "0.6610011", "0.6544976", "0.653806", "0.6512757", "0.64682734", "0.64381886", "0.6416964", "0.63373476", "0.63359964", "0.6334543", "0.63308066", "0.6321675", "0.63176167", "0.631661", "0.6310991", "0.63108873", "0.6295945", "0.6279438", "0.62778515", "0.62508965", "0.62422955", "0.62321424", "0.62237644", "0.6203428", "0.61954546", "0.6191255", "0.61774665", "0.61682004", "0.6151806", "0.61271876", "0.61257905", "0.6116093", "0.61126447", "0.6112368", "0.6101652", "0.60893977", "0.60871464", "0.60862815", "0.60734737", "0.60535145", "0.6028341", "0.60250086", "0.60224646", "0.6011745", "0.6011483", "0.60106593", "0.5998867", "0.5997086", "0.5991233", "0.59844923", "0.59668386", "0.5961315", "0.5954762" ]
0.0
-1
Define the the function that we are going to use
function url_for($script_path) { //add the leading '/' if not present if ($script_path[0] != '/') { $script_path = "/" . $script_path; } return WWW_ROOT . $script_path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function functions() {\n \n }", "public function getFunction(): string;", "protected function func_default() {}", "function do_sth_function_name(){\r\n }", "public function __construct($fun) {\n $this->f = $fun;\n }", "abstract protected function registerFunctions();", "private function setFuction($function) {\n $this->_function = $function;\n }", "private function aFunc()\n {\n }", "abstract public function getFunctions();", "public function changeFunc() {}", "function acf()\n{\n}", "public function f01()\n {\n }", "public function __construct($fun=null) {\n $this->f = $fun;\n }", "function uopz_function($function, $handler, $modifiers = NULL)\n{\n}", "public function publicFunction();", "public function helper()\n\t{\n\t\n\t}", "public function f02()\n {\n }", "public static function definition();", "public function custom_definition() {}", "public function custom_definition() {}", "public function custom_definition() {}", "function uopz_function($class, $function, $handler, $modifiers = NULL)\n{\n}", "abstract protected function exportFunctions();", "abstract protected function getFunctionName(): string;", "public function _default()\n {\n $_func_name = $this->_default_func;\n $this->$_func_name();\n }", "private function getFuction() {\n return $this->_function;\n }", "public function CBfunctions() {}", "function runkit_function_add($funcname, $arglist, $code)\n{\n}", "protected function func() { return $this->f; }", "public function method();", "public function method();", "public function method();", "public function method();", "function handlerFunction($module, $obj, $URI_function){\n //debugECHO($URI_function);\n $functions = simplexml_load_file(MODULES_PATH . $module . \"/resources/functions.xml\");\n $exist=false;\n\n foreach($functions->function as $function){\n if(($URI_function === (String)$function->uri)){\n $exist=true;\n $event=(String)$function->name;\n //debugECHO($event);\n break;\n }//enf if\n\n }//End foreach\n\n if(!$exist){\n //debugECHO(\"entra al exists false\");\n showErrorPage(4,\"\",'HTTP/1.0 400 Bad Request', 400);\n }else{\n //debugECHO($event);\n call_user_func(array($obj,$event));\n }\n}", "public function custom()\n\t{\n\t}", "public function xxxxx(){\n\n }", "static function defineFunctions()\n\t{\n\t\tif ( !function_exists('json_decode') ) {\n\t\t\tfunction json_decode($content, $assoc=false){\n\t\t\t\tif ( $assoc ){\n\t\t\t\t\t$json = new Pie_Json(SERVICES_JSON_LOOSE_TYPE);\n\t\t\t\t} else {\n\t\t\t\t\t$json = new Pie_Json;\n\t\t\t\t}\n\t\t\t\treturn $json->decode($content);\n\t\t\t}\n\t\t}\n\n\t\tif ( !function_exists('json_encode') ) {\n\t\t\tfunction json_encode($content){\n\t\t\t\t$json = new Services_JSON;\n\t\t\t\treturn $json->encode($content);\n\t\t\t}\n\t\t}\n\t}", "private static function support()\n {\n require_once static::$root.'Support'.'/'.'FunctionArgs.php';\n }", "function MyFunction4() {\n\t\t}", "public function func()\n {\n if ($this->lookahead->type == ControlFunctionLexer::NAME) {\n if (array_key_exists($this->lookahead->text, FunctionDispatcher::$functionNames)) {\n $this->function_name = $this->lookahead->text;\n //$this->function_index = FunctionDispatcher::$functionNames[$this->lookahead->text];\n $this->function_index = FunctionDispatcher::functionIndex($this->lookahead->text);\n } else {\n throw new \\Exception(\"Функция <$this->function_name> не существует\");\n }\n $this->root = new ControlFunctionParseTree($this->lookahead->type, $this->function_name);\n //$this->root = $this->currentNode;\n $this->match(ControlFunctionLexer::NAME);\n $this->cargs();\n } else {\n throw new \\Exception(\n \"Ожидалось объявление функции контроля (сравнение, зависимость ...). Получено \" .\n ControlFunctionLexer::$tokenNames[$this->lookahead->type]\n );\n }\n }", "public function define();", "function runkit_function_redefine($funcname, $arglist, $code)\n{\n}", "function fpg_functions($name, $params) {\n\t$return_type = $params['return'];\n\t$return_cmd = 'RETURN_';\n\tswitch ($return_type) {\n\t case 'float':\n\t case 'double':\n\t case 'fann_type':\n\t\t $return_cmd .= 'DOUBLE';\n\t\t break;\n\t case 'int':\n\t\t $return_cmd .= 'LONG';\n\t\t break;\n\t}\n\tif ($params['has_getter']) {\n\t\t$body = $params['empty_function'] ? \"\": \"PHP_FANN_GET_PARAM(fann_get_$name, $return_cmd);\";\n\t\t$getter = \"\n/* {{{ proto bool fann_get_$name(resource ann)\n Returns {$params['comment']} */\nPHP_FUNCTION(fann_get_$name)\n{\n\t$body\n}\n/* }}} */\";\n\t\tfpg_printf($getter);\n\t}\n\tif ($params['has_setter']) {\n\t\t$set_args = \"fann_set_$name\";\n\t\t$comment_args = \"resource ann\";\n\t\tforeach ($params['params'] as $param_name => $param_type) {\n\t\t\t$comment_args .= sprintf(\", %s %s\", $param_type == 'fann_type' ? 'double' : $param_type, $param_name);\n\t\t\t$set_args .= sprintf(\", %s\", $param_type == 'int' ? 'l, long' : 'd, double');\n\t\t}\n\t\t$body = $params['empty_function'] ? \"\": \"PHP_FANN_SET_PARAM($set_args);\";\n\t\t$setter = \"\n/* {{{ proto bool fann_set_$name($comment_args)\n Sets {$params['comment']}*/\nPHP_FUNCTION(fann_set_$name)\n{\n $body\n}\n/* }}} */\";\n\t\tfpg_printf($setter);\n\t}\n}", "public function getFunctions();", "function test () {}", "function metodo() {\n // Funcion normal\n }", "function MapFunc(&$aFunc) {\r\n\tparent::MapFunc($aFunc);\r\n }", "abstract public function __call($fnc, $args);", "function get_handler() {\r\n }", "public function getFunction()\n {\n return $this->function;\n }", "function myFunction()\n {\n }", "function fl_ajax(){\n $func = $this->input->post('function_name');\n $param = $this->input->post();\n \n if(method_exists($this, $func)){ \n (!empty($param))?$this->$func($param):$this->$func();\n }else{\n return false;\n }\n }", "public function action($func, $params)\n {\n }", "public function testFunctions(): void\n {\n $evaluator = new Evaluator();\n $evaluator->functions = [\n 'sum' => ['ref' => 'EvaluatorTest::sum', 'arc' => null],\n 'min' => ['ref' => 'min', 'arc' => null],\n ];\n self::assertEquals(\n 5,\n $evaluator->execute('sum(1, 2, 3) + min(0, -1, 4)')\n );\n }", "function myFunction()\n{\n}", "public function aaa() {\n\t}", "public function setUseFuncName($use_funcname) \n \t{\n \t\t$this->use_funcname = $use_funcname;\n \t}", "function MyFunction1() {\n\n}", "public function chooseFunction(){\n if (isset($this->provided['postLabel'])) {\n echo \"You called the function <b> \".$this->provided['postLabel'].\" </b> if you need to know what this shit does follow it for yourself\n in kikundi/controller/PostController.php <br>\";\n switch($this->provided['postLabel']){\n case 'createProjectPool':\n ProjectController::addProjectPool($this->provided['sessionID'], $this->provided['name'], $this->provided['adminName']);\n setcookie('newCook', '69', 2019-9-11, '/');\n break;\n case 'registerMember':\n $this->joinProjectPool();\n break;\n case 'createProject':\n $this->createProject();\n break;\n case 'addTag':\n TagController::saveTagInDb($this->provided['tag']);\n break;\n case 'checkTag':\n echo \"<h2>All the Tags starting with \".$this->provided['tag'].\"</h2>\";\n var_dump(TagController::searchInDb($this->provided['tag']));\n break;\n case 'joinProjectPool':\n break;\n case 'likeProject':\n $this->likeProject();\n break;\n case 'approve':\n break;\n default:\n echo \"no post with that label found!\";\n }\n } else {\n echo \"You should not be here!\";\n }\n\n }", "public function test_add_filter_create_function() {\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, function() {\n return rand_str();\n } );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n return $hook;\n\t}", "function add_table_function($label, $closure) {\n\t\t$key = 'table-function-'.md5($label);\n\t\t$this->tb_functions[$key] = ['label' => $label, 'key' => $key];\n\t\t\n\t\tif(isset($_GET[$key])) {\n\t\t\t$closure($this, $this->get_full_resultset());\n\t\t}\n\t}", "function name();", "function MyFunction3() {\n\n\t\t}", "public function demo();", "public function demo();", "function specialop() {\n\n\n\t}", "public function getLinkFun() {}", "function fooFunc()\n {\n }", "public function f() {}", "public function getF() {}", "function service();", "function runkit_function_rename($funcname, $newname)\n{\n}", "function routes($f3) {\r\n\r\n\t}", "public function example();", "function test()\n {\n echo \"The fuction name is: \".__FUNCTION__.\"<br><br>\";\n }", "public function getFunctions()\n {\n //Function definition\n return array(\n 'tyhand_docdownloader_url' => new \\Twig_Function_Method($this, 'url', array('is_safe' => array('html')))\n );\n }", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "protected function getAddBeforeFunction()\n {\n \n }", "public function getFunction ()\n\t{\n\t\treturn $this->_strFunction;\n\t}", "function Sparql_ParserFunctionSetup($parser) {\n // Set a function hook associating the \"example\" magic word with our function\n $parser->setFunctionHook(\"twinkle\", \"Sparql_ParserFunctionRender\" );\n // no hash needed \n $parser->setFunctionHook(\"sparqlencode\", \"Sparql_SparqlEncode\", SFH_NO_HASH);\n return true;\n}", "public function call();", "public function call();", "function asd()\n{\n\n}", "function test()\n {\n }", "function exampleHelpFunction()\n {\n //用法 >> exampleHelpFunction() \n return '這樣就能使用全域function了!';\n }", "abstract protected function create($funcName);", "public function f()\n {\n }", "public function func_search() {}", "protected function getAddAfterFunction()\n {\n \n }", "public function definition()\n {\n \n }", "function Execute ();", "public function aa()\n {\n }", "function sqlite_create_function($function_name, $callback, $num_args = -1)\n{\n}", "function truc() {\n}", "function createFileFuncObj()\t{\n\t\tif (!$this->fileFunc)\t{\n\t\t\t$this->fileFunc = t3lib_div::makeInstance('t3lib_basicFileFunctions');\n\t\t}\n\t}", "public function getUseFuncName() \n \t{\n \t\treturn $this->use_funcname;\n \t}", "public function test_add_filter_funcname() {\n // Random function name\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, rand_str() );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n // Specific function name to test with yourls_apply_filter\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, 'change_variable' );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n return $hook;\n\t}", "function test(){\r\n //placeholder for future test functions\r\n }", "public function apply();", "public function apply();", "private function set_default_behaviour()\n {\n if (isset($this->_config['behaviour']['default'])) {\n $_func_name = $this->_config['behaviour']['default'];\n if ($_func_name && is_string($_func_name) && function_exists($this->_default_func)) {\n $this->_default_func = $_func_name;\n } else {\n $this->_default_func = self::DEFAULT_FUNC;\n }\n } else {\n $this->_default_func = self::DEFAULT_FUNC;\n }\n }" ]
[ "0.7220153", "0.6702545", "0.6652616", "0.65621185", "0.6543064", "0.653418", "0.64811385", "0.6353948", "0.63446176", "0.63319826", "0.6330111", "0.63197434", "0.6288069", "0.6269719", "0.6260873", "0.623088", "0.61987364", "0.61956865", "0.61627936", "0.61627936", "0.61627936", "0.61422014", "0.61394346", "0.6131108", "0.61301744", "0.61278665", "0.61261445", "0.606312", "0.6061225", "0.60404897", "0.60404897", "0.60404897", "0.60404897", "0.60375583", "0.59906954", "0.59802985", "0.59783024", "0.59780955", "0.5940794", "0.5930411", "0.5927989", "0.59245896", "0.5923088", "0.58968157", "0.5878973", "0.5874722", "0.5872869", "0.5864842", "0.5859781", "0.58586615", "0.58480215", "0.58344036", "0.5833571", "0.5832897", "0.58302003", "0.5817846", "0.5804236", "0.5793296", "0.57931316", "0.57881504", "0.57758665", "0.57719344", "0.57705563", "0.57681614", "0.57681614", "0.57659036", "0.57643807", "0.5760856", "0.5745789", "0.57452077", "0.5742169", "0.5725261", "0.5720956", "0.5717122", "0.5712851", "0.5690156", "0.5679988", "0.567384", "0.5670925", "0.5670802", "0.5670571", "0.5670571", "0.5667793", "0.5663248", "0.5662766", "0.56606853", "0.56526375", "0.5651899", "0.5651399", "0.5651133", "0.5639199", "0.5637154", "0.56357044", "0.56327635", "0.5626125", "0.5619058", "0.56151414", "0.5614209", "0.56088305", "0.56088305", "0.5608492" ]
0.0
-1
In order to return 404 error, need to use the header function and need to provide a string. Use $_SERVER Global to ask for current server protocol is because protocol often change $_SERVER['SERVER_PROTOCOL'] => HTTP/1.1
function error_404() { header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found'); exit(); //don't do any additional php, we are done }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function error404() {\n\t$protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0');\n\t$code='404';\n\t$text='Not Found';\n\theader($protocol . ' ' . $code . ' ' . $text);\n\t//header(\"Status: 404 Not Found\");\n\t//http_response_code(404);\n\techo \"<h1>404 Page Does Not Exist</h1>\";\n}", "function error_404(){\n header($_SERVER[\"SERVER_PROTOCOL\"] . \" 404 Not Found\");\n //saying \"don't do any additional PHP, we're done.\"\n //Just send what you got to the browser\n exit();\n\n}", "function error_404() {\n\t\theader($_SERVER[\"SERVER_PROTOCOL\"] . \" 404 Not Found\");\n\t\texit();\n\t}", "function error404($html = \"\")\n{\n header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');\n echo $html;\n exit();\n}", "static function http404()\n {\n header('HTTP/1.1 404 Not Found');\n exit;\n }", "function wp_get_server_protocol()\n {\n }", "public function uriError()\n {\n header(\"HTTP/1.0 404\");\n exit();\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 notFound() {\n header('HTTP/1.0 404 Not Found');\n }", "public function notFound() :string {\n\t\theader('HTTP/1.0 404 Not Found');\n\t\tdie('404 not found');\n\t}", "function print404() {\n\theader('HTTP/1.1 404 Not Found');\n\theader('X-Powered-By:', TRUE);\n\theader('Set-Cookie', TRUE);\n\n\tprint '<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p>The requested URL '.$_SERVER['REQUEST_URI'].' was not found on this server.</p>\n<hr>\n<address>Apache Server at '.$_SERVER['SERVER_NAME'].' Port 80</address>\n</body></html>';\n\n}", "function server() {\n\tif(isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {\n\n\t\t$protocol = 'https://'; // The current URL scheme uses https\n\n\t} else {\n\n\t\t$protocol = 'http://'; // The current URL scheme uses http\n\n\t}\n\n\tdefine('HTTP', $protocol); // Create a constant called HTTP and append the $protocol variable to it.\n\tdefine('SERVER_NAME', $_SERVER['SERVER_NAME']); // Create a constant called SERVER_NAME and append $_SERVER['SERVER_NAME'] to it\n\tdefine('REQUEST_URI', $_SERVER['REQUEST_URI']); // Create a constant called REQUEST_URI and append $_SERVER['REQUEST_URI'] to it\n\n\t$uri = strtr($_SERVER['PHP_SELF'], ['/index.php' => '']);\n\n\tdefine('LINK', HTTP . SERVER_NAME . $uri); // Create a constant called LINK and append both HTTP and SERVER_NAME\n\tdefine('AUTHOR', '<br><br> &copy; 2019 <a href=\"https://sitepoint.com/community/u/spaceshiptrooper\">spaceshiptrooper</a>');\n\tdefine('SEPARATOR', '<span class=\"separator p-r-10\"></span>');\n\n}", "function getProtocol(){\n return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? 'https://' : 'http://';\n}", "public static function error404()\r\n\t{\r\n\t\theader(\"HTTP/1.1 404 Not Found\");\r\n\t\theader(\"Status: 404 Not Found\");\r\n\t\texit();\r\n\t}", "static function header($name)\n\t{\n\t\t$key = 'HTTP_' . str_replace('-', '_', strtoupper($name));\n\t\tif (isset($_SERVER[$key])) {\n\t\t\treturn $_SERVER[$key];\n\t\t}\n\t\treturn null;\n\t}", "public static function getProtocol(): ?string {\r\n return $_SERVER['SERVER_PROTOCOL'] ?? null;\r\n }", "function serverProtocol() {\r\n\t return (((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')\t|| $_SERVER['SERVER_PORT'] == 443) ? 'https://' : 'http://');\r\n\t}", "public function getServerProtocol(): string;", "public static function http404() {\n\t\tself::$global['CONTEXT']=$_SERVER['REQUEST_URI'];\n\t\tself::error(\n\t\t\tself::resolve(self::TEXT_NotFound),404,debug_backtrace(FALSE)\n\t\t);\n\t}", "function enlaceInicio(){\n if($_SERVER['HTTPS']){\n\t echo 'httpt://' . $_SERVER['SERVER_NAME'];\n\t}else{\n\t echo 'http://' . $_SERVER['SERVER_NAME'];\n\t}\n }", "function e404(){\n\t\theader('HTTP/1.0 404 Not Found');\n\t\trequire 'secciones/error404.sec.php';\n\t\tdie();\n\t}", "public static function ErrorPage404()\n {\n header('HTTP/1.1 404 Not Found');\n header(\"Status: 404 Not Found\");\n header('Location: '.$_SERVER['HTTP_HOST'].'404');\n }", "public function checkhttp() {\n\t\tif ($_SESSION['started'] == 1) {\n\t\t\t$headers = @get_headers($_SESSION['next_page'], 1);\n\t\t\t\tif(!preg_match('/(200|202|300|301|302)/', $headers[0]) && !preg_match('/(html)/', $headers['Content-Type'][0])){\n\t\t\t\t\t$_SESSION['next_page'] = $_SESSION['page_list'][0];\n\t\t\t\t\t$_SESSION['page_list_done'][] = $_SESSION['page_list'][0] . ' ----- FAIL TO CONNECT. Debug purpose : ' . $headers[0] . $headers['Content-Type'];\n\t\t\t\t\tarray_splice($_SESSION['page_list'], 0, 1);\n\t\t\t\t\tforeach ($_SESSION['page_list_done'] as $value) {\n\t\t\t\t\t\techo $value . '<br />';\n\t\t\t\t\t}\n\t\t\t\t\techo $headers[0] . '<br />';\n\t\t\t\t\tvar_dump($headers);\n\t\t\t\t\theader( \"refresh:2;url=\" . $_SERVER['PHP_SELF'] );\n\t\t\t\t\t//exit();\n\t\t\t\t} elseif (preg_match('/^.*(geolocalisation)$/i', $_SESSION['next_page'])) {\n\t\t\t\t\techo 'We skip that one <br /><br />';\n\t\t\t\t\theader( \"refresh:2;url=\" . $_SERVER['PHP_SELF'] );\n\t\t\t\t}\n\t\t}\n\t}", "public static function error_response() {\r\n header(\"HTTP/1.1 404 Recurso no encontrado\");\r\n exit();\r\n }", "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}", "function response404() {\n if ( headers_sent() )\n return;\n header( 'HTTP/1.1 404 Not Found', true, 404 );\n header( 'Content-Type: text/plain', true );\n echo 'Meal not found';\n exit();\n}", "function getCurrentURL(){\n $currentURL = (@$_SERVER[\"HTTPS\"] == \"on\") ? \"https://\" : \"http://\";\n $currentURL .= $_SERVER[\"SERVER_NAME\"];\n \n if($_SERVER[\"SERVER_PORT\"] != \"80\" && $_SERVER[\"SERVER_PORT\"] != \"443\")\n {\n $currentURL .= \":\".$_SERVER[\"SERVER_PORT\"];\n } \n \n $currentURL .= $_SERVER[\"REQUEST_URI\"];\n return $currentURL;\n}", "function render404() {\r\n header(\"HTTP/1.0 404 Not Found\");\r\n echo \"Seite nicht gefunden!\";\r\n exit();\r\n }", "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}", "function url_request(): string\n{\n return url_site() . input_server('REQUEST_URI');\n}", "function helperCheckForWrongUrl() {\n\t\t$status = array();\n\n\t\tif ($GLOBALS['TSFE']->config['config']['baseURL'] != '' || $GLOBALS['TSFE']->config['config']['absRefPrefix']) {\n\t\t\t$currentDomain = t3lib_div::getIndpEnv('TYPO3_HOST_ONLY');\n\t\t\t$linkDomain = $this->pi_getPageLink($GLOBALS['TSFE']->id);\n\n\t\t\tif ($linkDomain != '' && strpos($linkDomain, $currentDomain) === false) {\n\t\t\t\t$status['current']\t= $currentDomain;\n\t\t\t\t$status['link']\t\t\t= $linkDomain;\n\t\t\t}\n\t\t}\n\n\t\treturn $status;\n\t}", "public static function error404(){\n \t\t// header(\"Status: 404 Not Found\");\n \t\theader('Location: /');\n }", "function nebula_requested_url($host=\"HTTP_HOST\") { //Can use \"SERVER_NAME\" as an alternative to \"HTTP_HOST\".\n\t$protocol = ( (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443 ) ? 'https' : 'http';\n\t$full_url = $protocol . '://' . $_SERVER[\"$host\"] . $_SERVER[\"REQUEST_URI\"];\n\treturn $full_url;\n}", "function request_uri() {\n\n if (isset($_SERVER[\"REQUEST_URI\"])) {\n $uri = $_SERVER[\"REQUEST_URI\"];\n }\n else {\n $uri = $_SERVER[\"PHP_SELF\"] .\"?\". $_SERVER[\"argv\"][0];\n }\n\n return check_url($uri);\n}", "private function notFound()\n {\n $this->method = 'error404';\n header('X-PHP-Response-Code: 404', true, 404);\n }", "function status_header($code) {\n\t$desc = get_status_header_desc($code);\n\tif (empty($desc)) return false;\n\t$protocol = $_SERVER['SERVER_PROTOCOL'];\n\tif('HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol) $protocol = 'HTTP/1.0';\n\t$status_header = \"$protocol $code $desc\";\n\treturn @header($status_header, true, $code);\n}", "public function is_404();", "function getExit()\n{\n\theader(\"HTTP/1.0 404 Not Found\");\n\texit;\n}", "static function Protocol()\n {\n return self::Variable('SERVER_PROTOCOL');\n }", "function me() {\n\n if (!empty($_SERVER['REQUEST_URI'])) {\n return $_SERVER['REQUEST_URI'];\n\n } else if (!empty($_SERVER['PHP_SELF'])) {\n if (!empty($_SERVER['QUERY_STRING'])) {\n return $_SERVER['PHP_SELF'] .'?'. $_SERVER['QUERY_STRING'];\n }\n return $_SERVER['PHP_SELF'];\n\n } else if (!empty($_SERVER['SCRIPT_NAME'])) {\n if (!empty($_SERVER['QUERY_STRING'])) {\n return $_SERVER['SCRIPT_NAME'] .'?'. $_SERVER['QUERY_STRING'];\n }\n return $_SERVER['SCRIPT_NAME'];\n\n } else if (!empty($_SERVER['URL'])) { // May help IIS (not well tested)\n if (!empty($_SERVER['QUERY_STRING'])) {\n return $_SERVER['URL'] .'?'. $_SERVER['QUERY_STRING'];\n }\n return $_SERVER['URL'];\n\n } else {\n // notify('Warning: Could not find any of these web server variables: $REQUEST_URI, $PHP_SELF, $SCRIPT_NAME or $URL');\n return false;\n }\n}", "public static function error404() {\n header('This is not the page you are looking for', true, 404);\n $html404 = sprintf(\"<title>Error 404: Not Found</title>\\n\" .\n \"<main><div class=\\\"container\\\"><div class=\\\"row\\\"><div class=\\\"col-lg-10 offset-lg-1\\\">\" .\n \"<div class=\\\"row wow fadeIn\\\" data-wow-delay=\\\"0.4s\\\"><div class=\\\"col-lg-12\\\"><div class=\\\"divider-new\\\">\" .\n \"<h2 class=\\\"h2-responsive\\\">Error 404</h2>\" .\n \"</div></div>\" .\n \"<div class=\\\"col-lg-12 text-center\\\">\" .\n \"<p>The page <i>%s</i> does not exist.</p>\" .\n \"</div></div></div></div></div></main>\", $_SERVER[\"REQUEST_URI\"]);\n echo $html404;\n }", "function get_url() {\n $url = isset($_SERVER['HTTPS']) && 'on' === $_SERVER['HTTPS'] ? 'https' : 'http';\n $url .= '://' . $_SERVER['SERVER_NAME'];\n $url .= in_array($_SERVER['SERVER_PORT'], array('80', '443')) ? '' : ':' . $_SERVER['SERVER_PORT'];\n $url .= $_SERVER['REQUEST_URI'];\n return $url;\n}", "public function force404();", "public function force404();", "function getUrl(){\n return (!empty($_SERVER['HTTPS'])) ? \"https://\".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : \"http://\".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];\n}", "function url_exists($url){\n\t$url = str_replace(\"http://\", \"\", $url);\n\tif (strstr($url, \"/\")) {\n\t\t$url = explode(\"/\", $url, 2);\n\t\t$url[1] = \"/\".$url[1];\n\t} else {\n\t\t$url = array($url, \"/\");\n\t}\n\n\t$fh = fsockopen($url[0], 80);\n\tif ($fh) {\n\t\tfputs($fh,\"GET \".$url[1].\" HTTP/1.1\\nHost:\".$url[0].\"\\n\\n\");\n\t\tif (fread($fh, 22) == \"HTTP/1.1 404 Not Found\") { return FALSE; }\n\t\telse { return TRUE; }\n\n\t} else { \n\t\t//echo '<p>no fh</p>';\n\t\treturn FALSE;\n\t}\n}", "function is_invalid_request() {\n\t$http_referer = (isset($_SERVER['HTTP_REFERER'])) ? parse_url($_SERVER['HTTP_REFERER']) : NULL;\t\n\tif(!check_value($http_referer)) {\n\t\t$referal = HTTP_HOST;\n\t} else {\n\t\t$referal = (isset($http_referer['port']) && !empty($http_referer['port'])) ? $http_referer['host'].':'.$http_referer['port'] : $http_referer['host'];\n\t}\n\treturn ($referal !== HTTP_HOST) ? true : false;\t\n}", "function getHeader() {\n\tglobal $server, $html, $hostname, $userpwd;\n\t$chopts = array(\n\t\tCURLOPT_URL=>$hostname,\n\t CURLOPT_PORT=>80,\n\t CURLOPT_TIMEOUT=>5,\n\t CURLOPT_RETURNTRANSFER=>true,\n\t CURLOPT_HEADER=>true,\n\t CURLOPT_USERPWD=>\"$userpwd\",\n\t CURLOPT_FOLLOWLOCATION=>true);\n\n\t$ch = curl_init();\n\tcurl_setopt_array($ch, $chopts);\n\t$return = curl_exec($ch);\n\n\t// check for authentication failures using http codes *EXPERIMENTAL*\n\t/*\n\t$hCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\tif(isset($hCode)) {\n\t\tswitch($hCode) {\n\t\t\tcase \"401\": echo \"[-] authentication failure for: $hostname ($userpwd)\\n\"; exit(0);\n\t\t\tcase \"501\": echo \"[-] authentication failure for: $hostname ($userpwd)\\n\"; exit(0);\n\t\t\tdefault: break;\n\t\t}\n\t}\n\t*/\n\n\t// check for connection timeout using curl error codes\n\tif(curl_errno($ch)) {\n\t\tif(curl_errno($ch) == 28) {\n\t\t\tlogIT('e',\"[!] connection timed out to: $hostname, skipping...\");\n\t\t\techo \"[!] connection timed out to: $hostname, skipping...\\n\";\n\t\t\texit(0);\n\t\t}\n\t}\n\tcurl_close($ch);\n\n\t$headers = http_response_headers($return);\n\tforeach ($headers as $header) {\n\t\t$hdr_arr = http_response_header_lines($header);\n\t if(isset($hdr_arr['Location'])) {\n\t $str = $hdr_arr['Location'];\n\t $html = file_get_contents_curl(\"$str\", \"$userpwd\");\n\t } else {\n\t $html = file_get_contents_curl(\"$hostname\", \"$userpwd\");\n\t }\n\t if(isset($hdr_arr['Server'])) {\n\t\t\t$server = $hdr_arr['Server'];\n\t\t}\n\t}\n}", "function status($code) {\n $reason=@constant('self::HTTP_'.$code);\n if (PHP_SAPI!='cli')\n header($_SERVER['SERVER_PROTOCOL'].' '.$code.' '.$reason);\n return $reason;\n }", "function sysError404(){\n\tsysError( \"Please check the address and try again.\", \"The page you requested was not found.\", \"Page Not Found\" );\t\n\texit();\n}", "function url_site(): string\n{\n //return input_server('REQUEST_SCHEME') . '://' . input_server('SERVER_NAME');\n $site = \\get_site_url();\n $pos = strpos($site, '/', 8);\n return $pos ? substr($site, 0, $pos) : $site;\n}", "function getCurrentPageURL() {\n $pageURL = 'http';\n// if ($_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\n// $pageURL .= \"://\";\n// if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n// $pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n// } else {\n $pageURL .= $_SERVER[\"SERVER_NAME\"] . $_SERVER[\"REQUEST_URI\"];\n// }\n return $pageURL;\n}", "private function getErrorPage($url){\r\n header(\"HTTP/1.0 404 Not Found\");\r\n die(strtoupper(\"error 404 $url not found\"));\r\n }", "function server($element){\r\n if(@isset($_SERVER[$element])) return $_SERVER[$element];\r\n else return FALSE;\r\n}", "function getUrl() {\r\n\t$url = @( $_SERVER[\"HTTPS\"] != 'on' ) ? 'http://'.$_SERVER[\"SERVER_NAME\"] : 'https://'.$_SERVER[\"SERVER_NAME\"];\r\n\t$url .= ( $_SERVER[\"SERVER_PORT\"] !== 80 ) ? \":\".$_SERVER[\"SERVER_PORT\"] : \"\";\r\n\t$url .= $_SERVER[\"REQUEST_URI\"];\r\n\treturn $url;\r\n}", "function urlOK($url)\n{\n $headers = @get_headers($url);\n if(strpos($headers[0],'200')===false){return false;}else{return true;}\n}", "function curPageURL() {\n $pageURL = 'http';\n if (isset($_SERVER[\"HTTPS\"]) && $_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\n $pageURL .= \"://\";\n if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n $pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n } else {\n $pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n }\n return $pageURL;\n}", "function page_not_found()\n{\n header(\"HTTP/1.0 404 Not Found\");\n include __DIR__ . \"/../view/404.php\";\n die();\n}", "function ajax_action_check_url() {\n\n\t\t$hadError = true;\n\n\t\t$url = isset( $_REQUEST['url'] ) ? $_REQUEST['url'] : '';\n\n\t\tif ( strlen( $url ) > 0 && function_exists( 'get_headers' ) ) {\n\t\t\t\t\n\t\t\t$file_headers = @get_headers( $url );\n\t\t\t$exists = $file_headers && $file_headers[0] != 'HTTP/1.1 404 Not Found';\n\t\t\t$hadError = false;\n\t\t}\n\n\t\techo '{ \"exists\": '. ($exists ? '1' : '0') . ($hadError ? ', \"error\" : 1 ' : '') . ' }';\n\n\t\tdie();\n\t}", "function remote_file_exists($url)\n\t{\n\t // Make sure php will allow us to do this...\n\t if ( ini_get('allow_url_fopen') )\n\t {\n\t \t$head = '';\n\t \t$url_p = parse_url ($url);\n\t\n\t \tif (isset ($url_p['host']))\n\t \t{\n\t\t\t\t$host = $url_p['host']; \n\t\t\t}\n\t \telse\n\t \t{\n\t \treturn false;\n\t \t}\n\t\n\t \tif (isset ($url_p['path']))\n\t \t{ \n\t\t\t\t$path = $url_p['path']; \n\t\t\t}\n\t \telse\n\t \t{\n\t\t\t \t$path = ''; \n\t\t\t}\n\t\n\t \t$fp = @fsockopen ($host, 80, $errno, $errstr, 20);\n\t \tif (!$fp)\n\t \t{\n\t \t\treturn false;\n\t \t}\n\t \telse\n\t \t{\n\t \t\t$parse = parse_url($url);\n\t \t\t$host = $parse['host'];\n\t\n\t\t\t\t@fputs($fp, 'HEAD '.$url.\" HTTP/1.1\\r\\n\");\n\t \t\t@fputs($fp, 'HOST: '.$host.\"\\r\\n\");\n\t \t\t@fputs($fp, \"Connection: close\\r\\n\\r\\n\");\n\t \t\t$headers = '';\n\t \t\twhile (!@feof ($fp))\n\t \t\t{ \n\t\t\t\t\t$headers .= @fgets ($fp, 128); \n\t\t\t\t}\n\t \t}\n\t \t@fclose ($fp);\n\t\n\t \t$arr_headers = explode(\"\\n\", $headers);\n\t \tif (isset ($arr_headers[0])) \n\t\t\t{\n\t \t\tif(strpos ($arr_headers[0], '200') !== false)\n\t \t\t{ \n\t\t\t\t\treturn true; \n\t\t\t\t}\n\t \t\tif( (strpos ($arr_headers[0], '404') !== false) || (strpos ($arr_headers[0], '509') !== false) || (strpos ($arr_headers[0], '410') !== false))\n\t \t\t{ \n\t\t\t\t\treturn false; \n\t\t\t\t}\n\t \t\tif( (strpos ($arr_headers[0], '301') !== false) || (strpos ($arr_headers[0], '302') !== false))\n\t\t\t\t{\n\t \t\tpreg_match(\"/Location:\\s*(.+)\\r/i\", $headers, $matches);\n\t \t\tif(!isset($matches[1]))\n\t\t\t\t\t{\n\t \t\t\treturn false;\n\t\t\t\t\t}\n\t \t\t$nextloc = $matches[1];\n\t\t\t\t\treturn $this->remote_file_exists($nextloc);\n\t \t\t}\n\t \t}\n\t \t// If we are still here then we got an unexpected header\n\t \treturn false;\n\t }\n\t else\n\t {\n\t \t// Since we aren't allowed to use URL's bomb out\n\t \treturn false;\n\t }\n\t}", "public function getServerURI() {\n $server_name = $this->full_server_name;\n\n if ($server_name != '[manual]') {\n $server_matches = array();\n preg_match('/(.*)\\/hiro\\/HiroServlet/i', $server_name, $server_matches);\n\n // New servers are with an \"api\" prefix instead of the old ones.\n $servers_prefixes = array(\n \"console1\",\n );\n\n if (empty($server_matches[1])) {\n return FALSE;\n }\n $found = str_replace($servers_prefixes, \"api\", $server_matches[1]);\n\n return $found;\n }\n }", "public static function sendNotFoundResponse(){\n http_response_code(404);\n die();\n }", "function get_request_protocol()\n{\n return Request::GetProtocol();\n}", "function input_server(string $key): ?string\n{\n return $_SERVER[$key];\n}", "function serendipity_check_rewrite($default) {\n global $serendipity;\n\n if (IS_installed == true) {\n return $default;\n }\n\n $serendipity_root = dirname($_SERVER['PHP_SELF']) . '/';\n $serendipity_core = serendipity_httpCoreDir();\n $old_htaccess = @file_get_contents($serendipity_core . '.htaccess');\n $fp = @fopen($serendipity_core . '.htaccess', 'w');\n $serendipity_host = preg_replace('@^([^:]+):?.*$@', '\\1', $_SERVER['HTTP_HOST']);\n\n if (!$fp) {\n printf(HTACCESS_ERROR,\n '<b>chmod go+rwx ' . getcwd() . '/</b>'\n );\n return $default;\n } else {\n fwrite($fp, 'ErrorDocument 404 ' . addslashes($serendipity_root) . 'index.php');\n fclose($fp);\n\n // Do a request on a nonexistant file to see, if our htaccess allows ErrorDocument\n $sock = @fsockopen($serendipity_host, $_SERVER['SERVER_PORT'], $errorno, $errorstring, 10);\n $response = '';\n\n if ($sock) {\n fputs($sock, \"GET {$_SERVER['PHP_SELF']}nonexistant HTTP/1.0\\r\\n\");\n fputs($sock, \"Host: $serendipity_host\\r\\n\");\n fputs($sock, \"User-Agent: Serendipity/{$serendipity['version']}\\r\\n\");\n fputs($sock, \"Connection: close\\r\\n\\r\\n\");\n\n while (!feof($sock) && strlen($response) < 4096) {\n $response .= fgets($sock, 400);\n }\n fclose($sock);\n }\n\n if (preg_match('@^HTTP/\\d\\.\\d 200@', $response) && preg_match('@X\\-Blog: Serendipity@', $response)) {\n $default = 'errordocs';\n } else {\n $default = 'none';\n }\n\n if (!empty($old_htaccess)) {\n $fp = @fopen($serendipity_core . '.htaccess', 'w');\n fwrite($fp, $old_htaccess);\n fclose($fp);\n } else {\n @unlink($serendipity_core . '.htaccess');\n }\n\n return $default;\n }\n}", "function check_ref()\r\n\t{\r\n\t\t$srv = $_SERVER['SERVER_NAME']; //服务器名\r\n\t\t\r\n\t\tif (substr($_SERVER['HTTP_REFERER'],7,strlen($srv)) != $srv)\r\n\t {\r\n\t\t\t//header('Location: /');\r\n\t \t exit;\r\n\t }\r\n\t\t\r\n\t\treturn true;\r\n\t}", "function selfURL() {\n \t$s = empty($_SERVER[\"HTTPS\"]) ? '' : ($_SERVER[\"HTTPS\"] == \"on\") ? \"s\" : \"\";\n \t$protocol = strleft(strtolower($_SERVER[\"SERVER_PROTOCOL\"]), \"/\").$s;\n \t$port = ($_SERVER[\"SERVER_PORT\"] == \"80\") ? \"\" : (\":\".$_SERVER[\"SERVER_PORT\"]);\n\t\treturn $protocol.\"://\".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];\n\t}", "public function getRequestURL() {\n\t\t$scheme = $this->getScheme();\n\t\t$port = $this->getServerPort();\n\t\t$url = $scheme . '://';\n\t\t$url .= $this->getServerName();\n\t\tif(($scheme == 'http' && $port != 80) || ($scheme == 'https' && $port != 443)) {\n\t\t\t$url .= ':' . $port;\n\t\t}\n\t\t$url .= $this->getRequestURI();\n\t\treturn $url;\n\t}", "public function show404();", "public static function reviewServer($URL_request)\n {\n\n if (!in_array($_SERVER['HTTP_HOST'], Config::$_LOCAL_SERVERS)) {\n if (\n strpos(Config::$_HOST_, \"www\") !== FALSE\n ) {\n if (strpos($_SERVER['HTTP_HOST'], \"www\") === FALSE) {\n $render = Config::$_HOST_ . Config::$_MAIN_DIRECTORY . $URL_request;\n header(\"Location: $render\");\n }\n\n } else {\n throw new Exception('Error in request to server, please call the administrator');\n }\n }\n }", "function request_not_found(&$url, $page) {\n if(substr($url, -1) != '/') {\n $page = \\femto\\Page::resolve($url.'/');\n if($page) {\n header('Location: '.$page['url'], true, 301);\n exit();\n }\n }\n}", "function readURL()\n\t{\n\t\t\t $pageURL = 'http';\n\t\t\t if (isset($_SERVER[\"HTTPS\"]) && $_SERVER[\"HTTPS\"] == \"on\") $pageURL .= \"s\";\n\t\t\t $pageURL .= \"://\";\n\t\t\t if (isset($_SERVER[\"SERVER_PORT\"]) && $_SERVER[\"SERVER_PORT\"] != \"80\") {\n\t\t\t $pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n\t\t\t } else {\n\t\t\t $pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n\t\t\t }\n\t\t\t \n\t\treturn $pageURL;\n\t}", "static function URL ()\n\t\t{\n\t\t\tif (php_sapi_name() === \"cli\")\n\t\t\t\treturn NULL;\n\t\t\treturn (self::Protocol().\"://\".self::ServerName().self::PortReadable().self::RequestURI());\n\t\t}", "function get_http_response_code($url) {\n $headers = get_headers($url);\n return substr($headers[0], 9, 3);\n\t}", "function getServerProtocol() {\n\t\treturn $this->getParam(self::PARAM_SERVER_PROTOCOL);\n\t}", "function curPageURL() {\n @$pageURL = 'http';\n if (@$_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\n @$pageURL .= \"://\";\n if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n @$pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n } else {\n @$pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n }\n return @$pageURL;\n}", "function notFound()\n{\n error404('<h1>404 Not Found</h1>The page that you have requested could not be found.');\n}", "public function AppLocalOrServer()\n {\n if (preg_match('/localhost/i', base_url())) return \"local\";\n else return \"server\";\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}", "function request_uri() {\n\t\tif(isset($_SERVER['argv'])) {\n\t\t\t$protocol = 'cli';\n\t\t\t$host = gethostname();\n\t\t\t$path = '/' . $_SERVER['SCRIPT_FILENAME'];\n\t\t\tif(count($_SERVER['argv']) > 1) {\n\t\t\t\tunset($_SERVER['argv'][0]);\n\t\t\t\t$query_string = '?' . http_build_query($_SERVER['argv']);\n\t\t\t} else {\n\t\t\t\t$query_string = '';\n\t\t\t}\n\n\t\t\treturn $protocol . '://' . $host . $path . $query_string;\n\t\t} else {\n\t\t\tif (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) {\n\t\t\t\t$protocol = 'https';\n\t\t\t} else {\n\t\t\t\t$protocol = 'http';\n\t\t\t}\n\t\t\t$host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';\n\t\t\t$path = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';\n\t\t\t$query_string = isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING']) ? ('?' . $_SERVER['QUERY_STRING']) : '';\n\t\t\treturn $protocol . '://' . $host . $path . $query_string;\n\t\t}\n\t}", "public static function getHeader($name,$default=null) {\n\t\t$name = 'HTTP_'.strtoupper(str_replace('-','_',$name));\n\t\tif(isset($_SERVER[$name])) {\n\t\t\treturn $_SERVER[$name];\n\t\t}\n\t\treturn $default;\n\t}", "function curPageURL() {\n $pageURL = 'http';\n if (isset($_SERVER[\"HTTPS\"]) AND $_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\n $pageURL .= \"://\";\n if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n $pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n } else {\n $pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n }\n return $pageURL;\n}", "function redirect_404()\n{\n // prevent Browser cache for php site\n header(\"Cache-Control: no-store, no-cache, must-revalidate, max-age=0\");\n header(\"Cache-Control: post-check=0, pre-check=0\", false);\n header(\"Pragma: no-cache\");\n header('HTTP/1.1 404 Not Found');\n Error_Handling::showerror_404();\n}", "function curPageURL() {\n $pageURL = 'http';\n if ($_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\n $pageURL .= \"://\";\n if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n $pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n } else {\n $pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n }\n return $pageURL;\n}", "function curPageURL() {\n $pageURL = 'http';\n if ($_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\n $pageURL .= \"://\";\n if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n $pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n } else {\n $pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n }\n return $pageURL;\n}", "function curPageURL() {\n $pageURL = 'http';\n if ($_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\n $pageURL .= \"://\";\n if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n $pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n } else {\n $pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n }\n return $pageURL;\n}", "public function getOwnURL() \n\t{ \n\t\t$s = empty($_SERVER[\"HTTPS\"]) ? '' : ($_SERVER[\"HTTPS\"] == \"on\") ? \"s\" : \"\"; \n\t\t$protocol = $this->strleft(strtolower($_SERVER[\"SERVER_PROTOCOL\"]), \"/\").$s; \n$port = ($_SERVER[\"SERVER_PORT\"] == \"80\" || $_SERVER[\"SERVER_PORT\"] == \"82\") ? \"\" : (\":\".$_SERVER[\"SERVER_PORT\"]); \n\t\treturn $protocol.\"://\".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI']; \n\t}", "static private function CheckCorrectHost() {\n\t\tif (count($_POST) > 0) {\n\t\t\treturn;\n\t\t}\n\t\t$correct_host = str_replace('https://', '', self::getURL());\n\n\t\tif ($_SERVER[\"SERVER_NAME\"] !== $correct_host) {\n\t\t\tself::redirect(self::getCurrentURL() . $_SERVER[\"REQUEST_URI\"]);\n\t\t}\n\t}", "static function getUrl() {\n\t\t$host = env('HTTP_HOST');\n\t\t$script_filename = env('SCRIPT_FILENAME');\n\t\t$isshell = (strpos($script_filename, 'console')!==false);\n\t\t$envExtended = \"\";\n\t\tif ($isshell) {\n\t\t\t$envExtended = preg_replace('#[^a-zA-Z0-9]#', '', env('SCRIPT_FILENAME'));\n\t\t}\n\t\t$check_order = array(\n\t\t\t'REQUEST_URI',\n\t\t\t'QUERY_STRING'\n\t\t);\n\t\tforeach ($check_order as $key) {\n\t\t\tif (isset($_SERVER[$key]) && !empty($_SERVER[$key])) {\n\t\t\t\treturn $_SERVER[$key] . $envExtended;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "function getHttpCode();", "function status_header($header) {\n $text = get_status_header_desc($header);\n\n if (empty ($text)) {\n return;\n }\n $protocol = $_SERVER [\"SERVER_PROTOCOL\"];\n if ('HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol) {\n $protocol = 'HTTP/1.0';\n }\n\n $status_header = \"$protocol $header $text\";\n\n @header($status_header, true, $header);\n if (php_sapi_name() == 'cgi-fcgi') {\n @header(\"Status: $header $text\");\n }\n}", "protected function redirectNotFound(){\r\n \theader('Location: '.BASE_URI.Routes::getUri('not_found'));\r\n }", "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 currentPageURL()\n{\n $pageURL = 'http';\n if (array_key_exists('HTTPS', $_SERVER) && $_SERVER['HTTPS'] == 'on') {\n $pageURL .= 's';\n }\n $pageURL .= '://';\n if ($_SERVER['SERVER_PORT'] != '80') {\n $pageURL .= $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];\n } else {\n $pageURL .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\n }\n return $pageURL;\n}", "function errorPage($msg) {\n header(\"Status: 404 Not Found\");\n die('404: ' . $msg);\n}", "private function notFound() {\n if (file_exists(APP . 'Controller/error.php')) {\n header('Location: ' . BASE_URL . 'error');\n } else {\n die('Sorry, the requested content could not be found');\n }\n }", "function curPageURL() {\r\n $pageURL = 'http';\r\n if ($_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\r\n $pageURL .= \"://\";\r\n if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\r\n $pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\r\n } else {\r\n $pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\r\n }\r\n return $pageURL;\r\n}", "protected function handleNotFound(ServerRequestInterface $request)\n {\n // 重写路由找不到的处理逻辑\n return admin_abort([\"msg\" => \"页面不存在\"],404);\n }", "function realanswers_current_page_url() {\r\n $pageURL = (@$_SERVER[\"HTTPS\"] == \"on\") ? \"https://\" : \"http://\";\r\n if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\r\n $pageURL .= $_SERVER[\"SERVER_NAME\"] . \":\" . $_SERVER[\"SERVER_PORT\"] . $_SERVER[\"REQUEST_URI\"];\r\n }\r\n else\r\n {\r\n $pageURL .= $_SERVER[\"SERVER_NAME\"] . $_SERVER[\"REQUEST_URI\"];\r\n }\r\n return $pageURL;\r\n}", "function get_http_response_code($url) {\n $headers = get_headers($url);\n return substr($headers[0], 9, 3);\n}" ]
[ "0.69290465", "0.67394394", "0.66866505", "0.6655946", "0.659888", "0.6528775", "0.6462135", "0.63780314", "0.6366909", "0.63486725", "0.6317152", "0.6209743", "0.62046796", "0.61609083", "0.6158642", "0.6140819", "0.6124501", "0.61047065", "0.6102851", "0.60945535", "0.604605", "0.6019998", "0.59878564", "0.59802794", "0.5968029", "0.59668493", "0.59225225", "0.5921159", "0.5916184", "0.58781606", "0.5872121", "0.58670896", "0.5861211", "0.5845397", "0.58181006", "0.58100075", "0.58089286", "0.58064145", "0.5791587", "0.5790448", "0.57833076", "0.57575375", "0.5752993", "0.5752993", "0.5748125", "0.574787", "0.57427573", "0.57417536", "0.57331234", "0.5725152", "0.5722559", "0.57092804", "0.57081926", "0.5692595", "0.5690438", "0.56780565", "0.567266", "0.56718713", "0.56703615", "0.5667942", "0.566309", "0.56579703", "0.5657739", "0.56546634", "0.56532645", "0.5653014", "0.5645061", "0.56377524", "0.5637361", "0.56323195", "0.56250733", "0.5602062", "0.5601964", "0.56010425", "0.5589245", "0.55871606", "0.55858046", "0.5583492", "0.55808645", "0.5564876", "0.5554625", "0.5554471", "0.55536336", "0.55478877", "0.55478877", "0.55478877", "0.55471945", "0.55439675", "0.55438566", "0.55421513", "0.55400145", "0.55383664", "0.5530226", "0.55243534", "0.5513192", "0.55129135", "0.55093277", "0.5507022", "0.5504797", "0.55034125" ]
0.6535155
5
Verifica que este disponible la cartelera para una cierta fecha y duracion
function isAvailable($fromDate, $duration) { return AdvertisementQuery::create() ->filterByBillboard($this) ->filterByPublished($fromDate, $duration) ->count() == 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasCtime(){\n return $this->_has(4);\n }", "public function vacio() {\n if ($this->cantcartas == -1)\n return TRUE;\n return FALSE;\n }", "public function hasRelivetime(){\n return $this->_has(3);\n }", "public function hasBepro2Time(){\n return $this->_has(4);\n }", "public function hasExpiretime(){\n return $this->_has(4);\n }", "public function hasCTime(){\n return $this->_has(6);\n }", "private function verifyRent(){\n\t\tglobal $db;\n\t\t$date_now = date('2018-10-18');\n\t\t$sql = $db->prepare(\"SELECT * FROM project01_stock WHERE vacancy = 'no'\");\n\t\t$sql->execute();\n\t\tif ($sql->rowCount()>0) {\n\t\t\t$sql = $sql->fetch();\n\t\t\t$rom_info = $sql;\n\n\t\t\t$sql = $db->prepare(\"UPDATE project01_stock SET vacancy = 'yes', date_init = '0000-00-00', date_end = '0000-00-00' WHERE date_end <= :date_end\");\n\t\t\t$sql->bindValue(\":date_end\", $date_now);\n\t\t\t$sql->execute();\n\t\t}\n\t}", "public function hasCdtime(){\n return $this->_has(4);\n }", "public function hasBepro1Time(){\n return $this->_has(3);\n }", "public function isExpire(){\n\t\t$duedate = new DateTime($this->duedate);\n\t\t$today = new DateTime(\"now\");\n\t\t\n\t\tif($duedate < $today) \n\t\t\treturn true;\n\t\treturn false;\n\t}", "public function isDue(): bool;", "public function getCarStatusSoldExpire(){\r\n\t\tif($this->getCarStatusValue()==2){\r\n\t\t\tif($this->getCarStatusInterval()>30){\r\n\t\t\t\treturn true;\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn false;\t\r\n\t\t}\r\n\t}", "public function needsToCreateInstallments()\n\t{\n\t\tif ($this->recurringChargeStatusId != Recurring_Charge_Status::getIdForSystemName('ACTIVE'))\n\t\t{\n\t\t\tthrow new Exception('Recurring Charge is not ACTIVE');\n\t\t}\n \t\t\n\t\tif (!$this->isAccountEligibleForChargeGeneration())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->service != null)\n\t\t{\n\t\t\tif (!$this->isServiceEligibleForChargeGeneration())\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$intNextInstallment\t= $this->totalRecursions + 1;\n\t\t$intTimesToCharge\t= $this->getTimesToCharge();\n\t\t$strTodaysDate\t\t= GetCurrentISODate();\n\t\t\n\t\tif ($intNextInstallment > $intTimesToCharge)\n\t\t{\n\t\t\t// All obligated installments have been created\n\t\t\t// Considering the RecurringCharge is still ACTIVE, then it must be continuable, otherwise it would have been set to COMPLETED\n\t\t\tif ($this->continuable == 0)\n\t\t\t{\n\t\t\t\t// This should never happen\n\t\t\t\tthrow new Exception_Assertion(\"All obligated charges have been produced and this recurring charge is not continuable, but still ACTIVE. It should be set to COMPLETED\", \"Method: \". __METHOD__ .\"\\nRecurringCharge object: \\n\". print_r($this, true), \"RecurringCharge Record Data Integrity Breach\");\n\t\t\t}\n\t\t}\n\n\t\t// Get the ChargedOn timestamp for the next installment\n\t\t$strChargedOnForNextInstallment = $this->getChargedOnDateForInstallment($intNextInstallment);\n\t\t\n\t\t// Don't bother checking the $strChargedOnForNextInstallment > $this->lastChargedOn\n\t\t\n\t\treturn ($strChargedOnForNextInstallment <= $strTodaysDate)? true : false;\n\t}", "protected function needsRenewal(): bool\n {\n return $this->renewable() === true && $this->expiryTime() - time() < $this->duration() / 2;\n }", "public function hasDelay()\n {\n global $conf;\n\n if (empty($this->date_delivery) && ! empty($this->date_livraison)) $this->date_delivery = $this->date_livraison; // For backward compatibility\n\n $now = dol_now();\n $date_to_test = empty($this->date_delivery) ? $this->date_commande : $this->date_delivery;\n\n return ($this->statut > 0 && $this->statut < 4) && $date_to_test && $date_to_test < ($now - $conf->commande->fournisseur->warning_delay);\n }", "private function checkNewCommondaty()\n {\n $date = new DateTime($this->addDate);\n $date->modify(self::TIME_INTERVAL);\n $date->format('Y-m-d H:i:s');\n $dateNow = new DateTime();\n $dateNow->format('Y-m-d H:i:s');\n\n if ($dateNow < $date) {\n return 1;\n }\n return 0;\n }", "public function hasCleartime(){\n return $this->_has(2);\n }", "public function checkValidity()\n {\n // le pb est que la propriété publicationDate est de type dateTime or les tests initiaux\n // se basent sur un format de type date --> ce qui génère une erreur de type notice\n \n return true;\n }", "public function hasBepro3Time(){\n return $this->_has(5);\n }", "public function hasClearTime(){\n return $this->_has(2);\n }", "function isValid() {\n //we get if it is still good or expired\n return DataHora::compareDate2($this->getExpirationDate(), '>=', date('m/d/Y'), 'mm/dd/yyyy', 'mm/dd/yyyy');\n }", "private function isPreExpired($mix) {\n\t\tif ($this->recalc) {\n\t\t\t$currentDate = new Date(time());\n\t\t\t$equipmentExpireDate = ($mix->getEquipment()) ? $mix->getEquipment()->getDate() : null;\n\n\t\t\t//\tIf Equipment expire date - current date less than 5 days,\n\t\t\t//\tchange status to \"preExpired\"\n\t\t\tif ($equipmentExpireDate != null) {\n\t\t\t\t$secondsBetween = $equipmentExpireDate->getTimeStamp() - $currentDate->getTimeStamp();\n\t\t\t\tif ($secondsBetween < 60*60*24*5 && $secondsBetween > 0) {\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}\n\t\t\t}\n\t\t} else {\n\t\t\treturn $mix->isPreExpired();\n\t\t}\n\t}", "public function hasDate() {\n return $this->_has(3);\n }", "public function testSavedUrsprungPlan($mesic,$rok){\n $hasData = 0;\n $sql = \"select persnr from dzeitsoll2 where MONTH(datum)='$mesic' and YEAR(datum)='$rok'\";\n $result = $this->db->query($sql);\n if(count($result)>0)\n $hasData = 1;\n return $hasData;\n }", "public function checkStock()\n {\n if ($this->qty > ($this->beer->stock - $this->beer->requested_stock)){\n return false;\n }\n\n return true;\n }", "public function TieneCobranzasVigentes()\n\t{\n\t\t$q = Doctrine_Query::create()\n\t\t->from('CobranzaLiquidacion cl')\n\t\t->innerJoin('cl.Factura f')\n\t\t->andWhere('f.FechaAnulacion IS NULL')\n\t\t->where('cl.FacturaId = ?', $this->Id);\n\t\t \n\t\t$liquidaciones\t=\t $q->execute();\n\t\t\n\t\tif(count($liquidaciones) > 0)\n\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public function RegistrarDelivery()\n{\n\tself::SetNames();\n\tif(empty($_POST[\"txtTotal\"]) or empty($_POST[\"txtTotalCompra\"]))\n\t{\n\t\techo \"1\";\n\t\texit;\n\t}\n\n\tif($_POST[\"txtTotal\"]==\"\")\n\t{\n\t\techo \"2\";\n\t\texit;\n\n\t} else if(empty($_SESSION[\"CarritoDelivery\"]))\n\t{\n\t\techo \"3\";\n\t\texit;\n\n\t} \n\n\t$ver = $_SESSION[\"CarritoDelivery\"];\n\tfor($i=0;$i<count($ver);$i++){ \n\n\t\t$sql = \"select existencia from productos where codproducto = '\".$ver[$i]['txtCodigo'].\"'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t$existencia = $row['existencia'];\n\n\t\tif($ver[$i]['cantidad'] > $existencia) {\n\n\t\t\techo \"4\";\n\t\t\texit; }\n\t\t}\n\n\n\t\tif($_POST[\"codcaja\"]==\"\")\n\t{\n\t\techo \"5\";\n\t\texit;\n\t}\n\n\tif ($_POST[\"tipopagove\"] == \"CREDITO\" && $_POST[\"cliente\"] == '') { \n\n\t\techo \"6\";\n\t\texit;\n\t}\n\n\tif (strip_tags(isset($_POST['fechavencecredito']))) { $fechavencecredito = strip_tags(date(\"Y-m-d\",strtotime($_POST['fechavencecredito']))); } else { $fechavencecredito =''; }\n\t$f1 = new DateTime($fechavencecredito);\n\t$f2 = new DateTime(\"now\");\n\n\tif($_POST[\"tipopagove\"] == \"CREDITO\" && $f2 > $f1) { \n\n\t\techo \"7\";\n\t\texit;\n\t}\n\n\n\t$sql = \" select codventa from ventas order by codventa desc limit 1\";\n\t\t\t\t\tforeach ($this->dbh->query($sql) as $row){\n\n\t$codventa[\"codventa\"]=$row[\"codventa\"];\n\n\t\t}\n\t\tif(empty($codventa[\"codventa\"])){\n\n\t\t\t$codventa = '000000000000001';\n\n\t\t} else {\n\t\t\t$resto = substr($codventa[\"codventa\"], 0, 0);\n\t\t\t$coun = strlen($resto);\n\t\t\t$num = substr($codventa[\"codventa\"] , $coun);\n\t\t\t$dig = $num + 1;\n\t\t\t$cod = str_pad($dig, 15, \"0\", STR_PAD_LEFT);\n\t\t\t$codventa = $cod;\n\t\t}\n\n\t\t$query = \" insert into ventas values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $codventa);\n\t\t$stmt->bindParam(2, $codcaja);\n\t\t$stmt->bindParam(3, $codcliente);\n\t\t$stmt->bindParam(4, $codmesa);\n\t\t$stmt->bindParam(5, $subtotalivasive);\n\t\t$stmt->bindParam(6, $subtotalivanove);\n\t\t$stmt->bindParam(7, $ivave);\n\t\t$stmt->bindParam(8, $totalivave);\n\t\t$stmt->bindParam(9, $descuentove);\n\t\t$stmt->bindParam(10, $totaldescuentove);\n\t\t$stmt->bindParam(11, $totalpago);\n\t\t$stmt->bindParam(12, $totalpago2);\n\t\t$stmt->bindParam(13, $tipopagove);\n\t\t$stmt->bindParam(14, $formapagove);\n\t\t$stmt->bindParam(15, $montopagado);\n\t\t$stmt->bindParam(16, $montodevuelto);\n\t\t$stmt->bindParam(17, $fechavencecredito);\n\t\t$stmt->bindParam(18, $statusventa);\n\t\t$stmt->bindParam(19, $statuspago);\n\t\t$stmt->bindParam(20, $fechaventa);\n\t\t$stmt->bindParam(21, $codigo);\n\t\t$stmt->bindParam(22, $cocinero);\n\t\t$stmt->bindParam(23, $delivery);\n\t\t$stmt->bindParam(24, $repartidor);\n\t\t$stmt->bindParam(25, $entregado);\n\t\t$stmt->bindParam(26, $observaciones);\n\n\t\t$codcaja = strip_tags($_POST[\"codcaja\"]);\n\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t$codmesa = strip_tags(\"0\");\n\t\t$subtotalivasive = strip_tags($_POST[\"txtsubtotal\"]);\n\t\t$subtotalivanove = strip_tags($_POST[\"txtsubtotal2\"]);\n\t\t$ivave = strip_tags($_POST[\"iva\"]);\n\t\t$totalivave = strip_tags($_POST[\"txtIva\"]);\nif (strip_tags(isset($_POST['descuento']))) { $descuentove = strip_tags($_POST['descuento']); } else { $descuentove ='0.00'; }\nif (strip_tags(isset($_POST['txtDescuento']))) { $totaldescuentove = strip_tags($_POST['txtDescuento']); } else { $totaldescuentove ='0.00'; }\n\t\t\t\t\t$totalpago = strip_tags($_POST[\"txtTotal\"]);\n\t\t\t\t\t$totalpago2 = strip_tags($_POST[\"txtTotalCompra\"]);\nif (strip_tags(isset($_POST['tipopagove']))) { $tipopagove = strip_tags($_POST['tipopagove']); } else { $tipopagove =''; }\nif (strip_tags($_POST[\"tipopagove\"]==\"CONTADO\")) { $formapagove = strip_tags($_POST[\"formapagove\"]); } else { $formapagove = \"CREDITO\"; }\n\nif (strip_tags(isset($_POST['montopagado']))) { $montopagado = strip_tags($_POST['montopagado']); } else { $montopagado =''; }\nif (strip_tags(isset($_POST['montodevuelto']))) { $montodevuelto = strip_tags($_POST['montodevuelto']); } else { $montodevuelto =''; }\nif (strip_tags(isset($_POST['fechavencecredito']))) { $fechavencecredito = strip_tags(date(\"Y-m-d\",strtotime($_POST['fechavencecredito']))); } else { $fechavencecredito =''; }\nif (strip_tags($_POST[\"tipopagove\"]==\"CONTADO\")) { $statusventa = strip_tags(\"PAGADA\"); } else { $statusventa = \"PENDIENTE\"; }\n\t\t\t\t\t$statuspago = \"0\";\n\t\t\t\t\t$fechaventa = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t\t\t$codigo = strip_tags($_SESSION[\"codigo\"]);\n\t\t\t\t\t$cocinero = strip_tags('1');\n\t\t\t\t\t$delivery = strip_tags($_POST[\"delivery\"]);\nif (strip_tags(isset($_POST['repartidor']))) { $repartidor = strip_tags($_POST['repartidor']); } else { $repartidor ='0'; }\nif (strip_tags(isset($_POST['repartidor']))) { $entregado = strip_tags(\"1\"); } else { $entregado ='0'; }\nif (strip_tags(isset($_POST['observaciones']))) { $observaciones = strip_tags($_POST['observaciones']); } else { $observaciones =''; }\n\t\t\t\t\t$stmt->execute();\n\n\n\t\t\t\t\t$venta = $_SESSION[\"CarritoDelivery\"];\n\t\t\t\t\tfor($i=0;$i<count($venta);$i++){\n\n\t\t$sql = \"select existencia from productos where codproducto = '\".$venta[$i]['txtCodigo'].\"'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t\n\t\t$existenciadb = $row['existencia'];\n\n\t\t$query = \" insert into detalleventas values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t\t\t\t$stmt->bindParam(4, $producto);\n\t\t\t\t\t\t$stmt->bindParam(5, $codcategoria);\n\t\t\t\t\t\t$stmt->bindParam(6, $cantidad);\n\t\t\t\t\t\t$stmt->bindParam(7, $preciocompra);\n\t\t\t\t\t\t$stmt->bindParam(8, $precioventa);\n\t\t\t\t\t\t$stmt->bindParam(9, $ivaproducto);\n\t\t\t\t\t\t$stmt->bindParam(10, $importe);\n\t\t\t\t\t\t$stmt->bindParam(11, $importe2);\n\t\t\t\t\t\t$stmt->bindParam(12, $fechadetalleventa);\n\t\t\t\t\t\t$stmt->bindParam(13, $statusdetalle);\n\t\t\t\t\t\t$stmt->bindParam(14, $codigo);\n\n\t\t\t\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t\t\t\t$codproducto = strip_tags($venta[$i]['txtCodigo']);\n\t\t\t\t\t\t$producto = strip_tags($venta[$i]['descripcion']);\n\t\t\t\t\t\t$codcategoria = strip_tags($venta[$i]['tipo']);\n\t\t\t\t\t\t$cantidad = rount($venta[$i]['cantidad'],2);\n\t\t\t\t\t\t$preciocompra = strip_tags($venta[$i]['precio']);\n\t\t\t\t\t\t$precioventa = strip_tags($venta[$i]['precio2']);\n\t\t\t\t\t\t$ivaproducto = strip_tags($venta[$i]['ivaproducto']);\n\t\t\t\t\t\t$importe = strip_tags($venta[$i]['cantidad'] * $venta[$i]['precio2']);\n\t\t\t\t\t\t$importe2 = strip_tags($venta[$i]['cantidad'] * $venta[$i]['precio']);\n\t\t\t\t\t\t$fechadetalleventa = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t\t\t\t$statusdetalle = \"0\";\n\t\t\t\t\t\t$codigo = strip_tags($_SESSION['codigo']);\n\t\t\t\t\t\t$stmt->execute();\n\n\t\t\t\t\t\t$sql = \" update productos set \"\n\t\t\t\t\t\t.\" existencia = ? \"\n\t\t\t\t\t\t.\" where \"\n\t\t\t\t\t\t.\" codproducto = '\".$venta[$i]['txtCodigo'].\"';\n\t\t\t\t\t\t\";\n\t\t\t\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t\t\t\t$existencia = rount($existenciadb-$venta[$i]['cantidad'],2);\n\t\t\t\t\t\t$stmt->execute();\n\n\t\t\t\t\t\t$sql = \" update productos set \"\n\t\t\t\t\t\t.\" statusproducto = ? \"\n\t\t\t\t\t\t.\" where \"\n\t\t\t\t\t\t.\" codproducto = '\".$venta[$i]['txtCodigo'].\"' and existencia = '0';\n\t\t\t\t\t\t\";\n\t\t\t\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t\t\t\t$stmt->bindParam(1, $statusproducto);\n\t\t\t\t\t\t$statusproducto = \"INACTIVO\";\n\t\t\t\t\t\t$stmt->execute();\n\n\n##################### REGISTRAMOS LOS DATOS DE PRODUCTOS EN KARDEX #####################\n\t\t\t\t\t\t$query = \" insert into kardexproductos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t\t\t\t$stmt->bindParam(4, $movimiento);\n\t\t\t\t\t\t$stmt->bindParam(5, $entradas);\n\t\t\t\t\t\t$stmt->bindParam(6, $salidas);\n\t\t\t\t\t\t$stmt->bindParam(7, $devolucion);\n\t\t\t\t\t\t$stmt->bindParam(8, $stockactual);\n\t\t\t\t\t\t$stmt->bindParam(9, $preciounit);\n\t\t\t\t\t\t$stmt->bindParam(10, $costototal);\n\t\t\t\t\t\t$stmt->bindParam(11, $documento);\n\t\t\t\t\t\t$stmt->bindParam(12, $fechakardex);\n\n\t\t\t\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t\t\t\t$codproducto = strip_tags($venta[$i]['txtCodigo']);\n\t\t\t\t\t\t$movimiento = strip_tags(\"SALIDAS\");\n\t\t\t\t\t\t$entradas = strip_tags(\"0\");\n\t\t\t\t\t\t$salidas =strip_tags($venta[$i]['cantidad']);\n\t\t\t\t\t\t$devolucion = strip_tags(\"0\");\n\t\t\t\t\t\t$stockactual = rount($existenciadb-$venta[$i]['cantidad'],2); \n\t\t\t\t\t\t$preciounit = strip_tags($venta[$i]['precio2']);\n\t\t\t\t\t\t$costototal = strip_tags($venta[$i]['precio2'] * $venta[$i]['cantidad']);\n\t\t\t\t\t\t$documento = strip_tags(\"VENTA - FACTURA: \".$codventa);\n\t\t\t\t\t\t$fechakardex = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t\t\t\t$stmt->execute();\t\n\n\n################### CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS ##############\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array( $venta[$i]['txtCodigo'] ) );\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto IN ('\".$venta[$i]['txtCodigo'].\"')\";\n\n\t $array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\n\t\t\t$codproducto = $row['codproducto'];\n\t\t\t$codingrediente = $row['codingrediente'];\n\t\t\t$cantracion = $row['cantracion'];\n\t\t\t$cantingrediente = $row['cantingrediente'];\n\t\t\t$costoingrediente = $row['costoingrediente'];\n\n\t\t\t$update = \" update ingredientes set \"\n\t\t\t.\" cantingrediente = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codingrediente = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($update);\n\t\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t\t$racion = rount($cantracion*$cantidad,2);\n\t\t\t$cantidadracion = rount($cantingrediente-$racion,2);\n\t\t\t$stmt->execute();\n\n\n################# REGISTRAMOS LOS DATOS DE INGREDIENTES EN KARDEX #################\n\t\t\t\t\t$query = \" insert into kardexingredientes values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t\t\t$stmt->bindParam(4, $codingrediente);\n\t\t\t\t\t$stmt->bindParam(5, $movimientoing);\n\t\t\t\t\t$stmt->bindParam(6, $entradasing);\n\t\t\t\t\t$stmt->bindParam(7, $salidasing);\n\t\t\t\t\t$stmt->bindParam(8, $stockactualing);\n\t\t\t\t\t$stmt->bindParam(9, $preciouniting);\n\t\t\t\t\t$stmt->bindParam(10, $costototaling);\n\t\t\t\t\t$stmt->bindParam(11, $documentoing);\n\t\t\t\t\t$stmt->bindParam(12, $fechakardexing);\n\n\t\t\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t\t\t$codproducto = strip_tags($codproducto);\n\t\t\t\t\t$codingrediente = strip_tags($codingrediente);\n\t\t\t\t\t$movimientoing = strip_tags(\"SALIDAS\");\n\n\t\t\t\t\t$entradasing = strip_tags(\"0\");\n\t\t\t\t\t$salidasing = rount($cantracion*$cantidad,2);\n\t\t\t\t\t$stockactualing = rount($cantingrediente-$racion,2);\n\t\t\t\t\t$preciouniting = strip_tags($costoingrediente);\n\t\t\t\t\t$costototaling = strip_tags($costoingrediente * $cantidad);\n\n\t\t\t\t\t$documentoing = strip_tags(\"VENTA - FACTURA: \".$codventa);\n\t\t\t\t\t$fechakardexing = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t\t\t$stmt->execute();\n\t################# REGISTRAMOS LOS DATOS DE INGREDIENTES EN KARDEX ####################\n\n\t\t }\n\n}\n########## FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS #############\n\n }\n\n###### AQUI DESTRUIMOS TODAS LAS VARIABLES DE SESSION QUE RECIBIMOS EN CARRITO DE VENTAS ######\n\tunset($_SESSION[\"CarritoDelivery\"]);\n\n\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\tif ($_POST[\"tipopagove\"]==\"CONTADO\"){\n\n\t\t$sql = \"select ingresos from arqueocaja where codcaja = '\".$_POST[\"codcaja\"].\"' and statusarqueo = '1'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t$ingreso = $row['ingresos'];\n\n\t\t$sql = \" update arqueocaja set \"\n\t\t.\" ingresos = ? \"\n\t\t.\" where \"\n\t\t.\" codcaja = ? and statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $txtTotal);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$txtTotal = strip_tags($_POST[\"txtTotal\"]+$ingreso);\n\t\t$codcaja = strip_tags($_POST[\"codcaja\"]);\n\t\t$stmt->execute();\n\t}\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\n############## REGISTRO DE ABONOS EN VENTAS ##################\n\tif (strip_tags($_POST[\"tipopagove\"]==\"CREDITO\" && $_POST[\"montoabono\"]!=\"0.00\")) { \n\n\t\t$query = \" insert into abonoscreditos values (null, ?, ?, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $codventa);\n\t\t$stmt->bindParam(2, $codcliente);\n\t\t$stmt->bindParam(3, $montoabono);\n\t\t$stmt->bindParam(4, $fechaabono);\n\t\t$stmt->bindParam(5, $codigo);\n\t\t$stmt->bindParam(6, $codcaja);\n\n\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t$montoabono = strip_tags($_POST[\"montoabono\"]);\n\t\t$fechaabono = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t$codigo = strip_tags($_SESSION[\"codigo\"]);\n\t\t$codcaja = strip_tags($_POST[\"codcaja\"]);\n\t\t$stmt->execute();\n\t}\n\n\necho \"<div class='alert alert-success'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\necho \"<span class='fa fa-check-square-o'></span> EL PEDIDO FUE REGISTRADO EXITOSAMENTE <a href='reportepdf?codventa=\".base64_encode($codventa).\"&tipo=\".base64_encode(\"TICKET\").\"' class='on-default' data-placement='left' data-toggle='tooltip' data-original-title='Imprimir Comanda' target='_black'><strong>IMPRIMIR TICKET</strong></a>\";\necho \"</div>\";\n\necho \"<script>window.open('reportepdf?codventa=\".base64_encode($codventa).\"&tipo=\".base64_encode(\"TICKET\").\"', '_blank');</script>\";\n\t\t\t\t\texit;\n\t\t\t\t}", "function check_availability($post = array()){\n\t\t$result = array('result' => \"failed\", 'message' => 'Error has been occured. Please try again later.');\n\t\tif(is_array($post) && sizeof($post) > 0){ //kena besar dari kosong, kalau kurang ada error.\n\t\t\t$end_time = date(\"H:i\", strtotime($post['booking_time'] . ' +'.$post['duration'] . ' hour')); //dapatkan end time\n\t\t\t$booking_date_time = date(\"Y-m-d\", strtotime(datepicker2mysql($post['booking_date']))) . ' ' . $post['booking_time'].':00'; //dapatkan date and time. eg: 2017-11-09 23:00\n\t\t\t$booking_date_time_end = date(\"Y-m-d H:i:s\", strtotime($booking_date_time . ' +'.$post['duration'] . ' hour')); //dapatkan end time sekali date. eg: 2017-11-10 01:00 (beza dia kat tarikh)\n\t\t\t\n\t\t\t/* 1. dia check start time dalam masa operation hour ke tak\n\t\t\t or \n\t\t\t 2. dia check end time in between 3am-8am\n\t\t\t 3. kalau true, keluar result\n\t\t\t */\n\t\t\tif((strtotime($post['booking_time']) >= strtotime(\"03:00\") && strtotime($post['booking_time']) < strtotime(\"08:00\")) ||\n\t\t\t(strtotime($end_time) > strtotime(\"03:00\") && strtotime($end_time) < strtotime(\"08:00\"))){\n\t\t\t\t$result['message'] = \"Court is unavailable. Operation hour is from 8:00 AM until 3:00 AM\";\n\t\t\t}\n\t\t\t//check booking date, kalau sebelum dari current time, keluar result.\n\t\t\telse if(strtotime($booking_date_time) < strtotime(date(\"Y-m-d H:i:s\"))){\n\t\t\t\t$result['message'] = \"The time is already passed. Please choose another time.\";\n\t\t\t}\n\t\t\t//ni baru check database\n\t\t\telse{\n\t\t\t\t\n\t\t\t\t/* ini query nak check availability dalam database.\n\t\t\t\t 1. kalau masa start tu in between masa yang dah booking\n\t\t\t\t 0r\n\t\t\t\t 2. end time dia habis dalam masa orang yang dah booking\n\t\t\t\t 3. check status \n\t\t\t\t 4. check court id dulu baru 1, 2, 3\n\t\t\t\t*/\n\t\t\t\t$query_chk = $this->db->query(\"SELECT * FROM `ef_booking` \"\n\t\t\t\t\t\t\t\t\t\t\t. \"WHERE `court_id` = \" . $this->db->escape($post['court_id']) . \" \"\n\t\t\t\t\t\t\t\t\t\t\t. \"AND ((`booking_date_time` <= \" . $this->db->escape($booking_date_time) . \" AND `booking_date_time_end` > \" . $this->db->escape($booking_date_time) . \") \"\n\t\t\t\t\t\t\t\t\t\t\t. \"OR (`booking_date_time` < \" . $this->db->escape($booking_date_time_end) . \" AND `booking_date_time_end` >= \" . $this->db->escape($booking_date_time_end) . \")) \"\n\t\t\t\t\t\t\t\t\t\t\t. \"AND `status` != 'C'\");\n\t\t\t\t//kalau ada result, maksudnya dah reserved. \n\t\t\t\tif($query_chk->num_rows() > 0){\n\t\t\t\t\t$result['message'] = \"We're sorry, court is unavailable (Already reserved). Please check on another court/date/time.\";\n\t\t\t\t}\n\t\t\t\t//kumpul data\n\t\t\t\telse{\n\t\t\t\t\t$row_court = $this->court_m->get_single($post['court_id']);\n\t\t\t\t\t$rate_per_hour = 80.00;\n\t\t\t\t\t$result['booking_details'] = array(\n\t\t\t\t\t\t'booking_date_time_view' => date(\"d/m/Y g:i A\", strtotime($booking_date_time)),\n\t\t\t\t\t\t'booking_date_time_end_view' => date(\"d/m/Y g:i A\", strtotime($booking_date_time . ' +'.$post['duration'] . ' hour')),\n\t\t\t\t\t\t'booking_date_time' => date(\"Y-m-d H:i:s\", strtotime($booking_date_time)),\n\t\t\t\t\t\t'booking_date_time_end' => date(\"Y-m-d H:i:s\", strtotime($booking_date_time . ' +'.$post['duration'] . ' hour')),\n\t\t\t\t\t\t'date' => date(\"l, jS F Y\", strtotime($booking_date_time)),\n\t\t\t\t\t\t'start_end' => date(\"g:i A\", strtotime($booking_date_time)) . ' - ' . date(\"g:i A\", strtotime($booking_date_time_end)),\n\t\t\t\t\t\t'duration_view' => $post['duration'] . ' ' . ($post['duration'] > 1 ? 'Hours' : 'Hour'),\n\t\t\t\t\t\t'duration' => $post['duration'],\n\t\t\t\t\t\t'amount' => number_format($rate_per_hour * $post['duration'], 2, \".\", \"\"),\n\t\t\t\t\t\t'court_id' => $post['court_id'],\n\t\t\t\t\t\t'court_name' => isset($row_court) !== false ? $row_court->court_name : $post['court_id']\n\t\t\t\t\t);\n\t\t\t\t\t$result['encrypted_booking'] = encrypt_data($result['booking_details']);\n\t\t\t\t\t$result['result'] = \"success\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "private function checkEventDateNotDue(){\n $event = Event::find($this->id);\n $now = Carbon::now();\n \n $startTime = Carbon::createFromFormat('Y-m-d H:i:s', $event->start_time);\n return $startTime->gt($now);\n }", "public function hasTime(){\n return $this->_has(3);\n }", "public function hasExpired(){\n if($this->isIndefinied())\n return false;\n\n \\Log::info('Hoy'.print_r(Carbon::now(),true));\n \\Log::info('Expira'.print_r(Carbon::parse($this->expires_on),true));\n return (bool) Carbon::now()->greaterThan(Carbon::parse($this->expires_on));\n }", "public function needs_run() {\n $today = time();\n $lastrun = $this->info[\"last_run\"];\n $interval = (int)$this->freq * 86400;\n\n return($today > ($lastrun + $interval));\n }", "function check()\r\n\t{\r\n\t\tif (empty($this->product_id))\r\n\t\t{\r\n\t\t\t$this->setError( JText::_('COM_CITRUSCART_PRODUCT_ASSOCIATION_REQUIRED') );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$offset = JFactory::getConfig()->getValue( 'config.offset' );\r\n\t\tif( isset( $this->publishing_date ) )\r\n\t\t{\r\n\t\t\t$this->publishing_date = date( 'Y-m-d H:i:s', strtotime( CitruscartHelperBase::getOffsetDate( $this->publishing_date, -$offset ) ) );\r\n\t\t}\r\n\r\n\r\n\t\t$nullDate = $this->_db->getNullDate();\r\n\t\tCitruscart::load( 'CitruscartHelperBase', 'helpers._base' );\r\n\r\n\t\tif (empty($this->created_date) || $this->created_date == $nullDate)\r\n\t\t{\r\n\t\t\t$date = JFactory::getDate();\r\n\t\t\t$this->created_date = $date->toSql();\r\n\t\t}\r\n\r\n\t\t$date = JFactory::getDate();\r\n\t\t$this->modified_date = $date->toSql();\r\n\t\t$act = strtotime( Date( 'Y-m-d', strtotime( $this->publishing_date ) ) );\r\n\t\t\t\t\t\r\n\t\t$db = $this->_db;\r\n\t\tif( empty( $this->product_issue_id ) ) // add at the end\r\n\t\t{\r\n\t\t\t$q = 'SELECT `publishing_date` FROM `#__citruscart_productissues` WHERE `product_id`='.$this->product_id.' ORDER BY `publishing_date` DESC LIMIT 1';\r\n\t\t\t$db->setQuery( $q );\r\n\t\t\t$next = $db->loadResult();\r\n\t\t\tif( $next === null )\r\n\t\t\t\treturn true;\r\n\t\t\t$next = strtotime( $next );\r\n\t\t\tif( $act <= $next )\r\n\t\t\t{\r\n\t\t\t\t$this->setError( JText::_('COM_CITRUSCART_PUBLISHING_DATE_IS_NOT_PRESERVING_ISSUE_ORDER').' - '.$this->publishing_date );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$q = 'SELECT `publishing_date` FROM `#__citruscart_productissues` WHERE `product_issue_id`='.$this->product_issue_id;\r\n\t\t\t$db->setQuery( $q );\r\n\t\t\t$original = $db->loadResult();\r\n\t\t\tif( $act == strtotime( Date( 'Y-m-d', strtotime( $original ) ) ) )\r\n\t\t\t\treturn true;\r\n\r\n\t\t\t$q = 'SELECT `publishing_date` FROM `#__citruscart_productissues` WHERE `product_id`='.$this->product_id.' AND `publishing_date` < \\''.$original.'\\' ORDER BY `publishing_date` DESC LIMIT 1';\r\n\t\t\t$db->setQuery( $q );\r\n\t\t\t$prev = $db->loadResult();\r\n\t\t\t$q = 'SELECT `publishing_date` FROM `#__citruscart_productissues` WHERE `product_id`='.$this->product_id.' AND `publishing_date` > \\''.$original.'\\' ORDER BY `publishing_date` ASC LIMIT 1';\r\n\t\t\t$db->setQuery( $q );\r\n\t\t\t$next = $db->loadResult();\r\n\t\t\t\r\n\t\t\tif( $prev === null )\r\n\t\t\t\t$prev = 0;\r\n\t\t\telse\r\n\t\t\t\t$prev = strtotime( $prev );\r\n\t\t\tif( $next )\r\n\t\t\t\t$next = strtotime( $next );\r\n\t\r\n\t\t\tif( ( $prev >= $act ) || ( $next && $next <= $act ) )\r\n\t\t\t{\r\n\t\t\t\t$this->setError( JText::_('COM_CITRUSCART_PUBLISHING_DATE_IS_NOT_PRESERVING_ISSUE_ORDER').' - '.$this->publishing_date );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function isInvoiced() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn InputValidator::isEmpty($this->invoiceDate) ? false: true;\r\n\t}", "public function comprobarSaldo($cantidad){ //en cantidad le pasaremos lo que se le va a cobrar\n if($this->time - $cantidad < -300){\n return false;\n }else{\n return true;\n }\n\n }", "public function isDayPassed()\n {\n return ($this->declineTime < (time() - self::ONE_DAY_IN_SECONDS));\n }", "private function validate_booking(): bool {\n\t $this->errors = array();\n\n // Clear data using test_input function\n foreach ($this->request->post as $key => $value) {\n $this->request->post[$key] = self::test_input($this->request->post[$key]);\n }\n\n // Time\n if(!(preg_match(\"/^(?:2[0-3]|[01][0-9]):[0-5][0-9]$/\", $this->request->post[\"time\"]))){\n array_push($this->errors,$this->language->get('time_error'));\n }\n\n // Date\n $temp = new DateTime();\n\n // Create date object (without time)\n $date = DateTime::createFromFormat('Y-m-d', $this->request->post[\"date\"]);\n\n // Remove time from datetime string\n $now = DateTime::createFromFormat(\"Y-m-d\", $temp->format(\"Y-m-d\"));\n\n // Extract data\n $year = $date->format(\"Y\");\n $month = $date->format(\"m\");\n $day = $date->format(\"d\");\n\n if($date < $now){\n array_push($this->errors,$this->language->get('date_past_error'));\n }\n else if(!checkdate($month,$day,$year)) {\n //$this->errors[\"date\"] = $this->language->get('date_error');\n array_push($this->errors,$this->language->get('date_value_error'));\n }\n\n //TODO: REMOVE\n return count($this->errors) == 0;\n }", "public function hasDecredExpiry()\n {\n return $this->decred_expiry !== null;\n }", "public function it_should_be_available_on_cinemas()\n {\n $this->shouldBeAvailableOnCinemas();\n }", "public function tiene_cuenta()\n {\n if ($this->plan_de_cuenta->id != NULL)\n return true;\n else\n return false;\n }", "private function checkCartStatus()\n {\n if ($this->quote->getIsActive()=='0') {\n $this->getMagentoOrderId();\n throw new \\Exception(self::CMOS_ALREADY_PROCESSED);\n }\n }", "private function isExpired($mix) {\n\t\tif ($this->recalc) {\n\t\t\t$currentDate = new Date(time());\n\t\t\t$equipmentExpireDate = ($mix->getEquipment()) ? $mix->getEquipment()->getDate() : null;\n\n\t\t\t//\tIf Equipment has expire date - check MIX for overdue\n\t\t\tif ($equipmentExpireDate != null) {\n\t\t\t\tif ($currentDate->isBiggerThan($equipmentExpireDate)) {\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}\n\t\t\t}\n\n\t\t} else {\n\t\t\treturn $mix->isExpired();\n\t\t}\n\t}", "public function mezclar() {\n if ($this->cantcartas == -1 || $this->cantcartas == 0)\n return TRUE;\n $inicio = 0;\n $final = $this->cantcartas;\n $mezcla = [];\n $punt = 0;\n for (; $inicio != $final && $inicio < $final; $inicio++, $final--) {\n $mezcla[$punt] = $this->cajita[$final];\n $punt++;\n $mezcla[$punt] = $this->cajita[$inicio];\n $punt++;\n }\n if (($this->cantcartas % 2) == 0)\n $mezcla[$punt] = $this->cajita[$inicio];\n $this->cajita = $mezcla;\n return TRUE;\n }", "public function hasCreatetime(){\n return $this->_has(1);\n }", "public function hasVclock()\n {\n return isset($this->vclock);\n }", "public function validateStock()\n {\n $valid = true;\n $id_user = $this->session->userdata('id_user');\n $cart = $this->where('id_user', $id_user)->get();\n \n foreach ($cart as $row) {\n $this->table = 'barang';\n $barang = $this->where('id', $row->id_barang)->first(); \n \n if (($barang->qty - $row->qty) < 0) {\n $this->session->set_flashdata(\"qty_cartout_$row->id\", \"Stock hanya ada $barang->qty\");\n $valid = false;\n }\n\n $this->table = 'keranjang_keluar';\n }\n\n return $valid;\n }", "public function is_expired()\n {\n }", "function verificarComprobante($fecha)\n {\n global $db;\n $sql = \" select count(dateReception) as total from almacen_reception\n where tipoTrans = 'A' and tipoComprobante = 'A';\n and dateReception >= '$fecha' \";\n echo $sql;\n $db->SetFetchMode(ADODB_FETCH_ASSOC);\n \t$info = $db->execute($sql);\n if ($info->fields(\"total\") == 0)\n {\n return 1; // positivo, puede registrar\n }\n else if ($info->fields(\"total\") > 0)\n {\n return 0; // existe ajustes, no puede registrar\n }\n }", "function checkBankOptions(){\n $resultId = tep_db_query(\"SELECT configuration_id FROM \". TABLE_CONFIGURATION .\" WHERE configuration_key='MODULE_PAYMENT_CGP_IDEAL_ISSUER_REFRESH'\");\n $aResult = tep_db_fetch_array($resultId);\n if (!$aResult ){\n $resultId = tep_db_query(\"INSERT INTO \". TABLE_CONFIGURATION .\"(configuration_title, configuration_key, configuration_value) \n VALUES ( 'Issuer Refresh', 'MODULE_PAYMENT_CGP_IDEAL_ISSUER_REFRESH',0)\");\n }\n $resultId = tep_db_query(\"SELECT configuration_value FROM \". TABLE_CONFIGURATION .\" WHERE configuration_key='MODULE_PAYMENT_CGP_IDEAL_ISSUER_REFRESH'\");\n $aResult = tep_db_fetch_array($resultId);\n $iIssuerRefresh = (int) $aResult['configuration_value'];\n if ($iIssuerRefresh < time()) {\n $this->cacheBankOptions();\n }\n \n }", "protected function checkDelais(&$r, $productsoid, $validfroms){\n $lineids = array_keys($productsoid);\n $productoid = $productsoid[$lineids[0]];\n $validfrom = $validfroms[$lineids[0]];\n $now = date('Y-m-d');\n\n if ($now != $validfrom)\n return;\n $dsticket = XDataSource::objectFactoryHelper8('BCLASS=XDSTable&SPECS='.self::$tableTICKET);\n if (!$dsticket->fieldExists('heuredebut'))\n return;\n $dp = $this->modcatalog->displayProduct(NULL, NULL, NULL, NULL, $productoid);\n\n $rs = selectQueryGetAll('select heuredebut from '.self::$tableTICKET.' where LANG=\\'FR\\' and koid =\\''.$dp['owtsticket']->raw.'\\'');\n if (count($rs) == 0)\n return;\n if (empty($rs[0]['heuredebut']))\n return;\n\n $heuredebut = $rs[0]['heuredebut'];\n $dps = $this->getSeason();\n $dm = round($dps['odelaitrans']->raw*60);\n $hlim = date('H:i', strtotime(date('Y-m-d ').$heuredebut.' - '.$dm.' minutes'));\n $hnow = date('H:i');\n $hmess = date('H:i', strtotime(date('Y-m-d H:i:s').' + '.$dm.' minutes'));\n //$r['message'] = \"$dm - $hlim - $heuredebut - $hnow\";\n if ($hnow <= $hlim)\n return;\n\n $r['ok'] = 0;\n $r['iswarn'] = 1;\n\n $r['message'] = $GLOBALS['XSHELL']->labels->getCustomSysLabel('wts_delaiforfaits');\n if (empty($r['message']))\n $r['message'] = 'Attention : ces forfaits ne seront disponibles avant ';\n $r['message'].=$hmess;\n }", "private function checkDateAvailable($object)\n\t{\n\t\tif($object->FormCode == 'M505')\n\t\t{\n\t\t\t$issueDateAlias = 'NgayXuatHang';\n\t\t\t$deliveryDateAlias = 'NgayGiaoHang';\n\t\t\t$orderDateAlias = 'NgayDatHang';\n\t\t\t$requiredDateAlias = 'NgayYCNH';\n\t\t\t\n\t\t}\n\t\telseif($object->FormCode == 'M403')\n\t\t{\n\t\t\t$issueDateAlias = 'NgayXuatHang';\n\t\t\t$deliveryDateAlias = 'NgayGiaoHang';\n\t\t\t$orderDateAlias = 'NgayYeuCau';\n\t\t\t$requiredDateAlias = 'NgayTraHang';\t\t\n\t\t}\n\t\t\n\t\t// Ngay xuat hang bang so co the so sanh\n\t\t$issueDate = Qss_Lib_Date::i_fString2Time($object->getFieldByCode($issueDateAlias)->getValue());\n\t\t// Ngay giao hang bang so co the so sanh\n\t\t$deliveryDate = Qss_Lib_Date::i_fString2Time($object->getFieldByCode($deliveryDateAlias)->getValue());\n\t\t$orderDate = Qss_Lib_Date::i_fMysql2Time($this->_params->$orderDateAlias);// Ngay dat hang bang so co the so sanh\n\t\t$requiredDate = Qss_Lib_Date::i_fMysql2Time($this->_params->$requiredDateAlias);// Ngay yeu cau bang so co the so sanh\n\t\t\n\t\t// Ngay xuat hang nam trong khoang tu ngay dat hang den ngay yeu cau\n\t\tif( $issueDate < $orderDate || $issueDate > $requiredDate )\n\t\t{\n\t\t\t$this->setMessage($this->_translate(1));\n\t\t\t$this->setError();\n\t\t}\n\t\t\n\t\t// Ngay giao hang nam trong khoang tu ngay dat hang den ngay yeu cau\n\t\tif( $deliveryDate < $orderDate || $deliveryDate > $requiredDate )\n\t\t{\n\t\t\t$this->setMessage($this->_translate(2));\n\t\t\t$this->setError();\n\t\t}\n\t\t\n\t\t// Ngay giao hang phai lon hon hoac bang ngay xuat hang\n\t\tif( $deliveryDate < $issueDate )\n\t\t{\n\t\t\t$this->setMessage($this->_translate(3));\n\t\t\t$this->setError();\n\t\t}\n\t\t\t\n\t}", "public function hasNewPrice(){\n return $this->_has(16);\n }", "public function hasTime(){\n return $this->_has(6);\n }", "abstract function has_paid_plan();", "public function hasExpirationDate()\n {\n return isset($this->user_expiration);\n }", "public function should_run()\n\t{\n\t\treturn $this->config['delete_pms_last_gc'] < time() - $this->config['delete_pms_gc'];\n\t}", "public function checkData(){\n if(count($this->products) < 1){\n $this->basketError[] = 'Вы ничего не выбрали';\n return false;\n }\n if(empty($this->user_id)){\n $this->basketError[] = 'Вы неавторизованы...';\n return false;\n }\n if(empty($this->session_id)){\n $this->basketError[] = 'Пустая сессия';\n return false;\n }\n if(empty($this->delivery_id) || $this->delivery_id == 0){\n $this->basketError[] = 'Не выбрана доставка';\n return false;\n }\n if(empty($this->address_id)){\n $this->basketError[] = 'Не выбран адрес';\n return false;\n }\n if(empty($this->payment_id) || $this->payment_id == 0){\n $this->basketError[] = 'Не выбран способ оплаты';\n return false;\n }\n if(empty($this->time_list)){\n $basketError[] = 'Не выбрано время доставки';\n return false;\n }\n $deliveryGroup = new \\app\\modules\\basket\\models\\DeliveryGroup();\n $deliveryGroup->setProducts($this->products);\n $deliveryGroup->setDeliveryId($this->delivery_id);\n $deliveryGroup->setProductDeliveryGroup();\n $timeList = json_decode($this->time_list,true);\n if(!empty($deliveryGroup->productDeliveryGroup)){\n foreach ($deliveryGroup->productDeliveryGroup as $key => $group) {\n if(!empty($timeList[$key]['day']) && !empty($timeList[$key]['time'])){\n }else{\n $this->basketError[] = 'Время доставки выбрано не для всех типов товаров';\n return false;\n }\n }\n }else{\n $this->basketError[] = 'Нет групп продуктов';\n return false;\n }\n return true;\n }", "private function Verify_Bill_Dates()\n\t{\n\t\t$query = '\n\t\t\t\tSELECT \n\t\t\t\t\tcount(*) as count\n\t\t\t\tFROM \n\t\t\t\t\tbilling_date \n\t\t\t\tWHERE\n\t\t\t\t\tapproved_date > DATE_ADD(NOW(), INTERVAL 2 MONTH)\n\t\t\t\t';\n\t\t$results = $this->mysqli->Query($query);\n\t\t\n\t\t\n\t\t\n\t\t$row = $results->Fetch_Array_Row(MYSQLI_ASSOC);\n\t\t$count = $row['count'];\n\t\tif ($count==0) \n\t\t{\n\t\t\t//if we are running low, fire off an E-mail stating such.\n\t\t\t$this->Bill_Date_Warning();\t\n\t\t}\n\t\t\n\t}", "public function is_iptu_ano_quitado() {\n\n if ($this->contract == null) {\n return false;\n }\n\n if ($this->contract->imovel == null) {\n return false;\n }\n\n $iptutabela = IPTUTabela\n ::where('imovel_id', $this->contract->imovel->id)\n ->where('ano' , $this->monthrefdate->year)\n ->first();\n\n if ($iptutabela != null && $iptutabela->ano_quitado == true) {\n return true;\n }\n\n return false;\n }", "public function check_cart_items() {\n\t\t$return = true;\n\t\t$result = $this->check_cart_item_validity();\n\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\twc_add_notice( $result->get_error_message(), 'error' );\n\t\t\t$return = false;\n\t\t}\n\n\t\t$result = $this->check_cart_item_stock();\n\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\twc_add_notice( $result->get_error_message(), 'error' );\n\t\t\t$return = false;\n\t\t}\n\n\t\treturn $return;\n\n\t}", "public function isExpiring() {\n return $this->expiration - time() < 22 * 24 * 3600;\n }", "public function isDelivered() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn InputValidator::isEmpty($this->deliveryDate) ? false: true;\r\n\t}", "protected function checkStock()\n {\n DB::beginTransaction();\n try{\n foreach ($this->cart as $item){\n $unit = Itens::find($item->id);\n $qtd = !empty($unit->quantity) ? $unit->quantity : $unit->weight;\n\n if($qtd >= $item->qty){\n if(!empty($unit->quantity)){\n $unit->quantity = $unit->quantity - $item->qty;\n }else{\n $unit->weight = $unit->weight - $item->qty;\n }\n $unit->save();\n }\n }\n DB::commit();\n $this->addItensToOrder();\n Session::flash('error', 'INfelizmente não foi possível processar sua compra devido a falta de estoque para um de nossos itens em cotação');\n }catch (Exception $e){\n DB::rollback();\n DebugBar::addException($e);\n }\n\n }", "public static function check_ticker() {\n if (!isset(self::$_ticker) || (time() > self::$_ticker + 1)) {\n self::$_ticker = time();\n return true;\n }\n\n return false;\n }", "public function hasKernelTime(){\n return $this->_has(1);\n }", "public function hasPrecost(){\n return $this->_has(25);\n }", "public function checkForAnuallyRecurring()\n {\n // not supported\n }", "function custom_rules_is_cron_running(){\n\t$cron_expires = db_query(\"SELECT `expire` FROM {semaphore} WHERE `name` = 'cron' LIMIT 1\")->fetchField();\n\n\tif ( $cron_expires && $cron_expires > microtime(TRUE) ) {\n\t\treturn TRUE;\n\t}\n\n\treturn FALSE;\n}", "function check_cart_items() {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\t$result = $this->check_cart_item_stock();\n\t\t\tif (is_wp_error($result)) $cmdeals->add_error( $result->get_error_message() );\n\t\t}", "private function checkExpirated() {\n\n }", "public function getAvailable()\n {\n if (!$this->IsAvailable) {\n return false;\n }\n\n if (!$this->getAvailableFrom() && !$this->getAvailableTill()) {\n return false;\n } elseif ($this->validateDate() && $this->validateAvailability()) {\n return true;\n }\n\n return false;\n }", "private function isMach()\r\n {\r\n return $this->getPaymentMethod() == 15;\r\n }", "public function has_finished()\n {\n return $this->days_left() == 0;\n }", "public function isNeedUpdate()\n {\n if (is_null($this['episode_update_date'])){\n return true;\n }\n if (Carbon::now()->diffInDays(new Carbon($this['episode_update_date'])) > 3){\n return true;\n }\n return false;\n }", "public function isCakeFestInFuture()\n {\n $startDate = Configure::read('Site.cakefest.start_date');\n\n return (new Time($startDate)) > (new Time());\n }", "public function hasPartinTime(){\n return $this->_has(1);\n }", "function are_we_invoicing_today() {\n\t\t// see if an invoice exists with today's date\n\t\t$invoice_regex = str_replace('{{DATE}}',date('Ymd'),$this->config['invoice_file_find_by_date']);\n\n\t\t$dh = opendir($this->config['invoice_path']);\n\n\t\twhile ($file = readdir($dh)) {\n\t\t\tif (preg_match($invoice_regex,$file)) {\n\t\t\t\techo \"Today's invoice has already been generated: $file\\n\";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tclosedir($dh);\n\n\t\tforeach ($this->get_calendar_events() as $event) {\n\t\t\tif (preg_match($this->config['calendar_entry'], $event->title->text, $m)) {\n\t\t\t\treturn $m[1];\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function getTimeShoppingCarActive(){\n\treturn campo('config_system','id','1','time_in_minutes_shopping_cart_active');\n}", "function getTimeShoppingCarActive(){\n\treturn campo('config_system','id','1','time_in_minutes_shopping_cart_active');\n}", "private function getStatus(){\n\t\t$this->valid=$this->checkDatesValidity();\n\t\tif($this->usage==\"once\" && $this->usageCount) $this->valid = false;\n\t\tif($this->usage==\"count\" && $this->usageCount>=$this->maxUsage) $this->valid = false;\n\t\tif($this->type==\"fixed\" && $this->value<=0) $this->valid = false;\n\t\tif($this->type==\"grid\" && !count($this->grid)) $this->valid = false;\n\t}", "public function testCheckAvailability() {\n $date = '15/10/2015';\n $this->assertTrue($this->loan->checkAvailability($date));\n }", "public function isVerificato()\n {\n if ($this->verificato === NULL)\n {\n $conn = $GLOBALS[\"connest\"];\n $conn->connetti();\n $anno = AnnoSportivoFiam::get();\n\n //verifica pagamento\n $id = $this->getChiave();\n $mr = $conn->select('pagamenti_correnti', \"idtesserato='$id' AND YEAR(scadenza) >= $anno AND idtipo=\" . self::TIPO_ATL_FIAM);\n if ($mr->fetch_row() === NULL)\n {\n $this->verificato = false;\n } else\n {\n //verifica assicurazione\n $mr = $conn->select('assicurazioni_correnti', \"idtesserato='$id' AND YEAR(valido_da) <= $anno AND YEAR(valido_a) >= $anno\");\n $this->verificato = ($mr->fetch_row() !== NULL);\n }\n }\n return $this->verificato;\n }", "public function updateLicenseStatus()\n {\n $transient = get_transient($this->slug);\n\n // If set and valid, return.\n if (VALID === $transient) {\n error_log('Active...');\n return;\n }\n // If expired, do something to never req again.\n\n // If not then, perform a check\n // error_log('Checking ...');\n // $response = $this->checkLicenseKey();\n }", "private function should_show_feedback_notice() {\n\t\t$activated_time = get_option( 'neve_install' );\n\t\tif ( ! empty( $activated_time ) ) {\n\t\t\tif ( time() - intval( $activated_time ) > 14 * DAY_IN_SECONDS ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public static function purchaseArrived($id_compra){\n DB::beginTransaction();\n try {\n $compra = Compra::find($id_compra);\n $compra->llego = 1;\n $compra->fecha_llegada = Carbon::now()->toDateTimeString();\n $compra->update();\n\n foreach ($compra->detallesCompra as $detalle) {\n $articulo = Articulo::find($detalle->id_articulo);\n $dimension = $articulo->dimension;\n $stock = Stock::where('id_articulo', $detalle->id_articulo)\n ->where('id_almacen', $detalle->id_almacen)->lockForUpdate()->first();\n if (is_null($stock)) {\n $_stock = new Stock();\n $_stock->id_articulo = $detalle->id_articulo;\n $_stock->id_almacen = $detalle->id_almacen;\n if ($articulo->divisible) {\n $_stock->cantidad = $detalle->cantidad * $dimension->ancho * $dimension->largo;\n } else {\n $_stock->cantidad = $detalle->cantidad;\n }\n $_stock->save();\n } else {\n if ($articulo->divisible) {\n $stock->cantidad += (int)$detalle->cantidad * $dimension->ancho * $dimension->largo;\n } else {\n $stock->cantidad += (int)$detalle->cantidad;\n }\n $stock->update();\n }\n }\n DB::commit();\n return true;\n } catch (\\Exception $e) {\n DB::rollBack();\n return false;\n }\n }", "public function checkSyncDate(): bool\n {\n /** @var FileInfoImage $item */\n $item = $this->current();\n $date2 = $item->getSyncDateXmp();\n if ($date2 === null) {\n\n return true;\n } else {\n $date1 = DateTime::createFromFormat('U', $this->getMTime());\n\n return $date1 > $date2;\n }\n }", "public function hasStarttime(){\n return $this->_has(7);\n }", "function needs_payment() {\n\t\t\tif ( $this->total > 0 ) return true; else return false;\n\t\t}", "function checkReservedOrders()\n\t\t{\n\t\t\t$db = dbConnect::getInstance();\n \t\t $mysqli = $db->getConnection();\n\t\t\t$query = \" select * from check_tb where status = '3'\"; \n $res = $mysqli->query($query) or die (mysqli_error($mysqli));\n\t\t\tif(mysqli_num_rows($res) > 0)\n\t\t\t{\n\t\t\t\treturn true;\t\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}", "public function hasStarttime(){\n return $this->_has(2);\n }", "private function processarLicenca() {\n\n $sDataAtual = date('Y-m-d');\n $oDaoLicencaEmpreendimento = db_utils::getDao('licencaempreendimento');\n\n foreach ($this->aDataVencimento as $sDataVencimento) {\n\n $sWhere = \" am08_datavencimento between '$sDataAtual' and '$sDataVencimento'\";\n $sSqlLicenca = $oDaoLicencaEmpreendimento->sql_query_licenca_parecer('am13_sequencial, am08_sequencial, am08_tipolicenca', $sWhere);\n $rsLicenca = $oDaoLicencaEmpreendimento->sql_record($sSqlLicenca);\n\n $iTotalLincecas = pg_num_rows($rsLicenca);\n\n if ($iTotalLincecas == 0) {\n continue;\n }\n\n for ($iIndiceLicenca = 0; $iIndiceLicenca < $iTotalLincecas; $iIndiceLicenca++) {\n\n $oLicencaValida = db_utils::fieldsMemory($rsLicenca, $iIndiceLicenca);\n\n $iCodigoLicencaEmpreendimento = $oLicencaValida->am13_sequencial;\n\n $this->aLicencas[$iCodigoLicencaEmpreendimento] = LicencaEmpreendimentoRepository::getByCodigo($iCodigoLicencaEmpreendimento);\n }\n }\n\n return true;\n }", "public function checkAutoFinish()\n {\n $hFunction = new \\Hfunction();\n $modelCompany = new QcCompany();\n $currentDateCheck = $hFunction->carbonNow();\n # lay thong tin dang hoa dong\n $dataRequest = $this->getAllInfoActivity();\n if ($hFunction->checkCount($dataRequest)) {\n foreach ($dataRequest as $request) {\n $requestDate = $request->requestDate();\n $checkDate = $hFunction->datetimePlusDay($modelCompany->getDefaultTimeBeginToWorkOfDate($requestDate), 1);\n if ($currentDateCheck > $checkDate) {# qua ngay tang ca\n $this->confirmFinish($request->requestId());\n }\n }\n }\n\n }", "public function hasAdddate(){\n return $this->_has(29);\n }", "public function isIndefinied(){\n return !$this->expires_on;\n }", "public function testTresCeldasIndividuales(CartonInterface $carton) {\n\t$cantcolunacelda = 0;\t\n\t$flag = false;\n\tforeach($carton->columnas() as $col){\n\t\t$cant = 0;\n\t\tforeach($col as $num){\n\t\t\tif($num != 0){\n\t\t\t\t$cant++;\t\t\n\t\t\t}\n\t\t}\n\t\tif($cant == 1){\t\n\t\t\t$cantcolunacelda++;\t\t\n\t\t}\n\t}\n\tif($cantcolunacelda == 3){\n\t\t\t$flag = true;\n\t}\n $this->assertTrue($flag);\n }", "private function checkIfTimeLeft()\r\n {\r\n if($this->expireDateTime < strtotime(\"now\"))\r\n {\r\n generic::successEncDisplay(\"Emails have been sent out, however, there are a number of emails to be sent, and the server run out of time.\");\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "public function isTrial()\n\t{\n\t\tif($this->modulePrice != null && $this->modulePrice->price_per_month > 0)\n\t\t\treturn $this->trialDaysLeft > 0;\n\t\telse\n\t\t\treturn false;\n\t\t\n\t}", "public function chargingHasStarted()\n {\n $chargingPower = $this -> getChargingPower();\n $kiloWattHourLine = $this -> kiloWattHourLine;\n\n return $chargingPower > $kiloWattHourLine;\n }", "function is_available() {\n global $CFG;\n\n //we need the curriculum directory\n if (!file_exists($CFG->dirroot.'/curriculum/config.php')) {\n return false;\n }\n\n //we also need the curr_admin block\n if (!record_exists('block', 'name', 'curr_admin')) {\n return false;\n }\n\n //everything needed is present\n return true;\n }", "public function hasQuantity(): bool;", "public function isDue(): bool\n {\n $this->schedule($this->event());\n\n return $this->event->isDue(app());\n }" ]
[ "0.6272819", "0.6208066", "0.6101925", "0.6073597", "0.60542446", "0.59865636", "0.5970212", "0.5947909", "0.592344", "0.5922953", "0.5882857", "0.58813214", "0.58015174", "0.58010405", "0.5785437", "0.57784307", "0.5777827", "0.57568896", "0.57428116", "0.5732177", "0.57196957", "0.56920177", "0.567974", "0.5670179", "0.5648657", "0.56246173", "0.56153256", "0.5614493", "0.5598819", "0.5593595", "0.5588031", "0.55718666", "0.5565045", "0.5559657", "0.55587083", "0.5542898", "0.5525292", "0.55240154", "0.5516904", "0.55061054", "0.54883516", "0.5479273", "0.5476224", "0.5475516", "0.5462071", "0.54615337", "0.54590786", "0.545169", "0.5450907", "0.5448871", "0.5441792", "0.54394066", "0.54393125", "0.5436327", "0.5432076", "0.5430297", "0.54191804", "0.5413095", "0.5411916", "0.5408803", "0.53972816", "0.5389825", "0.5382886", "0.5374003", "0.5372284", "0.53687465", "0.53672355", "0.53594595", "0.5358776", "0.53566283", "0.53513795", "0.53480047", "0.53475416", "0.53450763", "0.5340056", "0.5339451", "0.53317046", "0.5329853", "0.5329853", "0.5327172", "0.53271645", "0.53236103", "0.53212094", "0.53186226", "0.53176457", "0.53134096", "0.53113097", "0.5306762", "0.530558", "0.5304006", "0.52989393", "0.5295138", "0.5293348", "0.5293154", "0.52922547", "0.52917695", "0.52880275", "0.5283", "0.52823013", "0.5279214", "0.52770746" ]
0.0
-1
Obtiene los avisos que estan en esa cartelera el dia de hoy
private function getTodayAdvertisements() { return AdvertisementQuery::create() ->filterByCurrent() ->filterByBillboard($this) ->find(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function obtener_asignaciones (){ //HAY QUE LLEVARLO AL DATOS_TABLA\n //tiene cierto sentido usar la fecha actual, dado que el uso de las aulas puede ser dinamico. \n //Necesitamos saber como es la asignacion de horarios en un momento determinado.\n $fecha= date('Y-m-d');\n \n $anio_lectivo=date('Y');\n \n $periodo=$this->dep('datos')->tabla('periodo')->get_periodo_calendario($fecha, $anio_lectivo);\n \n //analizamos el caso de dos periodos, cuando tenemos un turno de examen extraordinario incluido\n //en un cuatrimestre.\n $this->s__datos_cuadro_asig=array();\n foreach ($periodo as $clave=>$valor){\n $asignaciones=$this->dep('datos')->tabla('asignacion')->get_asignaciones_por_persona($this->s__nro_doc, $valor['id_periodo'], $fecha);\n $this->unificar_conjuntos(&$this->s__datos_cuadro_asig, $asignaciones);\n }\n \n }", "public function getAtraso() \n {\n // verifica se o atras ja foi calculado\n if (!$this->atraso) { \n $dataAtual = time();\n $vencimento = strtotime(Helper::dateUnmask($this->data_vencimento, Helper::DATE_DEFAULT));\n $diferenca = $dataAtual - $vencimento;\n\n // calcula o atraso e\n // não considera o dia do vencimento\n $this->atraso = round($diferenca / (60 * 60 * 24)) - 1;\n \n // valida o atraso negativo\n if ($this->atraso < 0) {\n $this->atraso = 0;\n }\n }\n \n return $this->atraso;\n }", "public function getAsientos(){ return $this->asientos;}", "public function ObtenerTotalVentasAnioActual()\n {\n $anio = \"actual\";\n $totalEne = DB::table('salidas')->whereMonth('fecha_emision', '1')->whereYear('fecha_emision', date(\"Y\"))->get();\n $totalFeb = DB::table('salidas')->whereMonth('fecha_emision', '2')->whereYear('fecha_emision', date(\"Y\"))->get();\n $totalMar = DB::table('salidas')->whereMonth('fecha_emision', '3')->whereYear('fecha_emision', date(\"Y\"))->get();\n $totalAbr = DB::table('salidas')->whereMonth('fecha_emision', '4')->whereYear('fecha_emision', date(\"Y\"))->get();\n $totalMay = DB::table('salidas')->whereMonth('fecha_emision', '5')->whereYear('fecha_emision', date(\"Y\"))->get();\n $totalJun = DB::table('salidas')->whereMonth('fecha_emision', '6')->whereYear('fecha_emision', date(\"Y\"))->get();\n $totalJul = DB::table('salidas')->whereMonth('fecha_emision', '7')->whereYear('fecha_emision', date(\"Y\"))->get();\n $totalAgo = DB::table('salidas')->whereMonth('fecha_emision', '8')->whereYear('fecha_emision', date(\"Y\"))->get();\n $totalSep = DB::table('salidas')->whereMonth('fecha_emision', '9')->whereYear('fecha_emision', date(\"Y\"))->get();\n $totalOct = DB::table('salidas')->whereMonth('fecha_emision', '10')->whereYear('fecha_emision', date(\"Y\"))->get();\n $totalNov = DB::table('salidas')->whereMonth('fecha_emision', '11')->whereYear('fecha_emision', date(\"Y\"))->get();\n $totalDic = DB::table('salidas')->whereMonth('fecha_emision', '12')->whereYear('fecha_emision', date(\"Y\"))->get();\n\n $sumEne = 0;\n foreach ($totalEne as $totalE) {\n if ($totalE->tipo_id == 1) {\n $sumEne = $totalE->total + $sumEne;\n }\n }\n\n $sumFeb = 0;\n foreach ($totalFeb as $totalF) {\n if ($totalF->tipo_id == 1) {\n $sumFeb = $totalF->total + $sumFeb;\n }\n }\n\n $sumMar = 0;\n foreach ($totalMar as $totalM) {\n if ($totalM->tipo_id == 1) {\n $sumMar = $totalM->total + $sumMar;\n }\n }\n\n $sumAbr = 0;\n foreach ($totalAbr as $totalA) {\n if ($totalA->tipo_id == 1) {\n $sumAbr = $totalA->total + $sumAbr;\n }\n }\n\n $sumMay = 0;\n foreach ($totalMay as $totalMa) {\n if ($totalMa->tipo_id == 1) {\n $sumMay = $totalMa->total + $sumMay;\n }\n }\n\n $sumJun = 0;\n foreach ($totalJun as $totalJ) {\n if ($totalJ->tipo_id == 1) {\n $sumJun = $totalJ->total + $sumJun;\n }\n }\n\n $sumJul = 0;\n foreach ($totalJul as $totalJu) {\n if ($totalJu->tipo_id == 1) {\n $sumJul = $totalJu->total + $sumJul;\n }\n }\n\n $sumAgo = 0;\n foreach ($totalAgo as $totalAg) {\n if ($totalAg->tipo_id == 1) {\n $sumAgo = $totalAg->total + $sumAgo;\n }\n }\n\n $sumSep = 0;\n foreach ($totalSep as $totalS) {\n if ($totalS->tipo_id == 1) {\n $sumSep = $totalS->total + $sumSep;\n }\n }\n\n $sumOct = 0;\n foreach ($totalOct as $totalO) {\n if ($totalO->tipo_id == 1) {\n $sumOct = $totalO->total + $sumOct;\n }\n }\n\n $sumNov = 0;\n foreach ($totalNov as $totalN) {\n if ($totalN->tipo_id == 1) {\n $sumNov = $totalN->total + $sumNov;\n }\n }\n\n $sumDic = 0;\n foreach ($totalDic as $totalD) {\n if ($totalD->tipo_id == 1) {\n $sumDic = $totalD->total + $sumDic;\n }\n }\n $anios = DB::table('salidas')\n ->selectRaw('distinct(year(fecha_emision)) as fecha')\n ->orderByDesc('fecha_emision')\n ->get()->toArray();\n return view('salidas.reporteVentas', compact('sumEne', 'sumFeb', 'sumMar', 'sumAbr', 'sumMay', 'sumJun', 'sumJul', 'sumAgo', 'sumSep', 'sumOct', 'sumNov', 'sumDic', 'anios', 'anio'));\n }", "function contarEspaciosAdelantados($cantidad_matriculas){\r\n $creditos=0;\r\n $adelantados=array();\r\n if(is_array($this->espaciosAprobados))\r\n {\r\n foreach ($this->espaciosAprobados as $espacio)\r\n {\r\n if($espacio['NIVEL']>$cantidad_matriculas){\r\n $adelantados[]=$espacio;\r\n $creditos=$creditos+(isset($espacio['CREDITOS'])?$espacio['CREDITOS']:'');\r\n }\r\n }\r\n }\r\n if($this->datosEstudiante['IND_CRED']=='N')\r\n {\r\n return count($adelantados);\r\n }elseif($this->datosEstudiante['IND_CRED']=='S')\r\n {\r\n return $creditos;\r\n }else{}\r\n }", "private function telaPerfilLoja()\r\n {\r\n //Carregando os anos do banco de dados\r\n $repositorio = $this->getDoctrine()->getRepository('DCPBundle:Quebra');\r\n\r\n $sql = $repositorio->createQueryBuilder('q')\r\n ->select('q.data')\r\n ->groupBy('q.data')\r\n ->getquery();\r\n\r\n $resultado = $sql->getResult();\r\n\r\n $anoGeral = array();\r\n $contAnoGeral = 0;\r\n foreach ($resultado as $data)\r\n {\r\n $anoGeral[$contAnoGeral] = $data[\"data\"]->format(\"Y\");\r\n $contAnoGeral++;\r\n }\r\n\r\n $ano = array();\r\n $contAno = 0;\r\n foreach ($anoGeral as $anoAPesquisar)\r\n {\r\n if (!in_array($anoAPesquisar, $ano))\r\n {\r\n $ano[$contAno] = $anoAPesquisar;\r\n $contAno++;\r\n }\r\n }\r\n\r\n return $ano;\r\n }", "function listaAsistenciasDia($fecha) {\n\t\t$asis = new mAsistencias();\n\t\treturn $asis->fetchAsistenciasDia($fecha);\n\t}", "public function notificacionesExpiradas()\n\t{\n\t\t$fechahoy = Carbon::now()->toDateString();\n\n\t\t$notificaciones = Notificacion::where('expiradate','<', $fechahoy)->orWhere('estatus_visto','=',\"visto\")->get();\n\n\t\treturn $notificaciones;\n\t}", "public function vacation_expired() {\n\t\t$vacaciones = $this->solicitudes_model->getVacacionesExpired();\n\t\tforeach ($vacaciones as $registro) :\n\t\t\t$datos = array(\n\t\t\t\t//'dias_acumulados'=>((int)$registro->dias_acumulados - (int)$registro->dias_uno) + (int)$registro->dias_dos,\n\t\t\t\t'dias_acumulados' => (int)$registro->dias_acumulados - (int)$registro->dias_uno,\n\t\t\t\t'dias_uno' => $registro->dias_dos,\n\t\t\t\t'vencimiento_uno' => $registro->vencimiento_dos,\n\t\t\t\t'dias_dos' => null,\n\t\t\t\t'vencimiento_dos' => null,\n\t\t\t);\n\t\t\t$this->solicitudes_model->actualiza_dias_vacaciones($registro->colaborador,$datos);\n\t\tendforeach;\n\t}", "private function ventasAleatoriasDelDia($fecha, $ventaTotal, $porcentajeMargen=0) {\n\n /**\n * Con una lista de objetos, los filtra dejando solo los que sean\n * candidatos validos según la frecuencia y devuelve uno de ellos\n * al azar\n */\n $objetoAleatorio = function(\n $lista,\n $catalogo, \n $nombre, \n $random,\n $frecuencia) {\n\n return $lista->filter(function($item) use ($random, $frecuencia) {\n return $item->$frecuencia >= $random;\n })->shuffle()->first();\n };\n\n /**\n * Obtiene un objeto aleatorio, bajando el valor de frecuencia\n * de ser necesario para forzar que se obtenga un elemento\n */\n $objetoAleatorioForzado = function(\n $lista,\n $catalogo,\n $nombre,\n $random,\n $frecuencia) use ($objetoAleatorio) {\n while(!$obj = $objetoAleatorio($lista, $catalogo,\n $nombre, $random, $frecuencia)) {\n if($random < 10) \n return null;\n $random = $random * 0.8;\n }\n return $obj;\n };\n\n /**\n * Wrapper para obtener un usuario aleatorio\n */\n $obtenerUsuario = function($random) use ($objetoAleatorioForzado) {\n $usuarios = User::role('vendedor')->get();\n return $objetoAleatorioForzado($usuarios, \n 'usuarios', \n 'name', \n $random,\n 'frecuenciaVentas');\n };\n\n /**\n * Wrapper para obtener un producto aleatorio\n */\n $obtenerProducto = function($random) use ($objetoAleatorioForzado) {\n $productos = Producto::all();\n return $objetoAleatorioForzado($productos, \n 'productos',\n 'nombre', \n $random,\n 'frecuenciaCompras');\n };\n\n /**\n * Fingir una venta, esta funcion es basicamente la misma que\n * Venta::crear() pero con ligeros ajustes para este entorno\n * de población\n */\n $vender = function(User $user, $productos, $fecha) {\n return DB::transaction(function() use ($user, $productos, $fecha) {\n $venta = new Venta;\n $venta->user_id = $user->id;\n $venta->fecha_hora = $fecha;\n $venta->fecha = $fecha->format('Y-m-d');\n $venta->save();\n\n $total = 0;\n foreach($productos as $producto) {\n list($id, $cantidad) = $producto;\n\n $producto = Producto::find($id);\n $total += $producto->precio*$cantidad;\n\n $venta->productos()->attach($producto, [\n 'precio' => $producto->precio,\n 'cantidad' => $cantidad\n ]);\n }\n\n $venta->total = $total;\n $venta->save();\n\n return $venta;\n });\n };\n\n /**\n * Aquí es donde se obtiene el usuario y la lista de productos\n * para generar lo que es una venta individual.\n */ \n $ventaAleatoria = function($fecha, $compraMinima) \n use ($obtenerProducto, $obtenerUsuario, $vender) {\n $fecha = (new Carbon(\"$fecha 09:00\"))\n ->add(rand(0, 12*60*60), 'seconds');\n $usuario = $obtenerUsuario(rand(0, 100));\n\n $total = 0;\n $venta_productos = [];\n\n while($total<$compraMinima) {\n $producto = $obtenerProducto(rand(0, 100));\n $cantidad = rand(1, 3);\n $total += $producto->precio * $cantidad;\n\n $venta_productos[] = [ $producto->id, $cantidad ]; \n }\n\n if(!$total) {\n return [ null, 0 ];\n }\n\n $venta = $vender($usuario, $venta_productos, $fecha);\n return [ $venta, $total ];\n };\n\n /*\n * Generar ventas aleatorias hasta llegar a un monto de venta\n * especifico para el dia\n */\n return DB::transaction(function() \n use ($fecha, $ventaTotal, $ventaAleatoria, $porcentajeMargen) {\n $total = 0;\n $compraMinima = 2000;\n $ventas = [];\n $margen = $ventaTotal*$porcentajeMargen/100;\n $ventaTotal += rand(0, $margen*2)-$margen;\n\n while($total<$ventaTotal) {\n list($venta, $totalOperacion) = $ventaAleatoria($fecha, $compraMinima);\n if(!$venta) {\n break;\n }\n $total += $totalOperacion;\n $ventas[] = $venta;\n }\n echo \"Total($fecha): $\". number_format($total, 2) .\"\\n\";\n return $ventas;\n });\n }", "public static function todosLosAnuncios()\n {\n try {\n $arrayanuncios = [];\n $fechaActual = new DateTime(date(\"d-m-y\", time()));\n $consulta = \"SELECT id_anuncio,autor,moroso,localidad,descripcion,fecha FROM anuncios ORDER BY fecha DESC\";\n $datos = [];\n $resultado = accesoDB::mostrarConsulta($consulta, $datos);\n\n if ($resultado == '1') {\n return 1;\n } else {\n foreach ($resultado as $valor) {\n $id_anuncio = $valor['id_anuncio'];\n $autor = $valor['autor'];\n $moroso = $valor['moroso'];\n $localidad = $valor['localidad'];\n $descripcion = $valor['descripcion'];\n $fecha = $valor['fecha'];\n $fechaAnuncio = new DateTime($fecha);\n $interval = $fechaAnuncio->diff($fechaActual);\n $dias = $interval->format('%d');\n $mes = $interval->format('%m');\n $año = $interval->format('%y');\n $anuncios = new Anuncios($id_anuncio, $autor, $moroso, $localidad, $descripcion, $fechaAnuncio->format('d-m-Y'));\n array_push($arrayanuncios, [$anuncios, $dias, $mes, $año]);\n }\n echo \"</div>\";\n return $arrayanuncios;\n $resultado = null;\n $conexion = null;\n }\n } catch (PDOException $ex) {\n echo $ex->getMessage();\n }\n }", "private function obtenerCantidadVentas()\n {\n\n $cantidadVentasActual = DB::table('detalleCompra')\n ->join('compra', 'detalleCompra.idCompra', '=', 'compra.idCompra')\n ->whereMonth('compra.fechaCompra', '=', Carbon::now()->month)->whereYear('compra.fechaCompra', '=', Carbon::now()->year)->sum('detalleCompra.cantidad');\n\n $cantidadVentasPasado = DB::table('detalleCompra')\n ->join('compra', 'detalleCompra.idCompra', '=', 'compra.idCompra')\n ->whereMonth('compra.fechaCompra', '=', Carbon::now()->subMonth()->format('m'))->sum('detalleCompra.cantidad');\n\n $cantidadVentas = array();\n\n if ($cantidadVentasActual) {\n\n array_push($cantidadVentas, $cantidadVentasActual);\n } else {\n\n array_push($cantidadVentas, 0);\n }\n\n if ($cantidadVentasPasado) {\n\n array_push($cantidadVentas, $cantidadVentasPasado);\n } else {\n\n array_push($cantidadVentas, 0);\n }\n\n return $cantidadVentas;\n }", "function procesar_cambio ($datos){\n //validamos que no exista otro periodo, para ello tomamos la fecha actual y obtenemos todos los periodo \n //que existen con sus respectivos dias y verificamos que el espacio que se quiere cargar no este ocupado en esos \n //dias\n \n }", "public function puestaACero() {\n $this -> horas = 0;\n $this -> minutos = 0;\n $this -> segundos = 0;\n }", "public function getAtivas()\n {\n return Experiencia::ativas()->orderBy('ordem')->get();\n }", "function en_rojo($anio){\n $ar=array();\n $ar['anio']=$anio;\n $sql=\"select sigla,descripcion from unidad_acad \";\n $sql = toba::perfil_de_datos()->filtrar($sql);\n $resul=toba::db('designa')->consultar($sql);\n $ar['uni_acad']=$resul[0]['sigla'];\n $res=$this->get_totales($ar);//monto1+monto2=gastado\n $band=false;\n $i=0;\n $long=count($res);\n while(!$band && $i<$long){\n \n if(($res[$i]['credito']-($res[$i]['monto1']+$res[$i]['monto2']))<-50){//if($gaste>$resul[$i]['cred']){\n $band=true;\n }\n \n $i++;\n }\n return $band;\n \n }", "public function getMetasAlcanzadas()\n {\n $metasAlcanzadas = 0;\n foreach ($this->objetivos as $objetivo)\n {\n if (count($objetivo->getActividades())!=0)\n {\n foreach($objetivo->getActividades() as $actividad)\n {\n if (count($actividad->getMetaAlcanzada())!=0)\n {\n foreach($actividad->getMetaAlcanzada() as $metaAlcanzada)\n { \n $metasAlcanzadas+=$metaAlcanzada->getMeta();\n }\n }\n } \n }\n }\n return $metasAlcanzadas;\n }", "function armarSemana($horarios, $horarioActual, $dias) {\n\tforeach($horarios as $hora) { //Se recorre el array de horarios\n\t\techo \"<tr><td>\".$hora.\"</td>\";\n\t\tforeach($dias as $dia=>$fecha) {\n\t\t\t$vacio = true;\n\t\t\tif($dia != \"Domingo\") {\n\t\t\t\tforeach ($horarioActual as $campo=>$estado) {\t//Se recorre el array de turnos del dia\n\t\t\t\t\tif (isset($_POST['patologias']) && $_POST['patologias'] != $estado['patologia']) { continue; }\n\t\t\t\t\tif ($hora == date(\"H:i\", strtotime($estado['HORA_TURNO'])) && date(\"w\", strtotime($estado['FECHA_TURNO'])) == date(\"w\", strtotime($fecha))) {\t//Si el turno coincide con el horario y el dia\n\t\t\t\t\t\tif (verificarLaborable($hora, $dia) == true) {\n\t\t\t\t\t\t\t$vacio = false;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$cupos = obtenerCuposTurno($estado['FECHA_TURNO'], $hora); //guardo cantidad de cupos por hora y fecha dadas\n\t\t\t\t\t\t\t$cantCamillas = 0;\n\t\t\t\t\t\t\t$cantGimnasio = 0;\n\t\t\t\t\t\t\tforeach($cupos as $reg=>$camp) {\t//en este for asigno las cantidades para cada categoria\n\t\t\t\t\t\t\t\tif($camp['sesion'] == \"Camilla\") {\n\t\t\t\t\t\t\t\t\t$cantCamillas += $camp['cantidad'];\n\t\t\t\t\t\t\t\t} elseif($camp['sesion'] ==\"Gimnasio\") {\n\t\t\t\t\t\t\t\t\t$cantGimnasio += $camp['cantidad'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$disponibilidad = estadoTurno($cantCamillas, $cantGimnasio);\n\n\t\t\t\t\t\t\tif ($disponibilidad == \"Disponible\") { //If que determina los colores de las casillas\n\t\t\t\t\t\t\t\t$colorCasilla = \"disponible\";\n\t\t\t\t\t\t\t} elseif($disponibilidad == \"Libre\") {\n\t\t\t\t\t\t\t\t$colorCasilla = \"libre\";\n\t\t\t\t\t\t\t} elseif($disponibilidad == \"Ocupado\") {\n\t\t\t\t\t\t\t\t$colorCasilla = \"ocupado\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t/*if ($GLOBALS['perfil'] == \"profesional\") { //si el perfil es de profesional, se veran los cupos disponibles\n\t\t\t\t\t\t\t\techo \"<td class=\".$colorCasilla.\">\".$estado[\"camilla\"].\"</td>\",\n\t\t\t\t\t\t\t\t\"<td class=\".$colorCasilla.\">\".$estado[\"gimnasio\"].\"</td>\";\n\t\t\t\t\t\t\t} else { */\n\t\t\t\t\t\t\techo \"<td class=\".$colorCasilla.\">\".cantidadCupos($cantCamillas, $GLOBALS['MaximoCamillas']).\"</td>\",\n\t\t\t\t\t\t\t\"<td class=\".$colorCasilla.\">\".cantidadCupos($cantGimnasio, $GLOBALS['MaximoGimnasio']).\"</td>\";\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tif ($disponibilidad == \"Disponible\") { \n\t\t\t\t\t\t\t\techo \"<td class=\".$colorCasilla.\"><input type='button' value='Si' onclick='location=\\\"reservar.php?fecha=\".$fecha.\"&hora=\".$hora.\"\\\";'/></td>\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\techo \"<td class=\".$colorCasilla.\">No</td>\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} elseif (verificarLaborable($hora, $dia) == false) {\n\t\t\t\t\t\t\t//Si la hora dada no es laboral el dia dado, entonces\n\t\t\t\t\t\t\techo \"<td class='cerrado'>-</td>\", \n\t\t\t\t\t\t\t\"<td class='cerrado'>-</td>\",\n\t\t\t\t\t\t\t\"<td class='cerrado'>-</td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\tif ($vacio == true) {\n\t\t\t\t\t\tif(verificarLaborable($hora, $dia)) {\n\t\t\t\t\t\t\tif ($_SESSION['perfil'] == \"Administrador\") {\n\t\t\t\t\t\t\t\techo \"<td class='libre'>\".$GLOBALS['MaximoCamillas'].\"</td>\", \"<td class='libre'>\".$GLOBALS['MaximoGimnasio'].\"</td>\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\techo \"<td class='libre'>Si</td>\", \"<td class='libre'>Si</td>\"; \n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\techo \"<td class='libre'><input type='button' value='Si' onclick='location=\\\"reservar.php?fecha=\".$fecha.\"&hora=\".$hora.\"\\\";'/></td>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//Si la hora dada no es laboral el dia dado, entonces\n\t\t\t\t\t\t\techo \"<td class='cerrado'>-</td>\", \n\t\t\t\t\t\t\t\"<td class='cerrado'>-</td>\",\n\t\t\t\t\t\t\t\"<td class='cerrado'>-</td>\";\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo \"</tr>\";\n\t}\n}", "public function getOpcionesEstadosPosiblesDeCambio(){\n \t//return array('planificado' => 'Planificado','parcial' => 'Realizada Parcialmente','cancelado' => 'Cancelada', 'realizado' => 'Realizada');\n \tif($this->esPlanificada()){\n\t\t\treturn array('planificado' => 'Planificado','parcial' => 'Realizada Parcialmente','cancelado' => 'Cancelada');\n\t\t}\n\t\telseif($this->esParcial()){\n\t\t\treturn array('parcial' => 'Realizada Parcialmente','atrasado' => 'Atrasado','cancelado' => 'Cancelada', 'realizado' => 'Realizada');\n\t\t}\n\t\telseif($this->esAtrasada()){\n\t\t\treturn array('parcial' => 'Realizada Parcialmente','atrasado' => 'Atrasado','cancelado' => 'Cancelada', 'realizado' => 'Realizada');\n\t\t}\n\t\telseif($this->esCancelada()){\n\t\t\treturn array('cancelado' => 'Cancelada');\n\t\t}\n\t\telseif($this->esRealizada()){\n\t\t\treturn array('realizado' => 'Realizada');\n\t\t}\n\t\treturn array('planificado' => 'Planificado','parcial' => 'Realizada Parcialmente','cancelado' => 'Cancelada', 'realizado' => 'Realizada');\n\t}", "function getDiasCorridos($data){\n\t\t\n\t\t\t$data_inicial = $data;\n\t\t\t$data_final = getDateCurrent();\n\t\t\t\n\t\t\t// Usa a função strtotime() e pega o timestamp das duas datas:\n\t\t\t$time_inicial = strtotime($data_inicial);\n\t\t\t$time_final = strtotime($data_final);\n\t\t\t\n\t\t\t// Calcula a diferença de segundos entre as duas datas:\n\t\t\t$diferenca = $time_final - $time_inicial; // 19522800 segundos\n\t\t\t\n\t\t\t// Calcula a diferença de dias\n\t\t\t$dias = (int)floor( $diferenca / (60 * 60 * 24)); // 225 dias\n\t\t\t\n\t\t\t// Exibe uma mensagem de resultado:\n\t\t\treturn $dias;\n\t\t\t\t\n\t\t}", "public function controlAviso()\n {\n $em = $this->getEntityManager();\n $q = $em->createQuery('SELECT r1 FROM Cespi\\Bundle\\IsoBundle\\Entity\\RegistroCargadoDato r1 '\n . ' WHERE r1.createdAt = (SELECT MAX(r2.createdAt) from Cespi\\Bundle\\IsoBundle\\Entity\\RegistroCargadoDato r2 where r2.idRegistroCargado = r1.idRegistroCargado group by r2.idRegistroCargado)'\n . ' and r1.control_envio_email = true ORDER BY r1.idRegistroCargado, r1.createdAt DESC');\n return $q->getResult();\n }", "public function todosLosEstados(){\r\n $arraySolicitudes =$this->controlDelivery->getSolicitudesDelivery();\r\n return $arraySolicitudes;\r\n }", "function get_horas_asignadas_x_designacion($designacion)\n {\n $anio = date('Y');\n\t$sql = \"\n\t\tSELECT sum(carga_horaria) as suma\n\t\tFROM asignaciones\n\t\tWHERE designacion = $designacion AND estado = 1\n OR (designacion = $designacion AND estado = 15 AND ciclo_lectivo = $anio)\n\t\t\";\n\treturn toba::db()->consultar_fila($sql);\n }", "public function inicia_vacaciones() {\n\t\t$vacaciones = $this->solicitudes_model->getVacaciones();\n\n\t\t//var_dump($vacaciones);exit;\n\n\t\tforeach ($vacaciones as $solicitud) {\n\n\t\t\t//echo $solicitud->colaborador;\n\n\t\t\t//$solicitud = $this->solicitudes_model->getSolicitudById($registro->id);\n\t\t\t//$this->actualiza_dias_disponibles($solicitud);\n\n\t\t\t$diasSolicitados = $solicitud->dias;\n\n\t\t\t// if exists row with vacations by user\n\t\t\tif($acumulados = $this->solicitudes_model->getAcumulados($colaborador = $solicitud->colaborador)){\n\n\t\t\t\t$datos = array(\n\t\t\t\t\t\"dias_uno\" => $acumulados->dias_uno,\n\t\t\t\t\t\"dias_dos\" => $acumulados->dias_dos,\n\t\t\t\t\t\"vencimiento_uno\" => $acumulados->vencimiento_uno,\n\t\t\t\t\t\"vencimiento_dos\" => $acumulados->vencimiento_dos,\n\t\t\t\t\t\"dias_acumulados\" => $acumulados->dias_acumulados\n\t\t\t\t);\n\n\t\t\t\t$diasSolicitados*=(-1);\n\n\t\t\t\twhile(true){\n\n\t\t\t\t\tif($datos['dias_uno'] > 0){\n\t\t\t\t\t\t$datos['dias_uno'] = $datos['dias_uno'] + $diasSolicitados;\n\t\t\t\t\t\tif($datos['dias_uno'] >= 0){\n\t\t\t\t\t\t\t$datos['dias_acumulados'] = $datos['dias_acumulados'] + $diasSolicitados;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$diasSolicitados = $datos['dias_uno'];\n\t\t\t\t\t}elseif($datos['dias_dos'] > 0){\n\t\t\t\t\t\t$datos['dias_dos'] = $datos['dias_dos'] + $diasSolicitados;\n\t\t\t\t\t\t$datos['dias_uno'] = 0;\n\t\t\t\t\t\tif($datos['dias_dos'] >= 0){\n\t\t\t\t\t\t\t$datos['dias_acumulados'] = $datos['dias_acumulados'] + $diasSolicitados;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$diasSolicitados = $datos['dias_dos'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$datos['dias_acumulados'] = $datos['dias_acumulados'] + $diasSolicitados;\n\t\t\t\t\t\t$vs['dias_uno'] = 0;\n\t\t\t\t\t\t$vs['dias_dos'] = 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t$datos['vencimiento_uno'] = ($datos['dias_uno'] == 0) ? null : $datos['vencimiento_uno'];\n\t\t\t\t$datos['vencimiento_dos'] = ($datos['dias_dos'] == 0) ? null : $datos['vencimiento_dos'];\n\n\t\t\t\t$this->solicitudes_model->actualiza_dias_vacaciones($colaborador,$datos);\n\n\t\t\t}\n\t\t\t$this->solicitudes_model->useSolicitudVacation($solicitud->id);\n\t\t}\n\t\t//exit;\n\t}", "public static function calculaVenda()\n {\n Marca::query()->update([\n 'dataultimacompra' => null,\n 'itensabaixominimo' => null,\n 'itensacimamaximo' => null,\n 'vendabimestrevalor' => null,\n 'vendasemestrevalor' => null,\n 'vendaanovalor' => null,\n 'vendaanopercentual' => null,\n ]);\n\n // Monta classificacao ABC\n $totalvendaano_geral = Marca::sum('vendaanovalor');\n $totalvendaano = Marca::where('abcignorar', '=', false)->sum('vendaanovalor');\n $posicao = 0;\n $percentual_acumulado = 0;\n\n foreach (Marca::orderByRaw('vendaanovalor DESC NULLS LAST')->orderBy('marca', 'ASC')->get() as $marca) {\n $abccategoria = 0;\n $abcposicao = null;\n\n if (!$marca->abcignorar) {\n $posicao++;\n $abcposicao = $posicao;\n $percentual_acumulado += (($marca->vendaanovalor / $totalvendaano) * 100);\n if ($percentual_acumulado <= 20) {\n $abccategoria = 3;\n } elseif ($percentual_acumulado <= 50) {\n $abccategoria = 2;\n } elseif ($percentual_acumulado <= 90) {\n $abccategoria = 1;\n } else {\n $abccategoria = 0;\n }\n }\n\n $marca->update([\n 'abccategoria' => $abccategoria,\n 'abcposicao' => $abcposicao,\n 'vendaanopercentual' => (($marca->vendaanovalor / $totalvendaano_geral) * 100),\n ]);\n\n $afetados++;\n }\n\n return $afetados;\n }", "public function getPontosAteDataAtual($cpf_usuario){\r\n\t\t$strQuery = \"\t\r\n\t\t\t\t\t \tSELECT SUM(qtd_pontos) as qtdPontos \r\n\t\t \r\n\t\t\t\t\tFROM \".$this->_table.\" h where h.cpf_usuario = \".$cpf_usuario.\" and data_venc_pontos <= CURDATE() and expirado = 0 \";\r\n\t\t$arrRet = ControlDB::getRow($strQuery,3);\r\n\t\treturn $arrRet;\r\n\t}", "function calcular_espacios_disponibles ($aula, $espacios){\n \n \n //creo un arreglo con todos los horarios de cursado por dia\n $horarios=$this->crear_horarios();\n $longitud=count($horarios);\n foreach ($espacios as $clave=>$espacio){\n $indice=0; //debe ir ahi porque el arreglo no esta ordenado\n $fin=FALSE;\n while(($indice < $longitud) && !$fin){\n \n if(strcmp(($horarios[$indice][0]), ($espacio['hora_inicio'])) == 0){\n// print_r(strcmp(($horarios[$indice][0]), ($espacio['hora_inicio'])));\n\n \n //para que el arreglo horarios pueda ser modificado en la rutina eliminar_horarios\n //hay que realizar un pasaje de parametros por referencia (&horarios)\n $this->eliminar_horario(&$horarios, $indice, $longitud, $espacio['hora_fin']);\n \n $fin=TRUE;\n \n //para volver a recorrer todo el arreglo de nuevo en la proxima iteracion.\n //Evita conflictos si el arreglo no esta ordenado.\n $indice=0;\n }\n else{\n $indice += 1;\n }\n }\n }\n return $horarios;\n }", "static public function mdlRangoFechasVentas($tabla, $fechaInicial, $fechaFinal){\n\n\t\tif($fechaInicial == null){\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT * FROM $tabla ORDER BY id ASC\");\n\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\t\n\n\n\t\t}else if($fechaInicial == $fechaFinal){\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT fecha_salida, round(sum(cantidad*precio_venta),2) AS totalvta FROM $tabla WHERE fecha_salida like '%$fechaFinal%'\");\n\n\t\t\t$stmt -> bindParam(\":fecha_salida\", $fechaFinal, PDO::PARAM_STR);\n\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\n\n\t\t}else{\n\n\t\t\t$fechaActual = new DateTime();\n\t\t\t$fechaActual ->add(new DateInterval(\"P1D\"));\n\t\t\t$fechaActualMasUno = $fechaActual->format(\"Y-m-d\");\n\n\t\t\t$fechaFinal2 = new DateTime($fechaFinal);\n\t\t\t$fechaFinal2 ->add(new DateInterval(\"P1D\"));\n\t\t\t$fechaFinalMasUno = $fechaFinal2->format(\"Y-m-d\");\n\n\t\t\tif($fechaFinalMasUno == $fechaActualMasUno){\n\n\t\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT `fecha_salida`, round(SUM(IF(`es_promo` = 0, `cantidad`*`precio_venta`,0)),2) AS sinpromo, round(SUM(IF(`es_promo` = 1, `precio_venta`,0)),2) AS promo FROM $tabla WHERE fecha_salida BETWEEN '$fechaInicial' AND '$fechaFinalMasUno' GROUP BY fecha_salida\");\n\n\t\t\t\t//$stmt = Conexion::conectar()->prepare(\"SELECT fecha_salida, round(sum(cantidad*precio_venta),2) AS totalvta FROM $tabla WHERE fecha_salida BETWEEN '$fechaInicial' AND '$fechaFinalMasUno' GROUP BY fecha_salida\");\n\n\t\t\t\t//SELECT `fecha_salida`, round(SUM(IF(`es_promo` = 0, `cantidad`*`precio_venta`,0)),2) AS sinpromo, round(SUM(IF(`es_promo` = 1, `precio_venta`,0)),2) AS promo FROM hist_salidas WHERE fecha_salida BETWEEN '2019-08-01' AND '2019-12-27' GROUP BY fecha_salida\n\n\t\t\t}else{\n\n\t\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT `fecha_salida`, SUM(IF(`es_promo` = 0, `cantidad`*`precio_venta`,0)) AS sinpromo, SUM(IF(`es_promo` = 1, `precio_venta`,0)) AS promo FROM $tabla WHERE fecha_salida BETWEEN '$fechaInicial' AND '$fechaFinal' GROUP BY fecha_salida \");\n\n\t\t\t\t//$stmt = Conexion::conectar()->prepare(\"SELECT fecha_salida, round(sum(cantidad*precio_venta),2) AS totalvta FROM $tabla WHERE fecha_salida BETWEEN '$fechaInicial' AND '$fechaFinal' GROUP BY fecha_salida\");\n\n\t\t\t}\n\t\t\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\n\n\t\t}\n\n\t}", "function fecha_no_paso($dia,$mes,$anio){\r\n$dia_hoy=date(\"d\");\r\n$mes_hoy=date(\"m\");\r\n$anio_hoy=date(\"Y\");\r\n\r\n$dif_en_meses=(($mes-$mes_hoy)+(12*($anio-$anio_hoy)));\r\n\r\nif($dif_en_meses<0){return(0);}\r\nif(($dif_en_meses==0) && ($dia<$dia_hoy)){return(0);}\r\nreturn(1);\r\n}", "public function cesta_sin_iva(){\r\n\t\t\t$total = 0;\r\n\t\t\tforeach ($this->listArticulos as $elArticulo){\r\n\t\t\t\t$precio = $elArticulo->oferta>0?$elArticulo->oferta:$elArticulo->precio;\r\n\t\t\t\t$total+= round($elArticulo->unidades*$precio,2);\t\t\t\t\r\n\t\t\t}\r\n\t\t\treturn $total;\r\n\t\t}", "private function asientosOcupados($entradasUsu, $entradasAnon){\n \n \n \n foreach ($entradasUsu as $entU){\n \n $asiento = new Asientos();\n \n $asiento->buscarPorId($entU[\"cod_asiento\"]);\n \n $asientoOcupado[$asiento->fila][$asiento->columna] = true;\n \n }\n \n \n foreach ($entradasAnon as $entA){\n \n $asiento = new Asientos();\n \n $asiento->buscarPorId($entA[\"cod_asiento\"]);\n \n $asientoOcupado[$asiento->fila][$asiento->columna] = true;\n \n }\n \n return $asientoOcupado;\n \n }", "public function getAtivas()\n {\n return Expedicao::ativas()->orderBy('ordem')->get();\n }", "function obter_todas_noticias_ativas() {\n $this->db->where(array(\"status_noticia\"=>1));\n $this->db->order_by(\"data_noticia\", \"desc\");\n return $this->db->get('noticia');\n }", "public function index()\n {\n// $asistencias = Asistencia::all()->groupBy('fecha');\n// // dd($asistencias);\n// //dd($asistencias);\n// foreach($asistencias as $as){\n// foreach ($as as $a){\n// dd($a);\n// }\n// }\n $u = Auth::user();\n $doc = Docente::where('identificacion', $u->identificacion)->first();\n $hoy = getdate();\n $a = $hoy[\"year\"] . \"-\" . $hoy[\"mon\"] . \"-\" . $hoy[\"mday\"];\n if ($doc != null) {\n $per = Periodo::where([['fechainicio', '<=', $a], ['fechafin', '>=', $a]])->first();\n if ($per == null) {\n $cargaAcademica = collect();\n } else {\n $cargaAcademica = Cargaacademica::where([['docente_id', $doc->id], ['periodo_id', $per->id]])->get();\n }\n } else {\n $cargaAcademica = Cargaacademica::all();\n }\n $asis = null;\n if($cargaAcademica != null){\n foreach ($cargaAcademica as $item){\n $obj = Asistencia::where('cargaacademica_id',$item->id)->get()->groupBy('fecha');\n if(count($obj)>0){\n $asis[]=$obj;\n }\n }\n }\n $asistencias = collect();\n if($asis != null){\n foreach ($asis as $i){\n foreach ($i as $item) {\n foreach ($item as $e){\n $asistencias[]=$e;\n }\n }\n }\n }\n return view('evaluacion.asistencia.list')\n ->with('location', 'evaluacion')\n ->with('asistencias', $asistencias);\n }", "public function avisoSubirAcuerdoDeAdhesion()\n {\n if (!Auth::user()->firmacorrecta) {\n $fecha = Carbon::now()->format('Y-m-d');\n $codigo = 'WIMPDADH';\n $aviso = 'Por favor, Ud. debe hacernos llegar el documento de acuerdo de adhesión que en\n su día le fue remitido por esta AMPA. Dicho documento deberá estar firmado por Ud.';\n $solucion = 'Realice una de las siguientes acciones: a) Imprímalo, fírmelo y escanéelo\n en formato pdf y súbalo a esta aplicación. Si desea optar por esta solución abra el\n desplegable con su nombre en la parte superior de la página y acceda a su perfil donde\n encontrará la opción correspondiente. b) imprímalo, fírmelo y deposítelo en nuestro\n buzón. c) imprímalo, fírmelo y entréguelo personalmente en nuestro despacho sito en la\n planta superior sobre la secretaría del colegio. d) Acuda a nuestro despacho y firme la\n copia de su documento que obra en nuestro poder.';\n $user_id = Auth::user()->id;\n\n return $this->avisos->crearAviso($codigo, $fecha, $aviso, $solucion, $user_id);\n }\n }", "function diasUteisNovo($vencto, $atual) {\r\n $data_inicio = strtotime($vencto);\r\n $data_fim = strtotime($atual);\r\n $dias = 0;\r\n $fimSem = 0;\r\n // Resgata diferença entre as datas\r\n if ($data_fim > $data_inicio) {\r\n $inicio = $data_inicio;\r\n $fim = $data_fim;\r\n while ($inicio <= $fim) {\r\n $diaSem = date(\"N\", $inicio);\r\n if ($diaSem > 5) {\r\n $fimSem++;\r\n }\r\n $inicio += 86400;\r\n $dias++;\r\n }\r\n /* $dateInterval = $data_inicio->diff($data_fim);\r\n $dias = $dateInterval->days; */\r\n $dias = $dias - $fimSem;\r\n if ($dias < 0) {\r\n $dias = 0;\r\n }\r\n } else {\r\n $dias = 0;\r\n }\r\n return $dias;\r\n }", "function FacturasAbiertas() {\n $sql = \"SELECT COUNT(*) count FROM \".self::$table.\" WHERE estado='Abierta'\";\n return DBManager::count($sql);\n }", "public function getDados()\n {\n $aLinhas = array();\n\n /**\n * montamos as datas, e processamos o balancete de verificação\n */\n $oDaoPeriodo = db_utils::getDao(\"periodo\");\n $sSqlDadosPeriodo = $oDaoPeriodo->sql_query_file($this->iCodigoPeriodo);\n $rsPeriodo = db_query($sSqlDadosPeriodo);\n $oDadosPerido = db_utils::fieldsMemory($rsPeriodo, 0);\n $sDataInicial = \"{$this->iAnoUsu}-01-01\";\n $iUltimoDiaMes = cal_days_in_month(CAL_GREGORIAN, $oDadosPerido->o114_mesfinal, $this->iAnoUsu);\n $sDataFinal = \"{$this->iAnoUsu}-{$oDadosPerido->o114_mesfinal}-{$iUltimoDiaMes}\";\n $sWherePlano = \" c61_instit in ({$this->getInstituicoes()}) \";\n /**\n * processa o balancete de verificação\n */\n $rsPlano = db_planocontassaldo_matriz($this->iAnoUsu,\n $sDataInicial,\n $sDataFinal,\n false,\n $sWherePlano,\n '',\n 'true',\n 'true');\n\n $iTotalLinhasPlano = pg_num_rows($rsPlano);\n /**\n * percorremos a slinhas cadastradas no relatorio, e adicionamos os valores cadastrados manualmente.\n */\n $aLinhasRelatorio = $this->oRelatorioLegal->getLinhasCompleto();\n for ($iLinha = 1; $iLinha <= count($aLinhasRelatorio); $iLinha++) {\n\n $aLinhasRelatorio[$iLinha]->setPeriodo($this->iCodigoPeriodo);\n $aColunasRelatorio = $aLinhasRelatorio[$iLinha]->getCols($this->iCodigoPeriodo);\n $aColunaslinha = array();\n $oLinha = new stdClass();\n $oLinha->totalizar = $aLinhasRelatorio[$iLinha]->isTotalizador();\n $oLinha->descricao = $aLinhasRelatorio[$iLinha]->getDescricaoLinha();\n $oLinha->colunas = $aColunasRelatorio;\n $oLinha->nivellinha = $aLinhasRelatorio[$iLinha]->getNivel();\n foreach ($aColunasRelatorio as $oColuna) {\n\n $oLinha->{$oColuna->o115_nomecoluna} = 0;\n if ( !$aLinhasRelatorio[$iLinha]->isTotalizador() ) {\n $oColuna->o116_formula = '';\n }\n }\n\n if (!$aLinhasRelatorio[$iLinha]->isTotalizador()) {\n\n $aValoresColunasLinhas = $aLinhasRelatorio[$iLinha]->getValoresColunas(null, null, $this->getInstituicoes(),\n $this->iAnoUsu);\n\n $aParametros = $aLinhasRelatorio[$iLinha]->getParametros($this->iAnoUsu, $this->getInstituicoes());\n foreach($aValoresColunasLinhas as $oValor) {\n foreach ($oValor->colunas as $oColuna) {\n $oLinha->{$oColuna->o115_nomecoluna} += $oColuna->o117_valor;\n }\n }\n\n /**\n * verificamos se a a conta cadastrada existe no balancete, e somamos o valor encontrado na linha\n */\n for ($i = 0; $i < $iTotalLinhasPlano; $i++) {\n\n $oResultado = db_utils::fieldsMemory($rsPlano, $i);\n\n\n $oParametro = $aParametros;\n\n foreach ($oParametro->contas as $oConta) {\n\n $oVerificacao = $aLinhasRelatorio[$iLinha]->match($oConta, $oParametro->orcamento, $oResultado, 3);\n\n if ($oVerificacao->match) {\n\n $this->buscarInscricaoEBaixa($oResultado, $iLinha, $sDataInicial, $sDataFinal);\n\n if ( $oVerificacao->exclusao ) {\n\n $oResultado->saldo_anterior *= -1;\n $oResultado->saldo_anterior_debito *= -1;\n $oResultado->saldo_anterior_credito *= -1;\n $oResultado->saldo_final *= -1;\n }\n\n $oLinha->sd_ex_ant += $oResultado->saldo_anterior;\n $oLinha->inscricao += $oResultado->saldo_anterior_credito;\n $oLinha->baixa += $oResultado->saldo_anterior_debito;\n $oLinha->sd_ex_seg += $oResultado->saldo_final;\n }\n }\n }\n }\n $aLinhas[$iLinha] = $oLinha;\n }\n\n unset($aLinhasRelatorio);\n\n /**\n * calcula os totalizadores do relatório, aplicando as formulas.\n */\n foreach ($aLinhas as $oLinha) {\n\n if ($oLinha->totalizar) {\n\n foreach ($oLinha->colunas as $iColuna => $oColuna) {\n\n if (trim($oColuna->o116_formula) != \"\") {\n\n $sFormulaOriginal = ($oColuna->o116_formula);\n $sFormula = $this->oRelatorioLegal->parseFormula('aLinhas', $sFormulaOriginal, $iColuna, $aLinhas);\n $evaluate = \"\\$oLinha->{$oColuna->o115_nomecoluna} = {$sFormula};\";\n ob_start();\n eval($evaluate);\n $sRetorno = ob_get_contents();\n ob_clean();\n if (strpos(strtolower($sRetorno), \"parse error\") > 0 || strpos(strtolower($sRetorno), \"undefined\" > 0)) {\n $sMsg = \"Linha {$iLinha} com erro no cadastro da formula<br>{$oColuna->o116_formula}\";\n throw new Exception($sMsg);\n\n }\n }\n }\n }\n }\n\n return $aLinhas;\n }", "public function total_reservas_sala_dia($fecha) // reservas sin eliminar // //PDF\n {\n $q_string = \"select sala, count(sala) as cant from reservas where fecha ='\".$fecha.\"' and eliminada ='0' and estado ='1' group by sala\";\n\t \t $data = $this->db->query($q_string);\n\t\t return $data;\n\t}", "public function index()\n { \n\n if(Auth::check()){\n $mesActual=date(\"n\");\n $añoActual=date(\"Y\"); \n $añoPasado=date(\"Y\")-1;\n $nombreMes = array(\"Enero\",\"Febrero\",\"Marzo\",\"Abril\",\"Mayo\",\"Junio\",\"Julio\",\"Agosto\",\"Septiembre\",\"Octubre\",\"Noviembre\",\"Diciembre\");\n $aniopasado = array(0,0,0,0,0,0,0,0,0,0,0,0);\n $aniopresente = array(0,0,0,0,0,0,0,0,0,0,0,0);\n $gananciaspasado = array(0,0,0,0,0,0,0,0,0,0,0,0);\n $gananciaspresente = array(0,0,0,0,0,0,0,0,0,0,0,0);\n /*$aniopasado = array(\"Enero\"=>0, \"Febrero\"=>0, \"Marzo\"=>0,\"Abril\"=>0, \"Mayo\"=>0, \"Junio\"=>0,\"Julio\"=>0, \"Agosto\"=>0, \"Septiembre\"=>0,\"Octubre\"=>0, \"Noviembre\"=>0, \"Diciembre\"=>0);\n $aniopresente = array(\"Enero\"=>0, \"Febrero\"=>0, \"Marzo\"=>0,\"Abril\"=>0, \"Mayo\"=>0, \"Junio\"=>0,\"Julio\"=>0, \"Agosto\"=>0, \"Septiembre\"=>0,\"Octubre\"=>0, \"Noviembre\"=>0, \"Diciembre\"=>0);*/\n \n $mes=11;\n $aniopresente[$mesActual-1]=1;\n while ($mes>0) {\n $mes1=$mesActual- $mes;\n if($mes1<0){\n $mes1=$mes1+12;\n $aniopasado[$mes1-1]=1;\n }else{\n $aniopresente[$mes1-1]=1;\n }\n $mes--; \n }\n \n $ganancias = Lava::DataTable(); \n $ganancias->addStringColumn(\"Mes\"); \n $ganancias->addNumberColumn(\"Ingresos\"); \n \n $arriendos = Arriendo::all(); \n foreach ($arriendos as $arriendo) {\n $fechaBd=$arriendo->fecha; \n $anio = date(\"Y\", strtotime($fechaBd)); \n $mess = date(\"n\", strtotime($fechaBd)); \n if($anio==$añoPasado){\n $gananciaspasado[$mess-1] = $gananciaspasado[$mess-1]+$arriendo->valor;\n }\n if($anio==$añoActual){\n $gananciaspresente[$mess-1] = $gananciaspresente[$mess-1]+$arriendo->valor;\n }\n }\n\n for ($i=0; $i <12 ; $i++) { \n if($aniopasado[$i]==1){\n $ganancias->addRow([$nombreMes[$i],$gananciaspasado[$i]]);\n }\n } \n\n for ($i=0; $i <12 ; $i++) { \n if($aniopresente[$i]==1){\n $ganancias->addRow([$nombreMes[$i],$gananciaspresente[$i]]);\n }\n }\n \n Lava::AreaChart('Ganancias', $ganancias,[\n 'title'=>'Ganancias por arriendo ultimos 12 meses',\n 'legend'=>[\n 'position'=>'in'\n ]\n\n ]);\n return view('grafico.arriendo',compact('arriendos'));\n }else{\n return view('auth.login');\n } \n \n }", "public function NumAdeudos(){\n\t\t$UsCg = new HomeController();\n\t\tdate_default_timezone_set('America/Mexico_City');\n\t\t$UsCfechaactual = date('Y-m-d');\n\t\t$UsCseccion = DB::table(\"colegiatura\")->where(\"Alumno_idAlumno\",Session::get(\"usuario\"));\n\t\t$UsCcolegiaturas = $UsCseccion->orderBy('periodo_idperiodo', 'asc')->get();\n\t\t$UsCconcole = $UsCseccion->count();\n\t\t$UsCusuario = DB::table(\"alumno\")->where(\"idAlumno\",Session::get(\"usuario\"))->first();\n\t\t$UsCadeudo = ($UsCg->restaFechas($UsCusuario->fecha, $UsCfechaactual))-$UsCconcole;\n\t\tif ($UsCadeudo < 0) {$UsCadeudo = 0;}\n\t\treturn \"- Adeudos: \".$UsCadeudo;\n\t}", "function Consulta_Informacion_Metas()\n {\n $sql=\"SELECT b.id,b.uid,year(b.fecha_inicio) AS ano, sum(b.no_dias) as no_dias,count(substr(b.fecha_inicio,1,4)) AS no_regs,\n sum(b.cantidad) AS total,a.name\n FROM crm_proyeccion as b LEFT JOIN users as a ON b.uid = a.uid\n WHERE b.active = 1 AND b.gid='\".$this->gid.\"' \".$this->filtro.\"\n GROUP BY substr(b.fecha_inicio,1,4)\n ORDER BY substr(b.fecha_inicio,1,4)\";\n $res=$this->db->sql_query($sql) or die (\"Error en la consulta: \".$sql);\n if($this->db->sql_numrows($res) > 0)\n {\n while(list($id,$_uid,$ano,$no_dias,$no_reg,$cantidad,$name) = $this->db->sql_fetchrow($res))\n {\n $this->array_metas[$ano]= $cantidad;\n }\n }\n }", "public function getAprovados()\n\t{\n\t\t \n\t\treturn $this->countByAttributes(array('status'=>2));\n\t}", "public function vendasHoje(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT ifnull(count(*),0) as total FROM tbpedidos c WHERE DAY(c.data_finaliza) = Day(now()) and c.status = 'F';\";\n $rsvendahj = $this->conexao->query($sql);\n $result = $rsvendahj->fetch_array();\n $vendashoje = $result['total'];\n\n return $vendashoje;\n }", "public function examenesPendientes(){\n\n\t\t$resultado = array();\n\t\t\n\t\t$query = \"SELECT count(E.idExamen) as cantidadExamenes\n\t\t\t\t\t\tFROM tb_examenes AS E \n \t\t\t\tWHERE Not E.idExamen IN (SELECT idTipoDetalle FROM tb_pago_factura_caja_detalle WHERE tipoDetalle = 'Examen' AND estado = 'Activo' )\";\n\t\t\n\t\t$conexion = parent::conexionCliente();\n\t\t\n\t\tif($res = $conexion->query($query)){\n \n /* obtener un array asociativo */\n while ($filas = $res->fetch_assoc()) {\n $resultado = $filas;\n }\n \n /* liberar el conjunto de resultados */\n $res->free();\n \n }\n\n return $resultado['cantidadExamenes'];\t\t\n\n\n\t\t\n\t}", "public function iva_articulos(){\r\n\t\t\t$total = $this->cesta_con_iva()-$this->cesta_sin_iva();\t\t\t\r\n\t\t\treturn $total;\r\n\t\t}", "public function total_reservas_sala_mes($fecha) // reservas sin eliminar // //PDF\n {\n\n $q_string = \"select sala, count(sala) as cant from reservas where month(fecha) = month('\".$fecha.\"') and eliminada ='0' and estado ='1' group by sala\";\n //select sala, count(sala) as cant\n //from reservas where month(fecha) ='6' and eliminada ='0' and estado ='1'\n //group by sala\n\t \t $data = $this->db->query($q_string);\n\t\t return $data;\n\t}", "public function getDados() {\n\n \t/**\n \t * Configurações do período informado.\n \t */\n $oDaoPeriodo = db_utils::getDao(\"periodo\");\n $sSqlDadosPeriodo = $oDaoPeriodo->sql_query_file($this->iCodigoPeriodo);\n $rsPeriodo = db_query($sSqlDadosPeriodo);\n $oDadosPeriodo = db_utils::fieldsMemory($rsPeriodo, 0);\n\n /**\n * Configurações do tipo de instituição da prefeitura ou câmara.\n */\n $oDaoDbConfig = db_utils::getDao(\"db_config\");\n $sWhere = \"codigo in({$this->getInstituicoes()})\";\n $sSqlDbConfig = $oDaoDbConfig->sql_query_file(null, 'db21_tipoinstit', null, $sWhere);\n $rsSqlDbConfig = $oDaoDbConfig->sql_record($sSqlDbConfig);\n $INumRowsDbConfig = $oDaoDbConfig->numrows;\n\n $iLimiteMaximo = 0;\n $iLimitePrudencial = 0;\n $nValorDespesaTotalPessoal = 0;\n $nTotalRCL = 0;\n $lTemPrefeitura = false;\n $lTemCamara = false;\n $lTemMinisterio = false;\n\n /**\n * Verifica o db21_tipoinstit para ver se é prefeitura ou câmara.\n */\n for ($iInd = 0; $iInd < $INumRowsDbConfig; $iInd++) {\n\n $oMunicipio = db_utils::fieldsMemory($rsSqlDbConfig, $iInd);\n\n if ($oMunicipio->db21_tipoinstit == 1) {\n $lTemPrefeitura = true;\n } else if ($oMunicipio->db21_tipoinstit == 2) {\n $lTemCamara = true;\n } else if ($oMunicipio->db21_tipoinstit == 101) {\n \t$lTemMinisterio = true;\n }\n }\n\n /**\n * Verifica o limite máximo (incisos I, II e III, art. 20 da LRF) {$iLimiteMaximo}%\n */\n if ($lTemPrefeitura == true && $lTemCamara == true) {\n\n if ($iLimiteMaximo == 0){\n $iLimiteMaximo = 60;\n $iLimiteMaximoAlerta = 54;\n\n }\n } else if ($lTemPrefeitura == true && $lTemCamara == false) {\n\n if ($iLimiteMaximo == 0) {\n\n $iLimiteMaximo = 54;\n $iLimiteMaximoAlerta = 48.6;\n }\n } else if ($lTemPrefeitura == false && $lTemCamara == true) {\n\n if ($iLimiteMaximo == 0) {\n $iLimiteMaximo = 6;\n $iLimiteMaximoAlerta = 5.4;\n }\n } else if ($lTemMinisterio) {\n\n if ($iLimiteMaximo == 0) {\n $iLimiteMaximo = 2;\n }\n }\n\n /**\n * Verifica o limite prudencial (parágrafo único, art. 22 da LRF) {$iLimitePrudencial}%\n */\n if ($iLimitePrudencial == 0) {\n $iLimitePrudencial = $iLimiteMaximo*95/100;\n }\n\n /**\n * Quadro de despesa bruta.\n */\n $oDespesaBruta = new stdClass();\n $oDespesaBruta->quadrodescricao = 'DESPESA BRUTA COM PESSOAL (I)';\n $oDespesaBruta->exercicio = 0;\n $oDespesaBruta->inscritas = 0;\n $oDespesaBruta->linhas = array();\n $oDespesaBruta->colunameses = $this->getDadosColuna();\n $oDespesaBruta->valorapurado = 0;\n $oDespesaBruta->percentuallimite = 0;\n $oDespesaBruta->linhatotalizadora = true;\n\n /**\n * Quadro de despesa não computadas.\n */\n $oDespesaNaoComputada = new stdClass();\n $oDespesaNaoComputada->quadrodescricao = 'DESPESAS NÃO COMPUTADAS (§ 1o do art. 19 da LRF) (II)';\n $oDespesaNaoComputada->exercicio = 0;\n $oDespesaNaoComputada->inscritas = 0;\n $oDespesaNaoComputada->linhas = array();\n $oDespesaNaoComputada->colunameses = $this->getDadosColuna();\n $oDespesaNaoComputada->valorapurado = 0;\n $oDespesaNaoComputada->percentuallimite = 0;\n $oDespesaNaoComputada->linhatotalizadora = true;\n\n /**\n * Quadro de despesa líquida.\n */\n $oDespesaLiquida = new stdClass();\n $oDespesaLiquida->quadrodescricao = 'DESPESA LÍQUIDA COM PESSOAL (III) = (I - II)';\n $oDespesaLiquida->exercicio = 0;\n $oDespesaLiquida->inscritas = 0;\n $oDespesaLiquida->linhas = array();\n $oDespesaLiquida->colunameses = $this->getDadosColuna();\n $oDespesaLiquida->valorapurado = 0;\n $oDespesaLiquida->percentuallimite = 0;\n $oDespesaLiquida->linhatotalizadora = true;\n\n /**\n * Quadro de despesa total com pessoal.\n */\n $oDespesaTotalComPessoal = new stdClass();\n $oDespesaTotalComPessoal->quadrodescricao = 'DESPESA TOTAL COM PESSOAL - DTP(V) = (IIIa + IIIb)';\n $oDespesaTotalComPessoal->exercicio = 0;\n $oDespesaTotalComPessoal->inscritas = 0;\n $oDespesaTotalComPessoal->linhas = array();\n $oDespesaTotalComPessoal->colunameses = array();\n $oDespesaTotalComPessoal->valorapurado = 0;\n $oDespesaTotalComPessoal->percentuallimite = 0;\n $oDespesaTotalComPessoal->linhatotalizadora = true;\n $oDespesaTotalComPessoal->percentualsobrercl = 0;\n\n /**\n * Quadro de receita corrente líquida.\n */\n $oReceitaTotalCorrenteLiquida = new stdClass();\n $oReceitaTotalCorrenteLiquida->quadrodescricao = 'RECEITA CORRENTE LÍQUIDA - RCL (IV)';\n $oReceitaTotalCorrenteLiquida->exercicio = 0;\n $oReceitaTotalCorrenteLiquida->inscritas = 0;\n $oReceitaTotalCorrenteLiquida->linhas = array();\n $oReceitaTotalCorrenteLiquida->colunameses = array();\n $oReceitaTotalCorrenteLiquida->valorapurado = 0;\n $oReceitaTotalCorrenteLiquida->percentuallimite = 0;\n $oReceitaTotalCorrenteLiquida->linhatotalizadora = false;\n\n /**\n * Quadro de despesa total com pessoal sem a RCL.\n */\n $oDespesaTotalComPessoalSemRCL = new stdClass();\n $oDespesaTotalComPessoalSemRCL->quadrodescricao = 'DESPESA TOTAL COM PESSOAL - DTP (V) = (III a + III b)';\n $oDespesaTotalComPessoalSemRCL->exercicio = 0;\n $oDespesaTotalComPessoalSemRCL->inscritas = 0;\n $oDespesaTotalComPessoalSemRCL->linhas = array();\n $oDespesaTotalComPessoalSemRCL->colunameses = array();\n $oDespesaTotalComPessoalSemRCL->valorapurado = 0;\n $oDespesaTotalComPessoalSemRCL->percentuallimite = 0;\n $oDespesaTotalComPessoalSemRCL->linhatotalizadora = false;\n\n /**\n * Quadro de limite máximo.\n */\n $oLimiteMaximo = new stdClass();\n $oLimiteMaximo->quadrodescricao = 'LIMITE MÁXIMO (VI) (incisos I, II e III, art. 20 da LRF)';\n $oLimiteMaximo->exercicio = 0;\n $oLimiteMaximo->inscritas = 0;\n $oLimiteMaximo->linhas = array();\n $oLimiteMaximo->colunameses = array();\n $oLimiteMaximo->valorapurado = 0;\n $oLimiteMaximo->percentuallimite = 0;\n $oLimiteMaximo->linhatotalizadora = false;\n\n /**\n * Quadro de limite prudencial.\n */\n $oLimitePrudencial = new stdClass();\n $oLimitePrudencial->quadrodescricao = 'LIMITE PRUDENCIAL (VII) = (0,95 x VI) (parágrafo único do art. 22 da LRF)';\n $oLimitePrudencial->exercicio = 0;\n $oLimitePrudencial->inscritas = 0;\n $oLimitePrudencial->linhas = array();\n $oLimitePrudencial->colunameses = array();\n $oLimitePrudencial->valorapurado = 0;\n $oLimitePrudencial->percentuallimite = 0;\n $oLimitePrudencial->linhatotalizadora = false;\n\n $oLimiteAlerta = new stdClass();\n $oLimiteAlerta->quadrodescricao = 'LIMITE DE ALERTA (VIII) = (0,90 x VI) (inciso II do §1º do art. 59 da LRF)';\n $oLimiteAlerta->exercicio = 0;\n $oLimiteAlerta->inscritas = 0;\n $oLimiteAlerta->linhas = array();\n $oLimiteAlerta->colunameses = array();\n $oLimiteAlerta->valorapurado = 0;\n $oLimiteAlerta->percentuallimite = 0;\n $oLimiteAlerta->linhatotalizadora = false;\n\n $aDadosMeses = $this->getDadosColuna();\n /**\n * Percorremos as linhas cadastradas no relatorio, e adicionamos os valores cadastrados manualmente.\n */\n $aLinhasRelatorio = $this->oRelatorioLegal->getLinhasCompleto();\n for ($iLinha = 1; $iLinha <= 7; $iLinha++) {\n\n $aLinhasRelatorio[$iLinha]->setPeriodo($this->iCodigoPeriodo);\n $aColunasRelatorio = $aLinhasRelatorio[$iLinha]->getCols($this->iCodigoPeriodo);\n\n /**\n * Monta o Object com os dados de cada linha interna do relatório.\n */\n $oLinha = new stdClass();\n switch ($iLinha) {\n\n \tcase 1:\n \t $sDescricao = ' Pessoal Ativo';\n \t break;\n\n case 2:\n $sDescricao = ' Pessoal Inativo e Pensionistas';\n break;\n\n case 3:\n $sDescricao = ' Outras despesas de pessoal decorrentes de contratos de terceirização (§ 1º do art. 18 da LRF)';\n break;\n\n case 4:\n $sDescricao = ' Indenizações por Demissão e Incentivos à Demissão Voluntária';\n break;\n\n case 5:\n $sDescricao = ' Decorrentes de Decisão Judicial de período anterior ao da apuração';\n break;\n\n case 6:\n $sDescricao = ' Despesas de Exercícios Anteriores de período anterior ao da apuração';\n break;\n\n case 7:\n $sDescricao = ' Inativos e Pensionistas com Recursos Vinculados';\n break;\n }\n\n $oLinha->descricao = $sDescricao;\n $oLinha->inscritas = 0;\n $oLinha->exercicio = 0;\n $oLinha->colunameses = $this->getDadosColuna();\n $oParametros = $aLinhasRelatorio[$iLinha]->getParametros($this->iAnoUsu,\n $this->getInstituicoes());\n /**\n * Verifica nas configurações se possui valores configurados por linha.\n */\n $aValoresColunasLinhas = $aLinhasRelatorio[$iLinha]->getValoresColunas(null, null,\n $this->getInstituicoes(),\n $this->iAnoUsu);\n foreach($aValoresColunasLinhas as $oValor) {\n\n \tif (isset($oLinha->colunameses[$oValor->colunas[0]->o117_valor])) {\n\n $oLinha->colunameses[$oValor->colunas[0]->o117_valor]->nValor += $oValor->colunas[1]->o117_valor;\n $oLinha->exercicio += $oValor->colunas[1]->o117_valor;\n $oLinha->inscritas += $oValor->colunas[2]->o117_valor;\n }\n }\n\n /**\n * Percore as colunas do período dos últimos 12 mêses.\n */\n foreach ($oLinha->colunameses as $sChaveMes => $oDadosMes) {\n\n \t/**\n \t * Informa as datas inicial e final do período.\n \t */\n $sDataInicialPeriodo = \"{$oDadosMes->iAno}-{$oDadosMes->iMes}-01\";\n $sDataFinalPeriodo = \"{$oDadosMes->iAno}-{$oDadosMes->iMes}-{$oDadosMes->iDiaFim}\";\n\n /**\n * Executa o saldo da dotação.\n */\n $sWhereDespesa = \"o58_instit in ({$this->getInstituicoes()})\";\n $rsDespesa = db_dotacaosaldo(8, 2, 3, true, $sWhereDespesa, $oDadosMes->iAno,\n $sDataInicialPeriodo, $sDataFinalPeriodo);\n\n /**\n * Verifica o saldo das contas por linha e mês do relatório\n */\n for ($iDespesa = 0; $iDespesa < pg_numrows($rsDespesa); $iDespesa++) {\n\n $oDespesa = db_utils::fieldsmemory($rsDespesa, $iDespesa);\n\n /**\n * Percorre as contas configuradas.\n */\n foreach ($oParametros->contas as $oConta) {\n\n $oVerificacao = $aLinhasRelatorio[$iLinha]->match($oConta, $oParametros->orcamento, $oDespesa, 2);\n if ($oVerificacao->match) {\n\n $oDespesaValores = clone $oDespesa;\n if ($oVerificacao->exclusao) {\n\n /**\n * Somas apenas os valor liquidados.\n */\n $oDespesaValores->liquidado *= -1;\n\n /**\n * Soma os demais valores\n */\n $oDespesaValores->liquidado_acumulado *= -1;\n $oDespesaValores->empenhado_acumulado *= -1;\n $oDespesaValores->anulado_acumulado *= -1;\n }\n\n $oLinha->colunameses[$sChaveMes]->nValor += $oDespesaValores->liquidado;\n $oLinha->exercicio += $oDespesaValores->liquidado;\n\n /**\n * Verifica totalização das inscritas do último período.\n */\n if ($oDadosPeriodo->o114_sigla == \"3Q\" || $oDadosPeriodo->o114_sigla == \"2S\"\n || $oDadosPeriodo->o114_sigla == \"DEZ\") {\n\n $aChaveMesColunaMeses = array_keys($oLinha->colunameses);\n if (trim($aChaveMesColunaMeses[11]) == trim($sChaveMes)) {\n\n $oLinha->inscritas += round(\n $oDespesaValores->empenhado_acumulado -\n $oDespesaValores->anulado_acumulado -\n $oDespesaValores->liquidado_acumulado, 2);\n }\n }\n }\n }\n }\n }\n\n /**\n * Monta as linhas dos quadros do demostrativo.\n */\n if ($iLinha <= 3) {\n $oDespesaBruta->linhas[$iLinha] = $oLinha;\n } else if ($iLinha >= 4) {\n $oDespesaNaoComputada->linhas[$iLinha] = $oLinha;\n }\n }\n\n /*\n * Calcula linhas totalizadoras da despesa bruta.\n */\n foreach ($oDespesaBruta->linhas as $oDadosLinhaDespesaBruta) {\n\n $oDespesaBruta->inscritas += $oDadosLinhaDespesaBruta->inscritas;\n $oDespesaBruta->exercicio += $oDadosLinhaDespesaBruta->exercicio;\n foreach ($oDadosLinhaDespesaBruta->colunameses as $sChaveMesDespesaBruta => $oDadosMesDespesaBruta) {\n\n \tif (isset($oDespesaBruta->colunameses[$sChaveMesDespesaBruta])) {\n $oDespesaBruta->colunameses[$sChaveMesDespesaBruta]->nValor += $oDadosMesDespesaBruta->nValor;\n \t}\n }\n }\n\n /**\n * Calcula linhas totalizadoras da despesa não computada.\n */\n foreach ($oDespesaNaoComputada->linhas as $oDadosLinhaDespesaNaoComputada) {\n\n $oDespesaNaoComputada->inscritas += $oDadosLinhaDespesaNaoComputada->inscritas;\n $oDespesaNaoComputada->exercicio += $oDadosLinhaDespesaNaoComputada->exercicio;\n foreach ($oDadosLinhaDespesaNaoComputada->colunameses as $sChaveMesDespesaNaoComputada\n => $oDadosMesDespesaNaoComputada) {\n\n if (isset($oDespesaNaoComputada->colunameses[$sChaveMesDespesaNaoComputada])) {\n $oDespesaNaoComputada->colunameses[$sChaveMesDespesaNaoComputada]\n ->nValor += $oDadosMesDespesaNaoComputada->nValor;\n }\n }\n }\n\n /**\n * Calcula linhas totalizadoras da despesa liquída.\n */\n $oDespesaLiquida->inscritas = ($oDespesaBruta->inscritas - $oDespesaNaoComputada->inscritas);\n $oDespesaLiquida->exercicio = ($oDespesaBruta->exercicio - $oDespesaNaoComputada->exercicio);\n foreach ($oDespesaLiquida->colunameses as $sChaveMesDespesaLiquida => $oDadosMesDespesaLiquida) {\n\n \tif (isset($oDespesaLiquida->colunameses[$sChaveMesDespesaLiquida])) {\n \t\t$oDespesaLiquida->colunameses[$sChaveMesDespesaLiquida]->nValor = ( $oDespesaBruta\n \t\t ->colunameses[$sChaveMesDespesaLiquida]\n \t\t ->nValor\n \t\t - $oDespesaNaoComputada\n \t\t ->colunameses[$sChaveMesDespesaLiquida]\n \t\t ->nValor );\n \t}\n }\n\n /**\n * Verifica valor RCL nas configurações da linha 8.\n */\n $aLinhasRelatorio[8]->setPeriodo($this->iCodigoPeriodo);\n $aValoresColunasLinhas = $aLinhasRelatorio[8]->getValoresColunas(null, null,\n $this->getInstituicoes(),\n $this->iAnoUsu);\n foreach($aValoresColunasLinhas as $oValor) {\n\n if (isset($oValor->colunas[0]->o117_valor)) {\n $nTotalRCL += $oValor->colunas[0]->o117_valor;\n }\n }\n\n if ($nTotalRCL == 0) {\n /**\n * Para o cálculo da RCL, a base de cálculo\n * deve ser feita por todas as instituições.\n */\n $rsInstituicoes = db_query(\"SELECT codigo FROM db_config;\");\n $oInstituicoes = db_utils::getCollectionByRecord($rsInstituicoes);\n $aInstituicoes = array();\n foreach ($oInstituicoes as $oInstituicao){\n $aInstituicoes[]= $oInstituicao->codigo;\n }\n $sInstituicoes = implode(\",\",$aInstituicoes);\n\n\t /**\n\t * Calcula RCL - duplicaReceitaaCorrenteLiquida.\n\t */\n $dtInicialAnterior = ($this->iAnoUsu-1).\"-01-01\";\n $dtFinalAnterior = ($this->iAnoUsu-1).\"-12-31\";\n\n duplicaReceitaaCorrenteLiquida($this->iAnoUsu, 81);\n\n $nTotalRCL += calcula_rcl2($this->iAnoUsu, $this->getDataInicial()->getDate(), $this->getDataFinal()->getDate(),\n $sInstituicoes, false, 81);\n $nTotalRCL += calcula_rcl2(($this->iAnoUsu-1), $dtInicialAnterior, $dtFinalAnterior,\n $sInstituicoes, false, 81, $this->getDataFinal()->getDate());\n }\n\n $nValorDespesaTotalPessoal = ($oDespesaLiquida->exercicio + $oDespesaLiquida->inscritas);\n\n /**\n * Verifica valor % despesa total com pessoal - DTP sobre a RCL (VI)=(IV/V)*100.\n */\n if ($nTotalRCL > 0) {\n $nValorDesepesaTotalPessoalSobreRCL = ($nValorDespesaTotalPessoal/$nTotalRCL)*100;\n } else {\n $nValorDesepesaTotalPessoalSobreRCL = 0;\n }\n\n $nPercentualDespesaPessoalSobreRcl = 0;\n if ($nTotalRCL > 0) {\n $nPercentualDespesaPessoalSobreRcl = ($nValorDespesaTotalPessoal * 100) / $nTotalRCL;\n }\n\n /**\n * Soma valores totail do limite maximo (incisos I, II e III, art. 20 da LRF) e\n * do limite prudencial (parágrafo único, art. 22 da LRF).\n */\n $nValorLimiteMaximo = (($nTotalRCL + 0) * $iLimiteMaximo) / 100;\n $nValorLimitePrudencial = (($nTotalRCL + 0) * $iLimitePrudencial) / 100;\n $nValorLimiteAlerta = (($nTotalRCL + 0) * $iLimiteMaximoAlerta) / 100;\n\n $oDespesaTotalComPessoal->valorapurado = $nValorDespesaTotalPessoal;\n $oDespesaTotalComPessoal->percentualsobrercl = $nPercentualDespesaPessoalSobreRcl;\n $oReceitaTotalCorrenteLiquida->valorapurado = $nTotalRCL;\n $oDespesaTotalComPessoalSemRCL->valorapurado = $nValorDesepesaTotalPessoalSobreRCL;\n $oLimiteMaximo->percentuallimite = $iLimiteMaximo;\n $oLimiteMaximo->valorapurado = $nValorLimiteMaximo;\n $oLimitePrudencial->percentuallimite = $iLimitePrudencial;\n $oLimitePrudencial->valorapurado = $nValorLimitePrudencial;\n\n $oLimiteAlerta->percentuallimite = $iLimiteMaximoAlerta;\n $oLimiteAlerta->valorapurado = $nValorLimiteAlerta;\n\n /**\n * Monta Object para retorno com todos os dados por quadro informado.\n */\n $oRetorno = new stdClass();\n $oRetorno->quadrodespesabruta = $oDespesaBruta;\n $oRetorno->quadrodespesanaocomputadas = $oDespesaNaoComputada;\n $oRetorno->quadrodespesaliquida = $oDespesaLiquida;\n $oRetorno->quadrodespesatotalcompessoal = $oDespesaTotalComPessoal;\n $oRetorno->quadroreceitatotalcorrenteliquida = $oReceitaTotalCorrenteLiquida;\n $oRetorno->quadrodespesatotalcompessoalsemrcl = $oDespesaTotalComPessoalSemRCL;\n $oRetorno->quadrolimitemaximo = $oLimiteMaximo;\n $oRetorno->quadrolimiteprudencial = $oLimitePrudencial;\n $oRetorno->quadrolimitealerta = $oLimiteAlerta;\n\n unset($aLinhasRelatorio);\n\n $this->oDados = $oRetorno;\n return $this->oDados;\n }", "function MESES_ANTIGUEDAD($_ARGS) {\r\n\t$fingreso = FECHA_INGRESO($_ARGS);\r\n\t$periodo_actual = $_ARGS['HASTA'];\r\n\tlist($anios, $meses, $dias) = TIEMPO_DE_SERVICIO(formatFechaDMA($fingreso), formatFechaDMA($periodo_actual));\r\n\t$cantidad = $meses + ($anios * 12);\r\n\treturn $cantidad;\r\n}", "protected function obtenerNivelesActivos(){\n $fechahoy=new \\DateTime('now',new \\DateTimeZone('America/El_Salvador'));\n //Para jalar el modulo activo\n $modulo=$this->getDoctrine()->getRepository('AppBundle:Modulo')->verificarModulo($fechahoy);\n return $modulo;\n\n }", "function getAportacionesSociales(){ $D\t= $this->getDatosAportaciones(); return $D[\"aportaciones\"]; \t}", "function fecha_menor($diainicio,$diafin,$mesinicio,$mesfin,$anioinicio,$aniofin){\r\n\r\n$dif_en_meses=(($mesfin-$mesinicio)+(12*($aniofin-$anioinicio)));\r\n\r\nif($dif_en_meses<0){return(0);}\r\nif(($dif_en_meses==0) && ($diafin<$diainicio)){return(0);}\r\nreturn(1);\r\n}", "function verificarSolapamiento($horario, $duracion, $idTeatroNuevaFuncion){\r\n $funcionTeatro = new FuncionTeatro('', '', '', '', '');\r\n $coleccionFuncionesTeatro = $funcionTeatro->listar(\"\");\r\n $cine = new Cine('','','','','','','');\r\n $coleccionCines = $cine->listar(\"\");\r\n $musical = new Musical('','','','','','','');\r\n $coleccionMusicales = $musical->listar(\"\");\r\n\r\n $retorno = false;\r\n\r\n list($horaFuncion, $minutosFuncion) = explode(\":\", $horario); //Extraigo la hora y los minutos separados por el \":\"\r\n $hora = intval($horaFuncion); //Convierto la hora de string a entero\r\n $minutos = intval($minutosFuncion); //Convierto los minutos de string a entero\r\n\r\n $horarioInicioFuncion = (($hora * 60) + $minutos); //Convierto el horario de INICIO de la nueva funcion a minutos\r\n $horarioCierreFuncion = $horarioInicioFuncion + $duracion; //Horario de CIERRE de la nueva funcion\r\n\r\n $horarioFuncionNueva = array('inicio'=>$horarioInicioFuncion, 'cierre'=>$horarioCierreFuncion);\r\n\r\n $coleccionHorarios = [];\r\n\r\n //Sumo los horarios de cada tipo\r\n $coleccionHorarios = armarColeccionHorarios($coleccionFuncionesTeatro, $idTeatroNuevaFuncion, $coleccionHorarios);\r\n $coleccionHorarios = armarColeccionHorarios($coleccionCines, $idTeatroNuevaFuncion, $coleccionHorarios);\r\n $coleccionHorarios = armarColeccionHorarios($coleccionMusicales, $idTeatroNuevaFuncion, $coleccionHorarios);\r\n\r\n if (count($coleccionHorarios)>0){\r\n $horarioDisponible = verificarHorario($horarioFuncionNueva, $coleccionHorarios);\r\n if ($horarioDisponible){\r\n $retorno = true;\r\n }\r\n } else {\r\n $retorno = true;\r\n }\r\n\r\n return $retorno;\r\n}", "function comparar_fechas($fecha_inicio, $fecha_fin){\n\t\t$inicio = array();\n\t\t$inicio['anno'] = substr($fecha_inicio, 0, 4);\n\t\t$inicio['mes'] = substr($fecha_inicio, 5, 2);\n\t\t$inicio['dia'] = substr($fecha_inicio, 8, 2);\n\t\t$inicio['hora'] = substr($fecha_inicio, 11, 2);\n\t\t$inicio['min'] = substr($fecha_inicio, 14, 2);\n\t\t$inicio['sec'] = substr($fecha_inicio, 17, 2);\n\t\t\n\t\t$fin = array();\n\t\t$fin['anno'] = substr($fecha_fin, 0, 4);\n\t\t$fin['mes'] = substr($fecha_fin, 5, 2);\n\t\t$fin['dia'] = substr($fecha_fin, 8, 2);\n\t\t$fin['hora'] = substr($fecha_fin, 11, 2);\n\t\t$fin['min'] = substr($fecha_fin, 14, 2);\n\t\t$fin['sec'] = substr($fecha_fin, 17, 2);\n\t\t\n\t\t$diferencia = array();\n\t\t$diferencia['anno'] = $fin['anno'] - $inicio['anno'];\n\t\t$diferencia['mes'] = $fin['mes'] - $inicio['mes'];\n\t\t$diferencia['dia'] = $fin['dia'] - $inicio['dia'];\n\t\t$diferencia['hora'] = $fin['hora'] - $inicio['hora'];\n\t\t$diferencia['min'] = $fin['min'] - $inicio['min'];\n\t\t$diferencia['sec'] = $fin['sec'] - $inicio['sec'];\n\t\t\n\t\tif($diferencia['mes'] < 0){\n\t\t\t$diferencia['mes'] = 12 + $diferencia['mes'];\n\t\t\t$diferencia['anno'] = $diferencia['anno'] - 1;\n\t\t}\n\t\tif($diferencia['dia'] < 0){\n\t\t\t$diferencia['dia'] = 30 + $diferencia['dia'];\n\t\t\t$diferencia['mes'] = $diferencia['mes'] - 1;\n\t\t}\n\t\tif($diferencia['hora'] < 0){\n\t\t\t$diferencia['hora'] = 24 + $diferencia['hora'];\n\t\t\t$diferencia['dia'] = $diferencia['dia'] - 1;\n\t\t}\n\t\tif($diferencia['min'] < 0){\n\t\t\t$diferencia['min'] = 60 + $diferencia['min'];\n\t\t\t$diferencia['hora'] = $diferencia['hora'] - 1;\n\t\t}\n\t\tif($diferencia['sec'] < 0){\n\t\t\t$diferencia['sec'] = 60 + $diferencia['sec'];\n\t\t\t$diferencia['min'] = $diferencia['min'] - 1;\n\t\t}\n\t\t\n\t\tif($diferencia['anno'] > 0){\n\t\t\tif($diferencia['anno'] > 1){\n\t\t\t\t$resultado = $diferencia['anno'].\" años\";\n\t\t\t}else{\n\t\t\t\t$resultado = $diferencia['anno'].\" año\";\n\t\t\t}\n\t\t}\n\t\telse if($diferencia['mes'] > 0){\n\t\t\tif($diferencia['mes'] > 1){\n\t\t\t\t$resultado = $diferencia['mes'].\" meses\";\n\t\t\t}else{\n\t\t\t\t$resultado = $diferencia['mes'].\" mes\";\n\t\t\t}\n\t\t}\n\t\telse if($diferencia['dia'] > 0){\n\t\t\tif($diferencia['dia'] > 1){\n\t\t\t\t$resultado = $diferencia['dia'].\" dias\";\n\t\t\t}else{\n\t\t\t\t$resultado = $diferencia['dia'].\" dia\";\n\t\t\t}\n\t\t}\n\t\telse if($diferencia['hora'] > 0){\n\t\t\tif($diferencia['hora'] > 1){\n\t\t\t\t$resultado = $diferencia['hora'].\" horas\";\n\t\t\t}else{\n\t\t\t\t$resultado = $diferencia['hora'].\" hora\";\n\t\t\t}\n\t\t}\n\t\telse if($diferencia['min'] > 0){\n\t\t\tif($diferencia['min'] > 1){\n\t\t\t\t$resultado = $diferencia['min'].\" mins\";\n\t\t\t}else{\n\t\t\t\t$resultado = $diferencia['min'].\" min\";\n\t\t\t}\n\t\t}\n\t\telse if($diferencia['sec'] > 0){\n\t\t\tif($diferencia['sec'] > 1){\n\t\t\t\t$resultado = $diferencia['sec'].\" secs\";\n\t\t\t}else{\n\t\t\t\t$resultado = $diferencia['sec'].\" sec\";\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$resultado = \"Justo ahora\";\n\t\t}\n\t\t\n\t\treturn $resultado;\n\t}", "private function ofertas() {\n\t\t$data = date ( 'Y/m/d' );\n\t\t$params = array (\n\t\t\t\t'OffersUser' => array (\n\t\t\t\t\t\t'conditions' => array (\n\t\t\t\t\t\t\t\t'user_id' => $this->Session->read ( 'userData.User.id' ),\n\t\t\t\t\t\t\t\t'Offer.status' => 'ACTIVE',\n\t\t\t\t\t\t\t\t'Offer.begins_at <= ' => $data,\n\t\t\t\t\t\t\t\t'Offer.ends_at >= ' => $data \n\t\t\t\t\t\t) \n\t\t\t\t),\n\t\t\t\t'Offer' \n\t\t);\n\t\t$contador = $this->Utility->urlRequestToGetData ( 'offers', 'count', $params );\n\t\t\n\t\tif ($this->Session->check ( 'ofertasIds' )) {\n\t\t\t$this->Session->write ( 'HomeOfertas', 'desejos' );\n\t\t} else if (! $contador > 0 && ! $this->Session->check ( 'Ofertas-Assinaturas' )) {\n\t\t\t$this->Session->write ( 'HomeOfertas', 'publico' );\n\t\t} else {\n\t\t\t$this->Session->write ( 'HomeOfertas', 'personalizado' );\n\t\t}\n\t}", "public function index()\n {\n $fiestas = Fiesta::where('academia_id', '=' , Auth::user()->academia_id)->get();\n $array = array();\n $academia = Academia::find(Auth::user()->academia_id);\n\n foreach($fiestas as $fiesta){\n\n $fecha = Carbon::createFromFormat('Y-m-d', $fiesta->fecha_inicio);\n\n if($fecha >= Carbon::now()){\n\n $dias_restantes = $fecha->diffInDays();\n $status = 'Activa';\n\n }else{\n $dias_restantes = 0;\n $status = 'Vencida';\n }\n\n if($academia->tipo_horario == 2){\n $hora_inicio = Carbon::createFromFormat('H:i:s',$fiesta->hora_inicio)->toTimeString();\n $hora_final = Carbon::createFromFormat('H:i:s',$fiesta->hora_final)->toTimeString();\n }else{\n $hora_inicio = Carbon::createFromFormat('H:i:s',$fiesta->hora_inicio)->format('g:i a');\n $hora_final = Carbon::createFromFormat('H:i:s',$fiesta->hora_final)->format('g:i a');\n }\n\n $collection=collect($fiesta); \n $fiesta_array = $collection->toArray(); \n $fiesta_array['status']=$status;\n $fiesta_array['dias_restantes']=$dias_restantes;\n $fiesta_array['hora_inicio']=$hora_inicio;\n $fiesta_array['hora_final']=$hora_final;\n $array[$fiesta->id] = $fiesta_array;\n }\n\n return view('agendar.fiesta.principal')->with('fiestas', $array);\n }", "function diasTranscurridos($fecha_inicial, $fecha_final)\n{\n\n $dias = strtotime($fecha_inicial) < strtotime($fecha_final);\n\n return $dias;\n}", "public function alumno__calificacionAprobada_(){\n if(empty($this->idAlumno_)) return [];\n $render = $this->container->getRender(\"calificacion\");\n $render->setFields([\"id\",\"alumno\",\"nota_final\",\"crec\", \"alu-tramo_ingreso\",\"alu-plan\",\"dis_pla-tramo\",\"dis_pla-plan\",\"dis-asignatura\"]);\n\n $render->setSize(0);\n $render->setCondition([\n [\"alumno\",\"=\",$this->idAlumno_],\n [\n [\"nota_final\",\">=\",\"7\"],\n [\"crec\",\">=\",\"4\",\"OR\"]\n ]\n ]);\n $render->setOrder([\"dis_pla-anio\"=>\"ASC\", \"dis_pla-semestre\"=>\"ASC\"]);\n \n $this->alumno__calificacionAprobada_ = array_group_value(\n $this->container->getDb()->select(\"calificacion\",$render),\n \"alumno\"\n );\n }", "function primer_dia_periodo() {\n\n $sql=\"select fecha_inicio from mocovi_periodo_presupuestario where actual=true\";\n $resul=toba::db('designa')->consultar($sql);\n return $resul[0]['fecha_inicio'];\n \n }", "function verificarReprobados($notas_estudiante){\n $reprobados = 0;\n if(count($notas_estudiante)>0){\n foreach ($notas_estudiante as $key => $estudiantes) {\n if ((isset($estudiantes['NOTA'])?$estudiantes['NOTA']:0)<30 || $estudiantes['OBSERVACION']==20 || $estudiantes['OBSERVACION']==23 || $estudiantes['OBSERVACION']==25){\n $reprobados=1;\n break;\n }\n }\n }\n return $reprobados;\n }", "function SemanasEnElMes(){\n \n $fecha_hoy = date('Y-m-01');\n $fecha_fin = date('Y-m-t');\n $dia_fin = date('t');\n $j=1;\n $diaf = '';\n //dia finales\n for($i=1;$i <= $dia_fin;$i++){ \n if(($i%7) == 0){\n $diaf .= $i.',';\n $j++; \n } \n }\n \n $diaf = substr($diaf, 0, -1);\n $sep_fd = explode(\",\", $diaf);\n $count_d = count($sep_fd); \n $ini_semana = array();\n $inicios = array();\n //dias iniciales\n for($i=0;$i< $count_d;$i++){ \n \n \n $fecha_actual = date(\"Y-m-$sep_fd[$i]\"); \n $ini_semana = date(\"Y-m-d\",strtotime($fecha_actual.\"- 6 days\")); \n array_push($inicios,$ini_semana); \n }\n \n //semanas del mes\n $semanas_mes = array();\n $semana_dia_final = array();\n for($i=0;$i< $count_d;$i++){\n if(($count_d-1) == $i){\n $semanas_mes[$i] = array('fi'=>$inicios[$i],'ff'=>date(\"Y-m-t\")); \n } else{ \n $semanas_mes[$i] = array('fi'=>$inicios[$i],'ff'=>date(\"Y-m-$sep_fd[$i]\")); \n }\n }\n \n //var_dump($semanas_mes);\n return $semanas_mes;\n\n \n}", "function listarCitasDisponibles()\n\t\t{\n\t\t\t$dia = $this->uri->segment(3);\n\t\t\t$mes = $this->uri->segment(4);\n\t\t\t$year = $this->uri->segment(5);\n\t\t\t$diaDeLaSemana = date('N',mktime(0, 0, 0, $mes, $dia, $year));\n\t\t\t\n\t\t\t//Obetenemos los arrays de horarios del dia de la semana concreto\n\t\t\t$diasSemana = $this->PacienteModel->getCalendario();\n\t\t\tforeach ($diasSemana as $value) {\n\t\t\t\tif($diaDeLaSemana == $value->Dia)\n\t\t\t\t{\n\t\t\t\t\t$horaInicio = explode(':', $value->HoraInicio);\n\t\t\t\t\t$horaFin = explode(':', $value->HoraFin);\n\t\t\t\t\t$duracionCita[] = $value->DuracionCita;\n\t\t\t\t\t$unixInicio[] = mktime($horaInicio[0], $horaInicio[1], 0, $mes, $dia, $year);\n\t\t\t\t\t$unixFin[] = mktime($horaFin[0], $horaFin[1], 0, $mes, $dia, $year);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Comprobamos las citas planificadas para el dia concreto\n\t\t\t$data = $this->PacienteModel->getCitasDisponibles($dia, $mes, $year);\n\t\t\tforeach ($data as $value) {\n\t\t\t\t$aux = explode(\" \", $value->FechaIni);\n\t\t\t\t$aux = $aux[1];\n\t\t\t\t$aux = explode(\":\", $aux);\n\t\t\t\t$hora[] = $aux[0];\n\t\t\t\t$min[] = $aux[1];\n\t\t\t}\n\t\t\t\n\t\t\t//Si no hay ninguna cita se ponen los arrays fuera de rango\n\t\t\tif(!isset($hora) && !isset($min))\n\t\t\t{\n\t\t\t\t$hora[0] = -1;\n\t\t\t\t$min[0] = -1;\n\t\t\t}\n\n\t\t\t//Visualizamos las citas disponibles\n\t\t\techo '<ul class=\"list-group\">';\n\t\t\techo '<li class=\"list-group-item\">'.date('d-m-Y',mktime(0, 0, 0, $mes, $dia, $year)).'</li>';\n\t\t\tfor($j = 0; $j < sizeof($unixInicio); $j++)\n\t\t\t\tfor($i = $unixInicio[$j]; $i < $unixFin[$j]; $i += 60*$duracionCita[$j] )\n\t\t\t\t{\n\t\t\t\t\tif ( (in_array(date('H',$i), $hora) && in_array(date('i',$i), $min) )\n\t\t\t\t\t\t|| time()>$i )\n\t\t\t\t\t\techo '<li class=\"list-group-item\">'.date('H:i',$i).'</li>';\n\t\t\t\t\telse \n\t\t\t\t\t\techo '<li class=\"list-group-item active\">\n\t\t\t\t\t\t\t<a style=\"color: black;\" onclick=\"crearCita(\\''.$this->session->userdata('id').'\\',\n\t\t\t\t\t\t\t\\''.date('Y-m-d H:i:s',$i).'\\',\n\t\t\t\t\t\t\t\\''.date('Y-m-d H:i:s',$i + 60 * $duracionCita[$j]).'\\'\n\t\t\t\t\t\t\t)\">'.date('H:i',$i).'</a></li>';\n\t\t\t\t}\n\t\t\techo '</ul>';\n\t\t}", "function primer_dia_periodo_anio($anio) {\n\n $sql=\"select fecha_inicio from mocovi_periodo_presupuestario where anio=\".$anio;\n $resul=toba::db('designa')->consultar($sql);\n return $resul[0]['fecha_inicio'];\n }", "function contarSemestresTranscurridos($semestre_ingreso){\r\n $cantidad='';\r\n $anio_actual=date('Y');\r\n if(date('m')<=6){\r\n $semestre_actual=1;\r\n }else{\r\n $semestre_actual=2;\r\n }\r\n $periodo_actual =$anio_actual.$semestre_actual;\r\n if($periodo_actual>=$semestre_ingreso){\r\n $cantidad = $this->calcularCantidadSemestres($semestre_ingreso,$periodo_actual);\r\n }\r\n if ($this->datosEstudiante['CARRERA']==97)\r\n $cantidad=round($cantidad/2);\r\n return $cantidad;\r\n }", "private function obtenerVentasDia($fecha,$sede)\n {\n $fechaFormateada = new \\DateTime($fecha);\n $fechaInicio = $fechaFormateada->format('Y-m-d 00:00:00');\n $fechaFinal = $fechaFormateada->format('Y-m-d 23:59:59');\n \n// $fechaInicio = $this->container->get('fechaHora')->fechaInicio($fecha);\n// \n// $fechaFinal = $this->container\n// ->get('fechaHora')\n// ->fechaFinal($fecha);\n \n return \n $this->entityManager->createQueryBuilder()\n ->select('tc.nombreComensal as tipo,'\n . 'count(hr) as cantidad,'\n . 'sum(hr.montoRecarga) as total'\n )\n ->from('ComensalesBundle:HistorialRecargas','hr')\n ->innerJoin('hr.tarjeta','tarj')\n ->innerJoin('tarj.solicitud','soli')\n ->innerJoin('soli.tipo_comensal','tc')\n ->innerJoin('hr.itemRecarga','item')\n ->innerJoin('hr.sedeRecarga','sed')\n ->where('sed.nombreSede = :sedeElegida')\n ->setParameter('sedeElegida',$sede)\n ->andWhere('hr.fechaHoraRecarga BETWEEN :dateMin AND :dateMax')\n ->setParameter('dateMin',$fechaInicio)\n ->setParameter('dateMax',$fechaFinal)\n ->groupBy('tc.nombreComensal')\n ->orderBy('total','DESC')\n ->getQuery()\n ->getArrayResult();\n }", "function Consulta_Informacion_Metas()\n {\n $sql=\"SELECT b.id,b.uid,year(b.fecha_inicio) AS ano, month(b.fecha_inicio) AS mes,b.no_dias,count(substr(b.fecha_inicio,1,7)) AS no_regs,\n sum(b.cantidad) AS total,a.name\n FROM crm_proyeccion as b LEFT JOIN users as a ON b.uid = a.uid\n WHERE b.active = 1 AND year(b.fecha_inicio) ='\".$this->ano_id.\"' AND b.gid='\".$this->gid.\"' \".$this->filtro.\"\n GROUP BY substr(b.fecha_inicio,1,7)\n ORDER BY substr(b.fecha_inicio,1,7)\";\n $res=$this->db->sql_query($sql) or die (\"Error en la consulta: \".$sql);\n if($this->db->sql_numrows($res) > 0)\n {\n while(list($id,$_uid,$ano,$mes,$no_dias,$no_reg,$cantidad,$name) = $this->db->sql_fetchrow($res))\n {\n $this->array_metas[$mes]= $cantidad;\n }\n }\n }", "public function data_disponivel($data_entrada,$data_saida,$id = null){\n // $data_entrada = '2016-09-01';\n // $data_saida = '2016-09-24';\n\n $data_entrada = Carbon::createFromFormat('d/m/Y', $data_entrada)->toDateString();\n $data_saida = Carbon::createFromFormat('d/m/Y', $data_saida)->toDateString();\n\n if ($id!=null) {\n //edicao\n return count(\\DB::select('SELECT id FROM eventos\n WHERE id != ? and (\n ? BETWEEN data_entrada AND data_saida\n or\n ? BETWEEN data_entrada AND data_saida)',\n [$id,$data_entrada,$data_saida])) == 0;\n }\n\n return count(\\DB::select('SELECT id FROM eventos\n WHERE\n ? BETWEEN data_entrada AND data_saida\n or\n ? BETWEEN data_entrada AND data_saida ',\n [$data_entrada,$data_saida])) == 0;\n }", "public function calculaMovimientos($insumos){\n\n\t\t$movimientos = [];\n\t\t$groups = [];\n\n\t\t//Calcula los lotes de los insumos a realizar movimientos utilizando el metodo fefo,\n\t\t//Si este posee lotes en los registros y su lote no ha sido especificado.\n\t\tforeach ($insumos as $insumo) {\n\n\t\t\tif( array_search($insumo['id'], array_column($movimientos, 'id')) !== false )\n\t\t\t\tcontinue;\n\n\t\t\tif( $this->hasLote($insumo) ){\n\n\t\t\t\t$insumoMovimientos = array_filter($insumos, function($element) use ($insumo){\n\t\t\t\t\treturn $element['id'] == $insumo['id'];\n\t\t\t\t});\n\n\t\t\t\tif( !empty($this->filterInsumosLote($insumoMovimientos, false)) ){\n\t\t\t\t\t$insumoMovimientos = $this->fefo($insumo['id'], $insumoMovimientos);\n\t\t\t\t}\n\n\t\t\t\t$movimientos = array_merge($movimientos, $insumoMovimientos);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tarray_push($movimientos, $insumo);\n\t\t\t}\n\t\t}\n\n\t\t//Agrupa los lotes de los movimientos de insumos.\n\t\tforeach ($movimientos as $movimiento){\n\n\t\t\tif(isset($movimiento['lote']) && !empty($movimiento['lote'])){\n\n\t\t\t\t$calculado = array_filter($groups, function($element) use ($movimiento){\n\t \t\t\t\treturn $element['id'] == $movimiento['id'] && $element['lote'] == $movimiento['lote'];\n\t\t\t\t});\n\n\t\t\t\tif( !empty($calculado) )\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$lotes = array_filter($movimientos, function($element) use ($movimiento){\n\t \t\t\t\treturn $element['id'] == $movimiento['id'] && $element['lote'] == $movimiento['lote'];\n\t\t\t\t});\n\n\t\t\t\t$despachado = 0;\n\t\t\t\t$solicitado = 0;\n\n\t\t\t\tforeach ($lotes as $lote) {\n\t\t\t\t\t$despachado += $lote['despachado'];\n\t\t\t\t\t$solicitado += $lote['solicitado'];\n\t\t\t\t}\n\n\t\t\t\t$movimiento['despachado'] = $despachado;\n\t\t\t\t$movimiento['solicitado'] = $solicitado;\n\t\t\t}\n\n\t\t\tarray_push($groups, $movimiento);\n\t\t}\n\n\t\t//Devuelve un arreglo con todos los movimientos de insumos a realizar\n\t\t//con lotes espeficicados y cantidades. Nota: Si no pose lote un movimiento de insumo en el arreglo\n\t\t//sera debido a que no posee lotes en los registros de lotes.\n\t\treturn $groups;\n\t}", "public function cesta_con_iva(){\r\n\t\t\t$total = 0;\r\n\t\t\tforeach ($this->listArticulos as $elArticulo){\r\n\t\t\t\t$precio = $elArticulo->oferta_iva>0?$elArticulo->oferta_iva:$elArticulo->precio_iva;\r\n\t\t\t\t$total+= round($elArticulo->unidades*$precio,2);\r\n\t\t\t}\r\n\t\t\treturn $total;\r\n\t\t}", "private function return_dates($dados)\n {\n\n $var_month = $dados[0]->mes;\n $var_year = $dados[0]->ano;\n $var_dayOfWeek = $dados[0]->dia_encontro;\n $var_counting_days = cal_days_in_month(CAL_GREGORIAN, $var_month, $var_year); //days of month\n\n $dini = mktime(0,0,0,$var_month,1,$var_year);\n $dfim = mktime(0,0,0,$var_month,$var_counting_days,$var_year);\n\n $return_d = array();\n\n while($dini <= $dfim) //Enquanto uma data for inferior a outra\n {\n $dt = date(\"d/m/Y\",$dini); //Convertendo a data no formato dia/mes/ano\n $diasemana = date(\"w\", $dini);\n\n if($diasemana == $var_dayOfWeek)\n { // [0 Domingo] - [1 Segunda] - [2 Terca] - [3 Quarta] - [4 Quinta] - [5 Sexta] - [6 Sabado]\n array_push($return_d, $dt);\n }\n\n $dini += 86400; // Adicionando mais 1 dia (em segundos) na data inicial\n }\n\n //Segundo dia encontro\n $var_month = $dados[0]->mes;\n $var_year = $dados[0]->ano;\n $var_dayOfWeek = $dados[0]->segundo_dia_encontro;\n $var_counting_days = cal_days_in_month(CAL_GREGORIAN, $var_month, $var_year); //days of month\n\n $dini = mktime(0,0,0,$var_month,1,$var_year);\n $dfim = mktime(0,0,0,$var_month,$var_counting_days,$var_year);\n\n $bPrimeiro = false;\n\n while($dini <= $dfim) //Enquanto uma data for inferior a outra\n {\n $dt = date(\"d/m/Y\",$dini); //Convertendo a data no formato dia/mes/ano\n $diasemana = date(\"w\", $dini);\n\n if($diasemana == $var_dayOfWeek)\n { // [0 Domingo] - [1 Segunda] - [2 Terca] - [3 Quarta] - [4 Quinta] - [5 Sexta] - [6 Sabado]\n\n if ($bPrimeiro==false) {\n array_push($return_d, \"\");\n array_push($return_d, \" Segundo Dia Encontro \");\n }\n\n array_push($return_d, $dt);\n $bPrimeiro=true;\n }\n\n $dini += 86400; // Adicionando mais 1 dia (em segundos) na data inicial\n }\n\n array_push($return_d, \"\");\n array_push($return_d, \" Encontro Avulso (Criar Novo) \");\n\n //Verifica se houve encontro avulso para a celula / mes / ano\n $dt_encontro_avulso = $this->buscar_data_avulsa($dados[0]->celulas_id, $var_month, $var_year);\n\n if ($dt_encontro_avulso!=null) {\n array_push($return_d, \"\");\n array_push($return_d, \" Houve Encontro Avulso : \");\n\n foreach ($dt_encontro_avulso as $item) {\n array_push($return_d, date(\"d/m/Y\", strtotime($item->data_encontro)));\n }\n }\n\n return ($return_d);\n\n }", "function qtdDiasUteis($hoje, $vencto) {\r\n $proxDia = proximoDiaUtil($vencto);\r\n $proxDia = retornaData($proxDia, 2);\r\n //$inicio = new DateTime($vencto);\r\n $inicio = new DateTime($proxDia);\r\n $fim = new DateTime($hoje);\r\n $fim->modify('+1 day');\r\n $diasUt = 0;\r\n\r\n $interval = new DateInterval('P1D');\r\n $periodo = new DatePeriod($inicio, $interval, $fim);\r\n\r\n foreach ($periodo as $data) {\r\n $tdy = strtotime($data->format(\"d-m-Y\"));\r\n //if (date('N', $tdy) <= 5) {\r\n $diasUt++;\r\n //}\r\n }\r\n return $diasUt;\r\n }", "function rotacionSeisMeses()\n {\n $rotacion_smeses = new \\stdClass();\n $rotacion_smeses->labels = [];\n $rotacion_smeses->data = [];\n\n // Prepare query\n $sql = \"\n SELECT (COUNT(f.id) / m.maquina_casillas) as result, DATE_FORMAT(f.factura_fecha_emision, '%m') AS month, DATE_FORMAT(f.factura_fecha_emision, '%M') AS month_letters\n FROM facturas as f, maquinas as m WHERE f.factura_fecha_emision <= DATE(NOW()) AND f.factura_fecha_emision > DATE_SUB(DATE(NOW()), INTERVAL 6 MONTH) $this->sql_condition\n GROUP BY month\";\n\n // Execute sql\n $query = DB::select($sql);\n\n // Config chart roacion ultimos 6 meses\n $rotacion_smeses->labels = array_pluck($query, 'month_letters');\n $rotacion_smeses->data = array_pluck($query, 'result');\n\n return $rotacion_smeses;\n }", "static public function mdlCierreDia($tabla, $id_caja, $id_corte, $id_fecha){\t\ntry{ \n\t\t$item=\"fecha_salida\";\n\t\t$valor=$id_caja;\n\t\t$campo=\"id_caja\";\n\t\t$cerrado=0;\n\n\t\t$ventas=self::mdlSumaTotalVentas($tabla, $item, $valor, $cerrado,$id_fecha=null);\n\t\t$ventasgral=$ventas[\"sinpromo\"]>0?$ventas[\"sinpromo\"]:0;\n\t\t$ventaspromo=$ventas[\"promo\"]>0?$ventas[\"promo\"]:0;\n\n\t\t$vtaEnv = self::mdlSumTotVtasEnv($tabla, $item, $valor, $cerrado,$id_fecha=null);\n\t\t$ventasenvases=$vtaEnv[\"total\"]>0?$vtaEnv[\"total\"]:0;\n\n\t\t$vtaServ = self::mdlSumTotVtasServ($tabla, $item, $valor, $cerrado,$id_fecha=null);\n\t\t$ventasservicios=$vtaServ[\"total\"]>0?$vtaServ[\"total\"]:0;\n\t\t\t\t\t\t \n\t\t$ventasaba=self::mdlSumTotVtasOtros($tabla, $item, $valor, $cerrado,$id_fecha=null);\n\t\t$ventasgralaba=$ventasaba[\"sinpromo\"]>0?$ventasaba[\"sinpromo\"]:0;\n\t\t$ventaspromoaba=$ventasaba[\"promo\"]>0?$ventasaba[\"promo\"]:0;\n\n\t\t$vtaCred = self::mdlSumTotVtasCred($tabla, $item, $valor, $cerrado,$id_fecha=null);\n\t\t$ventascredito=$vtaCred[\"sinpromo\"]+$vtaCred[\"promo\"]>0?$vtaCred[\"sinpromo\"]+$vtaCred[\"promo\"]:0;\n\t\t$totingyegr=self::mdlTotalingresoegreso($campo, $valor,$cerrado,$id_fecha=null);\n\t\t$ingresodia=$totingyegr[\"monto_ingreso\"]>0?$totingyegr[\"monto_ingreso\"]:0;\n\t\t$egresodia=$totingyegr[\"monto_egreso\"]>0?$totingyegr[\"monto_egreso\"]:0;\n\t\t$totVentaDia=$ventasgral+$ventaspromo+$ventasenvases+$ventasservicios+$ventasgralaba+$ventaspromoaba+$ventascredito;\n\n\t\t// SABER EL ID DEL CORTE PARA PONER EN HIST_SALIDAS, INGRESOS Y EGRESOS.\n\t\t$query = Conexion::conectar()->prepare(\"SELECT id FROM cortes WHERE fecha_venta=curdate() AND id_caja=$id_caja AND estatus=0\");\n\tif($query->execute()){\n\t\t$idcorte = $query->fetch(PDO::FETCH_ASSOC);\n\t\tif(is_null($idcorte[\"id\"])){\n\t\t\t\tunset($_SESSION[\"abierta\"]);\n\t\t\treturn true;\n\t\t}else{\n\t\t\t\n\t\t\t$numcorte= $idcorte[\"id\"]; \n\t\t\tif($numcorte>0){\n\n\t\t\t\t//CERRAR REGISTRO Y COLOCAR EL ID DE CORTE DE VENTA EN EL HIST_SALIDAS\n\t\t\t\t$stmt = Conexion::conectar()->prepare(\"UPDATE $tabla SET cerrado=1, id_corte=$numcorte WHERE fecha_salida=curdate() and id_caja=$id_caja AND cerrado=0\");\n\t\t\t\tif($stmt->execute()){\n\t\t\t\t\n\t\t\t\t\t//ACTUALIZAR TABLA CORTES CON LAS VENTAS, INGRESO Y EGRESOS\n\t\t\t\t\t$stmt2 = Conexion::conectar()->prepare(\"UPDATE cortes SET ventasgral=$ventasgral, ventaspromo=$ventaspromo, ventasenvases=$ventasenvases, ventasservicios=$ventasservicios, ventasabarrotes=($ventasgralaba+$ventaspromoaba),ventascredito=$ventascredito, monto_ingreso=$ingresodia, monto_egreso=$egresodia, total_venta=$totVentaDia, estatus=1 WHERE fecha_venta=curdate() AND id_caja=$id_caja AND estatus=0\");\n\t\t\t\t\t\n\t\t\t\t\t//COLOCAR EL ID DE CORTE DE VENTA EN INGRESOS E EGRESOS\n\t\t\t\t\tif ($stmt2->execute()){\n\t\t\t\t\t\t$query = Conexion::conectar()->prepare(\"UPDATE ingresos SET id_corte=$numcorte WHERE fecha_ingreso=curdate() AND id_caja=$id_caja AND id_corte=0\");\n\t\t\t\t\t\tif($query->execute()){\n\t\t\t\t\t\t\t$query = Conexion::conectar()->prepare(\"UPDATE egresos SET id_corte=$numcorte WHERE fecha_egreso=curdate() AND id_caja=$id_caja AND id_corte=0\");\n\t\t\t\t\t\t\t$query->execute();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//por el momento, despues desmarcar\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\treturn false;\n\t\t\t\t};\n\t\t\t unset($_SESSION[\"abierta\"]);\n\t\t\t return true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}\n\n\t}else{\n\t\t\treturn true;\n\t\t\t$query-> null;\n\t\t\t$stmt = null;\n\t\t\t$stmt2 = null;\n\t};\n\n\n} catch (Exception $e) {\n\t\techo \"Failed: \" . $e->getMessage();\n}\n\n\t\t// $query->close();\n\t\t// $stmt -> close();\n\t\t// $stmt2 -> close();\n}", "private function verificarConflictoFechas($dni,$fecha_ae,bool $finalizado){\n $q = DB::table('ae_datos as aed')->select('aee.*')\n ->join('ae_estado as aee','aee.id_autoexcluido','=','aed.id_autoexcluido')\n ->whereNull('aed.deleted_at')->whereNull('aee.deleted_at')\n ->where('aed.nro_dni','=',$dni);\n \n /*\n Agarra dos casos (el de abajo es el que se agregaria)\n \n fecha_ae fecha_cierre_ae\n ┌──────────────────────────────────────────────┐\n │ │\n │ │\n └──────────────────────────────────────────────┘\n $fecha_ae\n fecha_ae fecha_cierre_ae\n ┌──────────────────────────────────────────────┐\n │ │\n │ │\n └──────────────────────┘\n $fecha_ae\n */\n $dentro_algun_completo = (clone $q)->whereNull('aee.fecha_revocacion_ae')\n ->where('aee.fecha_ae','<=',$fecha_ae)->where('aee.fecha_cierre_ae','>=',$fecha_ae)\n ->count() > 0;\n if($dentro_algun_completo) return 1;\n \n /*\n Agarra dos casos (el de abajo es el que se agregaria)\n \n fecha_ae fecha_vencimiento\n ┌──────────────────────┐\n │ │\n │ │\n └──────────────────────────────────────────────┘\n $fecha_ae\n fecha_ae fecha_vencimiento\n ┌──────────────────────┐\n │ │\n │ │\n └──────────────────────┘\n $fecha_ae\n */\n $dentro_algun_finalizado = (clone $q)->whereNotNull('aee.fecha_revocacion_ae')\n ->where('aee.fecha_ae','<=',$fecha_ae)->where('aee.fecha_vencimiento','>=',$fecha_ae)\n ->count() > 0;\n if($dentro_algun_finalizado) return 2;\n \n $fecha_fin = null;\n {\n $fechas = AutoexclusionController::getInstancia(false)->generarFechas($fecha_ae);\n if($finalizado) $fecha_fin = $fechas->fecha_vencimiento;\n else $fecha_fin = $fechas->fecha_cierre_ae;\n }\n \n /*\n Agarra dos casos (el de abajo es el que se agregaria)\n fecha_ae fecha_cierre_ae\n ┌──────────────────────────────────────────────┐\n │ │\n │ │\n └──────────────────────┘\n $fecha_fin\n fecha_ae fecha_cierre_ae\n ┌──────────────────────────────────────────────┐\n │ │\n │ │\n └──────────────────────────────────────────────┘\n $fecha_fin\n */\n $se_extiende_dentro_de_alguno_ya_existente_completo = (clone $q)->whereNull('aee.fecha_revocacion_ae')\n ->where('aee.fecha_ae','<=',$fecha_fin)->where('aee.fecha_cierre_ae','>=',$fecha_fin)\n ->count() > 0;\n if($se_extiende_dentro_de_alguno_ya_existente_completo) return 3;\n \n /*\n Agarra dos casos (el de abajo es el que se agregaria)\n fecha_ae fecha_vencimiento\n ┌──────────────────────┐\n │ │\n │ │\n └──────────────────────┘\n $fecha_fin\n fecha_ae fecha_vencimiento\n ┌──────────────────────┐\n │ │\n │ │\n └──────────────────────────────────────────────┘\n $fecha_fin\n */\n $se_extiende_dentro_de_alguno_ya_existente_finalizado = (clone $q)->whereNotNull('aee.fecha_revocacion_ae')\n ->where('aee.fecha_ae','<=',$fecha_fin)->where('aee.fecha_vencimiento','>=',$fecha_fin)\n ->count() > 0;\n if($se_extiende_dentro_de_alguno_ya_existente_finalizado) return 4;\n \n return 0;\n }", "public function retosSemana(){\n\n\n //$s = explode(\"-\",$fecha);\n\n\t\t//$actualDate = Carbon::create(intval($s[2]),intval($s[1]),intval($s[0]));\n\t\t\n\t\t$actualDate= Carbon::now();\n\n \n\n $date1 = Carbon::now();\n $date2 = Carbon::now();\n $date3 = Carbon::now();\n $date4 = Carbon::now();\n $date5 = Carbon::now();\n $date6 = Carbon::now();\n $date7 = Carbon::now();\n\n \n \n \n $nD = $date1->dayOfWeekIso;\n\n \n if($nD==1){\n //Lunes\n\n $monday = $date1;\n $tuesday = $date2->addDay();\n $wednesday = $date3->addDays(2);\n $thursday= $date4->addDays(3);\n $friday= $date5->addDays(4);\n $saturday= $date6->addDays(5);\n $sunday= $date7->addDays(6);\n\n }elseif(intval($nD==2)){\n //Martes\n $monday = $date1->subDay();\n $tuesday = $date2;\n $wednesday = $date3->addDay();\n $thursday= $date4->addDays(2);\n $friday= $date5->addDays(3);\n $saturday= $date6->addDays(4);\n $sunday= $date7->addDays(5);\n\n }\n elseif(intval($nD==3)){\n //Miercoles\n \n $monday = $date1->subDays(2);\n $tuesday = $date2->subDay();\n $wednesday = $date3;\n $thursday= $date4->addDay();\n $friday= $date5->addDays(2);\n $saturday= $date6->addDays(3);\n $sunday= $date7->addDays(4);\n\n \n\n }elseif($nD==4){\n //Jueves\n $monday = $date1->subDays(3);\n $tuesday = $date2->subDays(2);\n $wednesday = $date3->subDay();\n $thursday= $date4;\n $friday= $date5->addDay();\n $saturday= $date6->addDays(2);\n $sunday= $date7->addDays(3);\n }elseif($nD==5){\n //Viernes\n $monday = $date1->subDays(4);\n $tuesday = $date2->subDays(3);\n $wednesday = $date3->subDays(2);\n $thursday= $date4->subDay();\n $friday= $date5;\n $saturday= $date6->addDay();\n $sunday= $date7->addDays(2);\n }elseif($nD==6){\n //Sabado\n $monday = $date1->subDays(5);\n $tuesday = $date2->subDays(4);\n $wednesday = $date3->subDays(3);\n $thursday= $date4->subDays(2);\n $friday= $date5->subDay();\n $saturday= $date6;\n $sunday= $date7->addDay();\n }else{\n //Domingo\n $monday = $date1->subDays(6);\n $tuesday = $date2->subDays(5);\n $wednesday = $date3->subDays(4);\n $thursday= $date4->subDays(3);\n $friday= $date5->subDays(2);\n $saturday= $date6->subDay();\n $sunday= $date7;\n\t\t}\n\n\n\t\t$company_id = auth()->user()->company_id;\n\t\t\n\n\t\t$sumaLunes = count(DB::table('innovations')->where(function ($query) {\n\t\t\t$query->where('innovations.type', '=', 'solucion')\n\t\t\t\t->orWhere('innovations.type', '=', 'idea');\n\n\t\t})->where('company_id',$company_id)->whereDate('created_at',$monday->toDateString())->get());\n\t\t$sumaMartes = count(DB::table('innovations')->where(function ($query) {\n\t\t\t$query->where('innovations.type', '=', 'solucion')\n\t\t\t\t->orWhere('innovations.type', '=', 'idea');\n\n\t\t})->where('company_id',$company_id)->whereDate('created_at',$tuesday->toDateString())->get());\n\t\t$sumaMiercoles = count(DB::table('innovations')->where(function ($query) {\n\t\t\t$query->where('innovations.type', '=', 'solucion')\n\t\t\t\t->orWhere('innovations.type', '=', 'idea');\n\n\t\t})->where('company_id',$company_id)->whereDate('created_at',$wednesday->toDateString())->get());\n\t\t$sumaJueves = count(DB::table('innovations')->where(function ($query) {\n\t\t\t$query->where('innovations.type', '=', 'solucion')\n\t\t\t\t->orWhere('innovations.type', '=', 'idea');\n\n\t\t})->where('company_id',$company_id)->whereDate('created_at',$thursday->toDateString())->get());\n\t\t$sumaViernes = count(DB::table('innovations')->where(function ($query) {\n\t\t\t$query->where('innovations.type', '=', 'solucion')\n\t\t\t\t->orWhere('innovations.type', '=', 'idea');\n\n\t\t})->where('company_id',$company_id)->whereDate('created_at',$friday->toDateString())->get());\n\t\t$sumaSabado = count(DB::table('innovations')->where(function ($query) {\n\t\t\t$query->where('innovations.type', '=', 'solucion')\n\t\t\t\t->orWhere('innovations.type', '=', 'idea');\n\n\t\t})->where('company_id',$company_id)->whereDate('created_at',$saturday->toDateString())->get());\n\t\t$sumaDomingo = count(DB::table('innovations')->where(function ($query) {\n\t\t\t$query->where('innovations.type', '=', 'solucion')\n\t\t\t\t->orWhere('innovations.type', '=', 'idea');\n\n\t\t})->where('company_id',$company_id)->whereDate('created_at',$sunday->toDateString())->get());\n\n\t\t\n\n\n\n\t\t$sumaSemanal = array(\n\n\t\t\t'Lunes ' =>$sumaLunes,\n\t\t\t'Martes'=>$sumaMartes,\n\t\t\t'Miércoles'=>$sumaMiercoles,\n\t\t\t'Jueves'=>$sumaJueves,\n\t\t\t'Viernes'=>$sumaViernes,\n\t\t\t'Sábado'=>$sumaSabado,\n\t\t\t'Domingo ' =>$sumaDomingo,\n\t\t);\n\n\t\treturn $sumaSemanal;\n\t}", "private static function setHorarioDeVerao() {\n $dataJunta = self::getAnoAtual() . self::getMesAtual() . self::getDiaAtual();\n //self::$horario_de_verao = ($dataJunta > '20121021' && $dataJunta < '20130217' ) ? true : false;\n self::$horario_de_verao = (date('I') == \"1\") ? true : false;\n return self::getHorarioDeVerao();\n }", "public function getClicks_leido(){\n\t return (($this->getContactos_enviados_leidos()>0)\n\t\t\t\t? round(($this->getClicks_totales() / $this->getContactos_enviados_leidos()),2)\n\t\t\t\t: 0\n\t\t\t);\n\t}", "function buscarEspaciosAprobados($notaAprobatoria){\r\n $aprobados=array();\r\n if(is_array($this->espaciosCursados))\r\n {\r\n foreach ($this->espaciosCursados as $value1)\r\n {\r\n if ((isset($value1['NOTA'])&&$value1['NOTA']>=$notaAprobatoria)||(isset($value1['CODIGO_OBSERVACION'])?$value1['CODIGO_OBSERVACION']:'')==19||(isset($value1['CODIGO_OBSERVACION'])?$value1['CODIGO_OBSERVACION']:'')==22||(isset($value1['CODIGO_OBSERVACION'])?$value1['CODIGO_OBSERVACION']:'')==24)\r\n {\r\n $aprobados[]=array('CODIGO'=>$value1['CODIGO'],'NIVEL'=>(isset($value1['NIVEL'])?$value1['NIVEL']:''),'CREDITOS'=>(isset($value1['CREDITOS'])?$value1['CREDITOS']:''));\r\n }\r\n }\r\n\r\n }else\r\n {\r\n $aprobados='';\r\n }\r\n return $aprobados;\r\n }", "public function mezclar() {\n if ($this->cantcartas == -1 || $this->cantcartas == 0)\n return TRUE;\n $inicio = 0;\n $final = $this->cantcartas;\n $mezcla = [];\n $punt = 0;\n for (; $inicio != $final && $inicio < $final; $inicio++, $final--) {\n $mezcla[$punt] = $this->cajita[$final];\n $punt++;\n $mezcla[$punt] = $this->cajita[$inicio];\n $punt++;\n }\n if (($this->cantcartas % 2) == 0)\n $mezcla[$punt] = $this->cajita[$inicio];\n $this->cajita = $mezcla;\n return TRUE;\n }", "public function anioLectivoSiguiente(){\n $fecha= date('d/m/Y');\n $fecha=Carbon::createFromFormat('d/m/Y', date('d/m/Y'));\n $fecha->addYear();\n //$fecha->addYear();\n\n $fechaBuscar=substr($fecha, 0,-15);//$fecha_de_creacion.slice(0,-6);\n $fechaBuscar=(int)$fechaBuscar;\n $anio=Anio::where('año',$fechaBuscar)->select('id')->get()->toArray();\n\n if($anio!=null){\n $var=\"Existe\";\n return $var;\n }else{\n $var=\"NoExiste\";\n return $var;\n }\n }", "public function get_dias ($fecha_inicio, $fecha_fin, $dias_seleccionados){\n //aca debemos tratar el caso del mes de febrero, que puede tener 29 dias si el anio es bisiesto\n $anio=date('Y');\n $febrero=(($anio%400==0) || (($anio%4==0)&&($anio%100 != 0))) ? 29 : 28;\n $this->_meses[2]=$febrero;\n\n //obtenemos dia (01 a 31) y mes (01 a 12) con representacion numerica\n $dia_inicio=date('d', strtotime($fecha_inicio));\n $mes_inicio=date('m', strtotime($fecha_inicio));\n\n $dia_fin=date('d', strtotime($fecha_fin));\n $mes_fin=date('m', strtotime($fecha_fin));\n\n if($mes_inicio == $mes_fin){\n //con mes_inicio y mes_fin obtenemos la cantidad de dias que forman a dichos meses\n return $this->generar_dias($dia_inicio, $dia_fin, $mes_inicio, $mes_fin, 'mm', $dias_seleccionados, NULL);\n }\n else{\n $diff=$mes_fin - $mes_inicio;\n if($diff >= 2){ //tenemos meses intermedios entre el periodo seleccionado\n //debemos decrementar una unidad de diff, para no repetir meses\n return $this->generar_dias($dia_inicio, $dia_fin, $mes_inicio, $mes_fin, 'mnc', $dias_seleccionados, $this->obtener_meses_intermedios($mes_inicio, ($diff - 1)));\n }\n else{ //en esta rama diff posee el valor 1, lo que implica que existen meses contiguos\n return $this->generar_dias($dia_inicio, $dia_fin, $mes_inicio, $mes_fin, 'mc', $dias_seleccionados, NULL);\n }\n }\n\n }", "function adivinarSexo($array_A){\n $datos=new ManejoDatos();\n $arrayBD =$datos->getEstiloSexoPromedioRecinto();\n if($array_A[0]=='DIVERGENTE'){\n $estilo=4;\n }\n if($array_A[0]=='CONVERGENTE'){\n $estilo=3;\n }\n if($array_A[0]=='ACOMODADOR'){\n $estilo=2;\n }\n if($array_A[0]=='ASIMILADOR'){\n $estilo=1;\n }\n $arrayA = array( $estilo, $array_A[1],($array_A[2] == \"Paraiso\" ? 1 : 2));\n foreach ($arrayBD as $elemento) {\n if($elemento['Estilo']=='DIVERGENTE'){\n $estiloBD=4;\n }\n if($elemento['Estilo']=='CONVERGENTE'){\n $estiloBD=3;\n }\n if($elemento['Estilo']=='ACOMODADOR'){\n $estiloBD=2;\n }\n if($elemento['Estilo']=='ASIMILADOR'){\n $estiloBD=1;\n }\n $arrayB = array($estiloBD, $elemento['Promedio'], $elemento['Recinto'] == \"Paraiso\" ? 1 : 2);\n $temporal = $this->distanciaEuclidiana($arrayA, $arrayB);\n if ($temporal < $this->distancia) {\n $this->distancia = $temporal;\n $this->temporal = $elemento['Sexo'];\n }\n }\n if($this->temporal=='M'){\n $this->temporal=\"Masculino\";\n return $this->temporal;\n }\n if($this->temporal=='F'){\n $this->temporal=\"Femenino\";\n return $this->temporal;\n }\n }", "function contarEspaciosNivelados($cantidadMatriculas) {\r\n $creditos=0;\r\n $nivelados=array();\r\n if (is_array($this->espaciosPlan))\r\n {\r\n foreach ($this->espaciosPlan as $key => $espacio) {\r\n if ($espacio['SEMESTRE']<=$cantidadMatriculas)\r\n {\r\n $nivelados[]=$espacio;\r\n $creditos=$creditos+(isset($espacio['CREDITOS'])?$espacio['CREDITOS']:'');\r\n }\r\n }\r\n }\r\n if($this->datosEstudiante['IND_CRED']=='N')\r\n {\r\n return count($nivelados);\r\n }elseif($this->datosEstudiante['IND_CRED']=='S')\r\n {\r\n return $creditos;\r\n }else{}\r\n }", "public function totalOrdersByDate()\n {\n $data = [\n 'ano' => (int)date('Y'),\n 'mes' => (int)date('m'),\n 'dia' => (int)date('d'),\n ];\n\n /*$ano = Pedido\n ::selectRaw('YEAR(created_at) as ano, COUNT(*) as count')\n ->whereIn('status', [1,2,3])\n ->whereIn(DB::raw('YEAR(created_at)'), [$data['ano'], $data['ano'] - 1])\n ->groupBy(DB::raw('YEAR(created_at)'))\n ->orderBy(DB::raw('YEAR(created_at)'), 'DESC')\n ->get()->toArray();\n\n if (count($ano) == 1 && $data['ano'] == $ano[0]['ano']) {\n $ano[] = [\n 'ano' => $data['ano'] - 1,\n 'count' => 0\n ];\n }*/\n\n $mes = Pedido\n ::selectRaw('MONTH(created_at) as mes, COUNT(*) as count')\n ->whereIn('status', [1,2,3])\n ->whereIn(DB::raw('MONTH(created_at)'), [$data['mes'], $data['mes'] - 1])\n ->where(DB::raw('YEAR(created_at)'), '=', $data['ano'])\n ->groupBy(DB::raw('MONTH(created_at)'))\n ->orderBy(DB::raw('MONTH(created_at)'), 'DESC')\n ->get()->toArray();\n\n if (!isset($mes[0])) {\n $mes[] = [\n 'mes' => $data['mes'],\n 'count' => 0\n ];\n }\n\n if (count($mes) == 1) {\n if ($data['mes'] == $mes[0]['mes']) {\n $mes[] = [\n 'mes' => $data['mes'] - 1,\n 'count' => 0\n ];\n } elseif (($data['mes'] - 1) == $mes[0]['mes']) {\n $mes[] = $mes[0];\n\n $mes[0] = [\n 'mes' => $data['mes'],\n 'count' => 0\n ];\n }\n }\n\n if ($mes[1]['mes'] === 0) {\n $mes[1]['count'] = Pedido\n ::selectRaw('MONTH(created_at) as mes, COUNT(*) as count')\n ->whereIn('status', [1,2,3])\n ->where(DB::raw('MONTH(created_at)'), '=', 12)\n ->where(DB::raw('YEAR(created_at)'), '=', ($data['ano'] - 1))\n ->groupBy(DB::raw('MONTH(created_at)'))\n ->orderBy(DB::raw('MONTH(created_at)'), 'DESC')\n ->get()->toArray();\n\n $mes[1]['count'] = $mes[1]['count'][0]['count'];\n $mes[1]['mes'] = 12;\n }\n\n $dia = Pedido\n ::selectRaw('DAY(created_at) as dia, COUNT(*) as count')\n ->whereIn('status', [1,2,3])\n ->whereIn(DB::raw('DAY(created_at)'), [$data['dia'], $data['dia'] - 1])\n ->where(DB::raw('MONTH(created_at)'), '=', $data['mes'])\n ->where(DB::raw('YEAR(created_at)'), '=', $data['ano'])\n ->groupBy(DB::raw('DAY(created_at)'))\n ->orderBy(DB::raw('DAY(created_at)'), 'DESC')\n ->get()->toArray();\n\n if (!isset($dia[0])) {\n $dia[] = [\n 'dia' => $data['dia'],\n 'count' => 0\n ];\n }\n\n if (count($dia) == 1) {\n if ($data['dia'] == $dia[0]['dia']) {\n $dia[] = [\n 'dia' => $data['dia'] - 1,\n 'count' => 0\n ];\n } elseif (($data['dia'] - 1) == $dia[0]['dia']) {\n $dia[] = $dia[0];\n\n $dia[0] = [\n 'dia' => $data['dia'],\n 'count' => 0\n ];\n }\n }\n\n $mesesExtenso = Config::get('core.meses');\n\n $pedidos = [\n /*'ano' => [\n 'atual' => [$ano[0]['ano'], $ano[0]['count']],\n 'ultimo' => [$ano[1]['ano'], $ano[1]['count']],\n ],*/\n 'mes' => [\n 'atual' => [$mesesExtenso[(int)$mes[0]['mes']], $mes[0]['count']],\n 'ultimo' => [$mesesExtenso[(int)$mes[1]['mes']], $mes[1]['count']],\n ],\n 'dia' => [\n 'atual' => [$dia[0]['dia'], $dia[0]['count']],\n 'ultimo' => [$dia[1]['dia'], $dia[1]['count']],\n ]\n ];\n\n return $this->listResponse($pedidos);\n }", "function get_listado_estactual($filtro=array())\n\t{ \n $concat='';\n if (isset($filtro['anio']['valor'])) {\n \t$udia=dt_mocovi_periodo_presupuestario::ultimo_dia_periodo_anio($filtro['anio']['valor']);\n $pdia=dt_mocovi_periodo_presupuestario::primer_dia_periodo_anio($filtro['anio']['valor']);\n\t\t} \n //que sea una designacion correspondiente al periodo seleccionado o anulada dentro del periodo \n $where=\" WHERE ((a.desde <= '\".$udia.\"' and (a.hasta >= '\".$pdia.\"' or a.hasta is null)) or (a.desde='\".$pdia.\"' and a.hasta is not null and a.hasta<a.desde))\";\n $where2=\" WHERE 1=1 \";//es para filtrar por estado. Lo hago al final de todo\n if (isset($filtro['uni_acad'])) {\n $concat=quote($filtro['uni_acad']['valor']);\n switch ($filtro['uni_acad']['condicion']) {\n case 'es_igual_a': $where.= \" AND a.uni_acad = \".quote($filtro['uni_acad']['valor']);break;\n case 'es_distinto_de': $where.= \" AND a.uni_acad <> \".quote($filtro['uni_acad']['valor']);break;\n }\n }\n //si el usuario esta asociado a un perfil de datos le aplica igual a su UA\n $con=\"select sigla from unidad_acad \";\n $con = toba::perfil_de_datos()->filtrar($con);\n $resul=toba::db('designa')->consultar($con);\n if(count($resul)<=1){//es usuario de una unidad academica\n $where.=\" and a.uni_acad = \".quote($resul[0]['sigla']);\n $concat=quote($resul[0]['sigla']);//para hacer el update de baja\n }\n if (isset($filtro['iddepto'])) {\n switch ($filtro['iddepto']['condicion']) {\n case 'es_igual_a': $where.= \" AND iddepto =\" .$filtro['iddepto']['valor'];break;\n case 'es_distinto_de': $where.= \" AND iddepto <>\" .$filtro['iddepto']['valor'];break;\n }\n }\n if (isset($filtro['por_permuta'])) {\n switch ($filtro['por_permuta']['condicion']) {\n case 'es_igual_a': $where.= \" AND a.por_permuta =\" .$filtro['por_permuta']['valor'];break;\n case 'es_distinto_de': $where.= \" AND a.por_permuta <>\" .$filtro['por_permuta']['valor'];break;\n }\n }\n if (isset($filtro['carac']['valor'])) {\n switch ($filtro['carac']['valor']) {\n case 'R':$c=\"'Regular'\";break;\n case 'O':$c=\"'Otro'\";break;\n case 'I':$c=\"'Interino'\";break;\n case 'S':$c=\"'Suplente'\";break;\n default:\n break;\n }\n switch ($filtro['carac']['condicion']) {\n case 'es_igual_a': $where.= \" AND a.carac=\".$c;break;\n case 'es_distinto_de': $where.= \" AND a.carac<>\".$c;break;\n }\t\n }\n if (isset($filtro['estado'])) {\n switch ($filtro['estado']['condicion']) {\n case 'es_igual_a': $where2.= \" and est like '\".$filtro['estado']['valor'].\"%'\";break;\n case 'es_distinto_de': $where2.= \" and est not like '\".$filtro['estado']['valor'].\"%'\";break;\n }\n }\n if (isset($filtro['legajo'])) {\n switch ($filtro['legajo']['condicion']) {\n case 'es_igual_a': $where.= \" and legajo = \".$filtro['legajo']['valor'];break;\n case 'es_mayor_que': $where.= \" and legajo > \".$filtro['legajo']['valor'];break;\n case 'es_mayor_igual_que': $where.= \" and legajo >= \".$filtro['legajo']['valor'];break;\n case 'es_menor_que': $where.= \" and legajo < \".$filtro['legajo']['valor'];break;\n case 'es_menor_igual_que': $where.= \" and legajo <= \".$filtro['legajo']['valor'];break;\n case 'es_distinto_de': $where.= \" and legajo <> \".$filtro['legajo']['valor'];break;\n case 'entre': $where.= \" and legajo >= \".$filtro['legajo']['valor']['desde'].\" and legajo <=\".$filtro['legajo']['valor']['hasta'];break;\n }\n } \n if (isset($filtro['docente_nombre'])) {\n switch ($filtro['docente_nombre']['condicion']) {\n case 'contiene': $where.= \" and LOWER(translate(docente_nombre,'áéíóúÁÉÍÓÚäëïöüÄËÏÖÜ','aeiouAEIOUaeiouAEIOU')) like LOWER('%\".$filtro['docente_nombre']['valor'].\"%')\";break;\n case 'no_contiene': $where.= \" and LOWER(translate(docente_nombre,'áéíóúÁÉÍÓÚäëïöüÄËÏÖÜ','aeiouAEIOUaeiouAEIOU')) not like LOWER('\".$filtro['docente_nombre']['valor'].\"')\";break;\n case 'comienza_con': $where.= \" and LOWER(translate(docente_nombre,'áéíóúÁÉÍÓÚäëïöüÄËÏÖÜ','aeiouAEIOUaeiouAEIOU')) like LOWER('\".$filtro['docente_nombre']['valor'].\"%')\";break;\n case 'termina_con': $where.= \" and LOWER(translate(docente_nombre,'áéíóúÁÉÍÓÚäëïöüÄËÏÖÜ','aeiouAEIOUaeiouAEIOU')) like LOWER('%\".$filtro['docente_nombre']['valor'].\"')\";break;\n case 'es_igual': $where.= \" and LOWER(translate(docente_nombre,'áéíóúÁÉÍÓÚäëïöüÄËÏÖÜ','aeiouAEIOUaeiouAEIOU')) == LOWER('\".$filtro['docente_nombre']['valor'].\"')\";break;\n case 'es_distinto': $where.= \" and LOWER(translate(docente_nombre,'áéíóúÁÉÍÓÚäëïöüÄËÏÖÜ','aeiouAEIOUaeiouAEIOU')) <> LOWER('\".$filtro['docente_nombre']['valor'].\"')\";break;\n }\n } \n if (isset($filtro['programa'])) {\n $sql=\"select * from mocovi_programa where id_programa=\".$filtro['programa']['valor'];\n $resul=toba::db('designa')->consultar($sql);\n switch ($filtro['programa']['condicion']) {\n case 'es_igual_a': $where.= \" AND programa =\".quote($resul[0]['nombre']);break;\n case 'es_distinto_de': $where.= \" AND programa <>\".quote($resul[0]['nombre']);break;\n }\n } \n if (isset($filtro['tipo_desig'])) {\n switch ($filtro['tipo_desig']['condicion']) {\n case 'es_igual_a': $where.=\" AND a.tipo_desig=\".$filtro['tipo_desig']['valor'];break;\n case 'es_distinto_de': $where.=\" AND a.tipo_desig <>\".$filtro['tipo_desig']['valor'];break;\n }\n }\n if (isset($filtro['anulada'])) {\n switch ($filtro['anulada']['valor']) {\n case '0': $where.=\" AND not (a.hasta is not null and a.hasta<a.desde)\";break;\n case '1': $where.=\" AND a.hasta is not null and a.hasta<a.desde \";break;\n }\n } \n if (isset($filtro['cat_estat'])) {\n switch ($filtro['cat_estat']['condicion']) {\n case 'es_igual_a': $where2.= \" and cat_estat=\".quote($filtro['cat_estat']['valor']);break;\n case 'es_distinto_de': $where2.= \" and cat_estat <>\".quote($filtro['cat_estat']['valor']);break;\n }\n }\n if (isset($filtro['dedic'])) {\n switch ($filtro['dedic']['condicion']) {\n case 'es_igual_a': $where2.= \" and dedic=\".$filtro['dedic']['valor'];break;\n case 'es_distinto_de': $where2.= \" and dedic<>\".$filtro['dedic']['valor'];break;\n }\n } \n //me aseguro de colocar en estado B todas las designaciones que tienen baja\n if($concat!=''){ \n $sql2=\" update designacion a set estado ='B' \"\n . \" where estado<>'B' and a.uni_acad=\".$concat\n .\" and exists (select * from novedad b\n where a.id_designacion=b.id_designacion \n and (b.tipo_nov=1 or b.tipo_nov=4))\";\n }\n \n //designaciones sin licencia UNION designaciones c/licencia sin norma UNION designaciones c/licencia c norma UNION reservas\n $sql=$this->armar_consulta($pdia,$udia,$filtro['anio']['valor']);\n\t\t//si el estado de la designacion es B entonces le pone estado B, si es <>B se fija si tiene licencia sin goce o cese\n// $sql= \"select id_designacion,docente_nombre,legajo,nro_cargo,anio_acad,desde,hasta,cat_mapuche,cat_mapuche_nombre,cat_estat,dedic,carac,check_presup,id_departamento,id_area,id_orientacion,uni_acad,emite_norma,nro_norma,tipo_norma,nro_540,observaciones,estado,porc,dias_lic,programa,costo_vale as costo,est,expediente,nro from(\"\n// . \"select sub2.*,case when t_no.tipo_nov in (1,4) then 'B('||coalesce(t_no.tipo_norma,'')||':'||coalesce(t_no.norma_legal,'')||')' else case when t_no.tipo_nov in (2,5) then 'L('||t_no.tipo_norma||':'||t_no.norma_legal||')' else sub2.estado end end as est,t_i.expediente,case when d.tipo_desig=2 then costo_reserva(d.id_designacion,costo,\".$filtro['anio']['valor'].\") else costo end as costo_vale \"\n// . \" ,case when t_nor.id_norma is null then '' else case when t_nor.link is not null or t_nor.link <>'' then '<a href='||chr(39)||t_nor.link||chr(39)|| ' target='||chr(39)||'_blank'||chr(39)||'>'||t_nor.nro_norma||'</a>' else cast(t_nor.nro_norma as text) end end as nro \"\n// . \"from (\"\n// .\"select sub.id_designacion,docente_nombre,legajo,nro_cargo,anio_acad, sub.desde, sub.hasta,cat_mapuche, cat_mapuche_nombre,cat_estat,dedic,carac,id_departamento, id_area,id_orientacion, uni_acad,sub.emite_norma, sub.nro_norma,sub.tipo_norma,nro_540,sub.observaciones,estado,programa,porc,costo_diario,check_presup,licencia,dias_des,dias_lic,costo,max(t_no.id_novedad) as id_novedad from (\"\n// .\"select distinct b.id_designacion,docente_nombre,legajo,nro_cargo,anio_acad, b.desde, b.hasta,cat_mapuche, cat_mapuche_nombre,cat_estat,dedic,carac,id_departamento, id_area,id_orientacion, uni_acad,emite_norma, b.nro_norma,b.tipo_norma,nro_540,b.observaciones,estado,programa,porc,costo_diario,check_presup,licencia,dias_des,dias_lic,case when (dias_des-dias_lic)>=0 then ((dias_des-dias_lic)*costo_diario*porc/100) else 0 end as costo\"\n// .\" from (\"\n// .\" select a.id_designacion,a.docente_nombre,a.legajo,a.nro_cargo,a.anio_acad, a.desde, a.hasta,a.cat_mapuche, a.cat_mapuche_nombre,a.cat_estat,a.dedic,a.carac,b.a.id_departamento, a.id_area,a.id_orientacion, a.uni_acad, a.emite_norma, a.nro_norma,a.tipo_norma,a.nro_540,a.observaciones,a.estado,programa,porc,a.costo_diario,check_presup,licencia,a.dias_des,a.dias_lic\".\n// \" from (\".$sql.\") a\"\n// .$where \n// .\") b \"\n// . \" )sub\"\n// . \" LEFT OUTER JOIN novedad t_no ON (sub.id_designacion=t_no.id_designacion and t_no.desde<='\".$udia.\"' and (t_no.hasta is null or t_no.hasta>='\".$pdia.\"' ))\"\n// . \" GROUP BY sub.id_designacion,docente_nombre,legajo,nro_cargo,anio_acad, sub.desde,sub.hasta,cat_mapuche, cat_mapuche_nombre,cat_estat,dedic,carac,id_departamento, id_area,id_orientacion, uni_acad,sub.emite_norma, sub.nro_norma,sub.tipo_norma,nro_540,sub.observaciones,estado,programa,porc,costo_diario,check_presup,licencia,dias_des,dias_lic,costo\" \n// . \")sub2\"//obtengo el id_novedad maximo\n// . \" LEFT OUTER JOIN novedad t_no on (t_no.id_novedad=sub2.id_novedad)\"//con el id_novedad maximo obtengo la novedad que predomina\n// .\" LEFT JOIN impresion_540 t_i ON (nro_540=t_i.id)\"//para agregar el expediente \n// .\" LEFT OUTER JOIN designacion d ON (sub2.id_designacion=d.id_designacion)\"//como no tengo el id de la norma tengo que volver a hacer join\n// .\" LEFT OUTER JOIN norma t_nor ON (d.id_norma=t_nor.id_norma)\"\n// . \")sub3\"\n// .$where2\n// . \" order by docente_nombre,desde\"; \n $sql= \"select id_designacion,docente_nombre,legajo,nro_cargo,anio_acad,desde,hasta,cat_mapuche,cat_mapuche_nombre,cat_estat,dedic,carac,check_presup,id_departamento,id_area,id_orientacion,uni_acad,emite_norma,nro_norma,tipo_norma,nro_540,tkd,observaciones,estado,porc,dias_lic,programa,costo_vale as costo,est,expediente,nro from(\"\n . \"select sub2.*,sub2.nro_540||'/'||t_i.anio as tkd,case when t_no.tipo_nov in (1,4) then 'B('||coalesce(t_no.tipo_norma,'')||':'||coalesce(t_no.norma_legal,'')||')' else case when t_no.tipo_nov in (2,5) then 'L('||t_no.tipo_norma||':'||t_no.norma_legal||')' else sub2.estado end end as est,t_i.expediente,case when d.tipo_desig=2 then costo_reserva(d.id_designacion,costo,\".$filtro['anio']['valor'].\") else costo end as costo_vale \"\n . \" ,case when t_nor.id_norma is null then '' else case when t_nor.link is not null or t_nor.link <>'' then '<a href='||chr(39)||t_nor.link||chr(39)|| ' target='||chr(39)||'_blank'||chr(39)||'>'||t_nor.nro_norma||'</a>' else cast(t_nor.nro_norma as text) end end as nro \"\n . \"from (\"\n .\"select sub.id_designacion,docente_nombre,legajo,nro_cargo,anio_acad, sub.desde, sub.hasta,cat_mapuche, cat_mapuche_nombre,cat_estat,dedic,carac,id_departamento, id_area,id_orientacion, uni_acad,sub.emite_norma, sub.nro_norma,sub.tipo_norma,nro_540,sub.observaciones,estado,programa,porc,costo_diario,check_presup,licencia,dias_des,dias_lic,costo,max(t_no.id_novedad) as id_novedad from (\"\n .\"select distinct b.id_designacion,docente_nombre,legajo,nro_cargo,anio_acad, b.desde, b.hasta,cat_mapuche, cat_mapuche_nombre,cat_estat,dedic,carac,id_departamento, id_area,id_orientacion, uni_acad,emite_norma, b.nro_norma,b.tipo_norma,nro_540,b.observaciones,estado,programa,porc,costo_diario,check_presup,licencia,dias_des,dias_lic,case when (dias_des-dias_lic)>=0 then ((dias_des-dias_lic)*costo_diario*porc/100) else 0 end as costo\"\n .\" from (\"\n .\" select a.id_designacion,a.por_permuta,a.docente_nombre,a.legajo,a.nro_cargo,a.anio_acad, a.desde, a.hasta,a.cat_mapuche, a.cat_mapuche_nombre,a.cat_estat,a.dedic,a.carac,t.iddepto,a.id_departamento, a.id_area,a.id_orientacion, a.uni_acad, a.emite_norma, a.nro_norma,a.tipo_norma,a.nro_540,a.observaciones,a.estado,programa,porc,a.costo_diario,a.check_presup,licencia,a.dias_des,a.dias_lic\".\n \" from (\".$sql.\") a\"\n . \" INNER JOIN designacion d ON (a.id_designacion=d.id_designacion)\"\n . \" LEFT OUTER JOIN departamento t ON (t.iddepto=d.id_departamento)\"\n .$where \n .\") b \"\n . \" )sub\"\n . \" LEFT OUTER JOIN novedad t_no ON (sub.id_designacion=t_no.id_designacion and t_no.desde<='\".$udia.\"' and (t_no.hasta is null or t_no.hasta>='\".$pdia.\"' ))\"\n . \" GROUP BY sub.id_designacion,docente_nombre,legajo,nro_cargo,anio_acad, sub.desde,sub.hasta,cat_mapuche, cat_mapuche_nombre,cat_estat,dedic,carac,id_departamento, id_area,id_orientacion, uni_acad,sub.emite_norma, sub.nro_norma,sub.tipo_norma,nro_540,sub.observaciones,estado,programa,porc,costo_diario,check_presup,licencia,dias_des,dias_lic,costo\" \n . \")sub2\"//obtengo el id_novedad maximo\n . \" LEFT OUTER JOIN novedad t_no on (t_no.id_novedad=sub2.id_novedad)\"//con el id_novedad maximo obtengo la novedad que predomina\n .\" LEFT JOIN impresion_540 t_i ON (nro_540=t_i.id)\"//para agregar el expediente \n .\" LEFT OUTER JOIN designacion d ON (sub2.id_designacion=d.id_designacion)\"//como no tengo el id de la norma tengo que volver a hacer join\n .\" LEFT OUTER JOIN norma t_nor ON (d.id_norma=t_nor.id_norma)\"\n . \")sub3\"\n .$where2\n . \" order by docente_nombre,desde\"; \n return toba::db('designa')->consultar($sql);\n\t}", "function hojas_vida_modificadas(){\n // Consulta\n $sql =\n \"SELECT\n c.Nombre,\n Count(hv.Pk_Id_Hoja_Vida) Vinculados,\n IFNULL(\n (\n SELECT\n Count(hvo.Nombres)\n FROM\n solicitudes.hojas_vida AS hvo\n LEFT JOIN ica.tbl_valores AS co ON hvo.Fk_Id_Valor_Contratista = co.Pk_Id_Valor\n WHERE\n hvo.Fecha_Actualizacion BETWEEN DATE_SUB(NOW(), INTERVAL 7 DAY)\n AND CURDATE()\n AND co.Pk_Id_Valor = c.Pk_Id_Valor\n GROUP BY\n co.Pk_Id_Valor\n ),\n 0\n ) Modificados\n FROM\n solicitudes.hojas_vida AS hv\n LEFT JOIN ica.tbl_valores AS c ON hv.Fk_Id_Valor_Contratista = c.Pk_Id_Valor\n WHERE\n hv.Contratado = 1\n AND c.Nombre IS NOT NULL\n GROUP BY\n hv.Fk_Id_Valor_Contratista\n ORDER BY\n c.Nombre ASC\";\n\n //Se retorna el resultado de la consulta\n return $this->db->query($sql)->result();\n }", "public function cargarAutorizaciones()\n {\n $alumnos = Auth::user()->students;\n $total_aut_pendientes = 0;\n\n foreach ($alumnos as $alumno) {\n $tot_aut_pend = 0;\n foreach ($alumno->activities as $actividad) {\n if (!$actividad->pivot->authorized && !$actividad->cerrada) {\n ++$tot_aut_pend;\n };\n }\n\n if ($tot_aut_pend > 0) {\n $total_aut_pendientes = $total_aut_pendientes + $tot_aut_pend;\n }\n }\n\n return $total_aut_pendientes;\n }", "public function testVerificaPagtoAtrasadoCincoDias() {\n \n $pagFatura = new PagamentoFatura();\n $pagFatura->dataVencimento = \"25/11/2010\";\n $pagFatura->dataPagamento = \"30/11/2010\";\n $pagFatura->SomarDatas();\n $pagFatura->StatusPagamento();\n \n $this->assertEquals(\"Pagto feito com atraso de 5 dias\", $pagFatura->status);\n \n }", "private function somaPorMoeda($ativos){\n $retorno = [];\n foreach($ativos as $at){\n if(!isset($at->dt_venda) && sizeof($at->cotacaos)>0){\n if(!array_key_exists($at->titulo->moeda, $retorno)){\n $retorno[$at->titulo->moeda] = $at->saldoSemMoeda;\n }else{\n $retorno[$at->titulo->moeda]+= $at->saldoSemMoeda;\n }\n }\n }\n return $retorno;\n }", "public function hospitalizacionesPendientes(){\n\n\t\t$resultado = array();\n\t\t\n\t\t$query = \"SELECT count(H.idHospitalizacion) as cantidadHospitalizaciones\n\t\t\t\t\t\tFROM tb_hospitalizacion AS H \n\t\t\t\t\t\tINNER JOIN tb_hospitalizacionAlta AS HA ON HA.idHospitalizacion = H.idHospitalizacion\n \t\t\t\tWHERE Not H.idHospitalizacion IN (SELECT idTipoDetalle FROM tb_pago_factura_caja_detalle WHERE tipoDetalle = 'Hospitalizacion' AND estado = 'Activo' )\";\n\t\t\n\t\t$conexion = parent::conexionCliente();\n\t\t\n\t\tif($res = $conexion->query($query)){\n \n /* obtener un array asociativo */\n while ($filas = $res->fetch_assoc()) {\n $resultado = $filas;\n }\n \n /* liberar el conjunto de resultados */\n $res->free();\n \n }\n\n return $resultado['cantidadHospitalizaciones'];\t\t\n\n\n\t\t\n\t}", "function contaNumeroCadastros(){\n if ($GLOBALS['cadastros'] == null) {//se não tiver nenhum cadastro\n $GLOBALS['quantidadeCadastros'] = 0;//numero de pessoas cadastradas = 0\n }else{\n $GLOBALS['quantidadeCadastros'] = count($GLOBALS['cadastros']);//salva na variavel global quantidadeCadastros o número de cadastros\n }\n }", "function obtener_aulas ($espacios_concedidos){\n $aulas=array();\n $indice=0;\n foreach($espacios_concedidos as $clave=>$valor){\n $aula=array(); // indice => (aula, id_aula)\n $aula['aula']=$valor['aula'];\n $aula['id_aula']=$valor['id_aula'];\n //$aula=$valor['aula'];\n $existe=$this->existe($aulas, $aula);\n if(!$existe){\n $aulas[$indice]=$aula;\n $indice += 1;\n }\n }\n return $aulas;\n }", "function getDatosAportaciones(){\n\t\t$socio\t= $this->mCodigo;\n\t\t$sql = \"SELECT\n\t\t\t\t`eacp_config_bases_de_integracion_miembros`.`codigo_de_base`,\n\t\t\t\t`operaciones_mvtos`.`socio_afectado`,\n\t\t\t\tMAX(`operaciones_mvtos`.`fecha_operacion`) AS `fecha`,\n\t\t\t\tSUM(`operaciones_mvtos`.`afectacion_real` * `eacp_config_bases_de_integracion_miembros`.`afectacion`) AS `aportaciones`\n\t\t\tFROM\n\t\t\t\t`eacp_config_bases_de_integracion_miembros`\n\t\t\t\t`eacp_config_bases_de_integracion_miembros`\n\t\t\t\t\tINNER JOIN `operaciones_mvtos` `operaciones_mvtos`\n\t\t\t\t\tON `eacp_config_bases_de_integracion_miembros`.`miembro` =\n\t\t\t\t\t`operaciones_mvtos`.`tipo_operacion`\n\t\t\tWHERE\n\t\t\t\t(`eacp_config_bases_de_integracion_miembros`.`codigo_de_base` =2609)\n\t\t\t\tAND\n\t\t\t\t(`operaciones_mvtos`.`socio_afectado` =$socio)\n\t\t\tGROUP BY\n\t\t\t\t`operaciones_mvtos`.`socio_afectado`\n\t\t\tORDER BY\n\t\t\t\t`eacp_config_bases_de_integracion_miembros`.`codigo_de_base`,\n\t\t\t\t`operaciones_mvtos`.`socio_afectado` \";\n\t\t$this->mDatosAports\t\t= obten_filas($sql);\t\t\n\t\treturn $this->mDatosAports;\n\t}", "public function show($id)\n\t{\n\t\t$prenomina = Payroll::find($id);\n\t\t$adicionales = $prenomina->adicionales;\n\t\t$empleados = $prenomina->payrolls;\n\t\t$deducciones = Deduction::first();\n $cestaticket = Cestaticket::first();\n\t\t$sso = array();\n\t\t$rpe = array();\n\t\t$rpvh = array();\n\t\t$horasExtras = array();\n\t\t$totalAsignacion = array();\n\t\t$diasLaborados = array();\n\t\t$totalCancelar = array();\n\t\t$totalDeducciones = array();\n\n\t\t$fecha = $prenomina->year.'-'.$prenomina->mes;\n\n\t\tif ($prenomina->quincena == 1)\n\t\t{\n\n\t\t\t$i = $fecha.'-01';\n\t\t\t$f = $fecha.'-15';\n\t\t\t\t\t\t\n\t\t\t$dates = Days_planning::whereBetween('dia', [$i,$f])->get();\n\t\t\t$assistances = Day_attendance::whereBetween('fecha', [$i,$f])->get();\n\n\t\t} else {\n\n\t\t\tif ($prenomina->quincena == 2 AND $prenomina->mes == 1 OR $prenomina->mes == 3 OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $prenomina->mes == 5 OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $prenomina->mes == 7 OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $prenomina->mes == 8 OR $prenomina->mes == 10 OR $prenomina->mes == 12)\n\t\t\t{\n\t\t\t\t$i = $fecha.'-16';\n\t\t\t\t$f = $fecha.'-31';\n\n\t\t\t\t$dates = Days_planning::whereBetween('dia', [$i,$f])->get();\n\t\t\t\t$assistances = Day_attendance::whereBetween('fecha', [$i,$f])->get();\n\n\t\t\t} else {\n\n\t\t\t\tif ($prenomina->quincena == 2 AND $prenomina->mes == 2)\n\t\t\t\t{\n\t\t\t\t\t$i = $fecha.'-16';\n\t\t\t\t\t$f = $fecha.'-29';\n\n\t\t\t\t\t$dates = Days_planning::whereBetween('dia', [$i,$f])->get();\n\t\t\t\t\t$assistances = Day_attendance::whereBetween('fecha', [$i,$f])->get();\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$i = $fecha.'-16';\n\t\t\t\t\t$f = $fecha.'-30';\n\n\t\t\t\t\t$dates = Days_planning::whereBetween('dia', [$i,$f])->get();\n\t\t\t\t\t$assistances = Day_attendance::whereBetween('fecha', [$i,$f])->get();\n }\n }\n }\n\n if (count($assistances) < 10)\n {\n Flash::warning('<strong> Disculpe </strong> las asistencias de los empleados no estan completas, debe registrar primero asistencias.');\n\n return redirect()->back();\n\n } else {\n return view('admin.payroll.show', compact('i', 'f', 'dates', 'assistances', 'adicionales', 'empleados', 'sso', 'rpe', 'rpvh', 'horasExtras', 'deducciones', 'cestaticket', 'totalAsignacion', 'diasLaborados', 'totalCancelar', 'totalDeducciones', 'prenomina'));\n }\n }", "function ver_dia($k,$hoy_es,$hoy)\n{\n\t$fdia = explode(\"-\",$hoy);\n\tif($k==$hoy_es)\n\t\t$fecha=$hoy;\n\telse\n\t\tif($k<$hoy_es)\n\t\t{\n\t\t\t$diferencia = $hoy_es - $k;\n\t\t\t$fecha = date(\"d-m-Y\",mktime(0, 0, 0, $fdia[1] , $fdia[0]-$diferencia, $fdia[2]));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$diferencia = $k - $hoy_es;\n\t\t \t$fecha = date(\"d-m-Y\",mktime(0, 0, 0, $fdia[1] , $fdia[0]+$diferencia, $fdia[2]));\n\t\t}\n\treturn $fecha;\n}", "public function obtener_impuestos_validos($id, $tipo, $almacen = 0)\n {\n $sql = \"SELECT DISTINCT id_mov_tip FROM movimientos_cierre_caja where Id_cierre = '$id' and numero <> '' and tabla_mov = 'venta' \";\n\n $data = array();\n $detalleventaid = \"\";\n\n foreach ($this->connection->query($sql)->result() as $value1) {\n $detalleventaid = $detalleventaid . \",'\" . $value1->id_mov_tip . \"'\";\n }\n\n $detalleventaid = trim($detalleventaid, ',');\n $ventascierre = \"\";\n if (!empty($detalleventaid)) {\n $ventascierre = \" AND venta.id IN($detalleventaid) \";\n }\n\n $total_ventas = '';\n $total_ventas_sin_impuesto = '';\n //$condition = \" and almacen_id = '$almacen' \";\n $ventas = array();\n if (!empty($ventascierre)) {\n // busco impuestos de las facturas del cierre\n /* $total_ventas = \"SELECT DATE(venta.fecha) AS fecha_dia, venta.id,\n SUM((((detalle_venta.precio_venta - detalle_venta.descuento) * detalle_venta.impuesto ) / 100 ) * detalle_venta.unidades) AS impuesto, porciento, nombre_impuesto,\n SUM((((detalle_venta.precio_venta - detalle_venta.descuento) ) ) * detalle_venta.unidades) AS subtotal,\n (SUM((((detalle_venta.precio_venta - detalle_venta.descuento) ) ) * detalle_venta.unidades) + SUM((((detalle_venta.precio_venta - detalle_venta.descuento) * detalle_venta.impuesto ) / 100 ) * detalle_venta.unidades)) AS total\n FROM venta\n inner join detalle_venta on venta.id = detalle_venta.venta_id\n inner join impuesto on detalle_venta.impuesto = impuesto.porciento\n WHERE estado='0' and impuesto > 0 and almacen_id = '$almacen' $ventascierre group by nombre_impuesto \";\n echo \"<br>\".$total_ventas; die();*/\n //DETALLADO\n $total_ventas_impuestos = \"SELECT DATE(venta.fecha) AS fecha_dia, venta.id, detalle_venta.precio_venta, detalle_venta.descuento, detalle_venta.impuesto, detalle_venta.unidades, porciento, nombre_impuesto,\n (IF((detalle_venta.descripcion_producto = '0' OR detalle_venta.descripcion_producto = ''),0,IF((SUBSTRING_INDEX(SUBSTRING_INDEX(detalle_venta.descripcion_producto,'\\\"cantidadSindevolver\\\":',-1),',',1))=0,detalle_venta.unidades,(SELECT detalle_venta.unidades - (SUBSTRING_INDEX(SUBSTRING_INDEX(detalle_venta.descripcion_producto,'\\\"cantidadSindevolver\\\":',-1),',',1)))))) AS cantidades_devueltas\n FROM venta\n INNER JOIN detalle_venta ON venta.id = detalle_venta.venta_id\n INNER JOIN impuesto ON detalle_venta.impuesto = impuesto.porciento\n WHERE estado='0'\n AND impuesto > 0\n AND almacen_id = $almacen\n $ventascierre ORDER BY impuesto\";\n\n //echo $total_ventas_impuestos;\n\n $subtotal = 0;\n $total = 0;\n $impuesto = 0;\n $i = 0;\n $aux = 0;\n foreach ($this->connection->query($total_ventas_impuestos)->result() as $value) {\n if ($i == 0) {\n $aux = $value->porciento;\n $i = 1;\n }\n\n if ($aux != $value->porciento) {\n $aux = $value->porciento;\n $subtotal = 0;\n $total = 0;\n $impuesto = 0;\n }\n\n if ($aux == $value->porciento) {\n\n $impuesto += $this->opciones->redondear(((($value->precio_venta - $value->descuento) * $value->impuesto) / 100) * ($value->unidades - $value->cantidades_devueltas));\n $subtotal += $this->opciones->redondear(((($value->precio_venta - $value->descuento))) * ($value->unidades - $value->cantidades_devueltas));\n $total += $this->opciones->redondear((((($value->precio_venta - $value->descuento))) * ($value->unidades - $value->cantidades_devueltas)) + (((($value->precio_venta - $value->descuento) * $value->impuesto) / 100) * ($value->unidades - $value->cantidades_devueltas)));\n\n $ventas[$value->porciento] = array(\n 'porciento' => $value->porciento,\n 'nombre_impuesto' => $value->nombre_impuesto,\n 'impuesto' => $impuesto,\n 'subtotal' => $subtotal,\n 'total' => $total,\n );\n }\n }\n /* echo \"<br>impuesto=\".$impuesto;\n echo \"<br>subtotal=\".$subtotal;\n echo \"<br>total=\".$total;\n print_r($ventas);\n die(\"<br>sali\");*/\n }\n /*print_r($ventas);\n die();*/\n return $ventas;\n }", "function NUMERO_DE_HIJOS_MAYORES_ESTUDIANDO($_ARGS) {\r\n\t$_PARAMETROS = PARAMETROS();\r\n\t\r\n\tlist($a, $m)=SPLIT( '[/.-]', $_ARGS[\"PERIODO\"]); \r\n\r\n $anio = $a - 18;\r\n\t$fecha18 = \"$anio-$m-01\";\r\n\t\r\n\t $anio = $a - 25;\r\n\t$fecha25 = \"$anio-$m-01\";\r\n\r\n\t$sql = \"SELECT\r\n\t\t\t\t*\r\n\t\t\tFROM\r\n\t\t\t\trh_cargafamiliar\r\n\t\t\tWHERE\r\n\t\t\t\tCodPersona = '\".$_ARGS['TRABAJADOR'].\"' AND\r\n\t\t\t\tParentesco = 'HI' \r\n\t\t\t\tAND\tFechaNacimiento <= '\".$fecha18.\"'\r\n\t\t\t\tAND\tFechaNacimiento >= '\".$fecha25.\"'\r\n\t\t\t\tAND rh_cargafamiliar.Parentesco = 'HI' \r\n\t\t\t\tAND rh_cargafamiliar.FlagEstudia = 'S'\t\r\n\t\t\t\t\";\r\n\t$query = mysql_query($sql) or die ($sql.mysql_error());\r\n\treturn intval(mysql_num_rows($query));\r\n}", "public function vacio() {\n if ($this->cantcartas == -1)\n return TRUE;\n return FALSE;\n }", "public function obtener_reservas_mensuales($fecha) //EXCELL\n {\n\n $q_string = \"select fecha, sala, modulo, id_a, nombre_a, carrera_a from reservas where month(fecha) = month('\".$fecha.\"') and eliminada ='0' and estado ='1' group by fecha\";\n\t\t//select fecha, sala, modulo, id_a, nombre_a, carrera_a\n\t\t//from reservas\n\t\t//where month(fecha) = '06' and eliminada ='0' and estado ='1'\n\t\t//group by fecha\n\t \t $data = $this->db->query($q_string);\n\t\t return $data;\n }", "function evt__form_asignacion__agregar_dias (){\n $datos_form_asignacion=$this->dep('form_asignacion')->get_datos();\n print_r($datos_form_asignacion);\n $tipo=$datos_form_asignacion['tipo'];\n if(strcmp($tipo, 'Definitiva')==0){\n $mensaje=\" No se puede asociar fechas a asignaciones definitivas. \";\n toba::notificacion()->agregar($mensaje);\n \n }\n else{\n $fecha_inicio=$datos_form_asignacion['fecha_inicio'];\n $fecha_fin=$datos_form_asignacion['fecha_fin'];\n if(isset($fecha_inicio) && isset($fecha_fin)){\n $this->s__cargar_fechas=TRUE; //se debe poner en false cuando termina la operacion de carga\n if(!isset($tipo)){\n $datos_form_asignacion['tipo']='Periodo';\n }\n $this->s__datos_form_asignacion=$datos_form_asignacion;\n $this->set_pantalla('pant_extra');\n }\n else{\n toba::notificacion()->agregar(\" Debe especificar fecha de inicio y fin. \");\n \n }\n \n }\n \n //para restaurar el estado actual del formulario form_asignacion\n $this->s__datos_form_asignacion=$datos_form_asignacion;\n \n }", "function ultimo_dia_periodo() { \n\n $sql=\"select fecha_fin from mocovi_periodo_presupuestario where actual=true\";\n $resul=toba::db('designa')->consultar($sql); \n return $resul[0]['fecha_fin'];\n }" ]
[ "0.62381876", "0.62025577", "0.6146904", "0.6017865", "0.59610283", "0.59038466", "0.58935773", "0.5884213", "0.58777297", "0.5850989", "0.58470315", "0.5841806", "0.5779973", "0.5778349", "0.5769302", "0.5763265", "0.5751557", "0.574577", "0.5717188", "0.5713526", "0.5712035", "0.56993866", "0.5676838", "0.56721157", "0.5655601", "0.5653966", "0.56463146", "0.56417304", "0.5628217", "0.5624476", "0.5604953", "0.56014997", "0.56007355", "0.5575568", "0.5564517", "0.5563711", "0.55525887", "0.5551062", "0.5546684", "0.5539466", "0.552465", "0.5524493", "0.5522354", "0.55162555", "0.5498652", "0.54974747", "0.5489439", "0.54816884", "0.54727554", "0.5468078", "0.5459691", "0.5456805", "0.54525787", "0.5448075", "0.54431987", "0.5441771", "0.5439576", "0.5433717", "0.5432625", "0.54308033", "0.54255855", "0.54214317", "0.54113275", "0.54109484", "0.54107094", "0.5405959", "0.54053766", "0.5401476", "0.5401343", "0.5397114", "0.53941786", "0.53909093", "0.5377483", "0.53659457", "0.53626615", "0.5362554", "0.5361565", "0.53612745", "0.5360722", "0.53602326", "0.535977", "0.5358974", "0.5355175", "0.5352683", "0.53496903", "0.5343523", "0.5341425", "0.5336491", "0.53347224", "0.5328654", "0.5328424", "0.53279305", "0.5327881", "0.53174037", "0.5313528", "0.5311851", "0.53091425", "0.5302426", "0.5290993", "0.52885574", "0.5281758" ]
0.0
-1
Devuelve el motivo que se encuentra el dia de hoy en la cartelera.
public function getCurrentTheme() { //No usamos el getTodayAdvertisements, así nos ahorramos la hidratacion de cosas innecesarias return ThemeQuery::create() ->filterByBillboard($this) ->filterByCurrent() ->findOne(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function calcula13o()\n {\n }", "public function calcula13o()\n {\n }", "public function puestaACero()\n {\n $this->hh = 0;\n $this->mm = 0;\n $this->ss = 0;\n }", "public function calcularSueldo(){\n $this->horas_trabajadas * 540;\n }", "public function modalitadiPagamento(){\n $delta = substr($this->dataInizioPeriodo(), -4) - substr($this->dataFinePeriodo(), -4);\n \n if($delta != 0) {\n return \"due soluzioni, di cui la seconda al termine del contratto\";\n } else {\n return \"un'unica soluzione al termine del contratto\";\n }\n\n }", "function motivoDeAnulacionDesin(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ANULACIÓNDS' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "function motivoDeAnulacion(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ANULACIÓNRE' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "public function trae_solo_anio_actual()\n {\n return $this->fecha->year;\n }", "function motivoDeAsignacion(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ASIGNACIÓN' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "function motivoDeAnulacionAsig(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ANULACIÓNAS' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "function motivoDeAnulacionDev(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ANULACIÓNDV' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "public function getDuracion() {\n return $this->duracion;\n }", "public function puestaACero() {\n $this -> horas = 0;\n $this -> minutos = 0;\n $this -> segundos = 0;\n }", "public function incremento() {\n if ($this -> segundos == 59) {\n $this -> segundos = 0;\n if ($this -> minutos == 59) {\n $this -> minutos = 0;\n if ($this -> horas == 23) {\n $this -> horas = 0;\n }else {\n $this -> horas++;\n }\n }else {\n $this -> minutos++;\n }\n }else {\n $this -> segundos++;\n }\n }", "function get_hora_meridiano($hora){\n\t$hora = explode(\":\",$hora);\n\t$h = $hora[0];\n\t$m = $hora[1];\n\tif($h > 12){\n\t\t$h = $h - 12;\n\t\tif($h < 10){\n\t\t\t$h = '0'.$h;\n\t\t}\n\t\t$h = $h.':'.$m.' pm';\t\t\n\t}else{\n\t\tif($h == 12){\n\t\t\t$h = $h.':'.$m.' m';\n\t\t}else{\n\t\t\t$h = $h.':'.$m.' am';\n\t\t}\t\t\n\t}\n\treturn $h;\n}", "public function mes(){\n\n\t\t$date = $this->dia;\n $date = DateTime::createFromFormat('Y-m-d', $date);\n \t \n\t\treturn $date->format('m') - 1;\n\t}", "public function possuiCalculoPorDiaDoMes() {\n return $this->lControleDiasNoMes;\n }", "function calc_chegada($partida,$tempo){\n \n \n $aux=split(\":\",$partida);\n\t\t$p=mktime($aux[0],$aux[1],$aux[2]);\n\n\t\t$aux=split(\":\",$tempo);\n\t\t$t=$aux[0]*3600+$aux[1]*60+$aux[2];\n\t\t\n\t\t$c=strftime(\"%H:%M:%S\",$p+$t);\n\t\t//echo \"$p<br>\";\n\t\t//echo \"$t<br>\";\n // echo $t+$p . \"<br>\";\n //echo \"$c<br>\";\n\t\t\n\t\treturn $c;\n }", "function DIA_DE_LA_SEMANA($_FECHA) {\r\n\t// primero creo un array para saber los días de la semana\r\n\t$dias = array(0, 1, 2, 3, 4, 5, 6);\r\n\t$dia = substr($_FECHA, 0, 2);\r\n\t$mes = substr($_FECHA, 3, 2);\r\n\t$anio = substr($_FECHA, 6, 4);\r\n\t\r\n\t// en la siguiente instrucción $pru toma el día de la semana, lunes, martes,\r\n\t$pru = strtoupper($dias[intval((date(\"w\",mktime(0,0,0,$mes,$dia,$anio))))]);\r\n\treturn $pru;\r\n}", "function fecha_menor($diainicio,$diafin,$mesinicio,$mesfin,$anioinicio,$aniofin){\r\n\r\n$dif_en_meses=(($mesfin-$mesinicio)+(12*($aniofin-$anioinicio)));\r\n\r\nif($dif_en_meses<0){return(0);}\r\nif(($dif_en_meses==0) && ($diafin<$diainicio)){return(0);}\r\nreturn(1);\r\n}", "function moisActuel()\n{\n\t$dateActuelle = date(\"d/m/Y\");\n\t@list($jour, $mois, $annee) = explode('/', $dateActuelle);\n\t//$annee--;\n\t$moisActuel = $mois;\n\treturn $annee . $moisActuel;\n}", "public function reiniciarMedio($tiempo) {\n $tiempo2 = $tiempo->time();\n $hora = date('H', $tiempo2);\n $minutos = date('i', $tiempo2);\n $segundos = date('s', $tiempo2);\n\n if ($hora == '00' && $minutos == '00' && $segundos == '00')\n {\n $this->vecesUsado = 0;\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }", "function get_convocatoria_actual_otro(){\n $actual=date('Y-m-d');\n $anio_actual= date(\"Y\", strtotime($actual));\n \n $sql=\"select id_conv from convocatoria_proyectos \"\n .\" where fec_inicio<='\".$actual.\"' and fec_fin >='\".$actual.\"'\"\n . \" and id_tipo=2\";\n $resul=toba::db('designa')->consultar($sql);\n if(count($resul)>0){\n return $resul[0]['id_conv'];\n }else \n return null;\n }", "function ver_dia($k,$hoy_es,$hoy)\n{\n\t$fdia = explode(\"-\",$hoy);\n\tif($k==$hoy_es)\n\t\t$fecha=$hoy;\n\telse\n\t\tif($k<$hoy_es)\n\t\t{\n\t\t\t$diferencia = $hoy_es - $k;\n\t\t\t$fecha = date(\"d-m-Y\",mktime(0, 0, 0, $fdia[1] , $fdia[0]-$diferencia, $fdia[2]));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$diferencia = $k - $hoy_es;\n\t\t \t$fecha = date(\"d-m-Y\",mktime(0, 0, 0, $fdia[1] , $fdia[0]+$diferencia, $fdia[2]));\n\t\t}\n\treturn $fecha;\n}", "public function motivoDesconexao($motivo) {\n $motivos = array(\n 'NAS-Request' => 'Solicitada pelo NAS.',\n 'User-Request' => 'Solicitada pelo usu&aacute;rio.',\n 'Lost-Service' => 'Conex&atilde;o interrompida.',\n 'Idle-Timeout' => 'Expirado por falta de atividade na rede.',\n 'Admin-Reset' => 'Resetada pelo administrador.',\n 'Session-Timeout' => 'Tempo de conex&atilde;o esgotado.',\n 'Admin-Reboot' => 'Reboot do administrador.',\n 'Lost-Carrier' => 'Conex&atilde;o interrompida.',\n 'NAS-Reboot' => 'Concentrador reiniciado.',\n '' => ''\n );\n return $motivos[$motivo];\n }", "function Fecha_dia($Ingresodia){\t\n$dia1 = new DateTime($Ingresodia);\n$dia = $dia1->format('d');\n$cadena = (\"$dia\");\nreturn $cadena;\n}", "private function ageChaton() { \n $datenow = new DateTime(\"now\");\n $result = date('Y-m-d', strtotime('-365 day')); //-12 mois\n\n return $result;\n }", "public function getFechaComentario()\n {\n return $this->fecha_comentario;\n }", "public function getAtraso() \n {\n // verifica se o atras ja foi calculado\n if (!$this->atraso) { \n $dataAtual = time();\n $vencimento = strtotime(Helper::dateUnmask($this->data_vencimento, Helper::DATE_DEFAULT));\n $diferenca = $dataAtual - $vencimento;\n\n // calcula o atraso e\n // não considera o dia do vencimento\n $this->atraso = round($diferenca / (60 * 60 * 24)) - 1;\n \n // valida o atraso negativo\n if ($this->atraso < 0) {\n $this->atraso = 0;\n }\n }\n \n return $this->atraso;\n }", "function primer_dia_periodo() {\n\n $sql=\"select fecha_inicio from mocovi_periodo_presupuestario where actual=true\";\n $resul=toba::db('designa')->consultar($sql);\n return $resul[0]['fecha_inicio'];\n \n }", "function moisAnPasse()\n{\n\t$dateActuelle = date(\"d/m/Y\");\n\t@list($jour, $mois, $annee) = explode('/', $dateActuelle);\n\t$annee--;\n\t$moisActuel = $annee . $mois;\n\treturn $moisActuel;\n}", "function fecha_no_paso($dia,$mes,$anio){\r\n$dia_hoy=date(\"d\");\r\n$mes_hoy=date(\"m\");\r\n$anio_hoy=date(\"Y\");\r\n\r\n$dif_en_meses=(($mes-$mes_hoy)+(12*($anio-$anio_hoy)));\r\n\r\nif($dif_en_meses<0){return(0);}\r\nif(($dif_en_meses==0) && ($dia<$dia_hoy)){return(0);}\r\nreturn(1);\r\n}", "function calcula_numero_dia_semana($dia,$mes,$ano){\r\n\t$nrodiasemana = date('w', mktime(0,0,0,$mes,$dia,$ano));\r\n\treturn $nrodiasemana;\r\n}", "function calcula_numero_dia_semana($dia,$mes,$ano){\r\n\t$nrodiasemana = date('w', mktime(0,0,0,$mes,$dia,$ano));\r\n\treturn $nrodiasemana;\r\n}", "protected function convertirMayuscula(){\n $cadena=strtoupper($this->tipo);\n $this->tipo=$cadena;\n }", "public function traerCualquiera()\n {\n }", "function diasvenc($fechamov,$diascred){\n\t\t$a=ceil((time() - (strtotime($fechamov)))/(60* 60*24))-$diascred;\n\t\t//if($a>0){$amod=$a;}else{$amod=0;}\n\t\t$amod = ($a < 0 ? 0 : $a);\n\t\treturn $amod;\n\t}", "function motivoDeRecepcion(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='RECEPCIÓN' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "function CalculaIdade( $data ) {\n\t//Data atual\n\t$dia = date ('d');\n\t$mes = date ('m');\n\t$ano = date ('Y');\n\t//Data do aniversário\n\t$dianasc = substr ( $data , 8, 2);\n\t$mesnasc = substr ( $data , 5, 2);\n\t$anonasc = substr ( $data , 0, 4);\n\t//Calculando sua idade\n\t$idade = $ano - $anonasc;\n\tif ($mes < $mesnasc){\n\t\t$idade--;\n\t\treturn $idade;\n\t}elseif ($mes == $mesnasc and $dia <= $dianasc) {\n\t\t$idade--;\n\t\treturn $idade;\n\t}else{\n\t\treturn $idade;\n\t}\n}", "private static function setHorarioDeVerao() {\n $dataJunta = self::getAnoAtual() . self::getMesAtual() . self::getDiaAtual();\n //self::$horario_de_verao = ($dataJunta > '20121021' && $dataJunta < '20130217' ) ? true : false;\n self::$horario_de_verao = (date('I') == \"1\") ? true : false;\n return self::getHorarioDeVerao();\n }", "function adjudicarTodo(){\n $this->procedimiento='adq.f_cotizacion_ime';\n $this->transaccion='ADQ_ADJTODO_IME';\n $this->tipo_procedimiento='IME';\n \n //Define los parametros para la funcion\n $this->setParametro('id_cotizacion','id_cotizacion','int4');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "public function dias_del_mes(){\n \n $fecha= date('Y-m-d');\n return; date('t',strtotime($fecha));\n \n}", "function ultimoDiaMes($x_fecha_f){\r\n\techo \"entra a ultimo dia mes con fecha \".$x_fecha_f.\"<br>\";\r\n\t\t\t\t\t$temptime_f = strtotime($x_fecha_f);\t\r\n\t\t\t\t\t$x_numero_dia_f = strftime('%d', $temptime_f);\r\n\t\t\t\t\t$x_numero_mes_f = strftime('%m', $temptime_f);\r\n\t\t\t\t\techo \"numero mes\".$x_numero_mes_f.\"<br>\";\r\n\t\t\t\t\t$x_numero_anio_f = strftime('%Y', $temptime_f);\r\n\t\t\t\t\t$x_ultimo_dia_mes_f = strftime(\"%d\", mktime(0, 0, 0, $x_numero_mes_f+2, 0, $x_numero_anio_f));\r\n\techo \"el ultimo dia de mes es\".\t$x_ultimo_dia_mes_f .\"<br>\";\t\t\t\r\n\treturn $x_ultimo_dia_mes_f;\r\n}", "function horas_em_mintutos($hora)\n{\n\n if ($hora == '') {\n $hora = '00:00';\n }\n\n $h1 = explode(\":\", $hora);\n\n\n $minuto = $h1[1];\n $horas = $h1[0];\n\n\n if ($horas > 0) {\n\n if (substr($horas, 0, 1) == 0) {\n $horas = substr($horas, 1, 1);\n }\n\n $horas = $horas * 60;\n\n $minuto = $minuto + $horas;\n }\n\n\n\n\n return $minuto;\n}", "public function getPazientiMedico() {\n return $this->_pazienti;\n }", "function setLlamadasDiariasCreditos360($fecha_operacion){\n\t//TODO: Terminar esta canija funcion\n\t$msg\t= \"====================== GENERAR_LLAMADAS_POR_CREDITOS_360 \\r\\n\";\n\t$msg\t.= \"====================== SE OMITEN \\r\\n\";\n\treturn $msg;\n}", "public function fechaVigencia() // funcion que suma fecha usada para años biciestos\n\t{\n\n\t\t$fecha = $_GET['fecha'];\n\t\t$nuevafecha = strtotime('+365 day', strtotime($fecha));\n\t\t$nuevafecha = date('Y-m-d', $nuevafecha);\n\t\treturn $nuevafecha;\n\t}", "function get_hora_bd($hora){\n\t$h = substr($hora,0,2);\n\t$m = substr($hora,3,2);\n\t$meridiano = substr($hora,-2,2);\n\tif($meridiano == 'pm'){\n\t\t$h = $h + 12;\n\t\t$h = $h.':'.$m.':00';\n\t}else{\n\t\t$h = $h.':'.$m.':00';\n\t}\n\treturn $h;\n}", "function obtenerPeriodoActual($conexion)\n{\n $anoActual = date('Y');\n $mesActual = date('m');\n\n if ($mesActual > 6) {\n $sentencia = \"select idPeriodo from periodo where AnoInicio=\" . $anoActual;\n } elseif ($mesActual <= 6) {\n $sentencia = \"select idPeriodo from periodo where AnoInicio=\" . ($anoActual - 1);\n }\n\n $conexion->Ejecuto($sentencia);\n $periodo = $conexion->Siguiente();\n return $periodo['idPeriodo'];\n}", "function MESES_ANTIGUEDAD($_ARGS) {\r\n\t$fingreso = FECHA_INGRESO($_ARGS);\r\n\t$periodo_actual = $_ARGS['HASTA'];\r\n\tlist($anios, $meses, $dias) = TIEMPO_DE_SERVICIO(formatFechaDMA($fingreso), formatFechaDMA($periodo_actual));\r\n\t$cantidad = $meses + ($anios * 12);\r\n\treturn $cantidad;\r\n}", "public function get_codigo_muestra($cod_muestra){\n $fecha = getdate();\n $dia = $fecha[\"mday\"];\n $mes = $fecha[\"mon\"];\n $año = $fecha[\"year\"];\n $año_=substr($año,2);\n \n while($datos = mysqli_fetch_array($cod_muestra)){\n $codigo_muestra = $datos['codigo_muestra'];\n }\n if($codigo_muestra!=\"\"){\n (int)$primer_digito = substr($codigo_muestra,0,4);\n $num = ((int)$primer_digito+1);\n\n $codigo_muestra = $num.\"-\".$dia.\"-\".$mes.\"-\".$año_.\"-\".$num;\n \n return ltrim($codigo_muestra);\n\n }else{\n $codigo_muestra =\"100\".\"-\".$dia.\"-\".$mes.\"-\".$año_.\"-\".\"100\";\n return $codigo_muestra;\n }\n\n }", "public function horas_contratadas_dia(int $y,int $m,int $d):int{\n\t\t$contratadas=strtotime($this->hora_salida)-strtotime($this->hora_entrada);\n\t\treturn $contratadas;\n\t}", "protected function getMois()\n{\nreturn substr($this->getDateSysteme(), 5, 2);\n}", "public function smanjiCenu(){\n if($this->getGodiste() < 2010){\n $discount=$this->cenapolovnogauta*0.7;\n return $this->cenapolovnogauta=$discount;\n }\n return $this->cenapolovnogauta; \n }", "function formatear_hora($parametro){\n\n\t\t/* Declaro variables personalizadas para que queden claros los datos */\n\t\t$hora = substr($parametro, 11, 2);\n\t\t$minuto = substr($parametro, 14, 2);\n\t\t$dia = substr($parametro, 8, 2);\n\t\t$mes = substr($parametro, 5, 2);\n\t\t\n\t\t/* Generamos el formato */\n\t\t$temp = $hora.\":\".$minuto;\n\t\t\n\t\treturn $temp;\n\t}", "function leerlafecha($fechaentrada, $idioma) {\n\t\t//devuelve variables en el idioma dado por la variable $idioma que puede valer 'cas' o 'cat'\n\t\t//Así podremos leer la fecha en formato humanoide.\n\t\t\n\t\tdate_default_timezone_set('Europe/Madrid');\t//Esta definicion de la zona horaria me la pide el php del hosting en freehostia.com para dejarme usar strtotime en el script\n\t\t\n\t\t//Dependiendo del idioma definimos los nombres de los meses del año y los dias de la semana\n\t\tif ($idioma == 'cat' or empty($idioma)) {$anno = array (\"gener\", \"febrer\", \"març\", \"abril\", \"maig\", \"juny\", \"juliol\", \"agost\", \"setembre\", \"octubre\", \"novembre\", \" desembre \"); $dias = array ('', 'Dilluns', 'Dimarts', 'Dimecres', 'Jueves', 'Divendres', 'Dissabte', 'Diumenge');}\n\t\telse if ($idioma == 'cas') {$anno = array(\"enero\", \"febrero\", \"marzo\", \"abril\",\"mayo\",\"junio\",\"julio\",\"agosto\",\"septiembre\",\"octubre\",\"noviembre\",\"diciembre\"); $dias = array('','Lunes','Martes','Miercoles','Jueves','Viernes','Sabado','Domingo');}\n\t\t\n\t\tif (empty($fechaentrada)==false){\n\t\t\t$dia = substr ($fechaentrada, 8 , 2 ); //número del dia\n\t\t\t$mesnumerico = substr($fechaentrada,5,2); //número del mes\n\t\t\t$ano = substr ($fechaentrada,0,4); //número del año\n\t\t\t$indicemes = intval($mesnumerico) - 1;\n\t\t\t$nombremes = $anno[$indicemes]; //nombre del mes en el idioma escojido\n\t\t\t$nombredia = $dias[date('N', strtotime($fechaentrada))]; //nombre del dia en el idioma elejido\n\t\t}\n\t\t\n\t\t return array ($dia,$mesnumerico,$ano,$nombremes,$nombredia);\n\t\t\n\t}", "function Fecha_mes_n2($Ingresomes_c){\t\n$mes_mes_c = new DateTime($Ingresomes_c);\n$mes = $mes_mes_c->format('m');\nreturn $mes;\n}", "public function desligarMudo() {\n if ($this->getLigado() && $this->getVolume == 0) {\n $this->setVolume(50);\n }\n }", "public function cadastrar() \n{\n //DEFINIR A DATA\n $this->data = date(\"Y:m:d H:i:s\");\n \n //INSERIR A VAGA NO BANCO\n\n //ATRIBUIR O ID NA VAGA DA INSTANCIA\n\n //RETORNAR SUCESSO\n\n}", "public function contarTempo(){\n $this->barraProgresso->set_fraction(($this->segundos)*(1.0/$this->tempoMax));\n //Coloca a contagem regressiva na tela de progesso\n $this->barraProgresso->set_text($this->tempoMax-$this->segundos);\n //$this->barraProgresso->set_show_tex(true);\n $this->segundos++;\n //Chama a tela de alerta caso o tempo máximo seja atingindo.\n if ($this->segundos ==$this->tempoMax+1){\n $this->zerarTempo();\n //Faz parar a contagem de tempo\n $this->pararContagem();\n $this->telaCampo->perder();\n }\n return $this->contar;\n }", "function deDiaDeLaSemanaPhpaDiaDelaSemanaHumano($dia_de_la_semana_php) {\n $respuesta = \"\";\n if($dia_de_la_semana_php == 0) $respuesta = \"domingo\";\n if($dia_de_la_semana_php == 1) $respuesta = \"lunes\";\n if($dia_de_la_semana_php == 2) $respuesta = \"martes\";\n if($dia_de_la_semana_php == 3) $respuesta = \"miercoles\";\n if($dia_de_la_semana_php == 4) $respuesta = \"jueves\";\n if($dia_de_la_semana_php == 5) $respuesta = \"viernes\";\n if($dia_de_la_semana_php == 6) $respuesta = \"sabado\";\n return $respuesta;\n }", "public function getDiaCalendario(){\n return $this->diaCalendario;\n }", "function dia ($hra){\r\t\tif ($hra==1 || $hra==7 || $hra==13 || $hra==19 || $hra==25 || $hra==31 || $hra==37 || $hra==43 || $hra==49)\r\t\t{\r\t\treturn 'Lunes';\t\r\t\t}else {\r\t\t\tif ($hra==2 || $hra==8 || $hra==14 || $hra==20 || $hra==26 || $hra==32 || $hra==38 || $hra==44 || $hra==50)\r\t\t{\r\t\treturn 'Martes';\t\r\t\t}else {\r\t\t\tif ($hra==3 || $hra==9 || $hra==15 || $hra==21 || $hra==27 || $hra==33 || $hra==39 || $hra==45 || $hra==51)\r\t\t{\r\t\treturn 'Miercoles';\t\r\t\t}else {\r\t\t\tif ($hra==4 || $hra==10 || $hra==16 || $hra==22 || $hra==28 || $hra==34 || $hra==340 || $hra==46 || $hra==52)\r\t\t{\r\t\treturn 'Jueves';\t\r\t\t}else {\r\t\t\tif ($hra==5 || $hra==11 || $hra==17 || $hra==23 || $hra==29 || $hra==35 || $hra==41 || $hra==47 || $hra==53)\r\t\t{\r\t\treturn 'Viernes';\t\r\t\t}else {\r\t\t\tif ($hra==6 || $hra==12 || $hra==18 || $hra==24 || $hra==30 || $hra==36 || $hra==42 || $hra==48 || $hra==54)\r\t\t{\r\t\treturn 'Sabado';\t\r\t\t}\r\t\t}\r\t\t}\r\t\t}\r\t\t}\r\t\t}\r\t}", "function verificarSolapamiento($horario, $duracion, $idTeatroNuevaFuncion){\r\n $funcionTeatro = new FuncionTeatro('', '', '', '', '');\r\n $coleccionFuncionesTeatro = $funcionTeatro->listar(\"\");\r\n $cine = new Cine('','','','','','','');\r\n $coleccionCines = $cine->listar(\"\");\r\n $musical = new Musical('','','','','','','');\r\n $coleccionMusicales = $musical->listar(\"\");\r\n\r\n $retorno = false;\r\n\r\n list($horaFuncion, $minutosFuncion) = explode(\":\", $horario); //Extraigo la hora y los minutos separados por el \":\"\r\n $hora = intval($horaFuncion); //Convierto la hora de string a entero\r\n $minutos = intval($minutosFuncion); //Convierto los minutos de string a entero\r\n\r\n $horarioInicioFuncion = (($hora * 60) + $minutos); //Convierto el horario de INICIO de la nueva funcion a minutos\r\n $horarioCierreFuncion = $horarioInicioFuncion + $duracion; //Horario de CIERRE de la nueva funcion\r\n\r\n $horarioFuncionNueva = array('inicio'=>$horarioInicioFuncion, 'cierre'=>$horarioCierreFuncion);\r\n\r\n $coleccionHorarios = [];\r\n\r\n //Sumo los horarios de cada tipo\r\n $coleccionHorarios = armarColeccionHorarios($coleccionFuncionesTeatro, $idTeatroNuevaFuncion, $coleccionHorarios);\r\n $coleccionHorarios = armarColeccionHorarios($coleccionCines, $idTeatroNuevaFuncion, $coleccionHorarios);\r\n $coleccionHorarios = armarColeccionHorarios($coleccionMusicales, $idTeatroNuevaFuncion, $coleccionHorarios);\r\n\r\n if (count($coleccionHorarios)>0){\r\n $horarioDisponible = verificarHorario($horarioFuncionNueva, $coleccionHorarios);\r\n if ($horarioDisponible){\r\n $retorno = true;\r\n }\r\n } else {\r\n $retorno = true;\r\n }\r\n\r\n return $retorno;\r\n}", "public function moverse(){\n\t\techo \"Soy $this->nombre y me estoy moviendo a \" . $this->getVelocidad();\n\t}", "public function vr_hora()\n {\n\n $valor=$this->vr_hora;\n\n if ($this->id_tipotitulo == 3)\n {\n $valor='10208';\n } elseif ($this->id_tipotitulo == 4) {\n $valor='15122';\n } elseif ($this->id_tipotitulo == 5) {\n $valor='19096';\n } elseif ($this->id_tipotitulo == 7) {\n $valor='23252';\n } elseif ($this->id_tipotitulo == 10) {\n $valor='27014';\n } elseif ($this->id_tipotitulo == 9) {\n $valor='10208';\n } elseif ($this->id_tipotitulo == 11) {\n $valor='10208'; }\n elseif ($this->id_tipotitulo == 12) {\n $valor='0';\n }\n\n\n return $valor;\n\n }", "public function getUltimoDiaMes($elAnio,$elMes) {\n return date(\"d\",(mktime(0,0,0,$elMes+1,1,$elAnio)-1));\n }", "function mot($chaine){\r\n $retourFinal = \"faux\";\r\n for($i=0;$i<laTaille($chaine);$i++){\r\n if(testAlphabet($chaine[$i])==\"vrai\"){\r\n $retour[$i]=\"vrai\";\r\n }\r\n else{\r\n $retour[$i]=\"faux\";\r\n }\r\n }\r\n $j=0;\r\n while($j<laTaille($chaine) && $retour[$j]==\"vrai\"){\r\n $j++;\r\n }\r\n if($j==laTaille($chaine)){\r\n $retourFinal = \"vrai\";\r\n }\r\n return $retourFinal;\r\n }", "function Fecha_mes_n($Ingresomes_c){\t\n$mes_mes_c = new DateTime($Ingresomes_c);\n$me = $mes_mes_c->format('m');\n$mes='';\nif($me=='01') $mes='01';\nif($me=='02') $mes='02';\nif($me=='03') $mes='03';\nif($me=='04') $mes='04';\nif($me=='05') $mes='05';\nif($me=='06') $mes='06';\nif($me=='07') $mes='07';\nif($me=='08') $mes='08';\nif($me=='09') $mes='09';\nif($me=='10') $mes='10';\nif($me=='11') $mes='11';\nif($me=='12') $mes='12';\n$cadena = (\"$mes\");\nreturn $cadena;\n}", "function dia_letras($dia){\t\n\t\t\t\t\t\t\t\t\t\n\t\t\tswitch($dia)\n\t\t\t{\n\t\t\tcase 1:\n\t\t\t $dia_letras=\"Lunes\";\n\t\t\t break;\n\t\t\tcase 2:\n\t\t\t $dia_letras=\"Martes\";\n\t\t\t break;\n\t\t\tcase 3:\n\t\t\t $dia_letras=\"Miercoles\";\n\t\t\t break;\n\t\t\tcase 4:\n\t\t\t $dia_letras=\"Jueves\";\n\t\t\t break;\n\t\t\tcase 5:\n\t\t\t $dia_letras=\"Viernes\";\n\t\t\t break;\n\t\t\t case 6:\n\t\t\t $dia_letras=\"Sabado\";\n\t\t\t break;\n\t\t\tcase 0:\n\t\t\t $dia_letras=\"Domingo\";\t\t \n\t\t\t break;\n\t\t\tcase 10:\n\t\t\t $dia_letras=\"Festivo\";\n\t\t\t break;\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $dia_letras;\n\t\t\t\n\t\t}", "public function tocar(){\n echo \"Tocando no volume: \" . $this->volume . \" decibéis. <br>\";\n }", "function acrescenta_min($horario, $minutos){\n $time = new DateTime($horario);\n $time->add(new DateInterval('PT' . $minutos . 'M'));\n return $stamp = $time->format('Y-m-d H:i:s');\n}", "function comprobar_fecha_inicio($fecha_entrada,$fecha_salida){\r\n // echo $fecha_salida;\r\n //echo $fecha_actual = strtotime(date(\"d-m-Y H:i:00\",time()));\r\n if( (empty($fecha_entrada))){\r\n return 'Las fechas no pueden estar vacias';\r\n }\r\n}", "public function getComentario()\n {\n return $this->comentario;\n }", "public function getDeterminarMetodologiaCalculo()\r\n\t\t{\r\n\t\t\t// Se refiere al parametro \"base-calculo\" de la entidad \"tipos-propagandas\".\r\n\t\t\t$idMetodo = 0;\r\n\r\n\t\t\t$tipo = self::getDatosPropaganda()->tipoPropaganda;\r\n\t\t\tif ( isset($tipo->base_calculo) ) {\r\n\t\t\t\t$idMetodo = (int)$tipo->base_calculo;\r\n\t\t\t}\r\n\t\t\treturn $idMetodo;\r\n\t\t}", "function horaire($horaire) {\r\n\t// affiche un nombre d'heures correctement formatté\r\n\t$horaire = ($horaire && $horaire !=='')? $horaire.\" h\":\"\";\r\n\treturn $horaire;\r\n}", "function ultimo_dia_periodo() { \n\n $sql=\"select fecha_fin from mocovi_periodo_presupuestario where actual=true\";\n $resul=toba::db('designa')->consultar($sql); \n return $resul[0]['fecha_fin'];\n }", "function quita_segundos($hora)\n{\n\t$sin_sec=explode(\":\",$hora);\n\t$final = $sin_sec[0].\":\".$sin_sec[1];\n\treturn $final;\n}", "public function tempoConexao($dataInicial, $dataFinal) {\n\n $dataInicial = strtotime($dataInicial);\n $dataFinal = strtotime($dataFinal);\n\n $dias = ($dataFinal - $dataInicial) / 86400;\n $tempo = $dataFinal - $dataInicial;\n $horas = 0;\n $minutos = 0;\n\n if ($tempo % 86400 <= 0) {\n $dias = $tempo / 86400;\n }\n\n if ($tempo % 86400 > 0) {\n\n $fatorResto = ($tempo % 86400);\n $dias = ($tempo - $fatorResto) / 86400;\n\n if ($fatorResto % 3600 > 0) {\n\n $fatorResto1 = ($fatorResto % 3600);\n $horas = ($fatorResto - $fatorResto1) / 3600;\n\n if ($fatorResto1 % 60 > 0) {\n\n $fatorResto2 = ($fatorResto1 % 60);\n $minutos = ($fatorResto1 - $fatorResto2) / 60;\n $segundos = $fatorResto2;\n } else {\n\n $minutos = $fatorResto1 / 60;\n }\n } else {\n\n $horas = $fatorResto / 3600;\n }\n }\n\n $segundos = (isset($segundos)) ? $segundos : '';\n\n $fatorPluralDias = ($dias > '1') ? 's' : '';\n $fatorPluralHoras = ($horas > '1') ? 's' : '';\n $fatorPluralMinutos = ($minutos > '1') ? 's' : '';\n $fatorPluralSegundos = ($segundos > '1') ? 's' : '';\n\n $resposta = \"\";\n\n if ($dias != \"\") {\n $resposta .= $dias . \" dia\" . $fatorPluralDias . \" \";\n }\n\n if ($horas != \"\") {\n $resposta .= $horas . \" hora\" . $fatorPluralHoras . \" \";\n }\n\n if ($minutos != \"\") {\n $resposta .= $minutos . \" minuto\" . $fatorPluralMinutos . \" \";\n }\n\n if ($segundos != \"\") {\n $resposta .= $segundos . \" segundo\" . $fatorPluralSegundos . \" \";\n }\n\n return($resposta);\n }", "public function getLargoChapaAdicional()\r\n\t{\r\n\t\tif($this->chapaPisoAdicional == 1){\r\n\t\t\treturn $this->apoyoTapas;\r\n\t\t}else{return 0;}\r\n\t}", "public function enviarNumero( ) {\n $cmd = new ComandoFlash(\"VIDEOCONFERENCIA\", \"MARCADO\",$this->getNumeroIP());\n $this->enviarPeticion($cmd->getComando());\n\n }", "function procesar_cambio ($datos){\n //validamos que no exista otro periodo, para ello tomamos la fecha actual y obtenemos todos los periodo \n //que existen con sus respectivos dias y verificamos que el espacio que se quiere cargar no este ocupado en esos \n //dias\n \n }", "function getDay()\r\n {\r\n return $this->dia;\r\n }", "public function crearDia($dia1, $sucursal, $mes) {\n $dia = new Dia();\n\n\n # Set the parameters\n $dia->numDia = $dia1;\n setlocale(LC_TIME, 'es_ES');\n $formato = 'd-m-Y';\n #$diaSemana = DateTime::createFromFormat($formato, $dia->numDia.'-'.$mes->mes.'-'.$mes->ano)->format('l');\n setlocale(LC_TIME, 'es_ES.UTF8'); ##GOP ojo cambiar en produccion\n #setlocale(LC_TIME, 'es_ES');\n $fecha = DateTime::createFromFormat($formato, $dia->numDia.'-'.$mes->mes.'-'.$mes->ano);\n $dia->diaSemana = strftime(\"%A\", $fecha->getTimestamp());\n #dd($dia->diaSemana);\n if($dia->diaSemana == \"sábado\" or $dia->diaSemana == \"domingo\"){\n $dia->estatus = 0;\n }else{\n $dia->estatus = 1;\n }\n $dia->mes_id = $mes->id;\n\n $dia->mes()->associate($mes);\n\n $dia->save();\n\n\n\n\n\n $start = new \\DateTime($sucursal->horaInicio);\n $end = new \\DateTime($sucursal->horaFin);\n $start = $start->sub(new \\DateInterval('PT30M'));\n while($start < $end){\n $hr = $start->add(new \\DateInterval('PT30M'));\n $this->crearHora($hr, $sucursal,$dia);\n }\n\n return true;\n\t}", "public function getComentario()\n {\n return $this->comentario;\n }", "public function getEstimacionEntrega()\n {\n \tif ( $this->getIdEshop() ) {\n \t\treturn 'Envío en 96hs Hábiles';\n \t}\n\n $campana = campanaTable::getInstance()->getFirstByIdProducto( $this->getIdProducto() );\n \n\t\tif ( $campana )\n { \n\n \tif ( $campana->getIdCampana() == 2776 ) {\n\t \t\treturn 'FECHA ESTIMADA DE ENVÍO ENTRE EL 06 DE NOVIEMBRE Y EL 14 DE NOVIEMBRE.';\n\t \t}\n\n if ( $campana && $campana->getIdCampana() == 2798 ) {\n return 'FECHA ESTIMADA DE ENVÍO ENTRE EL 13 DE NOVIEMBRE Y EL 21 DE NOVIEMBRE.';\n }\n\n\n if ( $campana->getEstimacionEnvioFecha() )\n {\n return 'Fecha estimada de envío: ' . strftime('%e de %B', strtotime($campana->getEstimacionEnvioFecha()));\n }\n elseif ( $campana->getEstimacionEnvioHoras() )\n {\n return 'Envío en ' . $campana->getEstimacionEnvioHoras() . 'hs Hábiles';\n }\n else\n {\n $timestampFechaFinCampana = strtotime($campana->getFechaFin());\n \n $desde = pmDateHelper::getInstance()->sumarDiasHabiles( 5, 'Y-m-d', $timestampFechaFinCampana);\n $hasta = pmDateHelper::getInstance()->sumarDiasHabiles( 10, 'Y-m-d', $timestampFechaFinCampana );\n \n return 'Fecha estimada de envío entre el ' . strftime('%e de %B', strtotime($desde)) . ' y el ' . strftime('%e de %B', strtotime($hasta)) . '.';\n }\n }\n \n if ( $this->getEsOutlet() )\n {\n $outletData = configuracionTable::getInstance()->getOutlet();\n $outletData = json_decode($outletData->getValor(), true);\n \n if ( $outletData['estimacion_envio_fecha'] )\n {\n return 'Fecha estimada de envío: ' . strftime('%e de %B', strtotime( $outletData['estimacion_envio_fecha'] ));\n }\n elseif ( $outletData['estimacion_envio_horas'] )\n {\n return 'Envío en ' . $outletData['estimacion_envio_horas'] . 'hs Hábiles';\n }\n else\n {\n $timestampFechaFin = strtotime( $outletData['fecha_fin'] );\n \n $desde = pmDateHelper::getInstance()->sumarDiasHabiles( 5, 'Y-m-d', $timestampFechaFin);\n $hasta = pmDateHelper::getInstance()->sumarDiasHabiles( 10, 'Y-m-d', $timestampFechaFin );\n \n return 'Fecha estimada de envío entre el ' . strftime('%e de %B', strtotime($desde)) . ' y el ' . strftime('%e de %B', strtotime($hasta)) . '.';\n } \n }\n \n $timestampFecha = time();\n $desde = pmDateHelper::getInstance()->sumarDiasHabiles( 5, 'Y-m-d', $timestampFecha );\n $hasta = pmDateHelper::getInstance()->sumarDiasHabiles( 10, 'Y-m-d', $timestampFecha );\n \n return 'Fecha estimada de envío entre el ' . strftime('%e de %B', strtotime($desde)) . ' y el ' . strftime('%e de %B', strtotime($hasta)) . '.';\n }", "function Fecha_mes_c($Ingresomes_c){\t\n$mes_mes_c = new DateTime($Ingresomes_c);\n$me = $mes_mes_c->format('m');\n$mes='';\nif($me=='01') $mes='Ene';\nif($me=='02') $mes='Feb';\nif($me=='03') $mes='Mar';\nif($me=='04') $mes='Abr';\nif($me=='05') $mes='May';\nif($me=='06') $mes='Jun';\nif($me=='07') $mes='Jul';\nif($me=='08') $mes='Ago';\nif($me=='09') $mes='Sep';\nif($me=='10') $mes='Oct';\nif($me=='11') $mes='Nov';\nif($me=='12') $mes='Dic';\n$cadena = (\"$mes\");\nreturn $cadena;\n}", "public function actionMuestraPuntoHumedad(){\n $dataHumedad= Test::model()->consultaPuntoHumedad();\n $time=strtotime ( $dataHumedad[\"date_test\"] )*1000;\n echo CJSON::encode(array(\"humedad\"=>(double)$dataHumedad[\"humedad\"],\"time\"=>$time)); \n }", "protected function getPeriodicidad() {\n\t\treturn 'mensual';\n\t}", "public function getAtualizadoEm()\n {\n return $this->atualizadoEm;\n }", "public function testTrasbordoMedio()\n {\n $tiempo = new TiempoFalso;//$tiempo = new TiempoFalso(0);\n $recargable = new Recargable();\n $tarjeta = new Medio(0, $tiempo,$recargable);\n $tiempo->avanzar(28800);\n $tarjeta->recargar(100);\n $tarjeta->recargar(100);\n $colectivo1 = new Colectivo(122, \"Semtur\", 37);\n $colectivo2 = new Colectivo(134, \"RosarioBus\", 52);\n\t\t$saldoEsperado =200;\n\n /*\n Pruebo pagar un trasbordo un dia feriado con 90 minutos de espera y el texto del boleto\n */\n $boleto = $colectivo1->pagarCon($tarjeta);\n\t\t$saldoEsperado=$saldoEsperado-(32.50/2);\n $this->assertEquals(date('N', $tiempo->time()), '4');\n $this->assertEquals(date('G', $tiempo->time()), '8');\n $this->assertEquals(date('d-m', $tiempo->time()), \"01-01\");\n $this->assertEquals($tarjeta->obtenerSaldo(), $saldoEsperado);\n\n $tiempo->avanzar(4200);\n\t\t$saldoEsperado=$saldoEsperado-((32.50/2)*0);\n $boleto2 = $colectivo2->pagarCon($tarjeta);\n $this->assertEquals($tarjeta->obtenerSaldo(), $saldoEsperado);\n }", "function Hora_prog($valor){\t\n\n return date(\"H:i\", strtotime($valor));\n\n}", "function primer_dia_periodo_anio($anio) {\n\n $sql=\"select fecha_inicio from mocovi_periodo_presupuestario where anio=\".$anio;\n $resul=toba::db('designa')->consultar($sql);\n return $resul[0]['fecha_inicio'];\n }", "public function consumo_medio_diario($codart){\n\n $hoy=date('Y-m-d');\n $fecha_inicio = date('Y-m-d', strtotime(\"-$this->meses month\", strtotime( $hoy ) ));\n $consumo = 0;\n\n $query1 = Planilla_entrega_renglones::find();\n $query1->joinWith(['remito']);\n $query1->andFilterWhere([\n 'PR_DEPOSITO' => $this->deposito,\n 'PR_CODART' => $codart,\n ]);\n \n $query1->andFilterWhere(['>=','PE_FECHA', $fecha_inicio]);\n\n $consumo += $query1->sum('PR_CANTID');\n\n \n $query1 = Devolucion_salas_renglones::find();\n\n $query1->joinWith(['devolucion_encabezado']);\n $query1->andFilterWhere([\n 'PR_DEPOSITO' => $this->deposito,\n 'PR_CODART' => $codart,\n ]);\n\n $query1->andFilterWhere(['>=','DE_FECHA', $fecha_inicio]);\n\n $consumo -= $query1->sum('PR_CANTID');\n \n $segundos=strtotime('now') - strtotime($fecha_inicio);\n \n $dias=intval($segundos/60/60/24);\n return $consumo/$dias;\n\n }", "public function getSalarioMinimoAtual(){\r\n\t $aux = $this->getAll([\"status=1\"]);\r\n\t return $aux[0]->valor;\r\n\t}", "public function getIdMovideuda()\n {\n return $this->id_movideuda;\n }", "public function getDurationAsString() {\n $years = floor($this->months / 12);\n $extraMonths = $this->months % 12;\n if ($years<=0) {\n // code...\n return \"$extraMonths meses\";\n }if($extraMonths==0){\n return \"$years años\";\n }\n else {\n return \"$years años $extraMonths meses\";\n }\n \n }", "public function getPrecioConMonedaAttribute()\r\n {\r\n // capturar la moneda que ha configurado el usuario\r\n $simbolo = \"$\";\r\n $tipo_cambio = 1;\r\n return $simbolo . $this->precio * $tipo_cambio;\r\n }", "function armarSemana($horarios, $horarioActual, $dias) {\n\tforeach($horarios as $hora) { //Se recorre el array de horarios\n\t\techo \"<tr><td>\".$hora.\"</td>\";\n\t\tforeach($dias as $dia=>$fecha) {\n\t\t\t$vacio = true;\n\t\t\tif($dia != \"Domingo\") {\n\t\t\t\tforeach ($horarioActual as $campo=>$estado) {\t//Se recorre el array de turnos del dia\n\t\t\t\t\tif (isset($_POST['patologias']) && $_POST['patologias'] != $estado['patologia']) { continue; }\n\t\t\t\t\tif ($hora == date(\"H:i\", strtotime($estado['HORA_TURNO'])) && date(\"w\", strtotime($estado['FECHA_TURNO'])) == date(\"w\", strtotime($fecha))) {\t//Si el turno coincide con el horario y el dia\n\t\t\t\t\t\tif (verificarLaborable($hora, $dia) == true) {\n\t\t\t\t\t\t\t$vacio = false;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$cupos = obtenerCuposTurno($estado['FECHA_TURNO'], $hora); //guardo cantidad de cupos por hora y fecha dadas\n\t\t\t\t\t\t\t$cantCamillas = 0;\n\t\t\t\t\t\t\t$cantGimnasio = 0;\n\t\t\t\t\t\t\tforeach($cupos as $reg=>$camp) {\t//en este for asigno las cantidades para cada categoria\n\t\t\t\t\t\t\t\tif($camp['sesion'] == \"Camilla\") {\n\t\t\t\t\t\t\t\t\t$cantCamillas += $camp['cantidad'];\n\t\t\t\t\t\t\t\t} elseif($camp['sesion'] ==\"Gimnasio\") {\n\t\t\t\t\t\t\t\t\t$cantGimnasio += $camp['cantidad'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$disponibilidad = estadoTurno($cantCamillas, $cantGimnasio);\n\n\t\t\t\t\t\t\tif ($disponibilidad == \"Disponible\") { //If que determina los colores de las casillas\n\t\t\t\t\t\t\t\t$colorCasilla = \"disponible\";\n\t\t\t\t\t\t\t} elseif($disponibilidad == \"Libre\") {\n\t\t\t\t\t\t\t\t$colorCasilla = \"libre\";\n\t\t\t\t\t\t\t} elseif($disponibilidad == \"Ocupado\") {\n\t\t\t\t\t\t\t\t$colorCasilla = \"ocupado\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t/*if ($GLOBALS['perfil'] == \"profesional\") { //si el perfil es de profesional, se veran los cupos disponibles\n\t\t\t\t\t\t\t\techo \"<td class=\".$colorCasilla.\">\".$estado[\"camilla\"].\"</td>\",\n\t\t\t\t\t\t\t\t\"<td class=\".$colorCasilla.\">\".$estado[\"gimnasio\"].\"</td>\";\n\t\t\t\t\t\t\t} else { */\n\t\t\t\t\t\t\techo \"<td class=\".$colorCasilla.\">\".cantidadCupos($cantCamillas, $GLOBALS['MaximoCamillas']).\"</td>\",\n\t\t\t\t\t\t\t\"<td class=\".$colorCasilla.\">\".cantidadCupos($cantGimnasio, $GLOBALS['MaximoGimnasio']).\"</td>\";\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tif ($disponibilidad == \"Disponible\") { \n\t\t\t\t\t\t\t\techo \"<td class=\".$colorCasilla.\"><input type='button' value='Si' onclick='location=\\\"reservar.php?fecha=\".$fecha.\"&hora=\".$hora.\"\\\";'/></td>\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\techo \"<td class=\".$colorCasilla.\">No</td>\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} elseif (verificarLaborable($hora, $dia) == false) {\n\t\t\t\t\t\t\t//Si la hora dada no es laboral el dia dado, entonces\n\t\t\t\t\t\t\techo \"<td class='cerrado'>-</td>\", \n\t\t\t\t\t\t\t\"<td class='cerrado'>-</td>\",\n\t\t\t\t\t\t\t\"<td class='cerrado'>-</td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\tif ($vacio == true) {\n\t\t\t\t\t\tif(verificarLaborable($hora, $dia)) {\n\t\t\t\t\t\t\tif ($_SESSION['perfil'] == \"Administrador\") {\n\t\t\t\t\t\t\t\techo \"<td class='libre'>\".$GLOBALS['MaximoCamillas'].\"</td>\", \"<td class='libre'>\".$GLOBALS['MaximoGimnasio'].\"</td>\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\techo \"<td class='libre'>Si</td>\", \"<td class='libre'>Si</td>\"; \n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\techo \"<td class='libre'><input type='button' value='Si' onclick='location=\\\"reservar.php?fecha=\".$fecha.\"&hora=\".$hora.\"\\\";'/></td>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//Si la hora dada no es laboral el dia dado, entonces\n\t\t\t\t\t\t\techo \"<td class='cerrado'>-</td>\", \n\t\t\t\t\t\t\t\"<td class='cerrado'>-</td>\",\n\t\t\t\t\t\t\t\"<td class='cerrado'>-</td>\";\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo \"</tr>\";\n\t}\n}", "public function enviarNuestroSonido( ) {\n $cmd = new ComandoFlash(\"VIDEOCONFERENCIA\",\"NUESTRO_SONIDO\",$this->getNuestroSonido());\n $this->enviarPeticion($cmd->getComando());\n\n }", "function anteriorEstadoCotizacion(){\n $this->procedimiento='adq.f_cotizacion_ime';\n $this->transaccion='ADQ_ANTEST_IME';\n $this->tipo_procedimiento='IME';\n \n //Define los parametros para la funcion\n $this->setParametro('id_cotizacion','id_cotizacion','int4');\n $this->setParametro('operacion','operacion','varchar');\n $this->setParametro('id_estado_wf','id_estado_wf','int4');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }" ]
[ "0.5940471", "0.5940471", "0.5940115", "0.59382796", "0.5841226", "0.5750094", "0.5741675", "0.57195616", "0.5683898", "0.56126505", "0.5603662", "0.55857307", "0.5568", "0.5550611", "0.5538794", "0.55119693", "0.5465808", "0.54591477", "0.54332155", "0.5400728", "0.5398417", "0.53769594", "0.5352096", "0.53277254", "0.53161037", "0.5309925", "0.53009284", "0.52855533", "0.5281365", "0.5268824", "0.52604884", "0.52589947", "0.52478516", "0.52478516", "0.5247321", "0.52415496", "0.523069", "0.5218301", "0.5218295", "0.51775193", "0.5172118", "0.5171684", "0.5161728", "0.51599234", "0.515378", "0.515329", "0.5148055", "0.51457304", "0.51443315", "0.5139587", "0.51386625", "0.5130025", "0.5130002", "0.5129951", "0.5126198", "0.51244956", "0.5121591", "0.5109643", "0.5105814", "0.51027733", "0.51007444", "0.5093021", "0.50908625", "0.5090525", "0.50891465", "0.50877297", "0.5081178", "0.50808287", "0.5076537", "0.5073876", "0.50728506", "0.5069647", "0.5065585", "0.50633216", "0.5050555", "0.50488454", "0.50471663", "0.50433064", "0.5037811", "0.50338435", "0.50326866", "0.5031475", "0.50313187", "0.5031163", "0.50283843", "0.5026613", "0.50259376", "0.5020832", "0.5019922", "0.50176877", "0.50041854", "0.49995682", "0.4997402", "0.49906668", "0.4978752", "0.4975436", "0.4973158", "0.49714318", "0.49693117", "0.49685347", "0.49636462" ]
0.0
-1
Devuelve el ultimo motivo publicado en esa cartelera a la fecha de hoy.
public function getLastTheme() { $advert = AdvertisementQuery::create() ->filterByLast() ->filterByBillboard($this) ->orderByPublishdate('desc') ->findOne(); if (empty($advert)) return false; return $advert->getTheme(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function diasvenc($fechamov,$diascred){\n\t\t$a=ceil((time() - (strtotime($fechamov)))/(60* 60*24))-$diascred;\n\t\t//if($a>0){$amod=$a;}else{$amod=0;}\n\t\t$amod = ($a < 0 ? 0 : $a);\n\t\treturn $amod;\n\t}", "function mdatosPublicaciones(){\n\t\t$conexion = conexionbasedatos();\n\n\t\t$consulta = \"select * from final_publicacion order by FECHA_PUBLICACION desc; \";\n\t\tif ($resultado = $conexion->query($consulta)) {\n\t\t\treturn $resultado;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}", "function limite_trazadora($fecha) {\r\n $fecha = strtotime(fecha_db($fecha));\r\n $actualm = date('m', $fecha);\r\n $actualy = $actualy2 = date('Y', $fecha);\r\n // $ano = date('Y', $fecha);\r\n $desdem1 = '01';\r\n $hastam1 = '04';\r\n $desdem2 = '05';\r\n $hastam2 = '08';\r\n $desdem3 = '09';\r\n $hastam3 = '12';\r\n if ($actualm >= $desdem1 && $actualm <= $hastam1) {\r\n $cuatrimestre = 1;\r\n $cuatrimestrem = 3;\r\n //$actualy2++;\r\n }\r\n if ($actualm >= $desdem2 && $actualm <= $hastam2) {\r\n $cuatrimestre = 2;\r\n $cuatrimestrem = $cuatrimestre - 1;\r\n // $actualy2++;\r\n }\r\n if ($actualm >= $desdem3 && $actualm <= $hastam3) {\r\n $cuatrimestre = 3;\r\n $cuatrimestrem = $cuatrimestre - 1;\r\n $actualy2++;\r\n }\r\n\r\n $query2 = \"SELECT desde\r\n\t\t\t\t\tFROM facturacion.cuatrimestres\r\n\t\t\t\t\t WHERE cuatrimestre='$cuatrimestre'\";\r\n $res_sql2 = sql($query2) or excepcion(\"Error al buscar cuatrimestre\");\r\n $valor['desde'] = $actualy . '-' . $res_sql2->fields['desde'];\r\n\r\n $query2 = \"SELECT limite\r\n\t\t\t\t\tFROM facturacion.cuatrimestres\r\n\t\t\t\t\t WHERE cuatrimestre='$cuatrimestre'\";\r\n $res_sql2 = sql($query2) or excepcion(\"Error al buscar cuatrimestre\");\r\n\r\n $valor['limite'] = $actualy2 . '-' . $res_sql2->fields['limite'];\r\n\r\n return $valor;\r\n}", "public function perimetre()\n {\n // section -64--88--103-1-2c9bd139:16deeff2ef5:-8000:000000000000099C begin\n // section -64--88--103-1-2c9bd139:16deeff2ef5:-8000:000000000000099C end\n }", "function fecha_menor($diainicio,$diafin,$mesinicio,$mesfin,$anioinicio,$aniofin){\r\n\r\n$dif_en_meses=(($mesfin-$mesinicio)+(12*($aniofin-$anioinicio)));\r\n\r\nif($dif_en_meses<0){return(0);}\r\nif(($dif_en_meses==0) && ($diafin<$diainicio)){return(0);}\r\nreturn(1);\r\n}", "public function getSalarioMinimoAtual(){\r\n\t $aux = $this->getAll([\"status=1\"]);\r\n\t return $aux[0]->valor;\r\n\t}", "public function calcularSueldo(){\n $this->horas_trabajadas * 540;\n }", "public function fechaVigencia() // funcion que suma fecha usada para años biciestos\n\t{\n\n\t\t$fecha = $_GET['fecha'];\n\t\t$nuevafecha = strtotime('+365 day', strtotime($fecha));\n\t\t$nuevafecha = date('Y-m-d', $nuevafecha);\n\t\treturn $nuevafecha;\n\t}", "function ultimos_materiales_publicados() {\n\t\n\t\t\n\t\t$query = \"SELECT COUNT(*)\n\t\tFROM materiales, licencias\n\t\tWHERE materiales.material_licencia=licencias.id_licencia\n\t\tAND materiales.material_estado=1\n\t\tORDER BY materiales.fecha_alta desc\";\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\n\t\t$numrows = mysql_fetch_array($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows[0] == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\treturn $numrows[0];\n\t\t}\n\t}", "public function getFechaUltimaModificacion( ){\n\t\t\treturn $this->fechaUltimaModificacion;\n\t\t}", "public function otorgarPrestamo(){\n $fecha = date('d-m-y');\n $this->setFechaOtorgado($fecha);\n $cantidadCuotas = $this->getCantidadCuotas();\n $monto = $this->getMonto();\n $colObjCuota = array();\n for($i=0; $i<$cantidadCuotas; $i++){\n $montoCuota = $monto / $cantidadCuotas;\n $montoInteres = $this->calcularInteresPrestamo($i);\n $colObjCuota[$i] = new Cuota($i, $montoCuota, $montoInteres);\n }\n $this->setColObjCuota($colObjCuota);\n }", "function getMerezcoTarjeta(){\n\t\tif($this->numero_cambio >= 3)\n\t\t\t$necesito=2;\n\t\telse\n\t\t\t$necesito=1;\n\t\t\n\t\tif($necesito <= $this->sacar_tarjeta){\n\t\t\t$this->sacar_tarjeta=0;\n\t\t\treturn 1;\n\t\t}\n\t\telse{\n\t\t\t$this->sacar_tarjeta=0;\n\t\t\treturn 0;\n\t\t}\n\t}", "function getMaximoRetirable($fecha = false){\n\t\tif ( $fecha == false ){\n\t\t\t$fecha = fechasys();\n\t\t}\n\t\tif ( $this->mCuentaIniciada == false ) {\n\t\t $this->init();\n\t\t}\n\t\t//Obtener la Captacion Total\n\t\t$xSoc\t\t\t\t\t= new cSocio($this->mSocioTitular);\n\t\t$DTCap\t\t\t\t\t= $xSoc->getTotalCaptacionActual();\n\t\t$this->mMessages \t\t.= \"MAX_RETIRABLE\\tA la fecha $fecha, El Saldo Total de Captacion es \" . $DTCap[\"saldo\"] . \" \\r\\n\";\n\t\t$this->mMessages \t\t.= \"MAX_RETIRABLE\\tA la fecha $fecha, El saldo por Esta Cuenta es \" . $this->mNuevoSaldo . \" \\r\\n\";\n\t\t$saldo\t\t\t\t\t= $this->mSaldoAnterior;\n\t\t$saldo\t\t\t\t\t= ( $DTCap[\"saldo\"] - $saldo ) + $this->mNuevoSaldo ;\n\t\t$maximo_retirable\t\t= 0;\n\t\t//obtener los maximos retirables por credito\n\t\t//2011-1-30 cambio de monto_autorizado a saldo_actual\n\t\t$sqlCompCreditos = \"SELECT\n\t\t\t\t\t\t\t\tSUM(`creditos_solicitud`.`saldo_actual`) AS `monto`\n\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\t`creditos_solicitud` `creditos_solicitud`\n\t\t\t\t\t\t\t\t\tINNER JOIN `eacp_config_bases_de_integracion_miembros`\n\t\t\t\t\t\t\t\t\t`eacp_config_bases_de_integracion_miembros`\n\t\t\t\t\t\t\t\t\tON `creditos_solicitud`.`tipo_convenio` =\n\t\t\t\t\t\t\t\t\t`eacp_config_bases_de_integracion_miembros`.`miembro`\n\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t(`creditos_solicitud`.`numero_socio` = \" . $this->mSocioTitular . \")\n\t\t\t\t\t\t\t\t\tAND\n\t\t\t\t\t\t\t\t\t(`eacp_config_bases_de_integracion_miembros`.`codigo_de_base` = 1110)\n\t\t\t\t\t\t\t\t\tAND\n \t\t\t\t\t(`creditos_solicitud`.`saldo_actual` > \" . TOLERANCIA_SALDOS . \")\n\t\t\t\t\t\t\t\tGROUP BY\n\t\t\t\t\t\t\t\t\t`creditos_solicitud`.`numero_socio`,\n\t\t\t\t\t\t\t\t\t`eacp_config_bases_de_integracion_miembros`.`codigo_de_base`\n \";\n\t\t$d\t\t\t\t\t\t\t= obten_filas($sqlCompCreditos);\n\t\t//Obtener el Maximo Comprometidos por Garantia Liquida\n\t\t$sqlCC = \"SELECT\n\t\t\t\t\t\t\t`creditos_solicitud`.`numero_socio`,\n\t\t\t\t\t\t\tSUM(`creditos_solicitud`.`saldo_actual`) AS 'monto_creditos',\n\t\t\t\t\t\t\tSUM(`creditos_solicitud`.`saldo_Actual` *\n\t\t\t\t\t\t\t`creditos_tipoconvenio`.`porciento_garantia_liquida`) AS 'monto_garantia'\n\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t`creditos_solicitud` `creditos_solicitud`\n\t\t\t\t\t\t\t\tINNER JOIN `creditos_tipoconvenio` `creditos_tipoconvenio`\n\t\t\t\t\t\t\t\tON `creditos_solicitud`.`tipo_convenio` = `creditos_tipoconvenio`.\n\t\t\t\t\t\t\t\t`idcreditos_tipoconvenio`\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t(`creditos_solicitud`.`numero_socio` =\" . $this->mSocioTitular . \")\n\t\t\t\t\t\t\tAND\n\t\t\t\t\t\t\t(`creditos_solicitud`.`saldo_actual` > \" . TOLERANCIA_SALDOS . \")\n\t\t\t\t\t\tGROUP BY\n\t\t\t\t\t\t\t`creditos_solicitud`.`numero_socio` \";\n\t\t$comprometido_por_garantia\t= 0;\n\n\t\t$comprometido_por_creditos\t= (isset($d[\"monto\"])) ? csetNoMenorQueCero( $d[\"monto\"] ) : 0;\n\t\t$comprometido_por_ide\t\t= 0;\t\t\t//Terminar el saldo de IDE retirable\n\t\t$this->mMessages \t\t\t.= \"MAX_RETIRABLE\\tA la fecha $fecha, Lo Comprometido por Creditos es de $comprometido_por_creditos \\r\\n\";\n\t\t$this->mMessages \t\t\t.= \"MAX_RETIRABLE\\tA la fecha $fecha, Lo Comprometido por IDE es de $comprometido_por_ide\\r\\n\";\n\n\t\t//\n\t\tif ( $this->mSubProducto == CAPTACION_PRODUCTO_GARANTIALIQ){\n\t\t\t$c\t\t\t\t\t\t\t= obten_filas($sqlCC);\n\t\t\t$comprometido_por_garantia\t= setNoMenorQueCero( $c[\"monto_garantia\"] );\n\t\t\t$this->mMessages \t\t\t.= \"MAX_RETIRABLE\\tA la fecha $fecha, Lo Comprometido por GARANTIA LIQUIDA ES $comprometido_por_garantia \\r\\n\";\n\t\t\t$saldo\t\t\t\t\t\t= $this->mNuevoSaldo;\t//correccion por garantia liquida\n\t\t\t$comprometido_por_creditos\t= 0;\t\t\t\t\t//La ganartia liquida solo es presionado por lo comprometido por garantia\n\t\t}\n\t\t//\n\n\n\t\t$maximo_retirable\t\t\t= $saldo - ($comprometido_por_creditos + $comprometido_por_ide + $comprometido_por_garantia);\n\t\t$maximo_retirable\t\t\t= setNoMenorQueCero($maximo_retirable);\n\t\t$this->mMessages \t\t\t.= \"MAX_RETIRABLE\\tA la fecha $fecha, El Maximo Retirable es de $maximo_retirable de un Monto de $saldo\\r\\n\";\n\t\t//Componer el Saldo, no puede ser mayor al nuevo saldo\n\t\treturn ($maximo_retirable <= $this->mNuevoSaldo ) ? round($maximo_retirable, 2) : round($this->mNuevoSaldo, 2);\n\t}", "public function modalitadiPagamento(){\n $delta = substr($this->dataInizioPeriodo(), -4) - substr($this->dataFinePeriodo(), -4);\n \n if($delta != 0) {\n return \"due soluzioni, di cui la seconda al termine del contratto\";\n } else {\n return \"un'unica soluzione al termine del contratto\";\n }\n\n }", "public function vr_hora()\n {\n\n $valor=$this->vr_hora;\n\n if ($this->id_tipotitulo == 3)\n {\n $valor='10208';\n } elseif ($this->id_tipotitulo == 4) {\n $valor='15122';\n } elseif ($this->id_tipotitulo == 5) {\n $valor='19096';\n } elseif ($this->id_tipotitulo == 7) {\n $valor='23252';\n } elseif ($this->id_tipotitulo == 10) {\n $valor='27014';\n } elseif ($this->id_tipotitulo == 9) {\n $valor='10208';\n } elseif ($this->id_tipotitulo == 11) {\n $valor='10208'; }\n elseif ($this->id_tipotitulo == 12) {\n $valor='0';\n }\n\n\n return $valor;\n\n }", "public function getAtualizadoEm()\n {\n return $this->atualizadoEm;\n }", "function metpago($metpago){\n\tif($metpago==\"01\"){$cuenta=\"101.01\";}else{$cuenta=\"102.01\";}\n\treturn $cuenta;\n}", "public function trae_solo_anio_actual()\n {\n return $this->fecha->year;\n }", "function moisAnPasse()\n{\n\t$dateActuelle = date(\"d/m/Y\");\n\t@list($jour, $mois, $annee) = explode('/', $dateActuelle);\n\t$annee--;\n\t$moisActuel = $annee . $mois;\n\treturn $moisActuel;\n}", "public function puestaACero()\n {\n $this->hh = 0;\n $this->mm = 0;\n $this->ss = 0;\n }", "public function getUltimoDiaMes($elAnio,$elMes) {\n return date(\"d\",(mktime(0,0,0,$elMes+1,1,$elAnio)-1));\n }", "function ultimos_eu_publicados_limit($inicial,$cantidad) {\n\t\n\t\t$query = \"SELECT eu.*, eu_descripcion.*\n\t\tFROM eu, eu_descripcion\n\t\tWHERE eu.id_eu=eu_descripcion.id_eu\n\t\tAND eu.eu_estado=1\n\t\tORDER BY eu.fecha_alta desc\n\t\tLIMIT $inicial,$cantidad\";\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\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "public function mes(){\n\n\t\t$date = $this->dia;\n $date = DateTime::createFromFormat('Y-m-d', $date);\n \t \n\t\treturn $date->format('m') - 1;\n\t}", "public function getMontoEjecutado()\n {\n $montoEjecutado = 0;\n foreach ($this->objetivos as $objetivo)\n {\n if (count($objetivo->getActividades())!=0)\n {\n foreach($objetivo->getActividades() as $actividad)\n {\n if (count($actividad->getRecursoEjecutado())!=0)\n {\n foreach($actividad->getRecursoEjecutado() as $ejecutado)\n {\n $moneda = $ejecutado->getMoneda();\n $montoEjecutado+=($ejecutado->getMonto()*$moneda->getPrecioBs());\n }\n }\n } \n }\n }\n return $montoEjecutado;\n }", "function votoMedio($nome) {\n\t$rows = selectVotoMedio($nome);\n\t$voto = 0;\n\tforeach ($rows as $row){\n\t\t$voto = $row[\"votoMedio\"];\n\t}\n\t$votoFormattato = number_format($voto, 1);\n\treturn $votoFormattato;\n}", "function moisActuel()\n{\n\t$dateActuelle = date(\"d/m/Y\");\n\t@list($jour, $mois, $annee) = explode('/', $dateActuelle);\n\t//$annee--;\n\t$moisActuel = $mois;\n\treturn $annee . $moisActuel;\n}", "function procesar_cambio ($datos){\n //validamos que no exista otro periodo, para ello tomamos la fecha actual y obtenemos todos los periodo \n //que existen con sus respectivos dias y verificamos que el espacio que se quiere cargar no este ocupado en esos \n //dias\n \n }", "function fechaPrestacionXLimite($fprestacion, $fprest_limite) {\r\n $pr = ((strtotime($fprest_limite) - strtotime($fprestacion)) / 86400); //limite de la prestacion - fecha prestacion\r\n $ctrl_fechapresta['debito'] = false;\r\n if ($pr < 0) {\r\n\r\n $ctrl_fechapresta['debito'] = true;\r\n $ctrl_fechapresta['id_error'] = 71;\r\n $ctrl_fechapresta['msj_error'] = 'Fecha de Prestacion supera el limite para el periodo liquidado';\r\n }\r\n return $ctrl_fechapresta;\r\n}", "function date_modif_manuelle_autoriser() {\n}", "abstract protected function getUploadMtime();", "function ultimas_noticias_publicadas($limit) {\n\t\n\t\t$query = \"SELECT noticias.*, colaboradores.*\n\t\tFROM noticias, colaboradores\n\t\tWHERE noticias.id_colaborador=colaboradores.id_colaborador\n\t\tAND noticias.estado=1\n\t\tORDER BY noticias.fecha_insercion desc\n\t\tLIMIT 0,$limit\";\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\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "function obtener_minutos($fecha) {\r\nreturn(substr($fecha,14,2));\r\n}", "function calc_chegada($partida,$tempo){\n \n \n $aux=split(\":\",$partida);\n\t\t$p=mktime($aux[0],$aux[1],$aux[2]);\n\n\t\t$aux=split(\":\",$tempo);\n\t\t$t=$aux[0]*3600+$aux[1]*60+$aux[2];\n\t\t\n\t\t$c=strftime(\"%H:%M:%S\",$p+$t);\n\t\t//echo \"$p<br>\";\n\t\t//echo \"$t<br>\";\n // echo $t+$p . \"<br>\";\n //echo \"$c<br>\";\n\t\t\n\t\treturn $c;\n }", "function ultimoDiaMes($data, $formato) {\r\n list($dia, $mes, $ano) = explode('/', $data);\r\n return date($formato, mktime(0, 0, 0, $mes + 1, 0, $ano));\r\n }", "public function get_codigo_muestra($cod_muestra){\n $fecha = getdate();\n $dia = $fecha[\"mday\"];\n $mes = $fecha[\"mon\"];\n $año = $fecha[\"year\"];\n $año_=substr($año,2);\n \n while($datos = mysqli_fetch_array($cod_muestra)){\n $codigo_muestra = $datos['codigo_muestra'];\n }\n if($codigo_muestra!=\"\"){\n (int)$primer_digito = substr($codigo_muestra,0,4);\n $num = ((int)$primer_digito+1);\n\n $codigo_muestra = $num.\"-\".$dia.\"-\".$mes.\"-\".$año_.\"-\".$num;\n \n return ltrim($codigo_muestra);\n\n }else{\n $codigo_muestra =\"100\".\"-\".$dia.\"-\".$mes.\"-\".$año_.\"-\".\"100\";\n return $codigo_muestra;\n }\n\n }", "public function getModTime(): int;", "function getMontantTVAArticle($numserie) {\n // if ($this->calculmontant) return (sprintf(\"%.2f\", ($this->article[$numserie]['montantTTC'] - $this->article[$numserie]['montantHT'])));\n if (isset($this->calculmontant) && $this->calculmontant == true) return (sprintf(\"%.2f\", ($this->article[$numserie]['montantHT'] * ($this->TVA / 100))));\n else return 0;\n }", "public function getDatePubli()\r\n {\r\n return $this->datePubli;\r\n }", "function obtenerPeriodoActual($conexion)\n{\n $anoActual = date('Y');\n $mesActual = date('m');\n\n if ($mesActual > 6) {\n $sentencia = \"select idPeriodo from periodo where AnoInicio=\" . $anoActual;\n } elseif ($mesActual <= 6) {\n $sentencia = \"select idPeriodo from periodo where AnoInicio=\" . ($anoActual - 1);\n }\n\n $conexion->Ejecuto($sentencia);\n $periodo = $conexion->Siguiente();\n return $periodo['idPeriodo'];\n}", "public function reiniciarMedio($tiempo) {\n $tiempo2 = $tiempo->time();\n $hora = date('H', $tiempo2);\n $minutos = date('i', $tiempo2);\n $segundos = date('s', $tiempo2);\n\n if ($hora == '00' && $minutos == '00' && $segundos == '00')\n {\n $this->vecesUsado = 0;\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }", "function precio($precioUnidad, $cantidad, $descuento = 0 ){ // las variables que tenemos son arbitrarias, por lo cual hay que mirar bien si ponerlas en () de la funcion\n\n\n\n$multiplicar = $precioUnidad * $cantidad;\n\n// $descuento es un porcentaje\n\n// $restar = $multiplicar - $descuento; // este descuento debe ir en % por lo cual no es lo mismo que un entero, por lo cual lo colocaremos en entero\n\n\n// si esto fuera un porcentaje entonces seria $multiplicar = $precioUnidad * $cantidad; // $porcentaje = $multiplicar - $descuento; // $solucion = $multiplicar - $porcentaje; lo cual es lo que haremos\n\n$porcentaje = $multiplicar * $descuento;\n\n$solucion = $multiplicar - $porcentaje;\nreturn $solucion;\n// si colocamos todos los datos en solo sitio o una sola linea, sin especificar es e novatos, porque hay que haber un orden\n\n}", "public function smanjiCenu(){\n if($this->getGodiste() < 2010){\n $discount=$this->cenapolovnogauta*0.7;\n return $this->cenapolovnogauta=$discount;\n }\n return $this->cenapolovnogauta; \n }", "public function consumo_medio_puntual_prevision($codart){\n\n $hoy=date('Y-m-d');\n $fecha_inicio = date('Y-m-d', strtotime(\"-3 month\", strtotime( $hoy ) ));\n $consumo = 0;\n\n $query1 = Planilla_entrega_renglones::find();\n $query1->joinWith(['remito']);\n $query1->andFilterWhere([\n 'PR_DEPOSITO' => $this->deposito,\n 'PR_CODART' => $codart,\n ]);\n \n $query1->andFilterWhere(['>=','PE_FECHA', $fecha_inicio]);\n\n $consumo += $query1->sum('PR_CANTID');\n\n \n $query1 = Devolucion_salas_renglones::find();\n\n $query1->joinWith(['devolucion_encabezado']);\n $query1->andFilterWhere([\n 'PR_DEPOSITO' => $this->deposito,\n 'PR_CODART' => $codart,\n ]);\n\n $query1->andFilterWhere(['>=','DE_FECHA', $fecha_inicio]);\n\n $consumo -= $query1->sum('PR_CANTID');\n \n $segundos=strtotime('now') - strtotime($fecha_inicio);\n \n $dias=intval($segundos/60/60/24);\n return $consumo/$dias;\n\n }", "public function mort()\n\t{\n\t\tif ( $this->vie <= 0 ) {\n\t\t\techo $this->nom . \" est mort <br>\";\n\t\t} else {\n\t\t\techo $this->nom . \" est vivant ! <br>\";\n\t\t}\n\t}", "function rotacionSeisMeses()\n {\n $rotacion_smeses = new \\stdClass();\n $rotacion_smeses->labels = [];\n $rotacion_smeses->data = [];\n\n // Prepare query\n $sql = \"\n SELECT (COUNT(f.id) / m.maquina_casillas) as result, DATE_FORMAT(f.factura_fecha_emision, '%m') AS month, DATE_FORMAT(f.factura_fecha_emision, '%M') AS month_letters\n FROM facturas as f, maquinas as m WHERE f.factura_fecha_emision <= DATE(NOW()) AND f.factura_fecha_emision > DATE_SUB(DATE(NOW()), INTERVAL 6 MONTH) $this->sql_condition\n GROUP BY month\";\n\n // Execute sql\n $query = DB::select($sql);\n\n // Config chart roacion ultimos 6 meses\n $rotacion_smeses->labels = array_pluck($query, 'month_letters');\n $rotacion_smeses->data = array_pluck($query, 'result');\n\n return $rotacion_smeses;\n }", "function ultimo_dia_periodo() { \n\n $sql=\"select fecha_fin from mocovi_periodo_presupuestario where actual=true\";\n $resul=toba::db('designa')->consultar($sql); \n return $resul[0]['fecha_fin'];\n }", "function ultimoDiaMes($x_fecha_f){\r\n\techo \"entra a ultimo dia mes con fecha \".$x_fecha_f.\"<br>\";\r\n\t\t\t\t\t$temptime_f = strtotime($x_fecha_f);\t\r\n\t\t\t\t\t$x_numero_dia_f = strftime('%d', $temptime_f);\r\n\t\t\t\t\t$x_numero_mes_f = strftime('%m', $temptime_f);\r\n\t\t\t\t\techo \"numero mes\".$x_numero_mes_f.\"<br>\";\r\n\t\t\t\t\t$x_numero_anio_f = strftime('%Y', $temptime_f);\r\n\t\t\t\t\t$x_ultimo_dia_mes_f = strftime(\"%d\", mktime(0, 0, 0, $x_numero_mes_f+2, 0, $x_numero_anio_f));\r\n\techo \"el ultimo dia de mes es\".\t$x_ultimo_dia_mes_f .\"<br>\";\t\t\t\r\n\treturn $x_ultimo_dia_mes_f;\r\n}", "function primer_dia_periodo() {\n\n $sql=\"select fecha_inicio from mocovi_periodo_presupuestario where actual=true\";\n $resul=toba::db('designa')->consultar($sql);\n return $resul[0]['fecha_inicio'];\n \n }", "function acrescenta_min($horario, $minutos){\n $time = new DateTime($horario);\n $time->add(new DateInterval('PT' . $minutos . 'M'));\n return $stamp = $time->format('Y-m-d H:i:s');\n}", "private function calcolaValutazione()\n {\n\n $media=0;\n $i=0;\n foreach ($this->valutazioni as &$value){\n $media=$media+$value->getvoto();\n $i++;}\n $this->valutazione=$media/$i;\n\n }", "public function get_expiration() \n\t{ \n\t// si no esta en memoria abrirlo\n\tif(empty($this->TA)) {\n\t\t$TA_file = file($this->path.self::TA, FILE_IGNORE_NEW_LINES);\n\t\tif($TA_file) {\n\t\t\t$TA_xml = '';\n\t\t\tfor($i=0; $i < sizeof($TA_file); $i++)\n\t\t\t\t$TA_xml.= $TA_file[$i]; \n\t\t\t$this->TA = $this->xml2Array($TA_xml);\n\t\t\t$r = $this->TA['header']['expirationTime'];\n\t\t} else {\n\t\t\t$r = false;\n\t\t}\n\t} else {\n\t\t$r = $this->TA['header']['expirationTime'];\n\t}\n\treturn $r;\n\t}", "public function getSimulacionReajuste(){\n //calculando según el IPC acumulado\n //entre el último reajuste realizado y ahora. \n $mes_actual = (int)date(\"m\");\n $agno_actual = (int)date('Y');\n $mes_inicio = $mes_actual - $this->reajusta_meses;\n $agno_inicio = $agno_actual;\n if($mes_inicio <= 0){\n $agno_inicio -= 1;\n $mes_inicio+= 12;\n }\n $ipcs = array();\n if($agno_inicio != $agno_actual){\n $ipcs = Ipc::model()->findAll(array('order'=>'mes','condition'=>'mes >= :m and agno = :a','params'=>array(':m'=>$mes_inicio,':a'=>$agno_inicio)));\n $ipcs_actual = Ipc::model()->findAll(array('order'=>'mes','condition'=>'mes < :m and agno = :a','params'=>array(':m'=>$mes_actual,':a'=>$agno_actual)));\n foreach($ipcs_actual as $ipc){\n $ipcs[] = $ipc;\n }\n }\n else{\n $ipcs = Ipc::model()->findAll(array('condition'=>'mes >= :m1 and mes < :m2 and agno = :a','params'=>array(':m1'=>$mes_inicio,':m2'=>$mes_actual,':a'=>$agno_actual)));\n }\n\n $ipc_acumulado = 0;\n foreach($ipcs as $ipc){\n //sumo los ipcs para generar el ipc acumulado\n $ipc_acumulado+= $ipc->porcentaje;\n }\n //para hacer el cálculo según porcentaje\n $ipc_acumulado /= 100;\n\n //saco el último debe pagar para ver cuánto era lo que tenía que pagar antes\n $debePagars = DebePagar::model()->findAllByAttributes(array('contrato_id'=>$this->id),array('order'=>'id DESC'));\n $debePagar = $debePagars[0];\n \n $debeNuevo = new DebePagar();\n $debeNuevo->agno = $agno_actual;\n $debeNuevo->mes = $mes_actual;\n $debeNuevo->dia = $debePagar->dia;\n $debeNuevo->contrato_id = $this->id;\n //ahora hay que reajustar los montos del contrato dependiendo del ipc_acumulado\n //el precio base debe ser el valor anterior en debe pagar\n $debeNuevo->monto_gastocomun = intval($debePagar->monto_gastocomun*(1+$ipc_acumulado));\n $debeNuevo->monto_gastovariable = intval($debePagar->monto_gastovariable*(1+$ipc_acumulado));\n $debeNuevo->monto_mueble = intval($debePagar->monto_mueble*(1+$ipc_acumulado));\n $debeNuevo->monto_renta = intval($debePagar->monto_renta*(1+$ipc_acumulado));\n \n return array('actual'=>$debePagar, 'nuevo'=>$debeNuevo);\n }", "function Fecha_mes_n($Ingresomes_c){\t\n$mes_mes_c = new DateTime($Ingresomes_c);\n$me = $mes_mes_c->format('m');\n$mes='';\nif($me=='01') $mes='01';\nif($me=='02') $mes='02';\nif($me=='03') $mes='03';\nif($me=='04') $mes='04';\nif($me=='05') $mes='05';\nif($me=='06') $mes='06';\nif($me=='07') $mes='07';\nif($me=='08') $mes='08';\nif($me=='09') $mes='09';\nif($me=='10') $mes='10';\nif($me=='11') $mes='11';\nif($me=='12') $mes='12';\n$cadena = (\"$mes\");\nreturn $cadena;\n}", "function UltimoDia($a,$m){\r\n if (((fmod($a,4)==0) and (fmod($a,100)!=0)) or (fmod($a,400)==0)) {\r\n $dias_febrero = 29;\r\n } else {\r\n $dias_febrero = 28; \r\n }\r\n switch($m) {\r\n case 1: $valor = 31; break;\r\n case 2: $valor = $dias_febrero; break;\r\n case 3: $valor = 31; break;\r\n case 4: $valor = 30; break;\r\n case 5: $valor = 31; break;\r\n case 6: $valor = 30; break;\r\n case 7: $valor = 31; break;\r\n case 8: $valor = 31; break;\r\n case 9: $valor = 30; break;\r\n case 10: $valor = 31; break;\r\n case 11: $valor = 30; break;\r\n case 12: $valor = 31; break;\r\n }\r\n return $valor;\r\n}", "function objetivos_mes(){\r\n \r\n $data['sistema'] = $this->sistema;\r\n \r\n $dia = $this->input->post(\"dia\"); \r\n $mes = $this->input->post(\"mes\"); \r\n $anio = $this->input->post(\"anio\");\r\n \r\n $fecha = date(\"Y-m-d H:i:s\", strtotime($anio.\"-\".$mes.\"-\".$dia));\r\n\r\n $primer_dia = 1;\r\n $ultimo_dia = $this->getUltimoDiaMes($anio,$mes);\r\n \r\n //$fecha_inicial = date(\"Y-m-d H:i:s\", strtotime($anio.\"-\".$mes.\"-\".$primer_dia) );\r\n //$fecha_final = date(\"Y-m-d H:i:s\", strtotime($anio.\"-\".$mes.\"-\".$ultimo_dia) );\r\n \r\n $fecha_inicial = $anio.\"-\".$mes.\"-01\";\r\n //$fecha_final = $anio.\"-\".$mes.\"-31\";\r\n $fecha_final = $anio.\"-\".$mes.\"-\".$ultimo_dia;\r\n // --------------------------------------------------------------------------------------------\r\n $sql_objetivos = \"SELECT u.usuario_nombre, u.`usuario_imagen`, aux.`tipousuario_descripcion`, e.`estado_color`, e.estado_descripcion, o.*\r\n FROM `objetivo` AS o\r\n LEFT JOIN usuario AS u ON o.usuario_id = u.`usuario_id`\r\n LEFT JOIN estado AS e ON o.`estado_id` = e.estado_id\r\n LEFT JOIN (\r\n SELECT u.`usuario_id`, t.tipousuario_descripcion \r\n FROM usuario AS u, tipo_usuario AS t\r\n WHERE u.`tipousuario_id` = t.`tipousuario_id`\r\n ) AS aux ON o.`usuario_id` = aux.usuario_id\r\n WHERE o.`usuario_id` = u.usuario_id\";\r\n //echo $sql_objetivos;\r\n $objetivos = $this->db->query($sql_objetivos)->result_array();\r\n // --------------------------------------------------------------------------------------------\r\n $sql_ventas_mes = \"SELECT if(sum(d.detalleven_total)>0, round(sum(d.detalleven_total),2), 0) AS total_mes, u.usuario_id\r\n FROM usuario AS u\r\n LEFT JOIN objetivo AS o ON o.usuario_id = u.usuario_id\r\n LEFT JOIN estado AS e ON u.`estado_id` = e.`estado_id`\r\n LEFT JOIN tipo_usuario AS t ON t.`tipousuario_id` = u.`tipousuario_id`\r\n left join detalle_venta as d on d.`usuario_id` = u.`usuario_id`\r\n left join venta as v on v.`usuario_id`=o.usuario_id\r\n WHERE o.usuario_id = u.usuario_id AND\r\n v.venta_id = d.venta_id AND \r\n v.venta_fecha >= '\".$fecha_inicial.\"' AND \r\n v.venta_fecha <= '\".$fecha_final.\"' AND \r\n v.usuario_id = u.usuario_id\r\n GROUP BY u.usuario_nombre \r\n order by u.usuario_nombre\r\n \";\r\n/* $sql_ventas_mes = \"SELECT if(sum(d.detalleven_total) > 0, round(sum(d.detalleven_total), 2), 0) AS total_mes, u.usuario_id\r\n FROM\r\n usuario u, detalle_venta d, venta v\r\n\r\n WHERE\r\n v.venta_id = d.venta_id AND \r\n v.venta_fecha >= '\".$fecha_inicial.\"' AND \r\n v.venta_fecha <= '\".$fecha_final.\"' AND \r\n v.usuario_id = u.usuario_id\r\n GROUP BY\r\n u.usuario_id\r\n ORDER BY\r\n u.usuario_nombre\";\r\n*/ \r\n //echo $sql_ventas_mes;\r\n $ventas_mes = $this->db->query($sql_ventas_mes)->result_array();\r\n // --------------------------------------------------------------------------------------------\r\n $sql_ventas_dia = \"SELECT if(sum(d.detalleven_total)>0, round(sum(d.detalleven_total),2), 0) AS total_dia, u.usuario_id\r\n FROM usuario AS u\r\n LEFT JOIN objetivo AS o ON o.usuario_id = u.usuario_id\r\n LEFT JOIN estado AS e ON u.`estado_id` = e.`estado_id`\r\n LEFT JOIN tipo_usuario AS t ON t.`tipousuario_id` = u.`tipousuario_id`\r\n left join detalle_venta as d on d.`usuario_id` = u.`usuario_id`\r\n left join venta as v on v.`usuario_id`=o.usuario_id\r\n WHERE o.usuario_id = u.usuario_id AND\r\n v.venta_id = d.venta_id AND \r\n v.venta_fecha = '\".$fecha.\"' AND \r\n v.usuario_id = u.usuario_id\r\n GROUP BY u.usuario_nombre \r\n order by u.usuario_nombre\r\n \";\r\n/* $sql_ventas_dia = \"SELECT \r\n if(sum(d.detalleven_total) > 0, round(sum(d.detalleven_total), 2), 0) AS total_dia,\r\n u.usuario_id\r\n FROM\r\n usuario u, venta v, detalle_venta d\r\n WHERE\r\n v.venta_fecha = '\".$fecha.\"' and\r\n v.venta_id = d.venta_id and\r\n v.usuario_id = u.usuario_id\r\n GROUP BY\r\n u.usuario_id\r\n ORDER BY\r\n u.usuario_nombre\";*/\r\n \r\n //echo $sql_ventas_dia;\r\n $ventas_dia = $this->db->query($sql_ventas_dia)->result_array();\r\n // // --------------------------------------------------------------------------------------------\r\n $sql_pedidos_mes = \"SELECT if(count(p.`pedido_total`)>0, COUNT(p.`pedido_total`),0) as pedido_mes, u.usuario_id\r\n FROM pedido as p\r\n LEFT JOIN venta as v on p.pedido_id = v.`pedido_id`\r\n LEFT JOIN usuario as u on p.`usuario_id` = u.usuario_id\r\n left join objetivo as o on p.`usuario_id` = o.`usuario_id`\r\n where v.`entrega_id` = 2\r\n and p.`pedido_fecha` >= '\".$fecha_inicial.\"'\r\n and p.pedido_fecha <= '\".$fecha_final.\"'\r\n and p.`regusuario_id` = o.usuario_id\r\n group by u.usuario_nombre\r\n ORDER by u.usuario_nombre\";\r\n \r\n \r\n/* $sql_pedidos_mes = \"SELECT \r\n if(count(p.pedido_total) > 0, COUNT(p.pedido_total), 0) AS pedido_mes, u.usuario_id\r\n\r\n FROM\r\n pedido p, venta v, detalle_venta d, usuario u\r\n\r\n WHERE\r\n v.entrega_id = 2 AND \r\n p.pedido_fecha >= '\".$fecha_inicial.\"' AND \r\n p.pedido_fecha <= '\".$fecha_final.\"' AND \r\n p.pedido_id = v.pedido_id and\r\n d.venta_id = v.venta_id and\r\n u.usuario_id = v.usuario_id\r\n\r\n GROUP BY\r\n\r\n u.usuario_id\r\n\r\n ORDER BY\r\n\r\n u.usuario_nombre\";*/\r\n //echo $sql_pedidos_mes;\r\n \r\n $pedidos_mes = $this->db->query($sql_pedidos_mes)->result_array();\r\n // // --------------------------------------------------------------------------------------------\r\n $sql_pedidos_dia = \"SELECT IF(COUNT(p.`pedido_id`)>0, COUNT(p.`pedido_id`),0) as pedido_dia, u.usuario_id\r\n FROM pedido AS p\r\n LEFT JOIN venta as v on p.pedido_id = v.`pedido_id`\r\n LEFT JOIN usuario AS u ON p.`usuario_id` = u.usuario_id\r\n LEFT JOIN objetivo AS o ON p.`usuario_id` = o.`usuario_id`\r\n WHERE date(p.`pedido_fecha`) = '\".$fecha.\"'\r\n AND p.`regusuario_id` = o.usuario_id\r\n GROUP BY u.usuario_nombre\r\n ORDER BY u.usuario_nombre\r\n \";\r\n //echo $sql_pedidos_dia;\r\n \r\n $pedidos_dia = $this->db->query($sql_pedidos_dia)->result_array();\r\n \r\n $data = array(\r\n \"objetivos\" => $objetivos,\r\n \"ventas_dia\" => $ventas_dia,\r\n \"ventas_mes\" => $ventas_mes,\r\n \"pedidos_dia\" => $pedidos_dia,\r\n \"pedidos_mes\" => $pedidos_mes\r\n );\r\n echo json_encode($data);\r\n }", "function formulaires_publication_ouverte_agenda_charger_dist()\n{\n\t$values = array();\n\n\t$values['etape'] \t\t= _request('etape');\t\t\t// etape actuelle\n\t$values['id_article']\t \t= _request('id_article');\t\t// id de l'article temporaire\n\t$values['type']\t\t\t= \"evenement\";\t\t\t// article ou evenement ?\n\t$values['id_rubrique'] \t\t= _request('id_rubrique');\t\t// rubrique de la contrib\n\t$values['jour_evenement'] \t= _request('jour_evenement'); \t\t// jour de l'événement\n\t$values['mois_evenement'] \t= _request('mois_evenement'); \t\t// mois de l'événement\n\t$values['annee_evenement'] \t= _request('annee_evenement'); \t\t// annee de l'événement\n\t$values['heure_evenement'] \t= _request('heure_evenement'); \t\t// heure de l'événement\n\t$values['lieu_evenement']\t= _request('lieu_evenement');\t\t// lieu de l'evenement\n\t$values['ville_evenement']\t= _request('ville_evenement');\t\t// lieu de l'evenement\n\t$values['adresse_evenement']\t= _request('adresse_evenement');\t// lieu de l'evenement\n\t$values['tel_evenement']\t= _request('tel_evenement');\t\t// lieu de l'evenement\n\t$values['web_evenement']\t= _request('web_evenement');\t\t// lieu de l'evenement\n\t$values['email_evenement']\t= _request('email_evenement');\t\t// lieu de l'evenement\n\t$values['lieu_evenement_existe']= _request('lieu_evenement_existe');\t// lieu de l'evenement déjà existant\n\t$values['titre'] \t\t= _request('titre');\t\t\t// titre de la contrib\n\t$values['texte'] \t\t= _request('texte');\t\t\t// texte de la contrib\n\t$values['pseudo'] \t\t= _request('pseudo');\t\t\t// pseudo ou nom de l'auteur\n\t$values['email'] \t\t= _request('email');\t\t\t// email de l'auteur\n\t$values['mots'] \t\t= _request('mots');\t\t\t// les mots-clés\n\t$values['date'] = _request('date');\n\t$values['date_modif'] = _request('date_modif');\n\t$values['supprimer_documents'] = _request('supprimer_documents');\n\t// editos\n\t$values['mise_en_edito'] = _request('mise_en_edito');\n\t$values['edito_complet'] = _request('edito_complet');\n\t// focus\n\t$values['mot_focus'] = _request('mot_focus');\n\t// si c'est pas un debut d'article\n\tif (_request('titre') or _request('previsu'))\n\t\t$values['ancre'] = '#etape_4';\n\telse\n\t\t$values['ancre'] = '.page-article';\n\t\n\t/*\n\t * s'il s'agit du premier passage, on créé l'article\n\t */\n\tif (!$values['id_article'])\n\t{\n\t\t$id_article = indymedia_creer_article();\n\t\t$values['id_article'] = $id_article;\n\t}\n\t/*\n\t * sinon, si admin, on peut l'éditer\n\t */\n\telse if ($values['id_article'] && est_admin())\n\t{\n\t\t$id_article = (int) $values['id_article'];\n\t\t// on recupere des infos sur l'article\t\n\t\t$row = sql_fetsel(\n\t\t\tarray('texte','extra','id_rubrique','titre','date_debut_indy','statut','date'),\n\t\t\tarray('spip_articles'),\n\t\t\tarray('id_article='.$id_article)\n\t\t);\n\t\t$values['texte'] = $row['texte'] ;\n\t\t$values['titre'] = $row['titre'] ;\n\t\t$values['id_rubrique'] = $row['id_rubrique'] ;\n\t\t//$values['statut'] = $row['statut'] ;\n\t\t$extra = unserialize($row['extra']);\n\t\t$values['explication'] = $extra['OP_moderation'];\n\t\t$values['pseudo'] = $extra['OP_pseudo'];\n\t\t$values['email'] = $extra['OP_email'];\n\t\t$values['date'] = $row['date'];\n\t\t\n\t\t// on recupere la date, l'heure et le lieu de l'evenement\n\t\t$values = indymedia_ajout_valeurs_date ($values, $row['date_debut_indy']);\n\t\t$values = indymedia_ajout_valeurs_lieu ($values, $id_article);\n\t\t$values = indymedia_ajout_valeurs_mots ($values, $id_article);\n\t}\n\tinclude_spip('inc/securiser_action');\n\t$values['cle_ajouter_document'] = calculer_cle_action('ajouter-document-' . 'article' . '-' . $id_article);\n\n\treturn $values;\n}", "function calcular_limite_fecha_prestacion($mes_vig, $ano_vig) {\r\n if ($mes_vig == '12') {\r\n $mes_vig1 = '01';\r\n $ano_vig1 = $ano_vig + 1;\r\n }\r\n if ($mes_vig != '12') {\r\n $mes_vig1 = $mes_vig + 1;\r\n $ano_vig1 = $ano_vig;\r\n if ($mes_vig1 < 10) {\r\n $mes_vig1 = '0' . $mes_vig1;\r\n }\r\n }\r\n return '10/' . $mes_vig1 . '/' . $ano_vig1;\r\n}", "function ultimos_materiales_publicados_limit($inicial,$cantidad) {\n\t\n\t\t\n\t\t$query = \"SELECT materiales.*, licencias.*\n\t\tFROM materiales, licencias\n\t\tWHERE materiales.material_licencia=licencias.id_licencia\n\t\tAND materiales.material_estado=1\n\t\tORDER BY materiales.fecha_alta desc\n\t\tLIMIT $inicial,$cantidad\";\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\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "public function imc(){\n\t\t\treturn $this-> peso / ($this->altura * $this->altura);\n\t\t}", "function MESES_ANTIGUEDAD($_ARGS) {\r\n\t$fingreso = FECHA_INGRESO($_ARGS);\r\n\t$periodo_actual = $_ARGS['HASTA'];\r\n\tlist($anios, $meses, $dias) = TIEMPO_DE_SERVICIO(formatFechaDMA($fingreso), formatFechaDMA($periodo_actual));\r\n\t$cantidad = $meses + ($anios * 12);\r\n\treturn $cantidad;\r\n}", "public function getPublicKeyExpiration() : int;", "public function mostraUltimaMensagem()\n { \n $arMsgSessao = $_SESSION['msg'];\n $stUltimaMensagem = $arMsgSessao[count($arMsgSessao)-1];\n return $stUltimaMensagem;\n }", "public function puestaACero() {\n $this -> horas = 0;\n $this -> minutos = 0;\n $this -> segundos = 0;\n }", "public function fechaFinPublicacion($fechainicio){\r\n\t\t$año = substr($fechainicio, 0, 4);\r\n\t\t$mes = substr($fechainicio, 5, 2);\r\n\t\t$dia = substr($fechainicio, 8, 2);\r\n\t\t$fecha = date_create();\r\n\t\tdate_date_set($fecha, $año, $mes, $dia);\r\n\t\t$fecha->add(new DateInterval(\"P6M\"));\r\n\t\treturn $fecha;\r\n\t}", "function anular_PM_MM($id_mov)\r\n{\r\n global $db,$_ses_user;\r\n\r\n $db->StartTrans();\r\n $query=\"update movimiento_material set estado=3 where id_movimiento_material=$id_mov\";\r\n sql($query) or fin_pagina();\r\n $usuario=$_ses_user['name'];\r\n $fecha_hoy=date(\"Y-m-d H:i:s\",mktime());\r\n //agregamos el log de anulacion del movimiento\r\n $query=\"insert into log_movimiento(fecha,usuario,tipo,id_movimiento_material)\r\n values('$fecha_hoy','$usuario','anulado',$id_mov)\";\r\n sql($query) or fin_pagina();\r\n\r\n //traemos el deposito de origen del MM o PM\r\n $query=\"select movimiento_material.deposito_origen\r\n \t\t from mov_material.movimiento_material\r\n \t\t where id_movimiento_material=$id_mov\";\r\n $orig=sql($query,\"<br>Error al traer el deposito origen del PM o MM<br>\") or fin_pagina();\r\n\r\n $deposito_origen=$orig->fields['deposito_origen'];\r\n descontar_reservados_mov($id_mov,$deposito_origen,1);\r\n\r\n $db->CompleteTrans();\r\n\r\n return \"El $titulo_pagina Nº $id_mov fue anulado con éxito\";\r\n}", "function Fecha_mes_n2($Ingresomes_c){\t\n$mes_mes_c = new DateTime($Ingresomes_c);\n$mes = $mes_mes_c->format('m');\nreturn $mes;\n}", "public function getValor_moeda()\n {\n return $this->valor_moeda;\n }", "function motivoDeAnulacionDesin(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ANULACIÓNDS' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "public function calcularTempo($tipoPubli,$indAberta){\n $horas = $this->calcularHoras();\n $minutos = $this->calcularMin();\n if($horas < 24){ // Menor que 1 dia\n if($minutos <= 60){ // Menor ou igual a 1 hora\n if($minutos == 0){ // Enviado agora mesmo\n $msg = \"agora\";\n }else if($minutos <= 59){ // Menor que 1 hora\n if($minutos == 1){ \n $msg = \"há 1 minuto\";\n }else if($minutos >= 2 && $minutos <= 59){\n $msg = \"há \". $minutos .\" minutos\";\n }else{ // Se os minutos forem menor que 0\n $msg = \"em \" . str_replace(\"/\", \" de \", $this->dataHoraEnvio->format('d/M/Y')) . \" às \" . $this->dataHoraEnvio->format('H:i');\n }\n }else{ // Igual a 1 hora\n $msg = \"há 1 hora\";\n }\n }else{ // Maior que 1 hora\n if($horas == 1){\n $msg = \"há 1 hora\";\n }else{\n \n $msg = \"há $horas horas\";\n }\n \n }\n }else{ // Maior que um dia\n if($horas >= 24 && $horas <= 48){ // menor q dois dias de diferenca\n $diasDiferenca = $this->dataHoraAgora->format('d') - $this->dataHoraEnvio->format('d');\n if($diasDiferenca == 1){\n $msg = \"ontem às \" . $this->dataHoraEnvio->format('H:i'); \n }else{ \n $msg = strftime('em %d de %B', strtotime($this->dataHoraEnvio->format('d-m-Y H:i:s'))) . \" às \" . $this->dataHoraEnvio->format('H:i');\n } \n }else if($this->dataHoraEnvio->format('Y') == $this->dataHoraAgora->format('Y')){ // Maior que dois dias e do mesmo ano \n $msg = strftime('em %d de %B', strtotime($this->dataHoraEnvio->format('d-m-Y H:i:s'))) . \" às \" . $this->dataHoraEnvio->format('H:i');\n }else{ // De outro ano\n $msg = strftime('em %d de %B de %Y', strtotime($this->dataHoraEnvio->format('d-m-Y H:i:s'))) . \" às \" . $this->dataHoraEnvio->format('H:i'); \n }\n }\n\n\n if($tipoPubli == \"debate\" && $indAberta == \"N\"){ // So cai nesse if se for debate e se nao estiver aberto \n $mensagem = $this->mensagemDebaNaoAberto($msg); \n }else{// se estiver aberto\n $mensagem = $this->mensagemPadrao($msg);\n } \n return $mensagem; \n }", "function calculaEdad($fechanacimiento) {\n list($anio, $mes, $dia) = explode(\"-\", $fechanacimiento);\n $anioDiferencia = date(\"Y\") - $anio;\n $mesDiferencia = date(\"m\") - $mes;\n $diaDiferencia = date(\"d\") - $dia;\n\n if ($diaDiferencia < 0 || $mesDiferencia < 0)\n $anioDiferencia--;\n\n return $anioDiferencia;\n }", "public function calcularGastoPorcentaje(){\n if($this->iPresupuestoModificado == 0)\n return 0;\n $porcentajeGasto = ($this->iGasto/$this->iPresupuestoModificado)*100;\n return $porcentajeGasto;\n }", "function calcularPonderacion($instanciaActual=\"\",$instanciaPonderar)\n\t{\n\t\t$personajesutil = new personajepar($this->BG->con);\n\t\t$personajesutil->setronda($instanciaActual);\n\t\t$personajesutil = $personajesutil->read(true,1,array(\"ronda\"));\n\t\t\n\t\t$batallutil = new batalla($this->BG->con);\n\t\t$batallutil->setronda($instanciaPonderar);\n\t\t$batallutil = $batallutil->read(true,1,array(\"ronda\"));\n\t\t\n\t\t$totalponderacion=0;\n\t\tfor($i=0;$i<count($batallutil);$i++)\n\t\t{\n\t\t\t$pos[0] = 1500;\n\t\t\t$pos[1] = 600;\n\t\t\t$pos[2] = 400;\n\t\t\t$pos[3] = 300;\n\t\t\t$pos[4] = 200;\n\t\t\t$pos[5] = 100;\n\t\t\t$pos[6] = 100;\n\t\t\t$pos[7] = 20;\n\t\t\t$peleapersonaje = new pelea($this->BG->con);\n\t\t\t$peleapersonaje->setidbatalla($batallutil[$i]->getid());\n\t\t\t$peleapersonaje = $peleapersonaje->read(true,1,array(\"idbatalla\"),1,array(\"votos\",\"DESC\"));\n\t\t\t$k=0;\n\t\t\t$calponderacion = 0;\n\t\t\tfor($j=0;$j<count($peleapersonaje);$j++)\n\t\t\t{\n\t\t\t\tif(comprobararray($personajesutil,\"id\",$peleapersonaje[$j]->getidpersonaje()))\n\t\t\t\t{\n\t\t\t\t\tif($j>0 && $peleapersonaje[$j]->getvotos() == $peleapersonaje[$j-1]->getvotos())\n\t\t\t\t\t{}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(count($pos)<=$j)\n\t\t\t\t\t\t\t$calponderacion = $pos[count($pos)-1];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$calponderacion = $pos[$j];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$calponderacion += $peleapersonaje[$j]->getvotos();\n\t\t\t\t\t}\t\t\n\t\t\t\t\t$totalponderacion+=$calponderacion;\n\t\t\t\t\t$personajemod = arrayobjeto($personajesutil,\"id\",$peleapersonaje[$j]->getidpersonaje());\n\t\t\t\t\t$personajemod->setponderacion($calponderacion);\n\t\t\t\t\t$personajemod->update(1,array(\"ponderacion\"),1,array(\"id\"));\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t$torneoActual = new torneo($this->BG->con);\n\t\t$torneoActual->setactivo(1);\n\t\t$torneoActual = $torneoActual->read(false,1,array(\"activo\"));\n\t\t$torneoActual->setponderacionprom(round($totalponderacion/count($personajesutil)));\n\t\t$torneoActual->update(1,array(\"ponderacionprom\"),1,array(\"id\"));\n\t}", "function getTimeProccess(){\n\t\treturn round($this->timeProccess,5);\n\t}", "function get_convocatoria_actual_otro(){\n $actual=date('Y-m-d');\n $anio_actual= date(\"Y\", strtotime($actual));\n \n $sql=\"select id_conv from convocatoria_proyectos \"\n .\" where fec_inicio<='\".$actual.\"' and fec_fin >='\".$actual.\"'\"\n . \" and id_tipo=2\";\n $resul=toba::db('designa')->consultar($sql);\n if(count($resul)>0){\n return $resul[0]['id_conv'];\n }else \n return null;\n }", "public function getUltimoDiaMes($elAnio,$elMes) {\r\n return date(\"d\",(mktime(0,0,0,$elMes+1,1,$elAnio)-1));\r\n }", "function Consulta_Informacion_Metas()\n {\n $sql=\"SELECT b.id,b.uid,year(b.fecha_inicio) AS ano, month(b.fecha_inicio) AS mes,b.no_dias,count(substr(b.fecha_inicio,1,7)) AS no_regs,\n sum(b.cantidad) AS total,a.name\n FROM crm_proyeccion as b LEFT JOIN users as a ON b.uid = a.uid\n WHERE b.active = 1 AND year(b.fecha_inicio) ='\".$this->ano_id.\"' AND b.gid='\".$this->gid.\"' \".$this->filtro.\"\n GROUP BY substr(b.fecha_inicio,1,7)\n ORDER BY substr(b.fecha_inicio,1,7)\";\n $res=$this->db->sql_query($sql) or die (\"Error en la consulta: \".$sql);\n if($this->db->sql_numrows($res) > 0)\n {\n while(list($id,$_uid,$ano,$mes,$no_dias,$no_reg,$cantidad,$name) = $this->db->sql_fetchrow($res))\n {\n $this->array_metas[$mes]= $cantidad;\n }\n }\n }", "function publushDateFix($publishedDate){\n\t $publishedAt = date('Y-m-d', strtotime($publishedDate));\n$publishedAt = date_create($publishedAt);\n$today = date_create('now');\n$diff=date_diff($publishedAt,$today);\n\n//accesing days\n$days = $diff->d;\n//accesing years\n$years = $diff->y;\n//accesing months\n$months = $diff->m;\n//accesing hours\n$hours=$diff->h;\nif($months==0 AND $years!=0){\n\t\t\t\techo $years.\" Year ago \";}\n\t\t\t\telseif($years==0 AND $months!=0){ echo $months; if($months==1){ echo \" month ago \";} else { echo \" months ago \";}}\n\t\t\t\telseif($years!=0 AND $months!=0){ echo $years; if($years==1){ echo \" year ago \";} else { echo \" years ago \";}}\n\t\t\t\telseif($years==0 AND $months==0 AND $days!=0 ){ echo $days; if($days==1){ echo \" day ago \";} else { echo \" days ago \";}}\n\t\t\t\telseif($years==0 AND $months==0 AND $days==0 AND $hours!=0){ echo $hours; if($hours==1){ echo \" hour ago \";} else { echo \" hours ago \";}}\n\t \n\t }", "public function calcularReservaPorcentaje(){\n if($this->iPresupuestoModificado == 0)\n return 0;\n $porcentajeReserva = ($this->iReserva/$this->iPresupuestoModificado)*100;\n return $porcentajeReserva;\n }", "public function dias_del_mes(){\n \n $fecha= date('Y-m-d');\n return; date('t',strtotime($fecha));\n \n}", "function pagoMonedas($precio){\n $pago = 0;\n \n $monedas = array_fill(0,6,0); // ind 0: 1€; ind 1: 0,50€; ind 2: 0,20€; ind 3: 0,10€; ind 4: 0,05€; ind 5: 0,01€;\n \n $vueltas = 0;\n \n while($precio != $pago){\n $vueltas ++;\n echo sprintf(\"vuelta %d - pago %f<br>\",$vueltas, $pago);\n echo sprintf(\"diferencia: %f<br>\",$precio - $pago);\n if($precio - $pago >= 1){\n $monedas[0]++;\n $pago++;\n }\n elseif($precio - $pago >= 0.5){\n $monedas[1]++;\n $pago += 0.5;\n }\n elseif($precio - $pago >= 0.2){\n $monedas[2]++;\n $pago += 0.2;\n }\n elseif($precio - $pago >= 0.1){\n $monedas[3]++;\n $pago += 0.1;\n }\n elseif($precio - $pago >= 0.05){\n $monedas[4]++;\n $pago += 0.05;\n }\n elseif($precio - $pago >= 0.01){\n $monedas[5]++;\n $pago += 0.01;\n }\n else{\n echo 'Precio no válido<br>';\n break;\n }\n \n }\n return $monedas;\n}", "public function calcularPresupuestoModificado(){\n $presupuesto = DB::table('tpresupuesto_tpartida')\n ->where('tPresupuesto_idPresupuesto','=', $this->idPresupuesto)\n ->sum('iPresupuestoModificado');\n $this->iPresupuestoModificado = $presupuesto;\n $this->save();\n }", "function calcula_metas($in_p, $in_aao, $trimestre = 0){\r\n\t\t\r\n\t\t$trimestres[1] = \"1,2,3\";\r\n\t\t$trimestres[2] = \"4,5,6\";\r\n\t\t$trimestres[3] = \"7,8,9\";\r\n\t\t$trimestres[4] = \"10,11,12\";\r\n\t\t\r\n\t\t\r\n\t\t$trim = $trimestre > 0 ? \" AND mm.id_mes IN(\".$trimestres[$trimestre].\") \" : \"\" ; \r\n\t\t\r\n\t\t$sql_afao = \" SELECT sum(mm.cantidad_metas_meses) as total \r\n\t\t\t\t\t\t\t\tFROM asignacion_ff_anp_objetivos afao, metas_meses mm \r\n\t\t\t\t\t\t\t\tWHERE \tafao.id_asignacion_ff_anp_objetivos = mm.id_ff_anp_subactividad\tAND\r\n\t\t\t\t\t\t\t \t\t\tid_presupuesto_anp in(\".$in_p.\") AND\r\n\t\t\t\t\t\t\t \t\t\tid_asignacion_anp_objetivos in(\".$in_aao.\")\t\".$trim.\"\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t \tGROUP BY id_asignacion_ff_anp_objetivos\";\r\n\t\t$query_afao = new Consulta($sql_afao);\r\n\t\t$total_metas = 0;\r\n\t\t\r\n\t\twhile($row_afao = $query_afao->ConsultaVerRegistro()){\r\n\t\t\t$total_metas += $row_afao['total'];\r\n\t\t}\r\n\t\t\r\n\t\treturn $total_metas;\r\n\t}", "function defiva($subt,$saldoi,$pago){\n $pagoiva;\n $resto = $saldoi -$subt;\n if($resto >0){\n // queda iva por aplicar\n if($resto>$pago){$pagoiva=$pago;}else{$pagoiva=$resto;}\n }else{\n //todo a capital\n $pagoiva = 0;\n }\n return $pagoiva;\n}", "public function sePuedePagar(){\n $ahora = $this->obtenerTiempo();\n if(date('d', $ahora) == (date('d', $this->ultimoPagoMedio) + 1)) {\n $this->mediosDisponibles = 2;\n }\n if(($ahora - $this->ultimoPago) >= 300 && $this->mediosDisponibles != 0){\n return true;\n }else{\n return false;\n }\n }", "protected function getTimeLastSaved()\n {\n return SiteConfig::current_site_config()->VimeoFeed_LastSaved;\n }", "public function getMontoPlanificado()\n {\n $montoPlanificado = 0;\n foreach ($this->objetivos as $objetivo)\n {\n foreach($objetivo->getActividades() as $actividad)\n {\n $moneda=$actividad->getMoneda();\n $montoPlanificado+=($actividad->getMonto()*$moneda->getPrecioBs());\n }\n }\n return $montoPlanificado;\n }", "function NUMERO_DE_HIJOS_MAYORES_ESTUDIANDO($_ARGS) {\r\n\t$_PARAMETROS = PARAMETROS();\r\n\t\r\n\tlist($a, $m)=SPLIT( '[/.-]', $_ARGS[\"PERIODO\"]); \r\n\r\n $anio = $a - 18;\r\n\t$fecha18 = \"$anio-$m-01\";\r\n\t\r\n\t $anio = $a - 25;\r\n\t$fecha25 = \"$anio-$m-01\";\r\n\r\n\t$sql = \"SELECT\r\n\t\t\t\t*\r\n\t\t\tFROM\r\n\t\t\t\trh_cargafamiliar\r\n\t\t\tWHERE\r\n\t\t\t\tCodPersona = '\".$_ARGS['TRABAJADOR'].\"' AND\r\n\t\t\t\tParentesco = 'HI' \r\n\t\t\t\tAND\tFechaNacimiento <= '\".$fecha18.\"'\r\n\t\t\t\tAND\tFechaNacimiento >= '\".$fecha25.\"'\r\n\t\t\t\tAND rh_cargafamiliar.Parentesco = 'HI' \r\n\t\t\t\tAND rh_cargafamiliar.FlagEstudia = 'S'\t\r\n\t\t\t\t\";\r\n\t$query = mysql_query($sql) or die ($sql.mysql_error());\r\n\treturn intval(mysql_num_rows($query));\r\n}", "function mois_precedent($mois,$annee){\n\t$mois--;\n\tif($mois==0){\n\t\t$annee--;\n\t\t$mois=12;\n\t}\n\treturn $_SERVER['PHP_SELF'].\"?m=$mois&a=$annee\";\n}", "public function getExpires()\n {\n\n }", "function getMontantArticle($numserie) {\n if (isset($this->calculmontant) && $this->calculmontant == true) return (sprintf(\"%.2f\", $this->article[$numserie]['montantHT']));\n else return 0;\n }", "function Consulta_Informacion_Metas()\n {\n $sql=\"SELECT b.id,b.uid,year(b.fecha_inicio) AS ano, sum(b.no_dias) as no_dias,count(substr(b.fecha_inicio,1,4)) AS no_regs,\n sum(b.cantidad) AS total,a.name\n FROM crm_proyeccion as b LEFT JOIN users as a ON b.uid = a.uid\n WHERE b.active = 1 AND b.gid='\".$this->gid.\"' \".$this->filtro.\"\n GROUP BY substr(b.fecha_inicio,1,4)\n ORDER BY substr(b.fecha_inicio,1,4)\";\n $res=$this->db->sql_query($sql) or die (\"Error en la consulta: \".$sql);\n if($this->db->sql_numrows($res) > 0)\n {\n while(list($id,$_uid,$ano,$no_dias,$no_reg,$cantidad,$name) = $this->db->sql_fetchrow($res))\n {\n $this->array_metas[$ano]= $cantidad;\n }\n }\n }", "protected function getMois()\n{\nreturn substr($this->getDateSysteme(), 5, 2);\n}", "function convertir_moneda($valor){\n\t\t//echo \"Entro: \".$valor;\n\t\t$sql=\"SELECT * FROM configuracion\";\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t$resultado=mysql_fetch_array($consulta);\n\t\tif(isset($_SESSION['moneda_temp']) && $_SESSION['moneda_temp']==\"dollar\")\n\t\t\t$valor=ceil($valor/$resultado['dolar_conf']);\n\t\tif(isset($_SESSION['moneda_temp']) && $_SESSION['moneda_temp']==\"euro\")\n\t\t\t$valor=ceil($valor/$resultado['euro_conf']);\n\t\treturn $valor;\n\t}", "public function publishedString() \n {\n $time = time() - strtotime($this->publish_date);\n $tokens = array (\n 31536000 => 'year',\n 2592000 => 'month',\n 604800 => 'week',\n 86400 => 'day',\n 3600 => 'hour',\n 60 => 'minute',\n 1 => 'second'\n );\n foreach ($tokens as $unit => $text) {\n if ($time < $unit) continue;\n $numberOfUnits = floor($time / $unit);\n return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':'') . ' ago';\n }\n }", "public function calcularPresupuestoInicial(){\n $presupuesto = DB::table('tpresupuesto_tpartida')\n ->where('tPresupuesto_idPresupuesto','=', $this->idPresupuesto)\n ->sum('iPresupuestoInicial');\n $this->iPresupuestoInicial = $presupuesto;\n $this->save();\n }", "public function getPaginaAtual(){\n return $this->PaginaAtual;\n }", "function fecha_instalacion($fecha_instalacion)\n\t{\n\t\t$hoy = date('Y-m-d');\n\t\t$fecha_valida = date('Y-m-d',strtotime('+3 day',strtotime($hoy)));\n\t\t$fecha_maxima = date('Y-m-d',strtotime('+6 month',strtotime($hoy)));\n\t\tif(($fecha_instalacion < $fecha_valida) || ($fecha_instalacion > $fecha_maxima))\n\t\t{\n\t\t\t$this->CI->form_validation->set_message('fecha_instalacion', \"El campo %s debe de ser por lo menos 3 d&iacute;as h&aacute;biles despu&eacute;s de la fecha de la orden de compra y menor a 6 meses de la misma.\");\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "function dw2_taches_generales_cron($taches_generales){\r\n\t\t$taches_generales['dw2_verif_maj'] = 3600*48; // tous les 2 jours\r\n\t\treturn $taches_generales;\r\n\t}", "function get_timeago( $ptime )\n{\n $estimate_time = time() - $ptime;\n\n if( $estimate_time < 1 )\n {\n return 'pubblicato meno di 1 secondo fa';\n }\n\n $condition = array(\n 12 * 30 * 24 * 60 * 60 => 'anno',\n 30 * 24 * 60 * 60 => 'mese',\n 24 * 60 * 60 => 'giorno',\n 60 * 60 => 'ora',\n 60 => 'minuto',\n 1 => 'secondo'\n );\n\n foreach( $condition as $secs => $str )\n {\n $d = $estimate_time / $secs;\n\n if( $d >= 1 )\n {\n $r = round( $d );\n\n if ($str == 'ora') {\n return 'pubblicato circa ' . $r . ' ' . ( $r > 1 ? substr($str, 0, -1).'e' : $str ) . ' fa';\n } else {\n return 'pubblicato circa ' . $r . ' ' . ( $r > 1 ? substr($str, 0, -1).'i' : $str ) . ' fa';\n }\n \n }\n }\n}", "function bote_creation($atts, $content=null){\r\n\tglobal $wpdb;\r\n\t$count = $wpdb->get_var(\"select count(*) from cuenta_triodos where valor is not null\");\r\n\tif ($count == 0) {\r\n\t\treturn \"<p>No hay movimientos en la cuenta.</p>\";\r\n\t}\r\n\t$row = $wpdb->get_row(\"select sum(valor) saldo, max(fecha) ult from cuenta_triodos where valor is not null\");\r\n\t$html=\r\n\t'<p>\r\n\t\t<strong>Última actualización:</strong> ' . date(\"d-m-Y\", strtotime($row->ult)) . ' (*)<br/>\r\n\t\t<strong>Saldo:</strong> ' . number_format ($row->saldo , 2 , \",\" , \",\" ) . ' €';\r\n $saldo = $row->saldo;\r\n\t$row = $wpdb->get_row(\"select CEIL(ABS(sum(valor) / CEIL(DATEDIFF(max(fecha),min(FECHA))/30))) media, MIN(fecha) desde, CEIL(DATEDIFF(current_date,min(FECHA)) /30) meses from cuenta_triodos where valor is not null and valor<0 and DATEDIFF(current_date, fecha)<=30*14\");\r\n if ($row->meses>2) {\r\n $queda = floor($saldo / $row->media);\r\n $html= $html . ' <span title=\"En base a los costes calculados sobre los últimos ' . $row->meses . ' meses\">(da para ' . $queda . ' meses más)</span>';\r\n }\r\n\t$html= $html . '\r\n\t</p>\r\n\t<table>\r\n\t\t<thead>\r\n\t\t\t<tr>\r\n\t\t\t\t<th>Fecha</th>\r\n\t\t\t\t<th>Concepto</th>\r\n\t\t\t\t<th style=\"text-align: right;\">Cantidad</th>\r\n\t\t\t</tr>\r\n\t\t</thead>\r\n\t\t<tbody>';\r\n\t$res=$wpdb->get_results(\"select fecha,concepto,valor from cuenta_triodos where valor is not null order by fecha DESC\");\r\n\tforeach ( $res as $re ) {\r\n\t\t$color = ($re->valor<0? 'red': 'blue');\r\n\t\t$html= $html . '\r\n\t\t<tr>\r\n\t\t\t<td>' . date(\"d-m-Y\", strtotime($re->fecha)) . '</td>\r\n\t\t\t<td style=\"color: ' . $color . ';\">' . (is_null($re->concepto)?'(*)':$re->concepto) . '</td>\r\n\t\t\t<td style=\"text-align: right; color: ' . $color . ';\">' . number_format ( $re->valor , 2 , \",\" , \",\" ) .' €</td>\r\n\t\t</tr>';\r\n\t}\r\n\treturn $html . '\r\n\t\t</tbody>\r\n\t</table>\r\n\t<p>(*) Esta tabla se actualiza semi-automáticamente, pudiendo tardar varios días en mostrar los últimos datos, en especial los conceptos de los movimientos.</p>\r\n <p>Si quieres que tu donación quede registrada a nombre de algún colectivo indicalo en el concepto de la transferencia o mandanos un correo a <a href=\"mailto:[email protected]\">[email protected]</a> notificándonoslo.</p>';\r\n}", "function obtener_mes($fecha) {\r\nreturn(substr($fecha,5,2));\r\n}" ]
[ "0.5942499", "0.5820981", "0.5764836", "0.5708186", "0.5681197", "0.56598574", "0.56247187", "0.5605407", "0.55942017", "0.5584095", "0.5564409", "0.5555876", "0.5553257", "0.55393404", "0.5538733", "0.5521087", "0.55160105", "0.5508137", "0.5507089", "0.55034435", "0.5503362", "0.5445872", "0.5420146", "0.5419862", "0.54148394", "0.54081583", "0.5406932", "0.53992987", "0.53882706", "0.5385287", "0.5378074", "0.53698564", "0.5369302", "0.53617626", "0.53567743", "0.5355857", "0.5349254", "0.53379965", "0.53362626", "0.5333897", "0.5329637", "0.53273916", "0.5326792", "0.5324732", "0.5312999", "0.53108627", "0.53095615", "0.53083545", "0.53030723", "0.5301897", "0.5286746", "0.5280551", "0.5277061", "0.5275137", "0.52749944", "0.52742183", "0.52734643", "0.52713543", "0.52622396", "0.5255743", "0.5254933", "0.5253701", "0.52512646", "0.525111", "0.5250443", "0.52500206", "0.5248837", "0.5240616", "0.524007", "0.5237556", "0.5237055", "0.5227247", "0.5218144", "0.5217009", "0.5216752", "0.52165115", "0.5216403", "0.5210235", "0.52091813", "0.52087915", "0.5207514", "0.52013934", "0.5201063", "0.519141", "0.51874393", "0.5186895", "0.51824677", "0.5180874", "0.5173902", "0.5172567", "0.5162904", "0.5161598", "0.5160165", "0.516011", "0.51555777", "0.5151656", "0.5150616", "0.51431096", "0.5142691", "0.5136828", "0.5136267" ]
0.0
-1
Devuelve el ultimo motivo publicado en esa cartelera a la fecha.
public function getPreviousTheme($date) { if (empty($date)) $date = date('Y-m-d'); $adverts = AdvertisementQuery::create() ->filterByBillboard($this) ->filterByPublishDate(array('max'=>$date)) ->orderByPublishdate('desc') ->limit(2) ->find(); if (empty($adverts)) return false; $advert = $adverts[1]; if (empty($advert)) return false; return $advert->getTheme(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function limite_trazadora($fecha) {\r\n $fecha = strtotime(fecha_db($fecha));\r\n $actualm = date('m', $fecha);\r\n $actualy = $actualy2 = date('Y', $fecha);\r\n // $ano = date('Y', $fecha);\r\n $desdem1 = '01';\r\n $hastam1 = '04';\r\n $desdem2 = '05';\r\n $hastam2 = '08';\r\n $desdem3 = '09';\r\n $hastam3 = '12';\r\n if ($actualm >= $desdem1 && $actualm <= $hastam1) {\r\n $cuatrimestre = 1;\r\n $cuatrimestrem = 3;\r\n //$actualy2++;\r\n }\r\n if ($actualm >= $desdem2 && $actualm <= $hastam2) {\r\n $cuatrimestre = 2;\r\n $cuatrimestrem = $cuatrimestre - 1;\r\n // $actualy2++;\r\n }\r\n if ($actualm >= $desdem3 && $actualm <= $hastam3) {\r\n $cuatrimestre = 3;\r\n $cuatrimestrem = $cuatrimestre - 1;\r\n $actualy2++;\r\n }\r\n\r\n $query2 = \"SELECT desde\r\n\t\t\t\t\tFROM facturacion.cuatrimestres\r\n\t\t\t\t\t WHERE cuatrimestre='$cuatrimestre'\";\r\n $res_sql2 = sql($query2) or excepcion(\"Error al buscar cuatrimestre\");\r\n $valor['desde'] = $actualy . '-' . $res_sql2->fields['desde'];\r\n\r\n $query2 = \"SELECT limite\r\n\t\t\t\t\tFROM facturacion.cuatrimestres\r\n\t\t\t\t\t WHERE cuatrimestre='$cuatrimestre'\";\r\n $res_sql2 = sql($query2) or excepcion(\"Error al buscar cuatrimestre\");\r\n\r\n $valor['limite'] = $actualy2 . '-' . $res_sql2->fields['limite'];\r\n\r\n return $valor;\r\n}", "function diasvenc($fechamov,$diascred){\n\t\t$a=ceil((time() - (strtotime($fechamov)))/(60* 60*24))-$diascred;\n\t\t//if($a>0){$amod=$a;}else{$amod=0;}\n\t\t$amod = ($a < 0 ? 0 : $a);\n\t\treturn $amod;\n\t}", "public function fechaVigencia() // funcion que suma fecha usada para años biciestos\n\t{\n\n\t\t$fecha = $_GET['fecha'];\n\t\t$nuevafecha = strtotime('+365 day', strtotime($fecha));\n\t\t$nuevafecha = date('Y-m-d', $nuevafecha);\n\t\treturn $nuevafecha;\n\t}", "function mdatosPublicaciones(){\n\t\t$conexion = conexionbasedatos();\n\n\t\t$consulta = \"select * from final_publicacion order by FECHA_PUBLICACION desc; \";\n\t\tif ($resultado = $conexion->query($consulta)) {\n\t\t\treturn $resultado;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}", "function getMaximoRetirable($fecha = false){\n\t\tif ( $fecha == false ){\n\t\t\t$fecha = fechasys();\n\t\t}\n\t\tif ( $this->mCuentaIniciada == false ) {\n\t\t $this->init();\n\t\t}\n\t\t//Obtener la Captacion Total\n\t\t$xSoc\t\t\t\t\t= new cSocio($this->mSocioTitular);\n\t\t$DTCap\t\t\t\t\t= $xSoc->getTotalCaptacionActual();\n\t\t$this->mMessages \t\t.= \"MAX_RETIRABLE\\tA la fecha $fecha, El Saldo Total de Captacion es \" . $DTCap[\"saldo\"] . \" \\r\\n\";\n\t\t$this->mMessages \t\t.= \"MAX_RETIRABLE\\tA la fecha $fecha, El saldo por Esta Cuenta es \" . $this->mNuevoSaldo . \" \\r\\n\";\n\t\t$saldo\t\t\t\t\t= $this->mSaldoAnterior;\n\t\t$saldo\t\t\t\t\t= ( $DTCap[\"saldo\"] - $saldo ) + $this->mNuevoSaldo ;\n\t\t$maximo_retirable\t\t= 0;\n\t\t//obtener los maximos retirables por credito\n\t\t//2011-1-30 cambio de monto_autorizado a saldo_actual\n\t\t$sqlCompCreditos = \"SELECT\n\t\t\t\t\t\t\t\tSUM(`creditos_solicitud`.`saldo_actual`) AS `monto`\n\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\t`creditos_solicitud` `creditos_solicitud`\n\t\t\t\t\t\t\t\t\tINNER JOIN `eacp_config_bases_de_integracion_miembros`\n\t\t\t\t\t\t\t\t\t`eacp_config_bases_de_integracion_miembros`\n\t\t\t\t\t\t\t\t\tON `creditos_solicitud`.`tipo_convenio` =\n\t\t\t\t\t\t\t\t\t`eacp_config_bases_de_integracion_miembros`.`miembro`\n\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t(`creditos_solicitud`.`numero_socio` = \" . $this->mSocioTitular . \")\n\t\t\t\t\t\t\t\t\tAND\n\t\t\t\t\t\t\t\t\t(`eacp_config_bases_de_integracion_miembros`.`codigo_de_base` = 1110)\n\t\t\t\t\t\t\t\t\tAND\n \t\t\t\t\t(`creditos_solicitud`.`saldo_actual` > \" . TOLERANCIA_SALDOS . \")\n\t\t\t\t\t\t\t\tGROUP BY\n\t\t\t\t\t\t\t\t\t`creditos_solicitud`.`numero_socio`,\n\t\t\t\t\t\t\t\t\t`eacp_config_bases_de_integracion_miembros`.`codigo_de_base`\n \";\n\t\t$d\t\t\t\t\t\t\t= obten_filas($sqlCompCreditos);\n\t\t//Obtener el Maximo Comprometidos por Garantia Liquida\n\t\t$sqlCC = \"SELECT\n\t\t\t\t\t\t\t`creditos_solicitud`.`numero_socio`,\n\t\t\t\t\t\t\tSUM(`creditos_solicitud`.`saldo_actual`) AS 'monto_creditos',\n\t\t\t\t\t\t\tSUM(`creditos_solicitud`.`saldo_Actual` *\n\t\t\t\t\t\t\t`creditos_tipoconvenio`.`porciento_garantia_liquida`) AS 'monto_garantia'\n\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t`creditos_solicitud` `creditos_solicitud`\n\t\t\t\t\t\t\t\tINNER JOIN `creditos_tipoconvenio` `creditos_tipoconvenio`\n\t\t\t\t\t\t\t\tON `creditos_solicitud`.`tipo_convenio` = `creditos_tipoconvenio`.\n\t\t\t\t\t\t\t\t`idcreditos_tipoconvenio`\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t(`creditos_solicitud`.`numero_socio` =\" . $this->mSocioTitular . \")\n\t\t\t\t\t\t\tAND\n\t\t\t\t\t\t\t(`creditos_solicitud`.`saldo_actual` > \" . TOLERANCIA_SALDOS . \")\n\t\t\t\t\t\tGROUP BY\n\t\t\t\t\t\t\t`creditos_solicitud`.`numero_socio` \";\n\t\t$comprometido_por_garantia\t= 0;\n\n\t\t$comprometido_por_creditos\t= (isset($d[\"monto\"])) ? csetNoMenorQueCero( $d[\"monto\"] ) : 0;\n\t\t$comprometido_por_ide\t\t= 0;\t\t\t//Terminar el saldo de IDE retirable\n\t\t$this->mMessages \t\t\t.= \"MAX_RETIRABLE\\tA la fecha $fecha, Lo Comprometido por Creditos es de $comprometido_por_creditos \\r\\n\";\n\t\t$this->mMessages \t\t\t.= \"MAX_RETIRABLE\\tA la fecha $fecha, Lo Comprometido por IDE es de $comprometido_por_ide\\r\\n\";\n\n\t\t//\n\t\tif ( $this->mSubProducto == CAPTACION_PRODUCTO_GARANTIALIQ){\n\t\t\t$c\t\t\t\t\t\t\t= obten_filas($sqlCC);\n\t\t\t$comprometido_por_garantia\t= setNoMenorQueCero( $c[\"monto_garantia\"] );\n\t\t\t$this->mMessages \t\t\t.= \"MAX_RETIRABLE\\tA la fecha $fecha, Lo Comprometido por GARANTIA LIQUIDA ES $comprometido_por_garantia \\r\\n\";\n\t\t\t$saldo\t\t\t\t\t\t= $this->mNuevoSaldo;\t//correccion por garantia liquida\n\t\t\t$comprometido_por_creditos\t= 0;\t\t\t\t\t//La ganartia liquida solo es presionado por lo comprometido por garantia\n\t\t}\n\t\t//\n\n\n\t\t$maximo_retirable\t\t\t= $saldo - ($comprometido_por_creditos + $comprometido_por_ide + $comprometido_por_garantia);\n\t\t$maximo_retirable\t\t\t= setNoMenorQueCero($maximo_retirable);\n\t\t$this->mMessages \t\t\t.= \"MAX_RETIRABLE\\tA la fecha $fecha, El Maximo Retirable es de $maximo_retirable de un Monto de $saldo\\r\\n\";\n\t\t//Componer el Saldo, no puede ser mayor al nuevo saldo\n\t\treturn ($maximo_retirable <= $this->mNuevoSaldo ) ? round($maximo_retirable, 2) : round($this->mNuevoSaldo, 2);\n\t}", "function fecha_menor($diainicio,$diafin,$mesinicio,$mesfin,$anioinicio,$aniofin){\r\n\r\n$dif_en_meses=(($mesfin-$mesinicio)+(12*($aniofin-$anioinicio)));\r\n\r\nif($dif_en_meses<0){return(0);}\r\nif(($dif_en_meses==0) && ($diafin<$diainicio)){return(0);}\r\nreturn(1);\r\n}", "public function getFechaUltimaModificacion( ){\n\t\t\treturn $this->fechaUltimaModificacion;\n\t\t}", "public function otorgarPrestamo(){\n $fecha = date('d-m-y');\n $this->setFechaOtorgado($fecha);\n $cantidadCuotas = $this->getCantidadCuotas();\n $monto = $this->getMonto();\n $colObjCuota = array();\n for($i=0; $i<$cantidadCuotas; $i++){\n $montoCuota = $monto / $cantidadCuotas;\n $montoInteres = $this->calcularInteresPrestamo($i);\n $colObjCuota[$i] = new Cuota($i, $montoCuota, $montoInteres);\n }\n $this->setColObjCuota($colObjCuota);\n }", "function fechaPrestacionXLimite($fprestacion, $fprest_limite) {\r\n $pr = ((strtotime($fprest_limite) - strtotime($fprestacion)) / 86400); //limite de la prestacion - fecha prestacion\r\n $ctrl_fechapresta['debito'] = false;\r\n if ($pr < 0) {\r\n\r\n $ctrl_fechapresta['debito'] = true;\r\n $ctrl_fechapresta['id_error'] = 71;\r\n $ctrl_fechapresta['msj_error'] = 'Fecha de Prestacion supera el limite para el periodo liquidado';\r\n }\r\n return $ctrl_fechapresta;\r\n}", "public function modalitadiPagamento(){\n $delta = substr($this->dataInizioPeriodo(), -4) - substr($this->dataFinePeriodo(), -4);\n \n if($delta != 0) {\n return \"due soluzioni, di cui la seconda al termine del contratto\";\n } else {\n return \"un'unica soluzione al termine del contratto\";\n }\n\n }", "function ultimos_materiales_publicados() {\n\t\n\t\t\n\t\t$query = \"SELECT COUNT(*)\n\t\tFROM materiales, licencias\n\t\tWHERE materiales.material_licencia=licencias.id_licencia\n\t\tAND materiales.material_estado=1\n\t\tORDER BY materiales.fecha_alta desc\";\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\n\t\t$numrows = mysql_fetch_array($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows[0] == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\treturn $numrows[0];\n\t\t}\n\t}", "function moisAnPasse()\n{\n\t$dateActuelle = date(\"d/m/Y\");\n\t@list($jour, $mois, $annee) = explode('/', $dateActuelle);\n\t$annee--;\n\t$moisActuel = $annee . $mois;\n\treturn $moisActuel;\n}", "public function perimetre()\n {\n // section -64--88--103-1-2c9bd139:16deeff2ef5:-8000:000000000000099C begin\n // section -64--88--103-1-2c9bd139:16deeff2ef5:-8000:000000000000099C end\n }", "public function mes(){\n\n\t\t$date = $this->dia;\n $date = DateTime::createFromFormat('Y-m-d', $date);\n \t \n\t\treturn $date->format('m') - 1;\n\t}", "public function trae_solo_anio_actual()\n {\n return $this->fecha->year;\n }", "function ultimos_eu_publicados_limit($inicial,$cantidad) {\n\t\n\t\t$query = \"SELECT eu.*, eu_descripcion.*\n\t\tFROM eu, eu_descripcion\n\t\tWHERE eu.id_eu=eu_descripcion.id_eu\n\t\tAND eu.eu_estado=1\n\t\tORDER BY eu.fecha_alta desc\n\t\tLIMIT $inicial,$cantidad\";\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\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "public function getSalarioMinimoAtual(){\r\n\t $aux = $this->getAll([\"status=1\"]);\r\n\t return $aux[0]->valor;\r\n\t}", "function getMerezcoTarjeta(){\n\t\tif($this->numero_cambio >= 3)\n\t\t\t$necesito=2;\n\t\telse\n\t\t\t$necesito=1;\n\t\t\n\t\tif($necesito <= $this->sacar_tarjeta){\n\t\t\t$this->sacar_tarjeta=0;\n\t\t\treturn 1;\n\t\t}\n\t\telse{\n\t\t\t$this->sacar_tarjeta=0;\n\t\t\treturn 0;\n\t\t}\n\t}", "public function getDatePubli()\r\n {\r\n return $this->datePubli;\r\n }", "public function consumo_medio_puntual_prevision($codart){\n\n $hoy=date('Y-m-d');\n $fecha_inicio = date('Y-m-d', strtotime(\"-3 month\", strtotime( $hoy ) ));\n $consumo = 0;\n\n $query1 = Planilla_entrega_renglones::find();\n $query1->joinWith(['remito']);\n $query1->andFilterWhere([\n 'PR_DEPOSITO' => $this->deposito,\n 'PR_CODART' => $codart,\n ]);\n \n $query1->andFilterWhere(['>=','PE_FECHA', $fecha_inicio]);\n\n $consumo += $query1->sum('PR_CANTID');\n\n \n $query1 = Devolucion_salas_renglones::find();\n\n $query1->joinWith(['devolucion_encabezado']);\n $query1->andFilterWhere([\n 'PR_DEPOSITO' => $this->deposito,\n 'PR_CODART' => $codart,\n ]);\n\n $query1->andFilterWhere(['>=','DE_FECHA', $fecha_inicio]);\n\n $consumo -= $query1->sum('PR_CANTID');\n \n $segundos=strtotime('now') - strtotime($fecha_inicio);\n \n $dias=intval($segundos/60/60/24);\n return $consumo/$dias;\n\n }", "public function fechaFinPublicacion($fechainicio){\r\n\t\t$año = substr($fechainicio, 0, 4);\r\n\t\t$mes = substr($fechainicio, 5, 2);\r\n\t\t$dia = substr($fechainicio, 8, 2);\r\n\t\t$fecha = date_create();\r\n\t\tdate_date_set($fecha, $año, $mes, $dia);\r\n\t\t$fecha->add(new DateInterval(\"P6M\"));\r\n\t\treturn $fecha;\r\n\t}", "function procesar_cambio ($datos){\n //validamos que no exista otro periodo, para ello tomamos la fecha actual y obtenemos todos los periodo \n //que existen con sus respectivos dias y verificamos que el espacio que se quiere cargar no este ocupado en esos \n //dias\n \n }", "function obtener_minutos($fecha) {\r\nreturn(substr($fecha,14,2));\r\n}", "function date_modif_manuelle_autoriser() {\n}", "public function getUltimoDiaMes($elAnio,$elMes) {\n return date(\"d\",(mktime(0,0,0,$elMes+1,1,$elAnio)-1));\n }", "function moisActuel()\n{\n\t$dateActuelle = date(\"d/m/Y\");\n\t@list($jour, $mois, $annee) = explode('/', $dateActuelle);\n\t//$annee--;\n\t$moisActuel = $mois;\n\treturn $annee . $moisActuel;\n}", "function objetivos_mes(){\r\n \r\n $data['sistema'] = $this->sistema;\r\n \r\n $dia = $this->input->post(\"dia\"); \r\n $mes = $this->input->post(\"mes\"); \r\n $anio = $this->input->post(\"anio\");\r\n \r\n $fecha = date(\"Y-m-d H:i:s\", strtotime($anio.\"-\".$mes.\"-\".$dia));\r\n\r\n $primer_dia = 1;\r\n $ultimo_dia = $this->getUltimoDiaMes($anio,$mes);\r\n \r\n //$fecha_inicial = date(\"Y-m-d H:i:s\", strtotime($anio.\"-\".$mes.\"-\".$primer_dia) );\r\n //$fecha_final = date(\"Y-m-d H:i:s\", strtotime($anio.\"-\".$mes.\"-\".$ultimo_dia) );\r\n \r\n $fecha_inicial = $anio.\"-\".$mes.\"-01\";\r\n //$fecha_final = $anio.\"-\".$mes.\"-31\";\r\n $fecha_final = $anio.\"-\".$mes.\"-\".$ultimo_dia;\r\n // --------------------------------------------------------------------------------------------\r\n $sql_objetivos = \"SELECT u.usuario_nombre, u.`usuario_imagen`, aux.`tipousuario_descripcion`, e.`estado_color`, e.estado_descripcion, o.*\r\n FROM `objetivo` AS o\r\n LEFT JOIN usuario AS u ON o.usuario_id = u.`usuario_id`\r\n LEFT JOIN estado AS e ON o.`estado_id` = e.estado_id\r\n LEFT JOIN (\r\n SELECT u.`usuario_id`, t.tipousuario_descripcion \r\n FROM usuario AS u, tipo_usuario AS t\r\n WHERE u.`tipousuario_id` = t.`tipousuario_id`\r\n ) AS aux ON o.`usuario_id` = aux.usuario_id\r\n WHERE o.`usuario_id` = u.usuario_id\";\r\n //echo $sql_objetivos;\r\n $objetivos = $this->db->query($sql_objetivos)->result_array();\r\n // --------------------------------------------------------------------------------------------\r\n $sql_ventas_mes = \"SELECT if(sum(d.detalleven_total)>0, round(sum(d.detalleven_total),2), 0) AS total_mes, u.usuario_id\r\n FROM usuario AS u\r\n LEFT JOIN objetivo AS o ON o.usuario_id = u.usuario_id\r\n LEFT JOIN estado AS e ON u.`estado_id` = e.`estado_id`\r\n LEFT JOIN tipo_usuario AS t ON t.`tipousuario_id` = u.`tipousuario_id`\r\n left join detalle_venta as d on d.`usuario_id` = u.`usuario_id`\r\n left join venta as v on v.`usuario_id`=o.usuario_id\r\n WHERE o.usuario_id = u.usuario_id AND\r\n v.venta_id = d.venta_id AND \r\n v.venta_fecha >= '\".$fecha_inicial.\"' AND \r\n v.venta_fecha <= '\".$fecha_final.\"' AND \r\n v.usuario_id = u.usuario_id\r\n GROUP BY u.usuario_nombre \r\n order by u.usuario_nombre\r\n \";\r\n/* $sql_ventas_mes = \"SELECT if(sum(d.detalleven_total) > 0, round(sum(d.detalleven_total), 2), 0) AS total_mes, u.usuario_id\r\n FROM\r\n usuario u, detalle_venta d, venta v\r\n\r\n WHERE\r\n v.venta_id = d.venta_id AND \r\n v.venta_fecha >= '\".$fecha_inicial.\"' AND \r\n v.venta_fecha <= '\".$fecha_final.\"' AND \r\n v.usuario_id = u.usuario_id\r\n GROUP BY\r\n u.usuario_id\r\n ORDER BY\r\n u.usuario_nombre\";\r\n*/ \r\n //echo $sql_ventas_mes;\r\n $ventas_mes = $this->db->query($sql_ventas_mes)->result_array();\r\n // --------------------------------------------------------------------------------------------\r\n $sql_ventas_dia = \"SELECT if(sum(d.detalleven_total)>0, round(sum(d.detalleven_total),2), 0) AS total_dia, u.usuario_id\r\n FROM usuario AS u\r\n LEFT JOIN objetivo AS o ON o.usuario_id = u.usuario_id\r\n LEFT JOIN estado AS e ON u.`estado_id` = e.`estado_id`\r\n LEFT JOIN tipo_usuario AS t ON t.`tipousuario_id` = u.`tipousuario_id`\r\n left join detalle_venta as d on d.`usuario_id` = u.`usuario_id`\r\n left join venta as v on v.`usuario_id`=o.usuario_id\r\n WHERE o.usuario_id = u.usuario_id AND\r\n v.venta_id = d.venta_id AND \r\n v.venta_fecha = '\".$fecha.\"' AND \r\n v.usuario_id = u.usuario_id\r\n GROUP BY u.usuario_nombre \r\n order by u.usuario_nombre\r\n \";\r\n/* $sql_ventas_dia = \"SELECT \r\n if(sum(d.detalleven_total) > 0, round(sum(d.detalleven_total), 2), 0) AS total_dia,\r\n u.usuario_id\r\n FROM\r\n usuario u, venta v, detalle_venta d\r\n WHERE\r\n v.venta_fecha = '\".$fecha.\"' and\r\n v.venta_id = d.venta_id and\r\n v.usuario_id = u.usuario_id\r\n GROUP BY\r\n u.usuario_id\r\n ORDER BY\r\n u.usuario_nombre\";*/\r\n \r\n //echo $sql_ventas_dia;\r\n $ventas_dia = $this->db->query($sql_ventas_dia)->result_array();\r\n // // --------------------------------------------------------------------------------------------\r\n $sql_pedidos_mes = \"SELECT if(count(p.`pedido_total`)>0, COUNT(p.`pedido_total`),0) as pedido_mes, u.usuario_id\r\n FROM pedido as p\r\n LEFT JOIN venta as v on p.pedido_id = v.`pedido_id`\r\n LEFT JOIN usuario as u on p.`usuario_id` = u.usuario_id\r\n left join objetivo as o on p.`usuario_id` = o.`usuario_id`\r\n where v.`entrega_id` = 2\r\n and p.`pedido_fecha` >= '\".$fecha_inicial.\"'\r\n and p.pedido_fecha <= '\".$fecha_final.\"'\r\n and p.`regusuario_id` = o.usuario_id\r\n group by u.usuario_nombre\r\n ORDER by u.usuario_nombre\";\r\n \r\n \r\n/* $sql_pedidos_mes = \"SELECT \r\n if(count(p.pedido_total) > 0, COUNT(p.pedido_total), 0) AS pedido_mes, u.usuario_id\r\n\r\n FROM\r\n pedido p, venta v, detalle_venta d, usuario u\r\n\r\n WHERE\r\n v.entrega_id = 2 AND \r\n p.pedido_fecha >= '\".$fecha_inicial.\"' AND \r\n p.pedido_fecha <= '\".$fecha_final.\"' AND \r\n p.pedido_id = v.pedido_id and\r\n d.venta_id = v.venta_id and\r\n u.usuario_id = v.usuario_id\r\n\r\n GROUP BY\r\n\r\n u.usuario_id\r\n\r\n ORDER BY\r\n\r\n u.usuario_nombre\";*/\r\n //echo $sql_pedidos_mes;\r\n \r\n $pedidos_mes = $this->db->query($sql_pedidos_mes)->result_array();\r\n // // --------------------------------------------------------------------------------------------\r\n $sql_pedidos_dia = \"SELECT IF(COUNT(p.`pedido_id`)>0, COUNT(p.`pedido_id`),0) as pedido_dia, u.usuario_id\r\n FROM pedido AS p\r\n LEFT JOIN venta as v on p.pedido_id = v.`pedido_id`\r\n LEFT JOIN usuario AS u ON p.`usuario_id` = u.usuario_id\r\n LEFT JOIN objetivo AS o ON p.`usuario_id` = o.`usuario_id`\r\n WHERE date(p.`pedido_fecha`) = '\".$fecha.\"'\r\n AND p.`regusuario_id` = o.usuario_id\r\n GROUP BY u.usuario_nombre\r\n ORDER BY u.usuario_nombre\r\n \";\r\n //echo $sql_pedidos_dia;\r\n \r\n $pedidos_dia = $this->db->query($sql_pedidos_dia)->result_array();\r\n \r\n $data = array(\r\n \"objetivos\" => $objetivos,\r\n \"ventas_dia\" => $ventas_dia,\r\n \"ventas_mes\" => $ventas_mes,\r\n \"pedidos_dia\" => $pedidos_dia,\r\n \"pedidos_mes\" => $pedidos_mes\r\n );\r\n echo json_encode($data);\r\n }", "function primer_dia_periodo() {\n\n $sql=\"select fecha_inicio from mocovi_periodo_presupuestario where actual=true\";\n $resul=toba::db('designa')->consultar($sql);\n return $resul[0]['fecha_inicio'];\n \n }", "function ultimoDiaMes($data, $formato) {\r\n list($dia, $mes, $ano) = explode('/', $data);\r\n return date($formato, mktime(0, 0, 0, $mes + 1, 0, $ano));\r\n }", "public function getAtualizadoEm()\n {\n return $this->atualizadoEm;\n }", "function ultimoDiaMes($x_fecha_f){\r\n\techo \"entra a ultimo dia mes con fecha \".$x_fecha_f.\"<br>\";\r\n\t\t\t\t\t$temptime_f = strtotime($x_fecha_f);\t\r\n\t\t\t\t\t$x_numero_dia_f = strftime('%d', $temptime_f);\r\n\t\t\t\t\t$x_numero_mes_f = strftime('%m', $temptime_f);\r\n\t\t\t\t\techo \"numero mes\".$x_numero_mes_f.\"<br>\";\r\n\t\t\t\t\t$x_numero_anio_f = strftime('%Y', $temptime_f);\r\n\t\t\t\t\t$x_ultimo_dia_mes_f = strftime(\"%d\", mktime(0, 0, 0, $x_numero_mes_f+2, 0, $x_numero_anio_f));\r\n\techo \"el ultimo dia de mes es\".\t$x_ultimo_dia_mes_f .\"<br>\";\t\t\t\r\n\treturn $x_ultimo_dia_mes_f;\r\n}", "function ultimo_dia_periodo() { \n\n $sql=\"select fecha_fin from mocovi_periodo_presupuestario where actual=true\";\n $resul=toba::db('designa')->consultar($sql); \n return $resul[0]['fecha_fin'];\n }", "public function dias_del_mes(){\n \n $fecha= date('Y-m-d');\n return; date('t',strtotime($fecha));\n \n}", "function calculaEdad($fechanacimiento) {\n list($anio, $mes, $dia) = explode(\"-\", $fechanacimiento);\n $anioDiferencia = date(\"Y\") - $anio;\n $mesDiferencia = date(\"m\") - $mes;\n $diaDiferencia = date(\"d\") - $dia;\n\n if ($diaDiferencia < 0 || $mesDiferencia < 0)\n $anioDiferencia--;\n\n return $anioDiferencia;\n }", "public function get_codigo_muestra($cod_muestra){\n $fecha = getdate();\n $dia = $fecha[\"mday\"];\n $mes = $fecha[\"mon\"];\n $año = $fecha[\"year\"];\n $año_=substr($año,2);\n \n while($datos = mysqli_fetch_array($cod_muestra)){\n $codigo_muestra = $datos['codigo_muestra'];\n }\n if($codigo_muestra!=\"\"){\n (int)$primer_digito = substr($codigo_muestra,0,4);\n $num = ((int)$primer_digito+1);\n\n $codigo_muestra = $num.\"-\".$dia.\"-\".$mes.\"-\".$año_.\"-\".$num;\n \n return ltrim($codigo_muestra);\n\n }else{\n $codigo_muestra =\"100\".\"-\".$dia.\"-\".$mes.\"-\".$año_.\"-\".\"100\";\n return $codigo_muestra;\n }\n\n }", "function Fecha_mes_n2($Ingresomes_c){\t\n$mes_mes_c = new DateTime($Ingresomes_c);\n$mes = $mes_mes_c->format('m');\nreturn $mes;\n}", "public function getMontoEjecutado()\n {\n $montoEjecutado = 0;\n foreach ($this->objetivos as $objetivo)\n {\n if (count($objetivo->getActividades())!=0)\n {\n foreach($objetivo->getActividades() as $actividad)\n {\n if (count($actividad->getRecursoEjecutado())!=0)\n {\n foreach($actividad->getRecursoEjecutado() as $ejecutado)\n {\n $moneda = $ejecutado->getMoneda();\n $montoEjecutado+=($ejecutado->getMonto()*$moneda->getPrecioBs());\n }\n }\n } \n }\n }\n return $montoEjecutado;\n }", "function Fecha_mes_n($Ingresomes_c){\t\n$mes_mes_c = new DateTime($Ingresomes_c);\n$me = $mes_mes_c->format('m');\n$mes='';\nif($me=='01') $mes='01';\nif($me=='02') $mes='02';\nif($me=='03') $mes='03';\nif($me=='04') $mes='04';\nif($me=='05') $mes='05';\nif($me=='06') $mes='06';\nif($me=='07') $mes='07';\nif($me=='08') $mes='08';\nif($me=='09') $mes='09';\nif($me=='10') $mes='10';\nif($me=='11') $mes='11';\nif($me=='12') $mes='12';\n$cadena = (\"$mes\");\nreturn $cadena;\n}", "function ultimos_materiales_publicados_limit($inicial,$cantidad) {\n\t\n\t\t\n\t\t$query = \"SELECT materiales.*, licencias.*\n\t\tFROM materiales, licencias\n\t\tWHERE materiales.material_licencia=licencias.id_licencia\n\t\tAND materiales.material_estado=1\n\t\tORDER BY materiales.fecha_alta desc\n\t\tLIMIT $inicial,$cantidad\";\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\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "private function _consolideDate(){\n\t\t$this->_mktime();\n\t\t$this->_setDate();\n\t}", "public function getSimulacionReajuste(){\n //calculando según el IPC acumulado\n //entre el último reajuste realizado y ahora. \n $mes_actual = (int)date(\"m\");\n $agno_actual = (int)date('Y');\n $mes_inicio = $mes_actual - $this->reajusta_meses;\n $agno_inicio = $agno_actual;\n if($mes_inicio <= 0){\n $agno_inicio -= 1;\n $mes_inicio+= 12;\n }\n $ipcs = array();\n if($agno_inicio != $agno_actual){\n $ipcs = Ipc::model()->findAll(array('order'=>'mes','condition'=>'mes >= :m and agno = :a','params'=>array(':m'=>$mes_inicio,':a'=>$agno_inicio)));\n $ipcs_actual = Ipc::model()->findAll(array('order'=>'mes','condition'=>'mes < :m and agno = :a','params'=>array(':m'=>$mes_actual,':a'=>$agno_actual)));\n foreach($ipcs_actual as $ipc){\n $ipcs[] = $ipc;\n }\n }\n else{\n $ipcs = Ipc::model()->findAll(array('condition'=>'mes >= :m1 and mes < :m2 and agno = :a','params'=>array(':m1'=>$mes_inicio,':m2'=>$mes_actual,':a'=>$agno_actual)));\n }\n\n $ipc_acumulado = 0;\n foreach($ipcs as $ipc){\n //sumo los ipcs para generar el ipc acumulado\n $ipc_acumulado+= $ipc->porcentaje;\n }\n //para hacer el cálculo según porcentaje\n $ipc_acumulado /= 100;\n\n //saco el último debe pagar para ver cuánto era lo que tenía que pagar antes\n $debePagars = DebePagar::model()->findAllByAttributes(array('contrato_id'=>$this->id),array('order'=>'id DESC'));\n $debePagar = $debePagars[0];\n \n $debeNuevo = new DebePagar();\n $debeNuevo->agno = $agno_actual;\n $debeNuevo->mes = $mes_actual;\n $debeNuevo->dia = $debePagar->dia;\n $debeNuevo->contrato_id = $this->id;\n //ahora hay que reajustar los montos del contrato dependiendo del ipc_acumulado\n //el precio base debe ser el valor anterior en debe pagar\n $debeNuevo->monto_gastocomun = intval($debePagar->monto_gastocomun*(1+$ipc_acumulado));\n $debeNuevo->monto_gastovariable = intval($debePagar->monto_gastovariable*(1+$ipc_acumulado));\n $debeNuevo->monto_mueble = intval($debePagar->monto_mueble*(1+$ipc_acumulado));\n $debeNuevo->monto_renta = intval($debePagar->monto_renta*(1+$ipc_acumulado));\n \n return array('actual'=>$debePagar, 'nuevo'=>$debeNuevo);\n }", "public function fechaInicioPublicacion($fechainicio){\r\n\t\t$año = substr($fechainicio, 0, 4);\r\n\t\t$mes = substr($fechainicio, 5, 2);\r\n\t\t$dia = substr($fechainicio, 8, 2);\r\n\t\t$fecha = date_create();\r\n\t\tdate_date_set($fecha, $año, $mes, $dia);\r\n\t\treturn $fecha;\r\n\t}", "public function puestaACero()\n {\n $this->hh = 0;\n $this->mm = 0;\n $this->ss = 0;\n }", "function calcular_limite_fecha_prestacion($mes_vig, $ano_vig) {\r\n if ($mes_vig == '12') {\r\n $mes_vig1 = '01';\r\n $ano_vig1 = $ano_vig + 1;\r\n }\r\n if ($mes_vig != '12') {\r\n $mes_vig1 = $mes_vig + 1;\r\n $ano_vig1 = $ano_vig;\r\n if ($mes_vig1 < 10) {\r\n $mes_vig1 = '0' . $mes_vig1;\r\n }\r\n }\r\n return '10/' . $mes_vig1 . '/' . $ano_vig1;\r\n}", "function obtenerPeriodoActual($conexion)\n{\n $anoActual = date('Y');\n $mesActual = date('m');\n\n if ($mesActual > 6) {\n $sentencia = \"select idPeriodo from periodo where AnoInicio=\" . $anoActual;\n } elseif ($mesActual <= 6) {\n $sentencia = \"select idPeriodo from periodo where AnoInicio=\" . ($anoActual - 1);\n }\n\n $conexion->Ejecuto($sentencia);\n $periodo = $conexion->Siguiente();\n return $periodo['idPeriodo'];\n}", "function fecha_instalacion($fecha_instalacion)\n\t{\n\t\t$hoy = date('Y-m-d');\n\t\t$fecha_valida = date('Y-m-d',strtotime('+3 day',strtotime($hoy)));\n\t\t$fecha_maxima = date('Y-m-d',strtotime('+6 month',strtotime($hoy)));\n\t\tif(($fecha_instalacion < $fecha_valida) || ($fecha_instalacion > $fecha_maxima))\n\t\t{\n\t\t\t$this->CI->form_validation->set_message('fecha_instalacion', \"El campo %s debe de ser por lo menos 3 d&iacute;as h&aacute;biles despu&eacute;s de la fecha de la orden de compra y menor a 6 meses de la misma.\");\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "function ultimas_noticias_publicadas($limit) {\n\t\n\t\t$query = \"SELECT noticias.*, colaboradores.*\n\t\tFROM noticias, colaboradores\n\t\tWHERE noticias.id_colaborador=colaboradores.id_colaborador\n\t\tAND noticias.estado=1\n\t\tORDER BY noticias.fecha_insercion desc\n\t\tLIMIT 0,$limit\";\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\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "function votoMedio($nome) {\n\t$rows = selectVotoMedio($nome);\n\t$voto = 0;\n\tforeach ($rows as $row){\n\t\t$voto = $row[\"votoMedio\"];\n\t}\n\t$votoFormattato = number_format($voto, 1);\n\treturn $votoFormattato;\n}", "function metpago($metpago){\n\tif($metpago==\"01\"){$cuenta=\"101.01\";}else{$cuenta=\"102.01\";}\n\treturn $cuenta;\n}", "public function takePostBaseOnMonth();", "public function calcularSueldo(){\n $this->horas_trabajadas * 540;\n }", "function get_convocatoria_actual_otro(){\n $actual=date('Y-m-d');\n $anio_actual= date(\"Y\", strtotime($actual));\n \n $sql=\"select id_conv from convocatoria_proyectos \"\n .\" where fec_inicio<='\".$actual.\"' and fec_fin >='\".$actual.\"'\"\n . \" and id_tipo=2\";\n $resul=toba::db('designa')->consultar($sql);\n if(count($resul)>0){\n return $resul[0]['id_conv'];\n }else \n return null;\n }", "function publushDateFix($publishedDate){\n\t $publishedAt = date('Y-m-d', strtotime($publishedDate));\n$publishedAt = date_create($publishedAt);\n$today = date_create('now');\n$diff=date_diff($publishedAt,$today);\n\n//accesing days\n$days = $diff->d;\n//accesing years\n$years = $diff->y;\n//accesing months\n$months = $diff->m;\n//accesing hours\n$hours=$diff->h;\nif($months==0 AND $years!=0){\n\t\t\t\techo $years.\" Year ago \";}\n\t\t\t\telseif($years==0 AND $months!=0){ echo $months; if($months==1){ echo \" month ago \";} else { echo \" months ago \";}}\n\t\t\t\telseif($years!=0 AND $months!=0){ echo $years; if($years==1){ echo \" year ago \";} else { echo \" years ago \";}}\n\t\t\t\telseif($years==0 AND $months==0 AND $days!=0 ){ echo $days; if($days==1){ echo \" day ago \";} else { echo \" days ago \";}}\n\t\t\t\telseif($years==0 AND $months==0 AND $days==0 AND $hours!=0){ echo $hours; if($hours==1){ echo \" hour ago \";} else { echo \" hours ago \";}}\n\t \n\t }", "function Consulta_Informacion_Metas()\n {\n $sql=\"SELECT b.id,b.uid,year(b.fecha_inicio) AS ano, month(b.fecha_inicio) AS mes,b.no_dias,count(substr(b.fecha_inicio,1,7)) AS no_regs,\n sum(b.cantidad) AS total,a.name\n FROM crm_proyeccion as b LEFT JOIN users as a ON b.uid = a.uid\n WHERE b.active = 1 AND year(b.fecha_inicio) ='\".$this->ano_id.\"' AND b.gid='\".$this->gid.\"' \".$this->filtro.\"\n GROUP BY substr(b.fecha_inicio,1,7)\n ORDER BY substr(b.fecha_inicio,1,7)\";\n $res=$this->db->sql_query($sql) or die (\"Error en la consulta: \".$sql);\n if($this->db->sql_numrows($res) > 0)\n {\n while(list($id,$_uid,$ano,$mes,$no_dias,$no_reg,$cantidad,$name) = $this->db->sql_fetchrow($res))\n {\n $this->array_metas[$mes]= $cantidad;\n }\n }\n }", "function rotacionSeisMeses()\n {\n $rotacion_smeses = new \\stdClass();\n $rotacion_smeses->labels = [];\n $rotacion_smeses->data = [];\n\n // Prepare query\n $sql = \"\n SELECT (COUNT(f.id) / m.maquina_casillas) as result, DATE_FORMAT(f.factura_fecha_emision, '%m') AS month, DATE_FORMAT(f.factura_fecha_emision, '%M') AS month_letters\n FROM facturas as f, maquinas as m WHERE f.factura_fecha_emision <= DATE(NOW()) AND f.factura_fecha_emision > DATE_SUB(DATE(NOW()), INTERVAL 6 MONTH) $this->sql_condition\n GROUP BY month\";\n\n // Execute sql\n $query = DB::select($sql);\n\n // Config chart roacion ultimos 6 meses\n $rotacion_smeses->labels = array_pluck($query, 'month_letters');\n $rotacion_smeses->data = array_pluck($query, 'result');\n\n return $rotacion_smeses;\n }", "function formulaires_publication_ouverte_agenda_charger_dist()\n{\n\t$values = array();\n\n\t$values['etape'] \t\t= _request('etape');\t\t\t// etape actuelle\n\t$values['id_article']\t \t= _request('id_article');\t\t// id de l'article temporaire\n\t$values['type']\t\t\t= \"evenement\";\t\t\t// article ou evenement ?\n\t$values['id_rubrique'] \t\t= _request('id_rubrique');\t\t// rubrique de la contrib\n\t$values['jour_evenement'] \t= _request('jour_evenement'); \t\t// jour de l'événement\n\t$values['mois_evenement'] \t= _request('mois_evenement'); \t\t// mois de l'événement\n\t$values['annee_evenement'] \t= _request('annee_evenement'); \t\t// annee de l'événement\n\t$values['heure_evenement'] \t= _request('heure_evenement'); \t\t// heure de l'événement\n\t$values['lieu_evenement']\t= _request('lieu_evenement');\t\t// lieu de l'evenement\n\t$values['ville_evenement']\t= _request('ville_evenement');\t\t// lieu de l'evenement\n\t$values['adresse_evenement']\t= _request('adresse_evenement');\t// lieu de l'evenement\n\t$values['tel_evenement']\t= _request('tel_evenement');\t\t// lieu de l'evenement\n\t$values['web_evenement']\t= _request('web_evenement');\t\t// lieu de l'evenement\n\t$values['email_evenement']\t= _request('email_evenement');\t\t// lieu de l'evenement\n\t$values['lieu_evenement_existe']= _request('lieu_evenement_existe');\t// lieu de l'evenement déjà existant\n\t$values['titre'] \t\t= _request('titre');\t\t\t// titre de la contrib\n\t$values['texte'] \t\t= _request('texte');\t\t\t// texte de la contrib\n\t$values['pseudo'] \t\t= _request('pseudo');\t\t\t// pseudo ou nom de l'auteur\n\t$values['email'] \t\t= _request('email');\t\t\t// email de l'auteur\n\t$values['mots'] \t\t= _request('mots');\t\t\t// les mots-clés\n\t$values['date'] = _request('date');\n\t$values['date_modif'] = _request('date_modif');\n\t$values['supprimer_documents'] = _request('supprimer_documents');\n\t// editos\n\t$values['mise_en_edito'] = _request('mise_en_edito');\n\t$values['edito_complet'] = _request('edito_complet');\n\t// focus\n\t$values['mot_focus'] = _request('mot_focus');\n\t// si c'est pas un debut d'article\n\tif (_request('titre') or _request('previsu'))\n\t\t$values['ancre'] = '#etape_4';\n\telse\n\t\t$values['ancre'] = '.page-article';\n\t\n\t/*\n\t * s'il s'agit du premier passage, on créé l'article\n\t */\n\tif (!$values['id_article'])\n\t{\n\t\t$id_article = indymedia_creer_article();\n\t\t$values['id_article'] = $id_article;\n\t}\n\t/*\n\t * sinon, si admin, on peut l'éditer\n\t */\n\telse if ($values['id_article'] && est_admin())\n\t{\n\t\t$id_article = (int) $values['id_article'];\n\t\t// on recupere des infos sur l'article\t\n\t\t$row = sql_fetsel(\n\t\t\tarray('texte','extra','id_rubrique','titre','date_debut_indy','statut','date'),\n\t\t\tarray('spip_articles'),\n\t\t\tarray('id_article='.$id_article)\n\t\t);\n\t\t$values['texte'] = $row['texte'] ;\n\t\t$values['titre'] = $row['titre'] ;\n\t\t$values['id_rubrique'] = $row['id_rubrique'] ;\n\t\t//$values['statut'] = $row['statut'] ;\n\t\t$extra = unserialize($row['extra']);\n\t\t$values['explication'] = $extra['OP_moderation'];\n\t\t$values['pseudo'] = $extra['OP_pseudo'];\n\t\t$values['email'] = $extra['OP_email'];\n\t\t$values['date'] = $row['date'];\n\t\t\n\t\t// on recupere la date, l'heure et le lieu de l'evenement\n\t\t$values = indymedia_ajout_valeurs_date ($values, $row['date_debut_indy']);\n\t\t$values = indymedia_ajout_valeurs_lieu ($values, $id_article);\n\t\t$values = indymedia_ajout_valeurs_mots ($values, $id_article);\n\t}\n\tinclude_spip('inc/securiser_action');\n\t$values['cle_ajouter_document'] = calculer_cle_action('ajouter-document-' . 'article' . '-' . $id_article);\n\n\treturn $values;\n}", "function anular_PM_MM($id_mov)\r\n{\r\n global $db,$_ses_user;\r\n\r\n $db->StartTrans();\r\n $query=\"update movimiento_material set estado=3 where id_movimiento_material=$id_mov\";\r\n sql($query) or fin_pagina();\r\n $usuario=$_ses_user['name'];\r\n $fecha_hoy=date(\"Y-m-d H:i:s\",mktime());\r\n //agregamos el log de anulacion del movimiento\r\n $query=\"insert into log_movimiento(fecha,usuario,tipo,id_movimiento_material)\r\n values('$fecha_hoy','$usuario','anulado',$id_mov)\";\r\n sql($query) or fin_pagina();\r\n\r\n //traemos el deposito de origen del MM o PM\r\n $query=\"select movimiento_material.deposito_origen\r\n \t\t from mov_material.movimiento_material\r\n \t\t where id_movimiento_material=$id_mov\";\r\n $orig=sql($query,\"<br>Error al traer el deposito origen del PM o MM<br>\") or fin_pagina();\r\n\r\n $deposito_origen=$orig->fields['deposito_origen'];\r\n descontar_reservados_mov($id_mov,$deposito_origen,1);\r\n\r\n $db->CompleteTrans();\r\n\r\n return \"El $titulo_pagina Nº $id_mov fue anulado con éxito\";\r\n}", "function getMontantTVAArticle($numserie) {\n // if ($this->calculmontant) return (sprintf(\"%.2f\", ($this->article[$numserie]['montantTTC'] - $this->article[$numserie]['montantHT'])));\n if (isset($this->calculmontant) && $this->calculmontant == true) return (sprintf(\"%.2f\", ($this->article[$numserie]['montantHT'] * ($this->TVA / 100))));\n else return 0;\n }", "function MESES_ANTIGUEDAD($_ARGS) {\r\n\t$fingreso = FECHA_INGRESO($_ARGS);\r\n\t$periodo_actual = $_ARGS['HASTA'];\r\n\tlist($anios, $meses, $dias) = TIEMPO_DE_SERVICIO(formatFechaDMA($fingreso), formatFechaDMA($periodo_actual));\r\n\t$cantidad = $meses + ($anios * 12);\r\n\treturn $cantidad;\r\n}", "public function testPrimeDirecteur4(){\n $directeurATester = new Directeur();\n $dateTemoin = \"12/07/2018\";\n $montantPrime = 5850;\n $salaireTemoin = 45000;\n \n $directeurATester->setSalaire($salaireTemoin);\n $directeurATester->setDateEmbauche($dateTemoin);\n $this->assertEquals($montantPrime,$directeurATester->calculerPrime());\n }", "public function smanjiCenu(){\n if($this->getGodiste() < 2010){\n $discount=$this->cenapolovnogauta*0.7;\n return $this->cenapolovnogauta=$discount;\n }\n return $this->cenapolovnogauta; \n }", "function precio($precioUnidad, $cantidad, $descuento = 0 ){ // las variables que tenemos son arbitrarias, por lo cual hay que mirar bien si ponerlas en () de la funcion\n\n\n\n$multiplicar = $precioUnidad * $cantidad;\n\n// $descuento es un porcentaje\n\n// $restar = $multiplicar - $descuento; // este descuento debe ir en % por lo cual no es lo mismo que un entero, por lo cual lo colocaremos en entero\n\n\n// si esto fuera un porcentaje entonces seria $multiplicar = $precioUnidad * $cantidad; // $porcentaje = $multiplicar - $descuento; // $solucion = $multiplicar - $porcentaje; lo cual es lo que haremos\n\n$porcentaje = $multiplicar * $descuento;\n\n$solucion = $multiplicar - $porcentaje;\nreturn $solucion;\n// si colocamos todos los datos en solo sitio o una sola linea, sin especificar es e novatos, porque hay que haber un orden\n\n}", "function comparar_fechas_num($fecha_inicio, $fecha_fin){\n\t\t$inicio = array();\n\t\t$inicio['anno'] = substr($fecha_inicio, 0, 4);\n\t\t$inicio['mes'] = substr($fecha_inicio, 5, 2);\n\t\t$inicio['dia'] = substr($fecha_inicio, 8, 2);\n\t\t$inicio['hora'] = substr($fecha_inicio, 11, 2);\n\t\t$inicio['min'] = substr($fecha_inicio, 14, 2);\n\t\t$inicio['sec'] = substr($fecha_inicio, 17, 2);\n\t\t\n\t\t$fin = array();\n\t\t$fin['anno'] = substr($fecha_fin, 0, 4);\n\t\t$fin['mes'] = substr($fecha_fin, 5, 2);\n\t\t$fin['dia'] = substr($fecha_fin, 8, 2);\n\t\t$fin['hora'] = substr($fecha_fin, 11, 2);\n\t\t$fin['min'] = substr($fecha_fin, 14, 2);\n\t\t$fin['sec'] = substr($fecha_fin, 17, 2);\n\t\t\n\t\t$diferencia = array();\n\t\t$diferencia['anno'] = $fin['anno'] - $inicio['anno'];\n\t\t$diferencia['mes'] = $fin['mes'] - $inicio['mes'];\n\t\t$diferencia['dia'] = $fin['dia'] - $inicio['dia'];\n\t\t$diferencia['hora'] = $fin['hora'] - $inicio['hora'];\n\t\t$diferencia['min'] = $fin['min'] - $inicio['min'];\n\t\t$diferencia['sec'] = $fin['sec'] - $inicio['sec'];\n\t\t\n\t\tif($diferencia['mes'] < 0){\n\t\t\t$diferencia['mes'] = 12 + $diferencia['mes'];\n\t\t\t$diferencia['anno'] = $diferencia['anno'] - 1;\n\t\t}\n\t\tif($diferencia['dia'] < 0){\n\t\t\t$diferencia['dia'] = 30 + $diferencia['dia'];\n\t\t\t$diferencia['mes'] = $diferencia['mes'] - 1;\n\t\t}\n\t\tif($diferencia['hora'] < 0){\n\t\t\t$diferencia['hora'] = 24 + $diferencia['hora'];\n\t\t\t$diferencia['dia'] = $diferencia['dia'] - 1;\n\t\t}\n\t\tif($diferencia['min'] < 0){\n\t\t\t$diferencia['min'] = 60 + $diferencia['min'];\n\t\t\t$diferencia['hora'] = $diferencia['hora'] - 1;\n\t\t}\n\t\tif($diferencia['sec'] < 0){\n\t\t\t$diferencia['sec'] = 60 + $diferencia['sec'];\n\t\t\t$diferencia['min'] = $diferencia['min'] - 1;\n\t\t}\n\t\t\n\t\t$resultado = sprintf(\"%02d\", $diferencia['anno']).sprintf(\"%02d\", $diferencia['mes']).sprintf(\"%02d\", $diferencia['dia']).sprintf(\"%02d\", $diferencia['hora']).sprintf(\"%02d\", $diferencia['min']);\n\t\t\n\t\treturn $resultado;\n\t}", "function calcularPonderacion($instanciaActual=\"\",$instanciaPonderar)\n\t{\n\t\t$personajesutil = new personajepar($this->BG->con);\n\t\t$personajesutil->setronda($instanciaActual);\n\t\t$personajesutil = $personajesutil->read(true,1,array(\"ronda\"));\n\t\t\n\t\t$batallutil = new batalla($this->BG->con);\n\t\t$batallutil->setronda($instanciaPonderar);\n\t\t$batallutil = $batallutil->read(true,1,array(\"ronda\"));\n\t\t\n\t\t$totalponderacion=0;\n\t\tfor($i=0;$i<count($batallutil);$i++)\n\t\t{\n\t\t\t$pos[0] = 1500;\n\t\t\t$pos[1] = 600;\n\t\t\t$pos[2] = 400;\n\t\t\t$pos[3] = 300;\n\t\t\t$pos[4] = 200;\n\t\t\t$pos[5] = 100;\n\t\t\t$pos[6] = 100;\n\t\t\t$pos[7] = 20;\n\t\t\t$peleapersonaje = new pelea($this->BG->con);\n\t\t\t$peleapersonaje->setidbatalla($batallutil[$i]->getid());\n\t\t\t$peleapersonaje = $peleapersonaje->read(true,1,array(\"idbatalla\"),1,array(\"votos\",\"DESC\"));\n\t\t\t$k=0;\n\t\t\t$calponderacion = 0;\n\t\t\tfor($j=0;$j<count($peleapersonaje);$j++)\n\t\t\t{\n\t\t\t\tif(comprobararray($personajesutil,\"id\",$peleapersonaje[$j]->getidpersonaje()))\n\t\t\t\t{\n\t\t\t\t\tif($j>0 && $peleapersonaje[$j]->getvotos() == $peleapersonaje[$j-1]->getvotos())\n\t\t\t\t\t{}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(count($pos)<=$j)\n\t\t\t\t\t\t\t$calponderacion = $pos[count($pos)-1];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$calponderacion = $pos[$j];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$calponderacion += $peleapersonaje[$j]->getvotos();\n\t\t\t\t\t}\t\t\n\t\t\t\t\t$totalponderacion+=$calponderacion;\n\t\t\t\t\t$personajemod = arrayobjeto($personajesutil,\"id\",$peleapersonaje[$j]->getidpersonaje());\n\t\t\t\t\t$personajemod->setponderacion($calponderacion);\n\t\t\t\t\t$personajemod->update(1,array(\"ponderacion\"),1,array(\"id\"));\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t$torneoActual = new torneo($this->BG->con);\n\t\t$torneoActual->setactivo(1);\n\t\t$torneoActual = $torneoActual->read(false,1,array(\"activo\"));\n\t\t$torneoActual->setponderacionprom(round($totalponderacion/count($personajesutil)));\n\t\t$torneoActual->update(1,array(\"ponderacionprom\"),1,array(\"id\"));\n\t}", "function NUMERO_DE_HIJOS_MAYORES_ESTUDIANDO($_ARGS) {\r\n\t$_PARAMETROS = PARAMETROS();\r\n\t\r\n\tlist($a, $m)=SPLIT( '[/.-]', $_ARGS[\"PERIODO\"]); \r\n\r\n $anio = $a - 18;\r\n\t$fecha18 = \"$anio-$m-01\";\r\n\t\r\n\t $anio = $a - 25;\r\n\t$fecha25 = \"$anio-$m-01\";\r\n\r\n\t$sql = \"SELECT\r\n\t\t\t\t*\r\n\t\t\tFROM\r\n\t\t\t\trh_cargafamiliar\r\n\t\t\tWHERE\r\n\t\t\t\tCodPersona = '\".$_ARGS['TRABAJADOR'].\"' AND\r\n\t\t\t\tParentesco = 'HI' \r\n\t\t\t\tAND\tFechaNacimiento <= '\".$fecha18.\"'\r\n\t\t\t\tAND\tFechaNacimiento >= '\".$fecha25.\"'\r\n\t\t\t\tAND rh_cargafamiliar.Parentesco = 'HI' \r\n\t\t\t\tAND rh_cargafamiliar.FlagEstudia = 'S'\t\r\n\t\t\t\t\";\r\n\t$query = mysql_query($sql) or die ($sql.mysql_error());\r\n\treturn intval(mysql_num_rows($query));\r\n}", "public function getValor_moeda()\n {\n return $this->valor_moeda;\n }", "function calc_chegada($partida,$tempo){\n \n \n $aux=split(\":\",$partida);\n\t\t$p=mktime($aux[0],$aux[1],$aux[2]);\n\n\t\t$aux=split(\":\",$tempo);\n\t\t$t=$aux[0]*3600+$aux[1]*60+$aux[2];\n\t\t\n\t\t$c=strftime(\"%H:%M:%S\",$p+$t);\n\t\t//echo \"$p<br>\";\n\t\t//echo \"$t<br>\";\n // echo $t+$p . \"<br>\";\n //echo \"$c<br>\";\n\t\t\n\t\treturn $c;\n }", "public function mort()\n\t{\n\t\tif ( $this->vie <= 0 ) {\n\t\t\techo $this->nom . \" est mort <br>\";\n\t\t} else {\n\t\t\techo $this->nom . \" est vivant ! <br>\";\n\t\t}\n\t}", "function Consulta_Informacion_Metas()\n {\n $sql=\"SELECT b.id,b.uid,year(b.fecha_inicio) AS ano, sum(b.no_dias) as no_dias,count(substr(b.fecha_inicio,1,4)) AS no_regs,\n sum(b.cantidad) AS total,a.name\n FROM crm_proyeccion as b LEFT JOIN users as a ON b.uid = a.uid\n WHERE b.active = 1 AND b.gid='\".$this->gid.\"' \".$this->filtro.\"\n GROUP BY substr(b.fecha_inicio,1,4)\n ORDER BY substr(b.fecha_inicio,1,4)\";\n $res=$this->db->sql_query($sql) or die (\"Error en la consulta: \".$sql);\n if($this->db->sql_numrows($res) > 0)\n {\n while(list($id,$_uid,$ano,$no_dias,$no_reg,$cantidad,$name) = $this->db->sql_fetchrow($res))\n {\n $this->array_metas[$ano]= $cantidad;\n }\n }\n }", "function bote_creation($atts, $content=null){\r\n\tglobal $wpdb;\r\n\t$count = $wpdb->get_var(\"select count(*) from cuenta_triodos where valor is not null\");\r\n\tif ($count == 0) {\r\n\t\treturn \"<p>No hay movimientos en la cuenta.</p>\";\r\n\t}\r\n\t$row = $wpdb->get_row(\"select sum(valor) saldo, max(fecha) ult from cuenta_triodos where valor is not null\");\r\n\t$html=\r\n\t'<p>\r\n\t\t<strong>Última actualización:</strong> ' . date(\"d-m-Y\", strtotime($row->ult)) . ' (*)<br/>\r\n\t\t<strong>Saldo:</strong> ' . number_format ($row->saldo , 2 , \",\" , \",\" ) . ' €';\r\n $saldo = $row->saldo;\r\n\t$row = $wpdb->get_row(\"select CEIL(ABS(sum(valor) / CEIL(DATEDIFF(max(fecha),min(FECHA))/30))) media, MIN(fecha) desde, CEIL(DATEDIFF(current_date,min(FECHA)) /30) meses from cuenta_triodos where valor is not null and valor<0 and DATEDIFF(current_date, fecha)<=30*14\");\r\n if ($row->meses>2) {\r\n $queda = floor($saldo / $row->media);\r\n $html= $html . ' <span title=\"En base a los costes calculados sobre los últimos ' . $row->meses . ' meses\">(da para ' . $queda . ' meses más)</span>';\r\n }\r\n\t$html= $html . '\r\n\t</p>\r\n\t<table>\r\n\t\t<thead>\r\n\t\t\t<tr>\r\n\t\t\t\t<th>Fecha</th>\r\n\t\t\t\t<th>Concepto</th>\r\n\t\t\t\t<th style=\"text-align: right;\">Cantidad</th>\r\n\t\t\t</tr>\r\n\t\t</thead>\r\n\t\t<tbody>';\r\n\t$res=$wpdb->get_results(\"select fecha,concepto,valor from cuenta_triodos where valor is not null order by fecha DESC\");\r\n\tforeach ( $res as $re ) {\r\n\t\t$color = ($re->valor<0? 'red': 'blue');\r\n\t\t$html= $html . '\r\n\t\t<tr>\r\n\t\t\t<td>' . date(\"d-m-Y\", strtotime($re->fecha)) . '</td>\r\n\t\t\t<td style=\"color: ' . $color . ';\">' . (is_null($re->concepto)?'(*)':$re->concepto) . '</td>\r\n\t\t\t<td style=\"text-align: right; color: ' . $color . ';\">' . number_format ( $re->valor , 2 , \",\" , \",\" ) .' €</td>\r\n\t\t</tr>';\r\n\t}\r\n\treturn $html . '\r\n\t\t</tbody>\r\n\t</table>\r\n\t<p>(*) Esta tabla se actualiza semi-automáticamente, pudiendo tardar varios días en mostrar los últimos datos, en especial los conceptos de los movimientos.</p>\r\n <p>Si quieres que tu donación quede registrada a nombre de algún colectivo indicalo en el concepto de la transferencia o mandanos un correo a <a href=\"mailto:[email protected]\">[email protected]</a> notificándonoslo.</p>';\r\n}", "function acrescenta_min($horario, $minutos){\n $time = new DateTime($horario);\n $time->add(new DateInterval('PT' . $minutos . 'M'));\n return $stamp = $time->format('Y-m-d H:i:s');\n}", "public function test_pagar_monto_viaje_plus_doble() {\n $tiempo = new Tiempo();\n $tiempo->avanzar( 36000 );\n $medio_boleto = new Tarjeta_Medio_Boleto( Null );\n $colectivo = new Colectivo( 'mixta', '133', 420 );\n $medio_boleto->recargar( 50.0 );\n $medio_boleto->gastarPlus();\n $medio_boleto->gastarPlus();\n $this->assertEquals( $medio_boleto->getViajesPlus(), 0 );\n $boleto = $medio_boleto->pagarConTarjeta( $colectivo , $tiempo );\n $this->assertEquals( $boleto->getValor(), $this->getCostoMedioBoleto() + (2 * $this->getCostoViaje() ) );\n }", "public function vr_hora()\n {\n\n $valor=$this->vr_hora;\n\n if ($this->id_tipotitulo == 3)\n {\n $valor='10208';\n } elseif ($this->id_tipotitulo == 4) {\n $valor='15122';\n } elseif ($this->id_tipotitulo == 5) {\n $valor='19096';\n } elseif ($this->id_tipotitulo == 7) {\n $valor='23252';\n } elseif ($this->id_tipotitulo == 10) {\n $valor='27014';\n } elseif ($this->id_tipotitulo == 9) {\n $valor='10208';\n } elseif ($this->id_tipotitulo == 11) {\n $valor='10208'; }\n elseif ($this->id_tipotitulo == 12) {\n $valor='0';\n }\n\n\n return $valor;\n\n }", "public function testPrimeDirecteur1(){\n $directeurATester = new Directeur();\n \n $directeurATester->setSalaire($this->salaireTemoin);\n\n $dateTemoin = \"12/07/2015\";\n $montantPrime = 6600;\n $directeurATester->setDateEmbauche($dateTemoin);\n $this->assertEquals($montantPrime,$directeurATester->calculerPrime());\n }", "function calcula_metas($in_p, $in_aao, $trimestre = 0){\r\n\t\t\r\n\t\t$trimestres[1] = \"1,2,3\";\r\n\t\t$trimestres[2] = \"4,5,6\";\r\n\t\t$trimestres[3] = \"7,8,9\";\r\n\t\t$trimestres[4] = \"10,11,12\";\r\n\t\t\r\n\t\t\r\n\t\t$trim = $trimestre > 0 ? \" AND mm.id_mes IN(\".$trimestres[$trimestre].\") \" : \"\" ; \r\n\t\t\r\n\t\t$sql_afao = \" SELECT sum(mm.cantidad_metas_meses) as total \r\n\t\t\t\t\t\t\t\tFROM asignacion_ff_anp_objetivos afao, metas_meses mm \r\n\t\t\t\t\t\t\t\tWHERE \tafao.id_asignacion_ff_anp_objetivos = mm.id_ff_anp_subactividad\tAND\r\n\t\t\t\t\t\t\t \t\t\tid_presupuesto_anp in(\".$in_p.\") AND\r\n\t\t\t\t\t\t\t \t\t\tid_asignacion_anp_objetivos in(\".$in_aao.\")\t\".$trim.\"\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t \tGROUP BY id_asignacion_ff_anp_objetivos\";\r\n\t\t$query_afao = new Consulta($sql_afao);\r\n\t\t$total_metas = 0;\r\n\t\t\r\n\t\twhile($row_afao = $query_afao->ConsultaVerRegistro()){\r\n\t\t\t$total_metas += $row_afao['total'];\r\n\t\t}\r\n\t\t\r\n\t\treturn $total_metas;\r\n\t}", "function obtener_mes($fecha) {\r\nreturn(substr($fecha,5,2));\r\n}", "function UltimoDia($a,$m){\r\n if (((fmod($a,4)==0) and (fmod($a,100)!=0)) or (fmod($a,400)==0)) {\r\n $dias_febrero = 29;\r\n } else {\r\n $dias_febrero = 28; \r\n }\r\n switch($m) {\r\n case 1: $valor = 31; break;\r\n case 2: $valor = $dias_febrero; break;\r\n case 3: $valor = 31; break;\r\n case 4: $valor = 30; break;\r\n case 5: $valor = 31; break;\r\n case 6: $valor = 30; break;\r\n case 7: $valor = 31; break;\r\n case 8: $valor = 31; break;\r\n case 9: $valor = 30; break;\r\n case 10: $valor = 31; break;\r\n case 11: $valor = 30; break;\r\n case 12: $valor = 31; break;\r\n }\r\n return $valor;\r\n}", "public function getEncuestaFechacreacion()\r\n {\r\n return $this->encuesta_fechaCreacion;\r\n }", "private function calcolaValutazione()\n {\n\n $media=0;\n $i=0;\n foreach ($this->valutazioni as &$value){\n $media=$media+$value->getvoto();\n $i++;}\n $this->valutazione=$media/$i;\n\n }", "public function getModDate();", "abstract protected function getUploadMtime();", "public function getMontoPlanificado()\n {\n $montoPlanificado = 0;\n foreach ($this->objetivos as $objetivo)\n {\n foreach($objetivo->getActividades() as $actividad)\n {\n $moneda=$actividad->getMoneda();\n $montoPlanificado+=($actividad->getMonto()*$moneda->getPrecioBs());\n }\n }\n return $montoPlanificado;\n }", "public function reiniciarMedio($tiempo) {\n $tiempo2 = $tiempo->time();\n $hora = date('H', $tiempo2);\n $minutos = date('i', $tiempo2);\n $segundos = date('s', $tiempo2);\n\n if ($hora == '00' && $minutos == '00' && $segundos == '00')\n {\n $this->vecesUsado = 0;\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }", "function tous_auteurs_date_passage() {\r\n\tglobal $couleur_claire, $connect_id_auteur;\r\n\r\n\t// fixer le nombre de ligne du tableau (tranche)\r\n\t$fl = $GLOBALS['actijour']['nbl_aut'];\r\n\r\n\t// recup $vl dans URL\r\n\t$dl = intval(_request('vl'));\r\n\t$dl = ($dl + 0);\r\n\t// valeur de tranche affichꥍ\r\n\t$nba1 = $dl + 1;\r\n\r\n\t$p_st = _request('st');\r\n\tif (!$p_st) {\r\n\t\t$where_st = \"statut IN ('0minirezo','1comite','6forum')\";\r\n\t\t$p_st = 'tous';\r\n\t} else {\r\n\t\t$where_st = \"statut = \" . _q($p_st);\r\n\t}\r\n\r\n\t$q = sql_select(\"SQL_CALC_FOUND_ROWS id_auteur, statut, nom,\r\n\t\t\t\t\t\tDATE_FORMAT(en_ligne,'%d/%m/%y %H:%i') AS vu \"\r\n\t\t. \"FROM spip_auteurs \"\r\n\t\t. \"WHERE $where_st \"\r\n\t\t. \"ORDER BY en_ligne DESC,nom \"\r\n\t\t. \"LIMIT $dl,$fl\"\r\n\t);\r\n\r\n\t// recup nombre total d'entrees\r\n\t$nl = sql_select(\"FOUND_ROWS()\");\r\n\t$found = @sql_fetch($nl);\r\n\t$nb_auteurs = $found['FOUND_ROWS()'];\r\n\r\n\t$ifond = 0;\r\n\r\n\t$aff = '';\r\n\r\n\t# onglet select statut\r\n\t$lst_statut = array('tous', '0minirezo', '1comite', '6forum');\r\n\t$script = _request('exec');\r\n\r\n\t$aff .= debut_onglet();\r\n\tforeach ($lst_statut as $statut) {\r\n\t\t$aff .= onglet(_T('actijour:onglet_connect_' . $statut),\r\n\t\t\tgenerer_url_ecrire($script, 'st=' . ($statut == 'tous' ? '' : $statut)),\r\n\t\t\t$statut,\r\n\t\t\t($p_st == $statut ? $statut : ''), '');\r\n\t}\r\n\t$aff .= fin_onglet();\r\n\r\n\r\n\t# tableau\r\n\t#\r\n\t$aff .= debut_cadre_relief(\"annonce.gif\", true);\r\n\r\n\t$aff .= \"<table align='center' border='0' cellpadding='2' cellspacing='0' width='100%'>\\n\"\r\n\t\t. \"<tr><td colspan='3' class='verdana3 bold'>\" . _T('actijour:tous_date_connections')\r\n\t\t. \"</td></tr>\";\r\n\t# Tranches\r\n\t$aff .= \"<tr><td colspan='3' class='verdana3 bold'>\";\r\n\t$aff .= \"<div align='center' class='iconeoff verdana2 bold' style='clear:both;'>\\n\"\r\n\t\t. tranches_liste_art($nba1, $nb_auteurs, $fl)\r\n\t\t. \"\\n</div>\\n\";\r\n\t$aff .= \"</td></tr>\";\r\n\r\n\twhile ($row = sql_fetch($q)) {\r\n\t\t$ifond = $ifond ^ 1;\r\n\t\t$couleur = ($ifond) ? '#FFFFFF' : $couleur_claire;\r\n\r\n\t\t$aff .= \"<tr bgcolor='$couleur'>\"\r\n\t\t\t. \"<td width='5%'>\\n\"\r\n\t\t\t. bonhomme_statut($row) . \"</td>\\n\"\r\n\t\t\t. \"<td width='75%'>\"\r\n\t\t\t. \"<a class='verdana2 bold' href='\" . generer_url_ecrire(\"auteur_infos\", \"id_auteur=\" . $row['id_auteur']) . \"'>\"\r\n\t\t\t. entites_html($row['nom']) . \"</a>\\n\"\r\n\t\t\t. \"<td width='20%'>\\n\"\r\n\t\t\t. \"<div align='right' class='verdana1'>\" . $row['vu'] . \"</div>\\n\"\r\n\t\t\t. \"</td></tr>\\n\";\r\n\r\n\t}\r\n\t$aff .= \"</table>\\n\\n\";\r\n\r\n\t$aff .= fin_cadre_relief(true);\r\n\r\n\treturn $aff;\r\n}", "public function sePuedePagar(){\n $ahora = $this->obtenerTiempo();\n if(date('d', $ahora) == (date('d', $this->ultimoPagoMedio) + 1)) {\n $this->mediosDisponibles = 2;\n }\n if(($ahora - $this->ultimoPago) >= 300 && $this->mediosDisponibles != 0){\n return true;\n }else{\n return false;\n }\n }", "static function ClientesMasFacturados($mes, $limit) {\n $ciud=array('nombres'=>array(),'cantidades'=>array());\n $t='';\n if ($mes=='ACTUAL') {\n $inicio=date('Y-m-d',strtotime('first day of this month'));\n $fin=date('Y-m-d',strtotime('last day of this month'));\n $t=ucfirst(strftime('%B',strtotime('this month')));\n }\n if ($mes=='ANTERIOR') {\n $inicio=date('Y-m-d',strtotime('first day of last month'));\n $fin=date('Y-m-d',strtotime('last day of last month'));\n $t=ucfirst(strftime('%B',strtotime('last month')));\n }\n if ($mes=='3MESES') {\n $s=strtotime('-3 months');\n $n=date('F Y',$s);\n $inicio=date('Y-m-d',strtotime('first day of '.$n));\n $fin=date('Y-m-d');\n $t=strftime('%B %Y',$s).' - '.strftime('%B %Y');\n }\n if ($mes=='6MESES') {\n $s=strtotime('-6 months');\n $n=date('F Y',$s);\n $inicio=date('Y-m-d',strtotime('first day of '.$n));\n $fin=date('Y-m-d');\n $t=strftime('%B %Y',$s).' - '.strftime('%B %Y');\n $tipo='MES';\n }\n if ($mes=='12MESES') {\n $s=strtotime('-1 year');\n $n=date('F Y',$s);\n $inicio=date('Y-m-d',strtotime('first day of '.$n));\n $fin=date('Y-m-d');\n $t=strftime('%B %Y',$s).' - '.strftime('%B %Y');\n $tipo='MES';\n }\n if ($mes=='24MESES') {\n $s=strtotime('-2 year');\n $n=date('F Y',$s);\n $inicio=date('Y-m-d',strtotime('first day of '.$n));\n $fin=date('Y-m-d');\n $t=strftime('%B %Y',$s).' - '.strftime('%B %Y');\n $tipo='MES';\n }\n\n $q = \"SELECT SUM(g.total+g.valorseguro) total, c.tipo_identificacion AS ti,\nc.nombre AS n, c.primer_apellido AS pa\nFROM \".self::$table.\" f, \".Guia::$table.\" g, \".Cliente::$table.\" c\nWHERE f.id=g.idfactura AND c.id=f.idcliente AND f.fechaemision BETWEEN '$inicio' AND '$fin'\nGROUP BY c.id\nORDER BY total DESC\nLIMIT 0,$limit\";\n $result = DBManager::execute($q);\n if (DBManager::rows_count($result) != 0) {\n while ($f = mysql_fetch_assoc($result)) {\n $ciud['nombres'][] = trim($f['n'].' '.$f['pa']);\n $ciud['cantidades'][] = intval($f['total']);\n }\n }\n $ciud['texto'] = $t;\n return $ciud;\n }", "function pagoMonedas($precio){\n $pago = 0;\n \n $monedas = array_fill(0,6,0); // ind 0: 1€; ind 1: 0,50€; ind 2: 0,20€; ind 3: 0,10€; ind 4: 0,05€; ind 5: 0,01€;\n \n $vueltas = 0;\n \n while($precio != $pago){\n $vueltas ++;\n echo sprintf(\"vuelta %d - pago %f<br>\",$vueltas, $pago);\n echo sprintf(\"diferencia: %f<br>\",$precio - $pago);\n if($precio - $pago >= 1){\n $monedas[0]++;\n $pago++;\n }\n elseif($precio - $pago >= 0.5){\n $monedas[1]++;\n $pago += 0.5;\n }\n elseif($precio - $pago >= 0.2){\n $monedas[2]++;\n $pago += 0.2;\n }\n elseif($precio - $pago >= 0.1){\n $monedas[3]++;\n $pago += 0.1;\n }\n elseif($precio - $pago >= 0.05){\n $monedas[4]++;\n $pago += 0.05;\n }\n elseif($precio - $pago >= 0.01){\n $monedas[5]++;\n $pago += 0.01;\n }\n else{\n echo 'Precio no válido<br>';\n break;\n }\n \n }\n return $monedas;\n}", "public function calcularTempo($tipoPubli,$indAberta){\n $horas = $this->calcularHoras();\n $minutos = $this->calcularMin();\n if($horas < 24){ // Menor que 1 dia\n if($minutos <= 60){ // Menor ou igual a 1 hora\n if($minutos == 0){ // Enviado agora mesmo\n $msg = \"agora\";\n }else if($minutos <= 59){ // Menor que 1 hora\n if($minutos == 1){ \n $msg = \"há 1 minuto\";\n }else if($minutos >= 2 && $minutos <= 59){\n $msg = \"há \". $minutos .\" minutos\";\n }else{ // Se os minutos forem menor que 0\n $msg = \"em \" . str_replace(\"/\", \" de \", $this->dataHoraEnvio->format('d/M/Y')) . \" às \" . $this->dataHoraEnvio->format('H:i');\n }\n }else{ // Igual a 1 hora\n $msg = \"há 1 hora\";\n }\n }else{ // Maior que 1 hora\n if($horas == 1){\n $msg = \"há 1 hora\";\n }else{\n \n $msg = \"há $horas horas\";\n }\n \n }\n }else{ // Maior que um dia\n if($horas >= 24 && $horas <= 48){ // menor q dois dias de diferenca\n $diasDiferenca = $this->dataHoraAgora->format('d') - $this->dataHoraEnvio->format('d');\n if($diasDiferenca == 1){\n $msg = \"ontem às \" . $this->dataHoraEnvio->format('H:i'); \n }else{ \n $msg = strftime('em %d de %B', strtotime($this->dataHoraEnvio->format('d-m-Y H:i:s'))) . \" às \" . $this->dataHoraEnvio->format('H:i');\n } \n }else if($this->dataHoraEnvio->format('Y') == $this->dataHoraAgora->format('Y')){ // Maior que dois dias e do mesmo ano \n $msg = strftime('em %d de %B', strtotime($this->dataHoraEnvio->format('d-m-Y H:i:s'))) . \" às \" . $this->dataHoraEnvio->format('H:i');\n }else{ // De outro ano\n $msg = strftime('em %d de %B de %Y', strtotime($this->dataHoraEnvio->format('d-m-Y H:i:s'))) . \" às \" . $this->dataHoraEnvio->format('H:i'); \n }\n }\n\n\n if($tipoPubli == \"debate\" && $indAberta == \"N\"){ // So cai nesse if se for debate e se nao estiver aberto \n $mensagem = $this->mensagemDebaNaoAberto($msg); \n }else{// se estiver aberto\n $mensagem = $this->mensagemPadrao($msg);\n } \n return $mensagem; \n }", "public function reajustar(){\n //calculando según el IPC acumulado\n //entre el último reajuste realizado y ahora. \n $mes_actual = (int)date(\"m\");\n $agno_actual = (int)date('Y');\n $mes_inicio = $mes_actual - $this->reajusta_meses;\n $agno_inicio = $agno_actual;\n if($mes_inicio <= 0){\n $agno_inicio -= 1;\n $mes_inicio+= 12;\n }\n $ipcs = array();\n if($agno_inicio != $agno_actual){\n $ipcs = Ipc::model()->findAll(array('order'=>'mes','condition'=>'mes >= :m and agno = :a','params'=>array(':m'=>$mes_inicio,':a'=>$agno_inicio)));\n $ipcs_actual = Ipc::model()->findAll(array('order'=>'mes','condition'=>'mes < :m and agno = :a','params'=>array(':m'=>$mes_actual,':a'=>$agno_actual)));\n foreach($ipcs_actual as $ipc){\n $ipcs[] = $ipc;\n }\n }\n else{\n $ipcs = Ipc::model()->findAll(array('condition'=>'mes >= :m1 and mes < :m2 and agno = :a','params'=>array(':m1'=>$mes_inicio,':m2'=>$mes_actual,':a'=>$agno_actual)));\n }\n\n $ipc_acumulado = 0;\n foreach($ipcs as $ipc){\n //sumo los ipcs para generar el ipc acumulado\n $ipc_acumulado+= $ipc->porcentaje;\n }\n //para hacer el cálculo según porcentaje\n $ipc_acumulado /= 100;\n\n //saco el último debe pagar para ver cuánto era lo que tenía que pagar antes\n $debePagars = DebePagar::model()->findAllByAttributes(array('contrato_id'=>$this->id),array('order'=>'id DESC'));\n $debePagar = $debePagars[0];\n \n $debeNuevo = new DebePagar();\n $debeNuevo->agno = $agno_actual;\n $debeNuevo->mes = $mes_actual;\n $debeNuevo->dia = $debePagar->dia;\n $debeNuevo->contrato_id = $this->id;\n //ahora hay que reajustar los montos del contrato dependiendo del ipc_acumulado\n //el precio base debe ser el valor anterior en debe pagar\n $debeNuevo->monto_gastocomun = intval($debePagar->monto_gastocomun*(1+$ipc_acumulado));\n $debeNuevo->monto_gastovariable = intval($debePagar->monto_gastovariable*(1+$ipc_acumulado));\n $debeNuevo->monto_mueble = intval($debePagar->monto_mueble*(1+$ipc_acumulado));\n $debeNuevo->monto_renta = intval($debePagar->monto_renta*(1+$ipc_acumulado));\n try{\n //se reajusta el contrato\n $debeNuevo->save(); \n } catch (Exception $ex) {\n }\n }", "public function getFechaEmision() {\n return $this->fecha_emision;\n }", "function proximoDiaUtil($data, $saida = 'd/m/Y') {\r\n\r\n $timestamp = strtotime($data);\r\n $dia = date('N', $timestamp);\r\n if ($dia >= 6) {\r\n $timestamp_final = $timestamp + ((8 - $dia) * 3600 * 24);\r\n } else {\r\n $timestamp_final = $timestamp;\r\n }\r\n return date($saida, $timestamp_final);\r\n }", "public function get_expiration() \n\t{ \n\t// si no esta en memoria abrirlo\n\tif(empty($this->TA)) {\n\t\t$TA_file = file($this->path.self::TA, FILE_IGNORE_NEW_LINES);\n\t\tif($TA_file) {\n\t\t\t$TA_xml = '';\n\t\t\tfor($i=0; $i < sizeof($TA_file); $i++)\n\t\t\t\t$TA_xml.= $TA_file[$i]; \n\t\t\t$this->TA = $this->xml2Array($TA_xml);\n\t\t\t$r = $this->TA['header']['expirationTime'];\n\t\t} else {\n\t\t\t$r = false;\n\t\t}\n\t} else {\n\t\t$r = $this->TA['header']['expirationTime'];\n\t}\n\treturn $r;\n\t}", "public function getModTime(): int;", "public function getUltimaCarga()\n {\n return $this->ultima_carga;\n }", "public function getUltimoDiaMes($elAnio,$elMes) {\r\n return date(\"d\",(mktime(0,0,0,$elMes+1,1,$elAnio)-1));\r\n }", "function fecha_no_paso($dia,$mes,$anio){\r\n$dia_hoy=date(\"d\");\r\n$mes_hoy=date(\"m\");\r\n$anio_hoy=date(\"Y\");\r\n\r\n$dif_en_meses=(($mes-$mes_hoy)+(12*($anio-$anio_hoy)));\r\n\r\nif($dif_en_meses<0){return(0);}\r\nif(($dif_en_meses==0) && ($dia<$dia_hoy)){return(0);}\r\nreturn(1);\r\n}", "public function calcularPresupuestoInicial(){\n $presupuesto = DB::table('tpresupuesto_tpartida')\n ->where('tPresupuesto_idPresupuesto','=', $this->idPresupuesto)\n ->sum('iPresupuestoInicial');\n $this->iPresupuestoInicial = $presupuesto;\n $this->save();\n }", "public function getMaxDateProperty()\n {\n return Carbon::now()->timezone($this->timezome)->format('Y-m-d');\n }", "static function FacturacionMensual($cliente, $mes, $tipo) {\n $response = array('nombres' => array(), 'cantidades' => array());\n $t = '';\n if ($mes == 'ACTUAL') {\n $inicio = date('Y-m-d', strtotime('first day of this month'));\n $fin = date('Y-m-d');\n $t = ucfirst(strftime('%B', strtotime('this month')));\n }\n if ($mes == 'ANTERIOR') {\n $inicio = date('Y-m-d', strtotime('first day of last month'));\n $fin = date('Y-m-d');\n $t = strftime('%B %Y', strtotime('-1 month')).' - '.strftime('%B %Y');\n }\n if ($mes == '3MESES') {\n $s = strtotime('-3 months');\n $n = date('F Y',$s);\n $inicio = date('Y-m-d', strtotime('first day of '.$n));\n $fin = date('Y-m-d');\n $t = strftime('%B %Y', $s).' - '.strftime('%B %Y');\n }\n if ($mes == '6MESES') {\n $s = strtotime('-6 months');\n $n = date('F Y',$s);\n $inicio = date('Y-m-d', strtotime('first day of '.$n));\n $fin = date('Y-m-d');\n $t = strftime('%B %Y', $s).' - '.strftime('%B %Y');\n $tipo = 'MES';\n }\n if ($mes == '12MESES') {\n $s = strtotime('-1 year');\n $n = date('F Y',$s);\n $inicio = date('Y-m-d', strtotime('first day of '.$n));\n $fin = date('Y-m-d');\n $t = strftime('%B %Y', $s).' - '.strftime('%B %Y');\n $tipo = 'MES';\n }\n if ($mes == '24MESES') {\n $s = strtotime('-2 year');\n $n = date('F Y',$s);\n $inicio = date('Y-m-d', strtotime('first day of '.$n));\n $fin = date('Y-m-d');\n $t = strftime('%B %Y', $s).' - '.strftime('%B %Y');\n $tipo = 'MES';\n }\n $f_c = $cliente ? \" AND f.idcliente=$cliente\" : '';\n if ($tipo == 'MES') {\n $select = 'YEAR( f.fechaemision ) ano, MONTH( f.fechaemision ) mes, ';\n $groupby = 'GROUP BY ano, mes';\n } else {\n $select = 'f.fechaemision fecha, ';\n $groupby = 'GROUP BY f.fechaemision';\n }\n $q = \"SELECT $select SUM( g.total + g.valorseguro ) total\nFROM \".self::$table.\" f, \".Guia::$table.\" g\nWHERE g.idfactura = f.id AND f.fechaemision BETWEEN '$inicio' AND '$fin' $f_c\n$groupby\";\n $result = DBManager::execute($q);\n $n = DBManager::rows_count($result);\n if ($n != 0) {\n $total = 0;\n while ($f = mysql_fetch_assoc($result)) {\n if ($tipo == 'MES') {\n $response['nombres'][] = strftime('%b %y', strtotime($f['ano'].'-'.$f['mes'].'-01'));\n } else {\n $response['nombres'][] = strftime('%d/%b/%Y', strtotime($f['fecha']));\n }\n $n++;\n $total += $f['total'];\n $response['cantidades'][]=intval($f['total']);\n }\n $response['total'] = intval($total);\n $response['prom'] = intval($total/$n);\n }\n $response['texto'] = $t;\n return $response;\n }", "public function getActualizarfecha($Email) {\n //Obtenemos los datos de acuerdo a email \n $data = $this->getPagoss($Email);\n $array = $data[\"results\"];\n // print_r($array[0][\"Proxima_fecha\"]);\n $where = \" WHERE Email = '$Email'\";\n $value = \"Fecha_anterior = :Fecha_anterior, Proxima_fecha = :Proxima_fecha\";\n //Actulizamos las fecha anterior \n $Fecha_actualizada = date(\"d-m-Y\", strtotime($array[0][\"Proxima_fecha\"] . \" + 28 days\"));\n $array = array(\n $array[0][\"Proxima_fecha\"], // Va a cambiarse a fecha anterior \n $Fecha_actualizada, //Proxima fecha actualizada \n );\n\n $data = $this->db->update(\"pagos\", $array, $value, $where);\n\n if (is_bool($data)) {\n return 0;\n } else {\n return $data;\n }\n }", "public function puestaACero() {\n $this -> horas = 0;\n $this -> minutos = 0;\n $this -> segundos = 0;\n }" ]
[ "0.5926407", "0.5907499", "0.57880217", "0.5761188", "0.5756349", "0.57389313", "0.57246476", "0.56818837", "0.56589484", "0.5628369", "0.55916005", "0.55737406", "0.5556375", "0.5555286", "0.55334634", "0.5532756", "0.5531798", "0.5523191", "0.55043286", "0.55030954", "0.550248", "0.54912156", "0.5470025", "0.5469187", "0.5455315", "0.5453821", "0.54444987", "0.5443747", "0.5425331", "0.5423937", "0.5417228", "0.5416671", "0.54083574", "0.5398874", "0.5392308", "0.53905725", "0.5387836", "0.53739244", "0.5365476", "0.53600043", "0.5359472", "0.5355284", "0.53509486", "0.53464484", "0.53420264", "0.5334909", "0.5333012", "0.5331224", "0.53308326", "0.5325468", "0.5319852", "0.53176254", "0.5307048", "0.5304894", "0.52944726", "0.52902323", "0.52898824", "0.5284115", "0.5275756", "0.5255971", "0.5254101", "0.5250371", "0.52496916", "0.5242586", "0.5237593", "0.52339727", "0.5231788", "0.52284884", "0.5227761", "0.52187026", "0.52175415", "0.52120113", "0.5210901", "0.5207243", "0.5206605", "0.52060777", "0.52060306", "0.5197601", "0.5197298", "0.5196933", "0.51922727", "0.51871884", "0.5186679", "0.5185036", "0.5183719", "0.518361", "0.51742166", "0.51693696", "0.5166679", "0.51662374", "0.51657754", "0.5164403", "0.516309", "0.51628083", "0.51590747", "0.5157497", "0.5153134", "0.5151019", "0.51500905", "0.5146453", "0.5145475" ]
0.0
-1
This route is only valid for multi locale applications.
public function landing(Request $request, AccountManager $manager) { if ($manager->account()->locales->count() == 1) { return redirect()->to(store_route('store.home')); } if ($request->hasCookie('locale')) { return redirect()->to(store_route('store.home', [], [], $request->cookie('locale'))); } return $this->theme->render('home.landing'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function localeIndex();", "static function locale() {\n return strtolower(str_replace('controllers\\\\', '', Route::$controller) . '/' . Route::$action);\n }", "public function resolveLocale(Request $request);", "private function processLocale(): void\n {\n if ($this->request->has(self::LOCALE) && null !== $this->request->get(self::LOCALE, null)) {\n $this->setLocale($this->request->get(self::LOCALE));\n }\n }", "function supportedLocaleKeys(): array\n {\n return config('localized-routes.supported-locales');\n }", "public function locale();", "function my_locale_url($locale)\n {\n // Parse URL\n $urlParsed = parse_url(Request::fullUrl());\n if (isset($urlParsed['query'])) {\n parse_str($urlParsed['query'], $params);\n }\n // Set locale to params\n $params['lang'] = $locale;\n\n // Build query\n $paramsJoined = [];\n foreach($params as $param => $value) {\n $paramsJoined[] = \"$param=$value\";\n }\n $query = implode('&', $paramsJoined);\n\n // Build URL\n $url = (App::environment('production') ? 'https' : $urlParsed['scheme']).'://'.\n // No necessity to deal with \"user\" and \"pass\".\n $urlParsed['host'].\n (isset($urlParsed['port']) ? ':'.$urlParsed['port'] : '').\n (isset($urlParsed['path']) ? $urlParsed['path'] : '/').\n '?'.$query.\n (isset($urlParsed['fragment']) ? '#'.$urlParsed['fragment'] : '');\n\n return $url;\n }", "public function routeShutdown(Zend_Controller_Request_Abstract $request) {\n $config = Zend_Registry::get('config');\n $frontController = Zend_Controller_Front::getInstance();\n $params = $request->getParams();\n $registry = Zend_Registry::getInstance();\n // Steps setting the locale.\n // 1. Default language is set in config\n // 2. TLD in host header\n // 3. Locale params specified in request\n $locale = $registry->get('Zend_Locale');\n // Check host header TLD.\n $tld = preg_replace('/^.*\\./', '', $request->getHeader('Host'));\n\n // Provide a list of tld's and their corresponding default languages\n $tldLocales = $frontController->getParam('tldLocales');\n if (is_array($tldLocales) && array_key_exists($tld, $tldLocales)) {\n // The TLD in the request matches one of our specified TLD -> Locales\n $locale->setLocale(strtolower($tldLocales[$tld]));\n } elseif (isset($params['locale'])) {\n // There is a locale specified in the request params.\n $locale->setLocale(strtolower($params['locale']));\n }\n // Now that our locale is set, let's check which language has been selected\n // and try to load a translation file for it.\n $language = $locale->getLanguage();\n $translate = Garp_I18n::getTranslateByLocale($locale);\n Zend_Registry::set('Zend_Translate', $translate);\n Zend_Form::setDefaultTranslator($translate);\n\n if (!$config->resources->router->locale->enabled) {\n return;\n }\n\n $path = '/' . ltrim($request->getPathInfo(), '/\\\\');\n\n // If the language is in the path, then we will want to set the baseUrl\n // to the specified language.\n $langIsInUrl = preg_match('/^\\/' . $language . '\\/?/', $path);\n $uiDefaultLangIsInUrl = false;\n $uiDefaultLanguage = false;\n if (isset($config->resources->locale->uiDefault)) {\n $uiDefaultLanguage = $config->resources->locale->uiDefault;\n $uiDefaultLangIsInUrl = preg_match('/^\\/' . $uiDefaultLanguage . '\\/?/', $path);\n }\n\n if ($langIsInUrl || $uiDefaultLangIsInUrl) {\n if ($uiDefaultLangIsInUrl) {\n $frontController->setBaseUrl(\n $frontController->getBaseUrl() . '/' . $uiDefaultLanguage\n );\n } else {\n $frontController->setBaseUrl($frontController->getBaseUrl() . '/' . $language);\n }\n } elseif (!empty($config->resources->router->locale->enabled) \n && $config->resources->router->locale->enabled\n ) {\n $redirectUrl = '/' . $language . $path;\n if ($frontController->getRouter()->getCurrentRouteName() === 'admin' \n && !empty($config->resources->locale->adminDefault)\n ) {\n $adminDefaultLanguage = $config->resources->locale->adminDefault;\n $redirectUrl = '/' . $adminDefaultLanguage . $path;\n } elseif ($uiDefaultLanguage) {\n $redirectUrl = '/' . $uiDefaultLanguage . $path;\n }\n if ($request->getQuery()) {\n $redirectUrl .= '?' . http_build_query($request->getQuery());\n }\n $this->getResponse()\n ->setRedirect($redirectUrl, 301);\n }\n }", "function get_locale(): string\n{\n $locale = \\Locale::acceptFromHttp(input_server('HTTP_ACCEPT_LANGUAGE'));\n if (!$locale) {\n $locale = 'en_US';\n }\n return $locale;\n}", "public function setLocale()\n {\n $lang = Request::segment(2);\n\n try {\n $this->language->set($lang);\n return Redirect::back();\n } catch (Exception $e) {\n //show error\n }\n }", "public function getIndex()\n {\n $selected_lang = false;\n $client_lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\n\n $languages = Config::get('app.available_locales');\n\n if(in_array($client_lang, $languages)) {\n $selected_lang = $client_lang;\n }\n \n if(Session::get('my.locale') && in_array(Session::get('my.locale'), $languages)) {\n $selected_lang = Session::get('my.locale');\n }\n\n $cookie_lang = Cookie::get('lang');\n if($cookie_lang && in_array($cookie_lang, $languages)) {\n $selected_lang = $cookie_lang;\n }\n\n if(!$selected_lang) {\n $selected_lang = $languages[0];\n }\n\n return Redirect::to('/'.$selected_lang);\n }", "public function isDefaultLocaleHiddenInUrl();", "public function index()\n {\n return Session::get('app.locale');\n }", "function site_locale($locale = null)\n{\n if ($locale) {\n return config(['app.locale' => $locale]);\n }\n\n return config('app.locale');\n}", "protected function mapFrontWebRoutes()\n {\n //Route::middleware( [ 'web', 'rememberLocale' ] )\n //Route::middleware( [ 'web' ] )\n Route::middleware(['web', 'localeSessionRedirect', 'localizationRedirect', 'localeViewPath'])\n ->namespace($this->namespace)\n ->group(function () {\n //$multiLingual = count( config( 'app.locales' ) ) > 1;\n\n //Route::group($multiLingual ? ['prefix' => locale()] : [], function () {\n //Route::group( $multiLingual ? [ 'prefix' => localeUrl() ] : [], function () {\n Route::group(['prefix' => LaravelLocalization::setLocale()], function () {\n\n //Route::group([], function () {\n try {\n require base_path('routes/front.php');\n } catch (Exception $exception) {\n logger()->warning(\"Front routes weren't included because {$exception->getMessage()}.\");\n }\n });\n\n /*if ( $multiLingual ) {\n Route::get( '/', function () {\n //return redirect( locale() );\n return redirect( Session::get( 'locale') );\n } );\n }*/\n });\n }", "protected static function getFacadeAccessor() { return Locale::class; }", "function resolveLocale(Request $request, array $availableLocales);", "function determine_locale()\n {\n }", "public function onKernelRequest(RequestEvent $event) {\n if ($this->isDebug) {\n return;\n }\n\n $request = $event->getRequest();\n $locale = $request->attributes->get('_locale');\n\n // nothing to do here, not a URL that has to do with _locale route param\n if (null === $locale) {\n return;\n }\n\n // locale exists and is enabled, nothing to do here - return;\n if ($this->manager->isLocaleEnabled($locale)) {\n return;\n }\n\n $route = $request->attributes->get('_route');\n\n // no route found, nothing to do here - return; and let the 404 handler do its job\n if (null === $route) {\n return;\n }\n\n $toLocale = $this->manager->getDefaultLocale();\n\n if ($this->usePreferredLocale && $this->manager->getPreferredLocale() != $locale) {\n $toLocale = $this->manager->getPreferredLocale();\n }\n\n $params = array_replace_recursive($request->attributes->get('_route_params', []), [\n '_locale' => $toLocale,\n ]);\n\n // generate a url for the same route with the same params, but with the default locale\n $url = $this->router->generate($route, $params, UrlGeneratorInterface::ABSOLUTE_URL);\n\n // append query string if any\n $qs = $request->getQueryString();\n if ($qs) {\n $url = $url.'?'.$qs;\n }\n\n $response = new RedirectResponse($url, Response::HTTP_FOUND);\n\n $event->setResponse($response);\n }", "protected function mapWebRoutes()\n {\n $locale = Request::segment(1);\n $this->app->setLocale($locale);\n\n Route::prefix($locale)\n ->middleware('web', 'language')\n ->namespace($this->namespace)\n ->group(base_path('routes/web.php'));\n }", "public function adminLocales(){\n $locales = $this->local->getLocales();\n $data['locales'] = $locales;\n if (isset($_SESSION['localAdmin'])){\n $data['localAdmin'] = $_SESSION['localAdmin'];\n }\n $_SESSION['localAdmin'] = 0;\n $this->view->show('adminLocales.php',$data);\n }", "public function __construct()\n {\n app()->setLocale('arm');\n }", "public function getLocale() {}", "private function CheckLangue(Request $request){\n $getPathArray = explode('/',$request->getPathInfo());\n $getLangue = $getPathArray[1];\n if(array_search($getLangue,$this->container->getParameter('languages'))===false)\n {\n $getPathArray[1] = $this->container->getParameter('locale');\n $urlredirect = implode(\"/\",$getPathArray);\n $this->redirect('google.fr'.$urlredirect,301);\n }\n\n }", "public function testParameterOrderIsRespected() {\n\t\tRouter::connect('/{:locale}/{:controller}/{:action}/{:args}');\n\t\tRouter::connect('/{:controller}/{:action}/{:args}');\n\n\t\t$request = Router::process(new Request(['url' => 'posts']));\n\n\t\t$url = Router::match('Posts::index', $request);\n\t\t$this->assertIdentical($this->request->env('base') . '/posts', $url);\n\n\t\t$request = Router::process(new Request(['url' => 'fr/posts']));\n\n\t\t$params = ['Posts::index', 'locale' => 'fr'];\n\t\t$url = Router::match($params, $request);\n\t\t$this->assertIdentical($this->request->env('base') . '/fr/posts', $url);\n\t}", "public function routeOnlyCallback() {\r\n return [\r\n '#markup' => $this->t('The route entry has no corresponding menu links entry, so it provides a route without a menu link, but it is the same in every other way to the simplest example.'),\r\n ];\r\n }", "protected function _language()\n {\n if (sizeof($this->_config['language']) > 1) {\n $language = $this->getRequest()->getParam('language');\n if (!empty($language)) {\n $this->_language = $language . '/';\n $this->_metaLanguage = $language;\n } else if (!empty($this->_session->language)) {\n $this->_language = $this->_session->language . '/';\n $this->_metaLanguage = $this->_session->language;\n } else {\n $browserLanguage = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\n if (in_array($browserLanguage, $this->_config['language'])) {\n $this->_session->language = $browserLanguage;\n $this->_language = $browserLanguage . '/';\n $this->_metaLanguage = $browserLanguage;\n } else {\n $this->_language = $this->_config['language'][0] . '/';\n $this->_metaLanguage = $this->_config['language'][0];\n }\n }\n } else {\n $this->_language = '';\n $this->_metaLanguage = $this->_config['language'][0];\n }\n }", "public function handle($request, Closure $next)\n {\n\n /*App::setLocale('de');*/\n $config = app('config');\n $locale = $request->segment(1);\n//dd($locale);\n if (session()->has('locale') && ($locale==session()->get('locale'))) {\n App::setLocale($locale);\n URL::defaults(['_locale' => $locale]);\n // dd($locale);\n }\n elseif(in_array($locale,$config['app.languages'])){\n\n App::setLocale($locale);\n session()->put('locale', $locale);\n URL::defaults(['_locale' => $locale]);\n }\n else{\n URL::defaults(['_locale' => 'en']);\n App::setLocale('en');\n }\n\n\n // url()->defaults(array('_locale'=>'de'));\n return $next($request);\n }", "public function localeSwitchRequest()\n {\n return $this->request->switch_locale_to;\n }", "public function changeLocale($current_route){\n\t\tif(strlen($current_route) <= 2){\n\t\t\t$CountryLanguage = CountryLanguage::where('wp_language', $current_route)->first();\n\t\t\tif(isset($CountryLanguage) && !empty($CountryLanguage->language_code)){\n\t\t\t\tConfig::set('app.locale', $CountryLanguage->language_code);\n\t\t\t}\n\t\t}\n\t}", "abstract public function getLocaleName();", "function switch_to_locale($locale)\n {\n }", "public function getLocaleFromRequest(): string {\n $params = explode('/', request()->getPathInfo());\n\n // Dump the first element (empty string) as getPathInfo() always returns a leading slash\n array_shift($params);\n\n if (count($params) > 0) {\n $locale = $params[0];\n\n if ($this->checkLocaleInSupportedLocales($locale)) {\n return $locale;\n }\n }\n\n return app()->getLocale() ?? config('translatable.fallback_locale');\n }", "function wp_oembed_register_route()\n {\n }", "abstract public function getLocaleCode();", "public function handle($request, Closure $next)\n {\n \n \n $i = explode(\"/\" ,$request);\n // url is $i[1] \n $m = \\LaravelLocalization::getSupportedLocales() ;\n\n if(array_key_exists($i[1],$m)){\n \\App::setLocale($i[1]);\n return $next($request);\n }elseif($i[1] == 'admin HTTP'){\n dd(\\App::getLocale());\n // return $next($request);\n }else{\n dd($i);\n }\n \n }", "function locale(string $locale = null)\n{\n if (!$locale) {\n return app('translator')->getLocale();\n }\n\n app('translator')->setLocale($locale);\n}", "function is_locale_switched()\n {\n }", "protected function checkSystemLocale() {}", "protected function initializeL10nLocales() {}", "public function switchToLocale(string $locale): string {\n $root = request()->root();\n $params = explode('/', request()->getPathInfo());\n\n // Dump the first element (empty string) as getPathInfo() always returns a leading slash\n array_shift($params);\n\n if (count($params) === 0) {\n return \"$root\";\n }\n\n if (!$this->checkLocaleInSupportedLocales($locale)) {\n return \"$root\";\n }\n\n if ($this->checkLocaleInSupportedLocales($params[0])) {\n array_shift($params);\n }\n\n $params = implode('/', $params);\n\n $url = ($this->isFallbackLocaleHidden() && $this->isFallbackLocale($locale))\n ? $params : \"$locale/$params\";\n\n return \"$root/$url\";\n }", "function lqd_app_view_rewrite_endpoint() {\n\tadd_rewrite_endpoint( 'messages-app-view', EP_ALL);\n\tadd_rewrite_rule('^messages/messages-app-view/page/?([0-9]{1,})/?$', 'index.php?pagename=messages&messages-app-view&paged=$matches[1]', 'top');\n}", "function language() {\n\t// Flip the language and go back\n\tCakeLog::write('debug', 'language: ' . print_r($this->request->named, true));\n\t$language = $this->request->named['new_language'];\n\n\tif (!empty($language)) {\n\t $referer = Router::normalize($this->referer(null, true));\n\t $urlRoute = Router::parse($referer);\n\t $urlRoute['language'] = $language;\n\t $urlRoute['url'] = array();\n\t $this->log(Router::reverse($urlRoute));\n\t $url = Router::normalize(Router::reverse($urlRoute));\n\t $this->params['language'] = $language;\n\t $this->redirect($url);\n\t} else {\n\t $this->redirect($this->referer());\n\t}\n }", "protected function loadLocalization() {}", "function define_application_uri(){\n //Cargo la URI segun el servidor - Esta siempre es todo lo que esta despues de www.edunola.com.ar o localhost/\n $uri_actual= $_SERVER['REQUEST_URI'];\n //Analizo la cantidad de partes de la baseurl para poder crear la URI correspondiente para la aplicacion\n $url_base= explode(\"/\", BASEURL);\n $uri_app= \"\";\n //0= http, 1= //, 2= dominio, >3= una carpeta cualquiera\n if(count($url_base) > 3){\n //Trabajar desde el 4to elemento del arreglo\n $count_url_base= count($url_base);\n for($i = 3; $i < $count_url_base; $i++){\n $uri_app .= \"/\" . $url_base[$i];\n }\n }\n //Elimino la parte de la URI que es fija y no es utilizada - Esto seria en caso de que haya carpeta\n $uri_actual= substr($uri_actual, strlen($uri_app));\n //Elimino \"/\" en caso de que haya una al final de la cadena\n $uri_actual= trim($uri_actual, \"/\"); \n /*\n * Analizar Internacionalizacion\n */ \n //Crea las variable LOCALE, LOCALE_URI, URI_LOCALE, BASEURL_LOCALE\n $locale_actual= NULL;\n $locale_uri= NULL;\n $uri_app_locale= $uri_actual;\n $base_url_locale= BASEURL; \n //Si hay configuracion de internacionalizacion realiza analisis\n if(isset($GLOBALS['i18n']['locales'])){\n //Consigue el locale por defecto\n $locale_actual= $GLOBALS['i18n']['default'];\n //Consigo la primer parte de la URI para ver si esta internacionalizada\n $uri_locale= explode(\"/\", $uri_actual);\n $uri_locale= $uri_locale[0];\n \n //Consigo el resto de los posibles LOCALES\n $locales= str_replace(\" \", \"\", $GLOBALS['i18n']['locales']);\n //Separo los LOCALE\n $locales= explode(\",\", $locales);\n\n //Recorro todos los locale para ver si alguno coincide con la primer parte de la URL\n foreach ($locales as $locale) {\n //Cuando un locale coincide armo los datos correspondientes\n if($uri_locale == $locale){\n //Cambio el locale y el locale uri por el correspondiente\n $locale_actual= $locale;\n $locale_uri= $locale; \n //Salgo del For\n break;\n }\n } \n if($locale_actual == $uri_locale){\n //Le quito la parte de internacionalizacion a la uri actual\n $uri_actual= substr($uri_actual, strlen($locale_actual));\n $uri_actual= trim($uri_actual, \"/\");\n //Le agrego la parte internacinalizada al base locale\n if($locale_uri != NULL){\n $base_url_locale= $base_url_locale . $locale_uri . \"/\";\n }\n }\n } \n //URIAPP: Contiene la URI de peticion sin el fragmento de internacionalizacion\n define('URIAPP', $uri_actual);\n //URIAPP_LOCALE: Contiene la URI de peticion con el fragmento de internacionalizacion\n define('URIAPP_LOCALE', $uri_app_locale);\n //LOCALE_URI: Contiene el LOCALE segun la URI actual\n define('LOCALE_URI', $locale_uri);\n //LOCALE: Contiene el Locale actual. Si no se encuentra ninguno en la URL es igual al por defecto, si no es igual a LOCALE_URI\n define('LOCALE', $locale_actual);\n //BASEURL_LOCALE: Contiene la base URL con el LOCALE correspondiente. Si el locale es el por defecto esta es igual a BASEURL\n define('BASEURL_LOCALE', $base_url_locale);\n }", "function get_current_url_locale(string $locale)\n {\n if($locale === get_locale()) {\n return get_current_url();\n }\n\n $current = get_current_route();\n\n $prev_locale = get_locale();\n set_locale($locale);\n\n if(Rseon\\Mallow\\Locale::getInstance()->exists($locale, 'routes', $current['name'])) {\n $current['path'] = __($current['name'], [], 'routes');\n }\n\n $url = router()->getUrl($current, $current['request']);\n set_locale($prev_locale);\n\n return $url;\n }", "abstract public function get_app_language();", "abstract protected function getListRoute() : string;", "public function __construct()\n\t{\n\t\t\\App::setLocale('en');\n\t}", "public function getLocale() {\n\t\treturn $this->getParameter('app_locale');\n\t}", "public function locale(string $locale = null);", "public function __construct()\n {\n $this->middleware('auth');\n app()->setLocale('arm'); \n }", "public function settingLocale() {}", "public function getLocale();", "public function getLocale();", "public function language()\n {\n \tif ( is_english() ){\n\t\t $this->session->engels = false;\n\t } else {\n\t\t $this->session->engels = true;\n }\n\t redirect($this->agent->referrer());\n }", "function getInternationalRoute($originCity, $destinyCity)\n {\n }", "function yourls_get_locale() {\n\tglobal $yourls_locale;\n\n\tif ( !isset( $yourls_locale ) ) {\n\t\t// YOURLS_LANG is defined in config.\n\t\tif ( defined( 'YOURLS_LANG' ) )\n\t\t\t$yourls_locale = YOURLS_LANG;\n\t}\n\n if ( !$yourls_locale )\n $yourls_locale = '';\n\n\treturn yourls_apply_filter( 'get_locale', $yourls_locale );\n}", "private function registerLocale()\n\t{\n\t\t$this->app->singleton('glottos.locale', function($app) {\n\t\t\treturn new Locale($this->getConfig('default_language_id'), $this->getConfig('default_country_id'));\n\t\t});\n\t}", "public static function getLocale(){\n return \\Illuminate\\Foundation\\Application::getLocale();\n }", "function setLocale($args) {\n\t\t$setLocale = isset($args[0]) ? $args[0] : null;\n\t\t\n\t\t$site = &Request::getSite();\n\t\t$journal = &Request::getJournal();\n\t\tif ($journal != null) {\n\t\t\t$journalSupportedLocales = $journal->getSetting('supportedLocales');\n\t\t\tif (!is_array($journalSupportedLocales)) {\n\t\t\t\t$journalSupportedLocales = array();\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (Locale::isLocaleValid($setLocale) && (!isset($journalSupportedLocales) || in_array($setLocale, $journalSupportedLocales)) && in_array($setLocale, $site->getSupportedLocales())) {\n\t\t\t$session = &Request::getSession();\n\t\t\t$session->setSessionVar('currentLocale', $setLocale);\n\t\t}\n\t\t\n\t\tif(isset($_SERVER['HTTP_REFERER'])) {\n\t\t\tRequest::redirect($_SERVER['HTTP_REFERER']);\n\t\t}\n\t\t\n\t\t$source = Request::getUserVar('source');\n\t\tif (isset($source) && !empty($source)) {\n\t\t\tRequest::redirect(Request::getProtocol() . '://' . Request::getServerHost() . $source, false);\n\t\t}\n\t\t\n\t\tRequest::redirect('index');\t\t\n\t}", "public function locale($request)\n {\n return $request->input('locale');\n }", "public function onKernelRequest(GetResponseEvent $event)\n {\n //only listen to master requests\n if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {\n return;\n }\n\n /** @var Request $request */\n $request = $event->getRequest();\n $params = $request->query->all();\n\n //retrieve path info and top level domain\n $tld = $this->localeManager->getTopLevelDomain($request);\n $pathInfo = $request->getPathInfo();\n\n //check if path info is in whitelist, if not, return without locale validation\n //otherwise return and continue\n if (!$this->localeManager->isPathIncluded($pathInfo)) {\n return;\n }\n\n $allowedLocales = $this->localeManager->getAllowedLocales($tld);\n $result = $this->localeManager->getLocalePathInfo($pathInfo);\n\n //if locale was found\n if (isset($result['locale'])) {\n\n $locale = $result['locale'];\n //check if locale is allowed for list of domain locales\n if ($this->localeManager->isLocaleAllowed($locale, $allowedLocales['locales'])) {\n //locale is allowed for current request, continue\n return;\n }\n //given locale is unknown, remove current locale in pathinfo\n $pathInfo = $this->localeManager->removeInvalidLocale($pathInfo, $locale);\n\n //permanently redirect to new path without locale!!\n $event->setResponse(\n new RedirectResponse(\n $request->getBaseUrl().$pathInfo.($params ? '?'.http_build_query($params) : ''),\n LocaleManager::HTTP_REDIRECT_PERM\n )\n );\n\n return;\n }\n //locale was not found\n $locale = $this->localeManager->getLocale($request, $allowedLocales);\n $request->setLocale($locale);\n $event->setResponse(\n $this->localeManager->redirect($request->getBaseUrl(), $pathInfo, $locale, $params)\n );\n }", "public function setLocale()\n\t{\n\t\tif ($locale = $this->app->session->get('admin_locale'))\n\t\t{\n\t\t\t$this->app->setLocale($locale);\n\t\t} else {\n \\Session::put('admin_locale', \\Config::get('app.locale'));\n }\n\t}", "function GetLanguage() : string\n{\n return App::getLocale();\n}", "function rest_get_queried_resource_route()\n {\n }", "public function getLocaleManager();", "public function handle($request, Closure $next)\n {\n \\App::setLocale(\\Routelocale::getLocaleFromRoute());\n return $next($request);;\n }", "public function getLocale(): string;", "public function getLocale(): string;", "public function getLocale(): string;", "function acf_get_locale()\n{\n}", "protected function registerDomainLocaleFilter()\n {\n $app = $this->app;\n\n $app->router->filter('domain.locale', function () use ($app) {\n $tld = $app['domain.localization']->getTld();\n\n if (! is_null($locale = $app['domain.localization']->getSupportedLocaleNameByTld($tld))) {\n $app['domain.localization']->setCurrentLocale($locale);\n }\n });\n }", "public function index()\n {\n return view('stevebauman/localization::locales.index');\n }", "protected function addLocales()\n {\n // @todo: add locales when locales configuration is updated\n }", "function admin_l10n($l10n)\n {\n }", "public function setLocale($locale)\n {\n $previous = app('url')->previous();\n $next = str_replace(url('/'), '', $previous);\n $tmp = explode('/', $next);\n array_shift($tmp);\n array_shift($tmp);\n $next = $locale . '/' . implode('/', $tmp);\n\n return redirect($next);\n }", "public function filter_locale($locale)\n {\n }", "public function getLocale(): ?string;", "public function getLocale(): ?string;", "public function handle($request, Closure $next)\n {\n\t\t$segments = $request->segments();\n\t\t$query = $request->query();\n\t\t\t\t\n\t\tif ($request->segment(1) !== \"admin\") \n\t\t{\n\t\t\t$locale = \"es\";\n\t\t\t\t\n\t\t\tif(Session::has('locale')){\t\t\n\t\t\t\t$locale = Session::get('locale');\n\t\t\t\tApp::setlocale($locale);\t\n\t\t\t\t\n\t\t\t\tif (substr($request->segment(1), 0, 3) === \"art\")\n\t\t\t\t\treturn $next($request);\n\t\t\t\t\n\t\t\t\t$localized_segments = $this->localize_segments($segments);\n\t\t\t\t\n\t\t\t\tif (count($segments) && strtoupper($locale) == \"ES\" && count($query)) {\n\t\t\t\t\treturn $this->redirect_ES($request, $localized_segments, $query);\n\t\t\t\t}\n\t\t\t\telse if (count($segments) && strtoupper($locale) == \"ES\") \n\t\t\t\t{\n\t\t\t\t\treturn $this->redirect_ES($request, $localized_segments, 0);\n\t\t\t\t}\n\t\t\t\telse if (count($segments) && count($query)) {\n\t\t\t\t\treturn $this->redirect_locale($request, $localized_segments, $locale, $query);\n\t\t\t\t}\n\t\t\t\telse if (count($segments)) {\n\t\t\t\t\treturn $this->redirect_locale($request, $localized_segments, $locale, $query);\n\t\t\t\t}\t\t\t\n\t\t\t\telse if ($locale !== \"es\")\n\t\t\t\t{\n\t\t\t\t\treturn redirect('/'.$locale);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ($request->lang == NULL || $request->lang == \"es\") \n\t\t\t{\n\t\t\t\t$locale = \"es\";\n\t\t\t\tApp::setlocale($locale);\t\n\t\t\t}\t\t\t\n\t\t\telse if ($request->lang == \"en\")\n\t\t\t{\n\t\t\t\t$locale = \"en\";\n\t\t\t\tApp::setlocale($locale);\t\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t return abort(404);\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t}\n\t\treturn $next($request);\n }", "function add_custom_admin_routes($app) {\n\n}", "protected function getSupportedLocales()\n {\n return Blog::getSupportedLocalesKeys();\n }", "function getFallbackLocale()\n {\n return config('app.fallback_locale');\n }", "public function cultureAction() {\n\tif($this->_getParam('id',false)) {\n\t$cultures = new Cultures();\n\t$this->view->cultures = $cultures->getCulture($this->_getParam('id'));\n\t} else {\n throw new Pas_Exception_Param($this->_missingParameter);\n\t}\n\t}", "public function __construct() {\n parent::__construct(self::ROUTE, self::TRANSLATION_LABEL, false);\n }", "public function getTargetLocale();", "function getLocale();", "protected function redirectTo()\n {\n return LaravelLocalization::setLocale().'/home';\n }", "function dev_change_locale( $locale ) {\n\n $dev_locale = filter_input( INPUT_GET, 'dev_lang', FILTER_SANITIZE_STRING );\n\n\tif ( ! empty( $dev_locale ) ) {\n\t\t$locale = $dev_locale;\n\t}\n\n\treturn $locale;\n}", "private function getFallbackLocale()\r\n {\r\n return config('app.fallback_locale');\r\n }", "function setLocale($inLocale = null) {\n\t\t$locale = false;\n\t\t$source = false;\n\t\tif ( $inLocale === null || strlen($inLocale) < 2 ) {\n\t\t\tif ( !$locale && isset($_COOKIE['locale']) ) {\n\t\t\t\t$locale = strip_tags(trim(stripslashes($_COOKIE['locale'])));\n\t\t\t\t$source = self::LOCALE_SOURCE_COOKIE;\n\t\t\t}\n\t\t\tif ( !$locale && $this->getSession() instanceof mvcSessionBase ) {\n\t\t\t\t$locale = $this->getSession()->getParam('locale');\n\t\t\t\t$source = self::LOCALE_SOURCE_SESSION;\n\t\t\t}\n\t\t\tif ( !$locale && isset($_REQUEST['lang']) ) {\n\t\t\t\t$locale = strip_tags(trim(stripslashes($_REQUEST['lang'])));\n\t\t\t\t$source = self::LOCALE_SOURCE_REQUEST;\n\t\t\t}\n\t\t\tif ( !$locale && strlen($this->getRequestUri()) > 0 ) {\n\t\t\t\t// check first chunk of request\n\t\t\t\t$pieces = explode('/', $this->getRequestUri());\n\t\t\t\tif ( strlen($pieces[0]) == 0 ) {\n\t\t\t\t\tunset($pieces[0]);\n\t\t\t\t}\n\t\t\t\t$locale = array_shift($pieces);\n\t\t\t\t$source = self::LOCALE_SOURCE_URI;\n\t\t\t}\n\t\t} else {\n\t\t\t$locale = strip_tags(trim(stripslashes($inLocale)));\n\t\t\t$source = self::LOCALE_SOURCE_OTHER;\n\t\t}\n\t\t\n\t\tif ( systemLocale::isValidLocale($locale, true) ) {\n\t\t\t$this->setParam(self::PARAM_REQUEST_LOCALE, $locale);\n\t\t\t$this->setParam(self::PARAM_REQUEST_LOCALE_SOURCE, $source);\n\t\t} else {\n\t\t\t$this->setParam(self::PARAM_REQUEST_LOCALE, (string) system::getLocale());\n\t\t\t$this->setParam(self::PARAM_REQUEST_LOCALE_SOURCE, self::LOCALE_SOURCE_SYSTEM);\n\t\t}\n\t\treturn $this;\n\t}", "public function index()\n {\n return view('locales.index');\n }", "public function switchLang($locale)\n {\n if( array_key_exists($locale, Config::get('translatable')['locales']) ) {\n\n App::setLocale($locale);\n }\n\n return Redirect::back();\n }", "public function routeStartup()\n {\n //...\n }", "public function localeIndex()\n {\n return $this->localeIndex;\n }", "private function getRoute(){\n\t}", "public function getLocale()\n {\n return 'en';\n }", "public function __construct()\n {\n $this->middleware('auth');\n setlocale(LC_ALL, 'pt_BR', 'pt_BR.utf-8', 'pt_BR.utf-8', 'portuguese');\n }", "public function indexAction(Request $request)\n {\n $enableAutodetect = $this->getParameter('kunstmaan_language_chooser.autodetectlanguage');\n $enableSplashpage = $this->getParameter('kunstmaan_language_chooser.showlanguagechooser');\n\n $defaultLocale = $this->getParameter('defaultlocale');\n\n if ($enableAutodetect) {\n $localeGuesserManager = $this->get('lunetics_locale.guesser_manager');\n\n $locale = $localeGuesserManager->runLocaleGuessing($request);\n\n if ($locale) {\n //locale returned will in the form of en_US, we need en\n $locale = locale_get_primary_language($locale);\n }\n\n // locale has been found, redirect\n if ($locale) {\n return $this->redirect($this->generateUrl('_slug', array('_locale' => $locale)), 302);\n } else {\n // no locale could be guessed, if splashpage is not enabled fallback to default and redirect\n if (!$enableSplashpage) {\n return $this->redirect($this->generateUrl('_slug', array('_locale' => $defaultLocale)), 302);\n }\n }\n }\n\n if ($enableSplashpage) {\n $viewPath = $this->getParameter('kunstmaan_language_chooser.languagechoosertemplate');\n\n return $this->render($viewPath);\n }\n }", "protected function loadBackendRoutes() {}" ]
[ "0.6297009", "0.6190423", "0.60642624", "0.6004546", "0.59710073", "0.5923558", "0.587926", "0.57957155", "0.5716554", "0.568837", "0.56763977", "0.5654062", "0.5647281", "0.5638102", "0.562977", "0.5603264", "0.55766624", "0.55453104", "0.55276614", "0.55271506", "0.54872084", "0.5486168", "0.5479965", "0.547167", "0.5453877", "0.5448724", "0.54250354", "0.54192126", "0.5415427", "0.5408861", "0.54029924", "0.53907335", "0.5386297", "0.5381008", "0.53668046", "0.5361389", "0.53563184", "0.535205", "0.53459436", "0.5345756", "0.5337256", "0.533272", "0.53317106", "0.53055394", "0.53047913", "0.5296099", "0.5295263", "0.5289697", "0.5285444", "0.5278366", "0.5274588", "0.5273194", "0.52658075", "0.5264405", "0.5264405", "0.5252716", "0.52498245", "0.52319825", "0.5231939", "0.5228689", "0.5219392", "0.5205673", "0.5197177", "0.5194508", "0.51887465", "0.51835436", "0.5182425", "0.51593566", "0.51537913", "0.51537913", "0.51537913", "0.5153204", "0.51468956", "0.5134912", "0.51323056", "0.51288164", "0.5125836", "0.51235265", "0.5111912", "0.5111912", "0.5106239", "0.50962764", "0.50905865", "0.5089593", "0.5089015", "0.5082992", "0.5080669", "0.5076538", "0.5073185", "0.50670373", "0.5063543", "0.50537324", "0.5047726", "0.5047236", "0.5043736", "0.5042083", "0.50416", "0.5038993", "0.5027773", "0.50171113", "0.50138986" ]
0.0
-1
Method returning the class name
public function __toString() { return __CLASS__; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClassName();", "public function getClassName();", "public function getClassName() ;", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName()\n {\n return __CLASS__;;\n }", "private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}", "public function getClassName() {\r\n\t\treturn($this->class_name);\r\n\t}", "public static function get_class_name() {\r\n\t\treturn __CLASS__;\r\n\t}", "public function getClassName() { return __CLASS__; }", "public static function getClassName() {\n\t\treturn get_called_class();\n\t}", "public function getClassName(): string\n {\n return $this->get(self::CLASS_NAME);\n }", "public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}", "public static function getClassName()\n {\n return get_called_class();\n }", "public function getClassName()\n {\n return $this->class;\n }", "public function getClassName()\n {\n return $this->class;\n }", "public static function className() : string {\n return get_called_class();\n }", "public function getName()\n {\n return __CLASS__;\n }", "public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}", "public function getClassName()\n {\n return $this->class_name;\n }", "public function class_name() {\n\t\treturn strtolower(get_class($this));\n\t}", "public function getName(): string\n {\n return __CLASS__;\n }", "public static function getClassName() {\n return get_called_class();\n }", "public function getClassname(){\n\t\treturn $this->classname;\n\t}", "public function getClassname()\n\t{\n\t\treturn $this->classname;\n\t}", "public function getClassName()\n {\n return $this->_sClass;\n }", "public function get_just_class_name() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn substr( strrchr( $full_path, '\\\\' ), 1 );\n\n\t}", "protected function getClassName(): string\n {\n return $this->className;\n }", "public static function getClassName() {\n return self::$className;\n }", "public function getClassName(): string;", "public function getClassName() : string;", "public function getName() {\r\n $parsed = Parser::parseClassName(get_class());\r\n return $parsed['className'];\r\n }", "public function getClassName() : string\n {\n return $this->className;\n }", "public function getClassName()\n {\n $fullClass = get_called_class();\n $exploded = explode('\\\\', $fullClass);\n\n return end($exploded);\n }", "public static function getClassName()\n {\n $classNameArray = explode('\\\\', get_called_class());\n\n return array_pop($classNameArray);\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName() {\t\t\n\t\treturn MemberHelper::getClassName($this->classNumber);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getClassName() {\r\n\t\treturn $this->strClassName;\r\n\t}", "public function getClassName() : string\n {\n\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public static function staticGetClassName()\n {\n return __CLASS__;\n }", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function getClassName(): string\n {\n return $this->makeClassFromFilename($this->filename);\n }", "public function getClassName() {\n\t\treturn $this->_className;\n\t}", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n return $this->className;\n }", "public function getClassName ()\n {\n $className = explode('\\\\', get_class($this));\n\n return array_pop($className);\n }", "function getClassName()\n {\n // TODO: Implement getClassName() method.\n }", "public static function getClassName(){\n $parts = explode('\\\\', static::class);\n return end($parts);\n }", "function getClassName(){\n echo __CLASS__ . \"<br><br>\"; \n }", "public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }", "public function class()\n {\n // @codingStandardsIgnoreLine\n return $this->class ?? \"\";\n }", "public function getClass()\n {\n return $this->_className;\n }", "private function getClassName() {\n return (new \\ReflectionClass(static::class))->getShortName();\n }", "public function getName() {\n\t\t\n\t\t// cut last part of class name\n\t\treturn substr( get_class( $this ), 0, -11 );\n\t\t\n\t}", "public function getClassNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[1];\r\n }", "public function className()\n {\n $full_path = explode('\\\\', get_called_class());\n return end($full_path);\n }", "private function className () {\n $namespacedClass = explode(\"\\\\\", get_class($this));\n\n return end($namespacedClass);\n }", "public function getClass(): string\n {\n return $this->class;\n }", "public static function getFullyQualifiedClassName() {\n $reflector = new \\ReflectionClass(get_called_class());\n return $reflector->getName();\n }", "public function getClassName()\n\t{\n\t\tif (null === $this->_className) {\n\t\t\t$this->setClassName(get_class($this));\n\t\t}\n\t\t\n\t\treturn $this->_className;\n\t}", "public function getClassName() : string {\n if ($this->getType() != Router::CLOSURE_ROUTE) {\n $path = $this->getRouteTo();\n $pathExplode = explode(DS, $path);\n\n if (count($pathExplode) >= 1) {\n $fileNameExplode = explode('.', $pathExplode[count($pathExplode) - 1]);\n\n if (count($fileNameExplode) == 2 && $fileNameExplode[1] == 'php') {\n return $fileNameExplode[0];\n }\n }\n }\n\n return '';\n }", "public function getName(){\n\t\treturn get_class($this);\n\t}", "public function getClassName() {\r\n return $this->myCRUD()->getClassName();\r\n }", "public static function className()\n\t{\n\t\treturn static::class;\n\t}", "public function toClassName(): string\n {\n return ClassName::full($this->name);\n }", "public function getName()\n {\n return static::CLASS;\n }", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "function getName()\n {\n return get_class($this);\n }", "public function className(): string\n {\n return $this->taskClass->name();\n }", "public static function getClassName($class)\n {\n return static::splitClassName($class)[1];\n }", "function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}", "public function getName() {\n return get_class($this);\n }", "public function getName() {\n return get_class($this);\n }", "public function toString()\n {\n return __CLASS__;\n }", "public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}", "public function getNamespacedName()\n {\n return get_class();\n }", "protected function name() {\n\t\treturn strtolower(str_replace('\\\\', '_', get_class($this)));\n\t}", "protected function getClassName()\n {\n return ucwords(camel_case($this->getNameInput())) . 'TableSeeder';\n }", "function getClassName($name)\n{\n return str_replace('_', ' ', snake_case(class_basename($name)));\n}", "public function getClassName(): ?string {\n\t\treturn Hash::get($this->_config, 'className');\n\t}", "public function __toString() {\n\t\treturn $this->className();\n\t}", "public static function name()\n {\n return lcfirst(self::getClassShortName());\n }" ]
[ "0.87522393", "0.87522393", "0.8751158", "0.87397957", "0.87397957", "0.87397957", "0.87397957", "0.8731564", "0.8696754", "0.8673495", "0.8638432", "0.8615335", "0.8603119", "0.8566906", "0.8562364", "0.8555002", "0.85503733", "0.85503733", "0.85425884", "0.8533183", "0.8529981", "0.85237026", "0.8502733", "0.8493115", "0.8491238", "0.8488943", "0.8484194", "0.847459", "0.8441478", "0.8418852", "0.8399611", "0.83950585", "0.83949184", "0.83853173", "0.8378261", "0.837777", "0.8372544", "0.8355432", "0.8355432", "0.83479965", "0.8325877", "0.8325877", "0.8312873", "0.83027107", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.82474744", "0.8242934", "0.8202995", "0.8185409", "0.8184752", "0.81829107", "0.81829107", "0.8176191", "0.81761754", "0.8162896", "0.8142928", "0.81323636", "0.8062757", "0.80528253", "0.8045769", "0.8033823", "0.8026215", "0.8001116", "0.79949147", "0.79779136", "0.79672754", "0.7957633", "0.790449", "0.78617185", "0.7860126", "0.7847096", "0.78195953", "0.7817044", "0.780094", "0.780094", "0.780094", "0.780094", "0.780094", "0.780094", "0.77821547", "0.7761565", "0.77588034", "0.7747239", "0.77409905", "0.77409905", "0.7710985", "0.76808393", "0.7670475", "0.76640886", "0.76514393", "0.76499707", "0.76323646", "0.76005036", "0.75937456" ]
0.0
-1
Run the database seeds.
public function run() { $regions = [ [ 'name' => 'Region 1', 'country_id' => 1 ], [ 'name' => 'Region 2', 'country_id' => 1 ], [ 'name' => 'Region 7', 'country_id' => 2 ], [ 'name' => 'Region 3', 'country_id' => 2 ] ]; Region::insert($regions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Register any application services.
public function register() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register()\n {\n $this->registerServices();\n }", "public function register()\n {\n $this->registerAssets();\n $this->registerServices();\n }", "public function register()\n\t{\n\n $this->registerUserService();\n $this->registerCountryService();\n $this->registerMetaService();\n $this->registerLabelService();\n $this->registerTypeService();\n $this->registerGroupeService();\n $this->registerActiviteService();\n $this->registerRiiinglinkService();\n $this->registerInviteService();\n $this->registerTagService();\n $this->registerAuthService();\n $this->registerChangeService();\n $this->registerRevisionService();\n $this->registerUploadService();\n //$this->registerTransformerService();\n }", "public function register()\n { \n // User Repository\n $this->app->bind('App\\Contracts\\Repository\\User', 'App\\Repositories\\User');\n \n // JWT Token Repository\n $this->app->bind('App\\Contracts\\Repository\\JSONWebToken', 'App\\Repositories\\JSONWebToken');\n \n $this->registerClearSettleApiLogin();\n \n $this->registerClearSettleApiClients();\n \n \n }", "public function register()\n {\n $this->registerRequestHandler();\n $this->registerAuthorizationService();\n $this->registerServices();\n }", "public function register()\n {\n $this->app->bind(\n PegawaiServiceContract::class,\n PegawaiService::class \n );\n\n $this->app->bind(\n RiwayatPendidikanServiceContract::class,\n RiwayatPendidikanService::class \n );\n\n $this->app->bind(\n ProductionHouseServiceContract::class,\n ProductionHouseService::class\n );\n\n $this->app->bind(\n MovieServiceContract::class,\n MovieService::class\n );\n\n $this->app->bind(\n PangkatServiceContract::class,\n PangkatService::class \n );\n\n }", "public function register()\n {\n // $this->app->bind('AuthService', AuthService::class);\n }", "public function register()\n {\n $this->registerServiceProviders();\n $this->registerSettingsService();\n $this->registerHelpers();\n }", "public function register()\n {\n $this->registerAccountService();\n\n $this->registerCurrentAccount();\n\n //$this->registerMenuService();\n\n //$this->registerReplyService();\n }", "public function register()\n {\n $this->registerRepositories();\n }", "public function register()\n {\n $this->registerFacades();\n $this->registerRespository();\n }", "public function register()\n {\n $this->app->bind('App\\Services\\UserService');\n $this->app->bind('App\\Services\\PostService');\n $this->app->bind('App\\Services\\MyPickService');\n $this->app->bind('App\\Services\\FacebookService');\n $this->app->bind('App\\Services\\LikeService');\n }", "public function register()\n {\n // service 由各个应用在 AppServiceProvider 单独绑定对应实现\n }", "public function register()\n {\n //\n if ($this->app->environment() !== 'production') {\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n }\n\n\n\n\n $this->app->register(ResponseMacroServiceProvider::class);\n $this->app->register(TwitterServiceProvider::class);\n }", "public function register()\n {\n $this->registerGraphQL();\n\n $this->registerConsole();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n\n $this->registerCommand();\n $this->registerSchedule();\n $this->registerDev();\n\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__.'/../config/telescope-error-service-client.php', 'telescope-error-service-client'\n );\n\n $this->registerStorageDriver();\n\n $this->commands([\n Console\\InstallCommand::class,\n Console\\PublishCommand::class,\n ]);\n }", "public function register()\n\t{\n\t\t$this->registerPasswordBroker();\n\n\t\t$this->registerTokenRepository();\n\t}", "public function register()\n {\n $this->registerConfig();\n\n $this->app->register('Arcanedev\\\\LogViewer\\\\Providers\\\\UtilitiesServiceProvider');\n $this->registerLogViewer();\n $this->app->register('Arcanedev\\\\LogViewer\\\\Providers\\\\CommandsServiceProvider');\n }", "public function register() {\n $this->registerProviders();\n $this->registerFacades();\n }", "public function register()\n {\n // $this->app->make('CheckStructureService');\n }", "public function register()\n\t{\n\t\t$this->app->bind(\n\t\t\t'Illuminate\\Contracts\\Auth\\Registrar',\n\t\t\t'APIcoLAB\\Services\\Registrar'\n\t\t);\n\n $this->app->bind(\n 'APIcoLAB\\Repositories\\Flight\\FlightRepository',\n 'APIcoLAB\\Repositories\\Flight\\SkyScannerFlightRepository'\n );\n\n $this->app->bind(\n 'APIcoLAB\\Repositories\\Place\\PlaceRepository',\n 'APIcoLAB\\Repositories\\Place\\SkyScannerPlaceRepository'\n );\n\t}", "public function register()\n {\n $this->app->register(\\Maatwebsite\\Excel\\ExcelServiceProvider::class);\n $this->app->register(\\Intervention\\Image\\ImageServiceProvider::class);\n $this->app->register(\\Rap2hpoutre\\LaravelLogViewer\\LaravelLogViewerServiceProvider::class);\n $this->app->register(\\Yajra\\Datatables\\DatatablesServiceProvider::class);\n $this->app->register(\\Yajra\\Datatables\\ButtonsServiceProvider::class);\n\n $loader = null;\n if (class_exists('Illuminate\\Foundation\\AliasLoader')) {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n }\n\n // Facades\n if ($loader != null) {\n $loader->alias('Image', \\Intervention\\Image\\Facades\\Image::class);\n $loader->alias('Excel', \\Maatwebsite\\Excel\\Facades\\Excel::class);\n\n }\n\n if (app()->environment() != 'production') {\n // Service Providers\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n $this->app->register(\\Barryvdh\\Debugbar\\ServiceProvider::class);\n\n // Facades\n if ($loader != null) {\n $loader->alias('Debugbar', \\Barryvdh\\Debugbar\\Facade::class);\n }\n }\n\n if ($this->app->environment('local', 'testing')) {\n $this->app->register(\\Laravel\\Dusk\\DuskServiceProvider::class);\n }\n }", "public function register()\n {\n $this->registerInertia();\n $this->registerLengthAwarePaginator();\n }", "public function register()\n {\n $this->registerFlareFacade();\n $this->registerServiceProviders();\n $this->registerBindings();\n }", "public function register()\n {\n $this->app->bind(\n 'Toyopecas\\Repositories\\TopoRepository',\n 'Toyopecas\\Repositories\\TopoRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\ServicesRepository',\n 'Toyopecas\\Repositories\\ServicesRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\SobreRepository',\n 'Toyopecas\\Repositories\\SobreRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\ProdutosRepository',\n 'Toyopecas\\Repositories\\ProdutosRepositoryEloquent'\n );\n }", "public function register()\r\n {\r\n Passport::ignoreMigrations();\r\n\r\n $this->app->singleton(\r\n CityRepositoryInterface::class,\r\n CityRepository::class\r\n );\r\n\r\n $this->app->singleton(\r\n BarangayRepositoryInterface::class,\r\n BarangayRepository::class\r\n );\r\n }", "public function register()\n {\n $this->registerRepositories();\n\n $this->pushMiddleware();\n }", "public function register()\r\n {\r\n $this->mergeConfigFrom(__DIR__ . '/../config/laravel-base.php', 'laravel-base');\r\n\r\n $this->app->bind(UuidGenerator::class, UuidGeneratorService::class);\r\n\r\n }", "public function register()\n {\n\n $this->app->register(RepositoryServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind(\n 'Uhmane\\Repositories\\ContatosRepository', \n 'Uhmane\\Repositories\\ContatosRepositoryEloquent'\n );\n }", "public function register()\r\n {\r\n $this->app->bind(\r\n ViberServiceInterface::class,\r\n ViberService::class\r\n );\r\n\r\n $this->app->bind(\r\n ApplicantServiceInterface::class,\r\n ApplicantService::class\r\n );\r\n }", "public function register()\n {\n $this->app->register('ProAI\\Datamapper\\Providers\\MetadataServiceProvider');\n\n $this->app->register('ProAI\\Datamapper\\Presenter\\Providers\\MetadataServiceProvider');\n\n $this->registerScanner();\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->app->bind(\n 'Larafolio\\Http\\HttpValidator\\HttpValidator',\n 'Larafolio\\Http\\HttpValidator\\CurlValidator'\n );\n\n $this->app->register(ImageServiceProvider::class);\n }", "public function register()\n {\n // Register all repositories\n foreach ($this->repositories as $repository) {\n $this->app->bind(\"App\\Repository\\Contracts\\I{$repository}\",\n \"App\\Repository\\Repositories\\\\{$repository}\");\n }\n\n // Register all services\n foreach ($this->services as $service) {\n $this->app->bind(\"App\\Service\\Contracts\\I{$service}\", \n \"App\\Service\\Modules\\\\{$service}\");\n }\n }", "public function register()\n {\n $this->registerAdapterFactory();\n $this->registerDigitalOceanFactory();\n $this->registerManager();\n $this->registerBindings();\n }", "public function register()\n {\n // Only Environment local\n if ($this->app->environment() !== 'production') {\n foreach ($this->services as $serviceClass) {\n $this->registerClass($serviceClass);\n }\n }\n\n // Register Aliases\n $this->registerAliases();\n }", "public function register()\n {\n $this->app->bind(\n 'App\\Contracts\\UsersInterface',\n 'App\\Services\\UsersService'\n );\n $this->app->bind(\n 'App\\Contracts\\CallsInterface',\n 'App\\Services\\CallsService'\n );\n $this->app->bind(\n 'App\\Contracts\\ContactsInterface',\n 'App\\Services\\ContactsService'\n );\n $this->app->bind(\n 'App\\Contracts\\EmailsInterface',\n 'App\\Services\\EmailsService'\n );\n $this->app->bind(\n 'App\\Contracts\\PhoneNumbersInterface',\n 'App\\Services\\PhoneNumbersService'\n );\n $this->app->bind(\n 'App\\Contracts\\NumbersInterface',\n 'App\\Services\\NumbersService'\n );\n $this->app->bind(\n 'App\\Contracts\\UserNumbersInterface',\n 'App\\Services\\UserNumbersService'\n );\n }", "public function register()\n {\n //\n if (env('APP_DEBUG', false) && $this->app->isLocal()) {\n $this->app->register(\\Laravel\\Telescope\\TelescopeServiceProvider::class);\n $this->app->register(TelescopeServiceProvider::class);\n }\n }", "public function register()\n {\n $this->registerBrowser();\n\n $this->registerViewFinder();\n }", "public function register()\n {\n $this->registerFriendsLog();\n $this->registerNotifications();\n $this->registerAPI();\n $this->registerMailChimpIntegration();\n }", "public function register()\n {\n $this->mergeConfigFrom(__DIR__.'/../config/awesio-auth.php', 'awesio-auth');\n\n $this->app->singleton(AuthContract::class, Auth::class);\n\n $this->registerRepositories();\n\n $this->registerServices();\n\n $this->registerHelpers();\n }", "public function register()\n {\n $this->registerRepository();\n $this->registerMigrator();\n $this->registerArtisanCommands();\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__.'/../config/services.php', 'services'\n );\n }", "public function register()\n {\n $this->registerRateLimiting();\n\n $this->registerHttpValidation();\n\n $this->registerHttpParsers();\n\n $this->registerResponseFactory();\n\n $this->registerMiddleware();\n }", "public function register()\n {\n $this->registerConfig();\n $this->registerView();\n $this->registerMessage();\n $this->registerMenu();\n $this->registerOutput();\n $this->registerCommands();\n require __DIR__ . '/Service/ServiceProvider.php';\n require __DIR__ . '/Service/RegisterRepoInterface.php';\n require __DIR__ . '/Service/ErrorHandling.php';\n $this->registerExportDompdf();\n $this->registerExtjs();\n }", "public function register()\n {\n $this->registerRepository();\n $this->registerParser();\n }", "public function register()\n {\n $this->registerOtherProviders()->registerAliases();\n $this->loadViewsFrom(__DIR__.'/../../resources/views', 'jarvisPlatform');\n $this->app->bind('jarvis.auth.provider', AppAuthenticationProvider::class);\n $this->loadRoutes();\n }", "public function register()\n {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n\n $loader->alias('Laratrust', 'Laratrust\\LaratrustFacade');\n $loader->alias('Form', 'Collective\\Html\\FormFacade');\n $loader->alias('Html', 'Collective\\Html\\HtmlFacade');\n $loader->alias('Markdown', 'BrianFaust\\Parsedown\\Facades\\Parsedown');\n\n $this->app->register('Baum\\Providers\\BaumServiceProvider');\n $this->app->register('BrianFaust\\Parsedown\\ServiceProvider');\n $this->app->register('Collective\\Html\\HtmlServiceProvider');\n $this->app->register('Laravel\\Scout\\ScoutServiceProvider');\n $this->app->register('Laratrust\\LaratrustServiceProvider');\n\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\AuthServiceProvider');\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\EventServiceProvider');\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\ViewServiceProvider');\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->registerGuard();\n $this->registerBladeDirectives();\n }", "public function register()\n {\n $this->registerConfig();\n\n $this->app->register(Providers\\ManagerServiceProvider::class);\n $this->app->register(Providers\\ValidationServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind(ReviewService::class, function ($app) {\n return new ReviewService();\n });\n }", "public function register()\n {\n $this->app->bind(\n Services\\UserService::class,\n Services\\Implementations\\UserServiceImplementation::class\n );\n $this->app->bind(\n Services\\FamilyCardService::class,\n Services\\Implementations\\FamilyCardServiceImplementation::class\n );\n }", "public function register()\n {\n // register its dependencies\n $this->app->register(\\Cviebrock\\EloquentSluggable\\ServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind('gameService', 'App\\Service\\GameService');\n }", "public function register()\n {\n $this->app->bind(VehicleRepository::class, GuzzleVehicleRepository::class);\n }", "public function register()\n {\n $this->app->bindShared(ElasticsearchNedvizhimostsObserver::class, function($app){\n return new ElasticsearchNedvizhimostsObserver(new Client());\n });\n\n // $this->app->bindShared(ElasticsearchNedvizhimostsObserver::class, function()\n // {\n // return new ElasticsearchNedvizhimostsObserver(new Client());\n // });\n }", "public function register()\n {\n // Register the app\n $this->registerApp();\n\n // Register Commands\n $this->registerCommands();\n }", "public function register()\n {\n $this->registerGeography();\n\n $this->registerCommands();\n\n $this->mergeConfig();\n\n $this->countriesCache();\n }", "public function register()\n {\n $this->app->bind(CertificationService::class, function($app){\n return new CertificationService();\n });\n }", "public function register()\n\t{\n\t\t$this->app->bind(\n\t\t\t'Illuminate\\Contracts\\Auth\\Registrar',\n\t\t\t'App\\Services\\Registrar'\n\t\t);\n \n $this->app->bind(\"App\\\\Services\\\\ILoginService\",\"App\\\\Services\\\\LoginService\");\n \n $this->app->bind(\"App\\\\Repositories\\\\IItemRepository\",\"App\\\\Repositories\\\\ItemRepository\");\n $this->app->bind(\"App\\\\Repositories\\\\IOutletRepository\",\"App\\\\Repositories\\\\OutletRepository\");\n $this->app->bind(\"App\\\\Repositories\\\\IInventoryRepository\",\"App\\\\Repositories\\\\InventoryRepository\");\n\t}", "public function register()\n {\n $this->registerRollbar();\n }", "public function register()\n {\n $this->app->bind('activity', function () {\n return new ActivityService(\n $this->app->make(Activity::class),\n $this->app->make(PermissionService::class)\n );\n });\n\n $this->app->bind('views', function () {\n return new ViewService(\n $this->app->make(View::class),\n $this->app->make(PermissionService::class)\n );\n });\n\n $this->app->bind('setting', function () {\n return new SettingService(\n $this->app->make(Setting::class),\n $this->app->make(Repository::class)\n );\n });\n\n $this->app->bind('images', function () {\n return new ImageService(\n $this->app->make(Image::class),\n $this->app->make(ImageManager::class),\n $this->app->make(Factory::class),\n $this->app->make(Repository::class)\n );\n });\n }", "public function register()\n {\n App::bind('CreateTagService', function($app) {\n return new CreateTagService;\n });\n\n App::bind('UpdateTagService', function($app) {\n return new UpdateTagService;\n });\n }", "public function register()\n {\n $this->registerDomainLocalization();\n $this->registerDomainLocaleFilter();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(MailConfigServiceProvider::class);\n }", "public function register()\n {\n $this->registerUserProvider();\n $this->registerGroupProvider();\n $this->registerNeo();\n\n $this->registerCommands();\n\n $this->app->booting(function()\n {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n $loader->alias('Neo', 'Wetcat\\Neo\\Facades\\Neo');\n });\n }", "public function register()\n {\n //\n $this->app->bind(\n 'App\\Repositories\\Interfaces\\CompanyInterface', \n 'App\\Repositories\\CompanyRepo'\n );\n $this->app->bind(\n 'App\\Repositories\\Interfaces\\UtilityInterface', \n 'App\\Repositories\\UtilityRepo'\n );\n }", "public function register()\n {\n $this->registerPayment();\n\n $this->app->alias('image', 'App\\Framework\\Image\\ImageService');\n }", "public function register()\n {\n $this->app->bind(AttributeServiceInterface::class,AttributeService::class);\n $this->app->bind(ProductServiceIntarface::class,ProductService::class);\n\n\n }", "public function register()\n {\n App::bind('App\\Repositories\\UserRepositoryInterface','App\\Repositories\\UserRepository');\n App::bind('App\\Repositories\\AnimalRepositoryInterface','App\\Repositories\\AnimalRepository');\n App::bind('App\\Repositories\\DonationTypeRepositoryInterface','App\\Repositories\\DonationTypeRepository');\n App::bind('App\\Repositories\\NewsAniRepositoryInterface','App\\Repositories\\NewsAniRepository');\n App::bind('App\\Repositories\\DonationRepositoryInterface','App\\Repositories\\DonationRepository');\n App::bind('App\\Repositories\\ProductRepositoryInterface','App\\Repositories\\ProductRepository');\n App::bind('App\\Repositories\\CategoryRepositoryInterface','App\\Repositories\\CategoryRepository');\n App::bind('App\\Repositories\\TransferMoneyRepositoryInterface','App\\Repositories\\TransferMoneyRepository');\n App::bind('App\\Repositories\\ShippingRepositoryInterface','App\\Repositories\\ShippingRepository');\n App::bind('App\\Repositories\\ReserveProductRepositoryInterface','App\\Repositories\\ReserveProductRepository');\n App::bind('App\\Repositories\\Product_reserveRepositoryInterface','App\\Repositories\\Product_reserveRepository');\n App::bind('App\\Repositories\\Ordering_productRepositoryInterface','App\\Repositories\\Ordering_productRepository');\n App::bind('App\\Repositories\\OrderingRepositoryInterface','App\\Repositories\\OrderingRepository');\n App::bind('App\\Repositories\\UserUpdateSlipRepositoryInterface','App\\Repositories\\UserUpdateSlipRepository');\n }", "public function register()\n {\n if ($this->app->runningInConsole()) {\n $this->registerPublishing();\n }\n }", "public function register()\n {\n $this->app->bind(HttpClient::class, function ($app) {\n return new HttpClient();\n });\n\n $this->app->bind(SeasonService::class, function ($app) {\n return new SeasonService($app->make(HttpClient::class));\n });\n\n $this->app->bind(MatchListingController::class, function ($app) {\n return new MatchListingController($app->make(SeasonService::class));\n });\n\n }", "public function register()\n {\n $this->setupConfig();\n\n $this->bindServices();\n }", "public function register()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n Console\\MakeEndpointCommand::class,\n Console\\MakeControllerCommand::class,\n Console\\MakeRepositoryCommand::class,\n Console\\MakeTransformerCommand::class,\n Console\\MakeModelCommand::class,\n ]);\n }\n\n $this->registerFractal();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(AuthServiceProvider::class);\n }", "public function register()\n {\n\n $config = $this->app['config']['cors'];\n\n $this->app->bind('Yocome\\Cors\\CorsService', function() use ($config){\n return new CorsService($config);\n });\n\n }", "public function register()\n {\n // Bind facade\n\n $this->registerRepositoryBibdings();\n $this->registerFacades();\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(\\Laravel\\Socialite\\SocialiteServiceProvider::class);\n }", "public function register()\n {\n\n\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\UserRepository',\n 'Onlinecorrection\\Repositories\\UserRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\ClientRepository',\n 'Onlinecorrection\\Repositories\\ClientRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\ProjectRepository',\n 'Onlinecorrection\\Repositories\\ProjectRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\DocumentRepository',\n 'Onlinecorrection\\Repositories\\DocumentRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\OrderRepository',\n 'Onlinecorrection\\Repositories\\OrderRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\OrderItemRepository',\n 'Onlinecorrection\\Repositories\\OrderItemRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\DocumentImageRepository',\n 'Onlinecorrection\\Repositories\\DocumentImageRepositoryEloquent'\n );\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\PackageRepository',\n 'Onlinecorrection\\Repositories\\PackageRepositoryEloquent'\n );\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\StatusRepository',\n 'Onlinecorrection\\Repositories\\StatusRepositoryEloquent'\n );\n\n }", "public function register()\n {\n $this->registerConfig();\n\n $this->registerDataStore();\n\n $this->registerStorageFactory();\n\n $this->registerStorageManager();\n\n $this->registerSimplePhoto();\n }", "public function register()\n {\n // Default configuration file\n $this->mergeConfigFrom(\n __DIR__.'/Config/auzo_tools.php', 'auzoTools'\n );\n\n $this->registerModelBindings();\n $this->registerFacadesAliases();\n }", "public function register()\n {\n $this->app->bind(\\Cookiesoft\\Repositories\\CategoryRepository::class, \\Cookiesoft\\Repositories\\CategoryRepositoryEloquent::class);\n $this->app->bind(\\Cookiesoft\\Repositories\\BillpayRepository::class, \\Cookiesoft\\Repositories\\BillpayRepositoryEloquent::class);\n $this->app->bind(\\Cookiesoft\\Repositories\\UserRepository::class, \\Cookiesoft\\Repositories\\UserRepositoryEloquent::class);\n //:end-bindings:\n }", "public function register()\n {\n $this->app->singleton(ThirdPartyAuthService::class, function ($app) {\n return new ThirdPartyAuthService(\n config('settings.authentication_services'),\n $app['Laravel\\Socialite\\Contracts\\Factory'],\n $app['Illuminate\\Contracts\\Auth\\Factory']\n );\n });\n\n $this->app->singleton(ImageValidator::class, function ($app) {\n return new ImageValidator(\n config('settings.image.max_filesize'),\n config('settings.image.mime_types'),\n $app['Intervention\\Image\\ImageManager']\n );\n });\n\n $this->app->singleton(ImageService::class, function ($app) {\n return new ImageService(\n config('settings.image.max_width'),\n config('settings.image.max_height'),\n config('settings.image.folder')\n );\n });\n\n $this->app->singleton(RandomWordService::class, function ($app) {\n return new RandomWordService(\n $app['App\\Repositories\\WordRepository'],\n $app['Illuminate\\Session\\SessionManager'],\n config('settings.number_of_words_to_remember')\n );\n });\n\n $this->app->singleton(WordRepository::class, function ($app) {\n return new WordRepository(config('settings.min_number_of_chars_per_one_mistake_in_search'));\n });\n\n $this->app->singleton(CheckAnswerService::class, function ($app) {\n return new CheckAnswerService(\n $app['Illuminate\\Session\\SessionManager'],\n config('settings.min_number_of_chars_per_one_mistake')\n );\n });\n\n if ($this->app->environment() !== 'production') {\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n }\n }", "public function register()\n {\n $this->registerJWT();\n $this->registerJWSProxy();\n $this->registerJWTAlgoFactory();\n $this->registerPayload();\n $this->registerPayloadValidator();\n $this->registerPayloadUtilities();\n\n // use this if your package has a config file\n // config([\n // 'config/JWT.php',\n // ]);\n }", "public function register()\n {\n $this->registerManager();\n $this->registerConnection();\n $this->registerWorker();\n $this->registerListener();\n $this->registerFailedJobServices();\n $this->registerOpisSecurityKey();\n }", "public function register()\n {\n $this->app->register(RouterServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind('App\\Services\\TripService.php', function ($app) {\n return new TripService();\n });\n }", "public function register()\n {\n $this->registerUserComponent();\n $this->registerLocationComponent();\n\n }", "public function register()\n {\n $this->app->bind(\n \\App\\Services\\UserCertificate\\IUserCertificateService::class,\n \\App\\Services\\UserCertificate\\UserCertificateService::class\n );\n }", "public function register()\n {\n $this->app->bind(FacebookMarketingContract::class,FacebookMarketingService::class);\n }", "public function register()\n {\n /**\n * Register additional service\n * providers if they exist.\n */\n foreach ($this->providers as $provider) {\n if (class_exists($provider)) {\n $this->app->register($provider);\n }\n }\n }", "public function register()\n {\n $this->app->singleton('composer', function($app)\n {\n return new Composer($app['files'], $app['path.base']);\n });\n\n $this->app->singleton('forge', function($app)\n {\n return new Forge($app);\n });\n\n // Register the additional service providers.\n $this->app->register('Nova\\Console\\ScheduleServiceProvider');\n $this->app->register('Nova\\Queue\\ConsoleServiceProvider');\n }", "public function register()\n {\n\n\n\n $this->mergeConfigFrom(__DIR__ . '/../config/counter.php', 'counter');\n\n $this->app->register(RouteServiceProvider::class);\n\n\n }", "public function register()\r\n {\r\n $this->mergeConfigFrom(__DIR__.'/../config/colissimo.php', 'colissimo');\r\n $this->mergeConfigFrom(__DIR__.'/../config/rules.php', 'colissimo.rules');\r\n $this->mergeConfigFrom(__DIR__.'/../config/prices.php', 'colissimo.prices');\r\n $this->mergeConfigFrom(__DIR__.'/../config/zones.php', 'colissimo.zones');\r\n $this->mergeConfigFrom(__DIR__.'/../config/insurances.php', 'colissimo.insurances');\r\n $this->mergeConfigFrom(__DIR__.'/../config/supplements.php', 'colissimo.supplements');\r\n // Register the service the package provides.\r\n $this->app->singleton('colissimo', function ($app) {\r\n return new Colissimo;\r\n });\r\n }", "public function register(){\n $this->registerDependencies();\n $this->registerAlias();\n $this->registerServiceCommands();\n }", "public function register()\n {\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyService::class,\n \\App\\Services\\Survey\\SurveyService::class\n );\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyQuestionService::class,\n \\App\\Services\\Survey\\SurveyQuestionService::class\n );\n\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyAttemptService::class,\n \\App\\Services\\Survey\\SurveyAttemptService::class\n );\n\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyAttemptDataService::class,\n \\App\\Services\\Survey\\SurveyAttemptDataService::class\n );\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/../config/atlas.php', 'atlas'\n );\n \n $this->app->singleton(CoreContract::class, Core::class);\n \n $this->registerFacades([\n 'Atlas' => 'Atlas\\Facades\\Atlas',\n ]);\n }", "public function register()\n {\n $this->app->bind(TelescopeRouteServiceContract::class, TelescopeRouteService::class);\n }", "public function register()\n {\n $this->registerRepositoryBindings();\n\n $this->registerInterfaceBindings();\n\n $this->registerAuthorizationServer();\n\n $this->registerResourceServer();\n\n $this->registerFilterBindings();\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->mergeConfigFrom(__DIR__.'/../config/faithgen-events.php', 'faithgen-events');\n\n $this->app->singleton(EventsService::class);\n $this->app->singleton(GuestService::class);\n }", "public function register()\n {\n $this->registerAliases();\n $this->registerFormBuilder();\n\n // Register package commands\n $this->commands([\n 'CoreDbCommand',\n 'CoreSetupCommand',\n 'CoreSeedCommand',\n 'EventEndCommand',\n 'ArchiveMaxAttempts',\n 'CronCommand',\n 'ExpireInstructors',\n 'SetTestLock',\n 'StudentArchiveTraining',\n 'TestBuildCommand',\n 'TestPublishCommand',\n ]);\n\n // Merge package config with one in outer app \n // the app-level config will override the base package config\n $this->mergeConfigFrom(\n __DIR__.'/../config/core.php', 'core'\n );\n\n // Bind our 'Flash' class\n $this->app->bindShared('flash', function () {\n return $this->app->make('Hdmaster\\Core\\Notifications\\FlashNotifier');\n });\n\n // Register package dependencies\n $this->app->register('Collective\\Html\\HtmlServiceProvider');\n $this->app->register('Bootstrapper\\BootstrapperL5ServiceProvider');\n $this->app->register('Codesleeve\\LaravelStapler\\Providers\\L5ServiceProvider');\n $this->app->register('PragmaRX\\ZipCode\\Vendor\\Laravel\\ServiceProvider');\n $this->app->register('Rap2hpoutre\\LaravelLogViewer\\LaravelLogViewerServiceProvider');\n\n $this->app->register('Zizaco\\Confide\\ServiceProvider');\n $this->app->register('Zizaco\\Entrust\\EntrustServiceProvider');\n }" ]
[ "0.7879658", "0.7600202", "0.74930716", "0.73852855", "0.736794", "0.7306089", "0.7291359", "0.72896826", "0.72802424", "0.7268026", "0.7267702", "0.72658145", "0.7249053", "0.72171587", "0.7208486", "0.7198799", "0.7196415", "0.719478", "0.7176513", "0.7176227", "0.7164647", "0.71484524", "0.71337837", "0.7129424", "0.71231985", "0.7120174", "0.7103653", "0.71020955", "0.70977163", "0.7094701", "0.7092148", "0.70914364", "0.7088618", "0.7087278", "0.70827085", "0.70756096", "0.7075115", "0.70741326", "0.7071857", "0.707093", "0.7070619", "0.7067406", "0.7066438", "0.7061766", "0.70562875", "0.7051525", "0.7049684", "0.70467263", "0.7043264", "0.7043229", "0.70429426", "0.7042174", "0.7038729", "0.70384216", "0.70348704", "0.7034105", "0.70324445", "0.70282733", "0.7025024", "0.702349", "0.7023382", "0.702262", "0.7022583", "0.7022161", "0.702139", "0.7021084", "0.7020801", "0.7019928", "0.70180106", "0.7017351", "0.7011482", "0.7008627", "0.7007786", "0.70065045", "0.7006424", "0.70060986", "0.69992065", "0.699874", "0.69980377", "0.69980335", "0.6997871", "0.6996457", "0.69961494", "0.6994749", "0.6991596", "0.699025", "0.6988414", "0.6987274", "0.69865865", "0.69862866", "0.69848233", "0.6978736", "0.69779474", "0.6977697", "0.6976002", "0.69734764", "0.6972392", "0.69721776", "0.6970663", "0.6968296", "0.696758" ]
0.0
-1
Bootstrap any application services.
public function boot() { Route::bind('user_domain', function ($value) { return EventList::where('domain', $value)->firstOrFail(); }); Route::bind('event', function ($value, \Illuminate\Routing\Route $route) { return Event::where([ 'id' => $value, 'event_list_id' => $route->parameter('user_domain')->id, ])->firstOrFail(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function bootstrap(): void\n {\n if (! $this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrappers());\n }\n\n $this->app->loadDeferredProviders();\n }", "public function boot()\n {\n // Boot here application\n }", "public function bootstrap()\n {\n if (!$this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrapperList);\n }\n\n $this->app->loadDeferredProviders();\n }", "public function boot()\r\n {\r\n // Publishing is only necessary when using the CLI.\r\n if ($this->app->runningInConsole()) {\r\n $this->bootForConsole();\r\n }\r\n }", "public function boot()\n {\n $this->app->bind(IUserService::class, UserService::class);\n $this->app->bind(ISeminarService::class, SeminarService::class);\n $this->app->bind(IOrganizationService::class, OrganizationService::class);\n $this->app->bind(ISocialActivityService::class, SocialActivityService::class);\n }", "public function boot()\n {\n if ($this->booted) {\n return;\n }\n\n array_walk($this->loadedServices, function ($s) {\n $this->bootService($s);\n });\n\n $this->booted = true;\n }", "public function boot()\n {\n\n $this->app->bind(FileUploaderServiceInterface::class,FileUploaderService::class);\n $this->app->bind(ShopServiceInterface::class,ShopService::class);\n $this->app->bind(CategoryServiceInterface::class,CategoryService::class);\n $this->app->bind(ProductServiceInterface::class,ProductService::class);\n $this->app->bind(ShopSettingsServiceInterface::class,ShopSettingsService::class);\n $this->app->bind(FeedbackServiceInterface::class,FeedbackService::class);\n $this->app->bind(UserServiceInterface::class,UserService::class);\n $this->app->bind(ShoppingCartServiceInterface::class,ShoppingCartService::class);\n $this->app->bind(WishlistServiceInterface::class,WishlistService::class);\n $this->app->bind(NewPostApiServiceInterface::class,NewPostApiService::class);\n $this->app->bind(DeliveryAddressServiceInterface::class,DeliveryAddressService::class);\n $this->app->bind(StripeServiceInterface::class,StripeService::class);\n $this->app->bind(OrderServiceInterface::class,OrderService::class);\n $this->app->bind(MailSenderServiceInterface::class,MailSenderSenderService::class);\n }", "public function boot()\n {\n $this->setupConfig('delta_service');\n $this->setupMigrations();\n $this->setupConnection('delta_service', 'delta_service.connection');\n }", "public function boot()\n {\n $configuration = [];\n\n if (file_exists($file = getcwd() . '/kaleo.config.php')) {\n $configuration = include_once $file;\n }\n\n $this->app->singleton('kaleo', function () use ($configuration) {\n return new KaleoService($configuration);\n });\n }", "public function boot()\n {\n $this->shareResources();\n $this->mergeConfigFrom(self::CONFIG_PATH, 'amocrm-api');\n }", "public function boot(): void\n {\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n // Ports\n $this->app->bind(\n IAuthenticationService::class,\n AuthenticationService::class\n );\n $this->app->bind(\n IBeerService::class,\n BeerService::class\n );\n\n // Adapters\n $this->app->bind(\n IUserRepository::class,\n UserEloquentRepository::class\n );\n $this->app->bind(\n IBeerRepository::class,\n BeerEloquentRepository::class\n );\n }", "public function boot()\n {\n $this->setupConfig($this->app);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->loadMigrations();\n }\n if(config($this->vendorNamespace. '::config.enabled')){\n Livewire::component($this->vendorNamespace . '::login-form', LoginForm::class);\n $this->loadRoutes();\n $this->loadViews();\n $this->loadMiddlewares();\n $this->loadTranslations();\n }\n }", "public function boot()\n {\n $source = dirname(__DIR__, 3) . '/config/config.php';\n\n if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {\n $this->publishes([$source => config_path('dubbo_cli.php')]);\n } elseif ($this->app instanceof LumenApplication) {\n $this->app->configure('dubbo_cli');\n }\n\n $this->mergeConfigFrom($source, 'dubbo_cli');\n }", "public function boot()\n {\n $this->package('domain/app');\n\n $this->setApplication();\n }", "public function boot()\n {\n $this->setUpConfig();\n $this->setUpConsoleCommands();\n }", "public function boot()\n {\n $this->strapRoutes();\n $this->strapViews();\n $this->strapMigrations();\n $this->strapCommands();\n\n $this->registerPolicies();\n }", "public function boot()\n {\n $this->app->singleton('LaraCurlService', function ($app) {\n return new LaraCurlService();\n });\n\n $this->loadRoutesFrom(__DIR__.'/routes/web.php');\n }", "public function boot()\n {\n $providers = $this->make('config')->get('app.console_providers', array());\n foreach ($providers as $provider) {\n $provider = $this->make($provider);\n if ($provider && method_exists($provider, 'boot')) {\n $provider->boot();\n }\n }\n }", "public function boot()\n {\n foreach (glob(app_path('/Api/config/*.php')) as $path) {\n $path = realpath($path);\n $this->mergeConfigFrom($path, basename($path, '.php'));\n }\n\n // 引入自定义函数\n foreach (glob(app_path('/Helpers/*.php')) as $helper) {\n require_once $helper;\n }\n // 引入 api 版本路由\n $this->loadRoutesFrom(app_path('/Api/Routes/base.php'));\n\n }", "public function bootstrap()\n {\n if (!$this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrappers());\n }\n\n //$this->app->loadDeferredProviders();\n\n if (!$this->commandsLoaded) {\n //$this->commands();\n\n $this->commandsLoaded = true;\n }\n }", "protected function boot()\n\t{\n\t\tforeach ($this->serviceProviders as $provider)\n\t\t{\n\t\t\t$provider->boot($this);\n\t\t}\n\n\t\t$this->booted = true;\n\t}", "public function boot()\n {\n $this->setupConfig();\n //register rotating daily monolog provider\n $this->app->register(MonologProvider::class);\n $this->app->register(CircuitBreakerServiceProvider::class);\n $this->app->register(CurlServiceProvider::class);\n }", "public function boot(): void\n {\n if ($this->booted) {\n return;\n }\n\n array_walk($this->services, function ($service) {\n $this->bootServices($service);\n });\n\n $this->booted = true;\n }", "public static function boot() {\n\t\tstatic::container()->boot();\n\t}", "public function boot()\n {\n include_once('ComposerDependancies\\Global.php');\n //---------------------------------------------\n include_once('ComposerDependancies\\League.php');\n include_once('ComposerDependancies\\Team.php');\n include_once('ComposerDependancies\\Matchup.php');\n include_once('ComposerDependancies\\Player.php');\n include_once('ComposerDependancies\\Trade.php');\n include_once('ComposerDependancies\\Draft.php');\n include_once('ComposerDependancies\\Message.php');\n include_once('ComposerDependancies\\Poll.php');\n include_once('ComposerDependancies\\Chat.php');\n include_once('ComposerDependancies\\Rule.php');\n\n \n include_once('ComposerDependancies\\Admin\\Users.php');\n\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n if ($this->app instanceof LaravelApplication) {\n $this->publishes([\n __DIR__.'/../config/state-machine.php' => config_path('state-machine.php'),\n ], 'config');\n } elseif ($this->app instanceof LumenApplication) {\n $this->app->configure('state-machine');\n }\n }\n }", "public function boot()\n {\n $this->bootEvents();\n\n $this->bootPublishes();\n\n $this->bootTypes();\n\n $this->bootSchemas();\n\n $this->bootRouter();\n\n $this->bootViews();\n \n $this->bootSecurity();\n }", "public function boot()\n {\n //\n Configuration::environment(\"sandbox\");\n Configuration::merchantId(\"cmpss9trsxsr4538\");\n Configuration::publicKey(\"zy3x5mb5jwkcrxgr\");\n Configuration::privateKey(\"4d63c8b2c340daaa353be453b46f6ac2\");\n\n\n $modules = Directory::listDirectories(app_path('Modules'));\n\n foreach ($modules as $module)\n {\n $routesPath = app_path('Modules/' . $module . '/routes.php');\n $viewsPath = app_path('Modules/' . $module . '/Views');\n\n if (file_exists($routesPath))\n {\n require $routesPath;\n }\n\n if (file_exists($viewsPath))\n {\n $this->app->view->addLocation($viewsPath);\n }\n }\n }", "public function boot()\n {\n resolve(EngineManager::class)->extend('elastic', function () {\n return new ElasticScoutEngine(\n ElasticBuilder::create()\n ->setHosts(config('scout.elastic.hosts'))\n ->build()\n );\n });\n }", "public function boot(): void\n {\n try {\n // Just check if we have DB connection! This is to avoid\n // exceptions on new projects before configuring database options\n // @TODO: refcator the whole accessareas retrieval to be file-based, instead of db based\n DB::connection()->getPdo();\n\n if (Schema::hasTable(config('cortex.foundation.tables.accessareas'))) {\n // Register accessareas into service container, early before booting any module service providers!\n $this->app->singleton('accessareas', fn () => app('cortex.foundation.accessarea')->where('is_active', true)->get());\n }\n } catch (Exception $e) {\n // Be quiet! Do not do or say anything!!\n }\n\n $this->bootstrapModules();\n }", "public function boot()\n {\n $this->app->register(UserServiceProvider::class);\n $this->app->register(DashboardServiceProvider::class);\n $this->app->register(CoreServiceProvider::class);\n $this->app->register(InstitutionalVideoServiceProvider::class);\n $this->app->register(InstitutionalServiceProvider::class);\n $this->app->register(TrainingServiceProvider::class);\n $this->app->register(CompanyServiceProvider::class);\n $this->app->register(LearningUnitServiceProvider::class);\n $this->app->register(PublicationServiceProvider::class);\n }", "public function boot()\n {\n Schema::defaultStringLength(191);\n\n $this->app->bindMethod([SendMailPasswordReset::class, 'handle'], function ($job, $app) {\n return $job->handle($app->make(MailService::class));\n });\n\n $this->app->bindMethod([ClearTokenPasswordReset::class, 'handle'], function ($job, $app) {\n return $job->handle($app->make(PasswordResetRepository::class));\n });\n\n $this->app->bind(AuthService::class, function ($app) {\n return new AuthService($app->make(HttpService::class));\n });\n }", "public function boot()\n {\n $this->makeRepositories();\n }", "public function boot(): void\n {\n $this->loadMiddlewares();\n }", "public function boot()\n {\n $this->app->when(ChatAPIChannel::class)\n ->needs(ChatAPI::class)\n ->give(function () {\n $config = config('services.chatapi');\n return new ChatAPI(\n $config['token'],\n $config['api_url']\n );\n });\n }", "public function boot() {\r\n\t\t$hosting_service = HostResolver::get_host_service();\r\n\r\n\t\tif ( ! empty( $hosting_service ) ) {\r\n\t\t\t$this->provides[] = $hosting_service;\r\n\t\t}\r\n\t}", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n require(__DIR__ . '/../routes/console.php');\n } else {\n // Menus for BPM are done through middleware. \n Route::pushMiddlewareToGroup('web', AddToMenus::class);\n \n // Assigning to the web middleware will ensure all other middleware assigned to 'web'\n // will execute. If you wish to extend the user interface, you'll use the web middleware\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(__DIR__ . '/../routes/web.php');\n \n // If you wish to extend the api, be sure to utilize the api middleware. In your api \n // Routes file, you should prefix your routes with api/1.0\n Route::middleware('api')\n ->namespace($this->namespace)\n ->prefix('api/1.0')\n ->group(__DIR__ . '/../routes/api.php');\n \n Event::listen(ScreenBuilderStarting::class, function($event) {\n $event->manager->addScript(mix('js/screen-builder-extend.js', 'vendor/api-connector'));\n $event->manager->addScript(mix('js/screen-renderer-extend.js', 'vendor/api-connector'));\n });\n }\n\n // load migrations\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n\n // Load our views\n $this->loadViewsFrom(__DIR__.'/../resources/views/', 'api-connector');\n\n // Load our translations\n $this->loadTranslationsFrom(__DIR__.'/../lang', 'api-connector');\n\n $this->publishes([\n __DIR__.'/../public' => public_path('vendor/api-connector'),\n ], 'api-connector');\n\n $this->publishes([\n __DIR__ . '/../database/seeds' => database_path('seeds'),\n ], 'api-connector');\n\n $this->app['events']->listen(PackageEvent::class, PackageListener::class);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->bindCommands();\n $this->registerCommands();\n $this->app->bind(InstallerContract::class, Installer::class);\n\n $this->publishes([\n __DIR__.'/../config/exceptionlive.php' => base_path('config/exceptionlive.php'),\n ], 'config');\n }\n\n $this->registerMacros();\n }", "public function boot(){\r\n $this->app->configure('sdk');\r\n $this->publishes([\r\n __DIR__.'/../../resources/config/sdk.php' => config_path('sdk.php')\r\n ]);\r\n $this->mergeConfigFrom(__DIR__.'/../../resources/config/sdk.php','sdk');\r\n\r\n $api = config('sdk.api');\r\n foreach($api as $key => $value){\r\n $this->app->singleton($key,$value);\r\n }\r\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n EnvironmentCommand::class,\n EventGenerateCommand::class,\n EventMakeCommand::class,\n JobMakeCommand::class,\n KeyGenerateCommand::class,\n MailMakeCommand::class,\n ModelMakeCommand::class,\n NotificationMakeCommand::class,\n PolicyMakeCommand::class,\n ProviderMakeCommand::class,\n RequestMakeCommand::class,\n ResourceMakeCommand::class,\n RuleMakeCommand::class,\n ServeCommand::class,\n StorageLinkCommand::class,\n TestMakeCommand::class,\n ]);\n }\n }", "public function boot()\n {\n $this->app->bind(WeatherInterface::class, OpenWeatherMapService::class);\n $this->app->bind(OrderRepositoryInterface::class, EloquentOrderRepository::class);\n $this->app->bind(NotifyInterface::class, EmailNotifyService::class);\n }", "public function boot()\n {\n $this->app->bind(DateService::class,DateServiceImpl::class);\n $this->app->bind(DisasterEventQueryBuilder::class,DisasterEventQueryBuilderImpl::class);\n $this->app->bind(MedicalFacilityQueryBuilder::class,MedicalFacilityQueryBuilderImpl::class);\n $this->app->bind(RefugeCampQueryBuilder::class,RefugeCampQueryBuilderImpl::class);\n $this->app->bind(VictimQueryBuilder::class,VictimQueryBuilderImpl::class);\n $this->app->bind(VillageQueryBuilder::class,VillageQueryBuilderImpl::class);\n }", "public function boot()\n {\n\t\tif ( $this->app->runningInConsole() ) {\n\t\t\t$this->loadMigrationsFrom(__DIR__.'/migrations');\n\n//\t\t\t$this->publishes([\n//\t\t\t\t__DIR__.'/config/scheduler.php' => config_path('scheduler.php'),\n//\t\t\t\t__DIR__.'/console/CronTasksList.php' => app_path('Console/CronTasksList.php'),\n//\t\t\t\t__DIR__.'/views' => resource_path('views/vendor/scheduler'),\n//\t\t\t]);\n\n//\t\t\tapp('Revolta77\\ScheduleMonitor\\Conntroller\\CreateController')->index();\n\n//\t\t\t$this->commands([\n//\t\t\t\tConsole\\Commands\\CreateController::class,\n//\t\t\t]);\n\t\t}\n\t\t$this->loadRoutesFrom(__DIR__.'/routes/web.php');\n }", "public function boot()\n {\n $this->bootPackages();\n }", "public function boot(): void\n {\n if ($this->app->runningInConsole()) {\n $this->commands($this->load(__DIR__.'/../Console', Command::class));\n }\n }", "public function boot(): void\n {\n $this->publishes(\n [\n __DIR__ . '/../config/laravel_entity_services.php' =>\n $this->app->make('path.config') . DIRECTORY_SEPARATOR . 'laravel_entity_services.php',\n ],\n 'laravel_repositories'\n );\n $this->mergeConfigFrom(__DIR__ . '/../config/laravel_entity_services.php', 'laravel_entity_services');\n\n $this->registerCustomBindings();\n }", "public function boot()\n {\n // DEFAULT STRING LENGTH\n Schema::defaultStringLength(191);\n\n // PASSPORT\n Passport::routes(function (RouteRegistrar $router)\n {\n $router->forAccessTokens();\n });\n Passport::tokensExpireIn(now()->addDays(1));\n\n // SERVICES, REPOSITORIES, CONTRACTS BINDING\n $this->app->bind('App\\Contracts\\IUser', 'App\\Repositories\\UserRepository');\n $this->app->bind('App\\Contracts\\IUserType', 'App\\Repositories\\UserTypeRepository');\n $this->app->bind('App\\Contracts\\IApiToken', 'App\\Services\\ApiTokenService');\n $this->app->bind('App\\Contracts\\IModule', 'App\\Repositories\\ModuleRepository');\n $this->app->bind('App\\Contracts\\IModuleAction', 'App\\Repositories\\ModuleActionRepository');\n }", "public function bootstrap(): void\n {\n $globalConfigurationBuilder = (new GlobalConfigurationBuilder())->withEnvironmentVariables()\n ->withPhpFileConfigurationSource(__DIR__ . '/../config.php');\n (new BootstrapperCollection())->addMany([\n new DotEnvBootstrapper(__DIR__ . '/../.env'),\n new ConfigurationBootstrapper($globalConfigurationBuilder),\n new GlobalExceptionHandlerBootstrapper($this->container)\n ])->bootstrapAll();\n }", "public function boot()\n {\n // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'deniskisel');\n // $this->loadViewsFrom(__DIR__.'/../resources/views', 'deniskisel');\n// $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n // $this->loadRoutesFrom(__DIR__.'/routes.php');\n\n // Publishing is only necessary when using the CLI.\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n $this->bootingDomain();\n\n $this->registerCommands();\n $this->registerListeners();\n $this->registerPolicies();\n $this->registerRoutes();\n $this->registerBladeComponents();\n $this->registerLivewireComponents();\n $this->registerSpotlightCommands();\n\n $this->bootedDomain();\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->registerMigrations();\n $this->registerMigrationFolder();\n $this->registerConfig();\n }\n }", "public function boot()\n {\n $this->bootModulesMenu();\n $this->bootSkinComposer();\n $this->bootCustomBladeDirectives();\n }", "public function boot(): void\n {\n $this->app->bind(Telegram::class, static function () {\n return new Telegram(\n config('services.telegram-bot-api.token'),\n new HttpClient()\n );\n });\n }", "public function boot()\n {\n\n if (! config('app.installed')) {\n return;\n }\n\n $this->loadRoutesFrom(__DIR__ . '/Routes/admin.php');\n $this->loadRoutesFrom(__DIR__ . '/Routes/public.php');\n\n $this->loadMigrationsFrom(__DIR__ . '/Database/Migrations');\n\n// $this->loadViewsFrom(__DIR__ . '/Resources/Views', 'portfolio');\n\n $this->loadTranslationsFrom(__DIR__ . '/Resources/Lang/', 'contact');\n\n //Add menu to admin panel\n $this->adminMenu();\n\n }", "public function boot()\n {\n if (! config('app.installed')) {\n return;\n }\n\n $this->app['config']->set([\n 'scout' => [\n 'driver' => setting('search_engine', 'mysql'),\n 'algolia' => [\n 'id' => setting('algolia_app_id'),\n 'secret' => setting('algolia_secret'),\n ],\n ],\n ]);\n }", "protected function bootServiceProviders()\n {\n foreach($this->activeProviders as $provider)\n {\n // check if the service provider has a boot method.\n if (method_exists($provider, 'boot')) {\n $provider->boot();\n }\n }\n }", "public function boot(): void\n {\n // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'imc');\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n $this->loadViewsFrom(__DIR__.'/../resources/views', 'imc');\n $this->registerPackageRoutes();\n\n // Publishing is only necessary when using the CLI.\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n // Larapex Livewire\n $this->mergeConfigFrom(__DIR__ . '/../configs/larapex-livewire.php', 'larapex-livewire');\n\n $this->loadViewsFrom(__DIR__ . '/../resources/views', 'larapex-livewire');\n\n $this->registerBladeDirectives();\n\n if ($this->app->runningInConsole()) {\n $this->registerCommands();\n $this->publishResources();\n }\n }", "public function boot()\n {\n // Bootstrap code here.\n $this->app->singleton(L9SmsApiChannel::class, function () {\n $config = config('l9smsapi');\n if (empty($config['token']) || empty($config['service'])) {\n throw new \\Exception('L9SmsApi missing token and service in config');\n }\n\n return new L9SmsApiChannel($config['token'], $config['service']);\n });\n\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/l9smsapi.php' => config_path('l9smsapi.php'),\n ], 'config');\n }\n }", "public function boot()\n\t{\n\t\t$this->bindRepositories();\n\t}", "public function boot()\n {\n if (!$this->app->runningInConsole()) {\n return;\n }\n\n $this->commands([\n ListenCommand::class,\n InstallCommand::class,\n EventsListCommand::class,\n ObserverMakeCommand::class,\n ]);\n\n foreach ($this->listen as $event => $listeners) {\n foreach ($listeners as $listener) {\n RabbitEvents::listen($event, $listener);\n }\n }\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n MultiAuthInstallCommand::class,\n ]);\n }\n }", "public function boot() {\n\n\t\t$this->registerProviders();\n\t\t$this->bootProviders();\n\t\t$this->registerProxies();\n\t}", "public function boot(): void\n {\n // routes\n $this->loadRoutes();\n // assets\n $this->loadAssets('assets');\n // configuration\n $this->loadConfig('configs');\n // views\n $this->loadViews('views');\n // view extends\n $this->extendViews();\n // translations\n $this->loadTranslates('views');\n // adminer\n $this->loadAdminer('adminer');\n // commands\n $this->loadCommands();\n // gates\n $this->registerGates();\n // listeners\n $this->registerListeners();\n // settings\n $this->applySettings();\n }", "public function boot()\n {\n $this->setupFacades();\n $this->setupViews();\n $this->setupBlades();\n }", "public function boot()\n {\n\n $this->app->translate_manager->addTranslateProvider(TranslateMenu::class);\n\n\n\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n $this->loadMigrationsFrom(__DIR__ . '/../migrations/');\n\n\n\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../config/larkeauth-rbac-model.conf' => config_path('larkeauth-rbac-model.conf.larkeauth'),\n __DIR__ . '/../config/larkeauth.php' => config_path('larkeauth.php.larkeauth')\n ], 'larke-auth-config');\n\n $this->commands([\n Commands\\Install::class,\n Commands\\GroupAdd::class,\n Commands\\PolicyAdd::class,\n Commands\\RoleAssign::class,\n ]);\n }\n\n $this->mergeConfigFrom(__DIR__ . '/../config/larkeauth.php', 'larkeauth');\n\n $this->bootObserver();\n }", "public function boot(): void\n {\n $this->app\n ->when(RocketChatWebhookChannel::class)\n ->needs(RocketChat::class)\n ->give(function () {\n return new RocketChat(\n new HttpClient(),\n Config::get('services.rocketchat.url'),\n Config::get('services.rocketchat.token'),\n Config::get('services.rocketchat.channel')\n );\n });\n }", "public function boot()\n {\n if ($this->booted) {\n return;\n }\n\n $this->app->registerConfiguredProvidersInRequest();\n\n $this->fireAppCallbacks($this->bootingCallbacks);\n\n /** array_walk\n * If when a provider booting, it reg some other providers,\n * then the new providers added to $this->serviceProviders\n * then array_walk will loop the new ones and boot them. // pingpong/modules 2.0 use this feature\n */\n array_walk($this->serviceProviders, function ($p) {\n $this->bootProvider($p);\n });\n\n $this->booted = true;\n\n $this->fireAppCallbacks($this->bootedCallbacks);\n }", "public function boot()\n {\n $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n\t{\n\t\t$this->package('atlantis/admin');\n\n\t\t#i: Set the locale\n\t\t$this->setLocale();\n\n $this->registerServiceAdminValidator();\n $this->registerServiceAdminFactory();\n $this->registerServiceAdminDataTable();\n $this->registerServiceModules();\n\n\t\t#i: Include our filters, view composers, and routes\n\t\tinclude __DIR__.'/../../filters.php';\n\t\tinclude __DIR__.'/../../views.php';\n\t\tinclude __DIR__.'/../../routes.php';\n\n\t\t$this->app['events']->fire('admin.ready');\n\t}", "public function boot()\n {\n $this->app->booted(function () {\n $this->callMethodIfExists('jobs');\n });\n }", "public function boot()\n {\n $this->bootSetTimeLocale();\n $this->bootBladeHotelRole();\n $this->bootBladeHotelGuest();\n $this->bootBladeIcon();\n }", "public function boot(): void\n {\n $this->registerRoutes();\n $this->registerResources();\n $this->registerMixins();\n\n if ($this->app->runningInConsole()) {\n $this->offerPublishing();\n $this->registerMigrations();\n }\n }", "public function boot()\n {\n $this->dispatch(new SetCoreConnection());\n $this->dispatch(new ConfigureCommandBus());\n $this->dispatch(new ConfigureTranslator());\n $this->dispatch(new LoadStreamsConfiguration());\n\n $this->dispatch(new InitializeApplication());\n $this->dispatch(new AutoloadEntryModels());\n $this->dispatch(new AddAssetNamespaces());\n $this->dispatch(new AddImageNamespaces());\n $this->dispatch(new AddViewNamespaces());\n $this->dispatch(new AddTwigExtensions());\n $this->dispatch(new RegisterAddons());\n }", "public function boot(): void\n {\n $this->loadViews();\n $this->loadTranslations();\n\n if ($this->app->runningInConsole()) {\n $this->publishMultipleConfig();\n $this->publishViews(false);\n $this->publishTranslations(false);\n }\n }", "public function boot()\n {\n $this->bootForConsole();\n $this->loadRoutesFrom(__DIR__ . '/routes/web.php');\n $this->loadViewsFrom(__DIR__ . '/./../resources/views', 'bakerysoft');\n }", "public function boot()\n {\n $this->app->booted(function () {\n $this->defineRoutes();\n });\n $this->defineResources();\n $this->registerDependencies();\n }", "public function boot()\n {\n $this->app->bind(CustomersRepositoryInterface::class, CustomersRepository::class);\n $this->app->bind(CountryToCodeMapperInterface::class, CountryToCodeMapper::class);\n $this->app->bind(PhoneNumbersValidatorInterface::class, PhoneNumbersRegexValidator::class);\n $this->app->bind(CustomersFilterServiceInterface::class, CustomersFilterService::class);\n $this->app->bind(CacheInterface::class, CacheAdapter::class);\n\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([$this->configPath() => config_path('oauth.php')], 'oauth');\n }\n\n app()->bind(ClientToken::class, function () {\n return new ClientToken();\n });\n\n app()->bind(TokenParser::class, function () {\n return new TokenParser(\n app()->get(Request::class)\n );\n });\n\n app()->bind(OAuthClient::class, function () {\n return new OAuthClient(\n app()->get(Request::class),\n app()->get(ClientToken::class)\n );\n });\n\n app()->bind(AccountService::class, function () {\n return new AccountService(app()->get(OAuthClient::class));\n });\n }", "public function boot()\n {\n Client::observe(ClientObserver::class);\n $this->app->bind(ClientRepositoryInterface::class, function ($app) {\n return new ClientRepository(Client::class);\n });\n $this->app->bind(UserRepositoryInterface::class, function ($app) {\n return new UserRepository(User::class);\n });\n }", "public function boot()\n {\n $this->setupFacades(); \n //$this->setupConfigs(); \n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n //\n }\n\n $this->loadRoutesFrom(__DIR__ . '/routes.php');\n }", "public function boot()\n {\n $path = __DIR__.'/../..';\n\n $this->package('clumsy/cms', 'clumsy', $path);\n\n $this->registerAuthRoutes();\n $this->registerBackEndRoutes();\n\n require $path.'/helpers.php';\n require $path.'/errors.php';\n require $path.'/filters.php';\n\n if ($this->app->runningInConsole()) {\n $this->app->make('Clumsy\\CMS\\Clumsy');\n }\n\n }", "public function boot()\n {\n $this->mergeConfigFrom(__DIR__ . '/../../config/bs4.php', 'bs4');\n $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'bs');\n $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'bs');\n\n if ($this->app->runningInConsole())\n {\n $this->publishes([\n __DIR__ . '/../../resources/views' => resource_path('views/vendor/bs'),\n ], 'views');\n\n $this->publishes([\n __DIR__ . '/../../resources/lang' => resource_path('lang/vendor/bs'),\n ], 'lang');\n\n $this->publishes([\n __DIR__ . '/../../config' => config_path(),\n ], 'config');\n }\n }", "public function boot()\n {\n $this->client = new HttpClient([\n 'base_uri' => 'https://api.ipfinder.io/v1/',\n 'headers' => [\n 'User-Agent' => 'Laravel-GeoIP-Torann',\n ],\n 'query' => [\n 'token' => $this->config('key'),\n ],\n ]);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n Check::class,\n Clear::class,\n Fix::class,\n Fresh::class,\n Foo::class,\n Ide::class,\n MakeDatabase::class,\n Ping::class,\n Version::class,\n ]);\n }\n }", "public function boot()\n {\n $app = $this->app;\n\n if (!$app->runningInConsole()) {\n return;\n }\n\n $source = realpath(__DIR__ . '/config/config.php');\n\n if (class_exists('Illuminate\\Foundation\\Application', false)) {\n // L5\n $this->publishes([$source => config_path('sniffer-rules.php')]);\n $this->mergeConfigFrom($source, 'sniffer-rules');\n } elseif (class_exists('Laravel\\Lumen\\Application', false)) {\n // Lumen\n $app->configure('sniffer-rules');\n $this->mergeConfigFrom($source, 'sniffer-rules');\n } else {\n // L4\n $this->package('chefsplate/sniffer-rules', null, __DIR__);\n }\n }", "public function boot()\r\n\t{\r\n\t\t$this->package('estey/hipsupport');\r\n\t\t$this->registerHipSupport();\r\n\t\t$this->registerHipSupportOnlineCommand();\r\n\t\t$this->registerHipSupportOfflineCommand();\r\n\r\n\t\t$this->registerCommands();\r\n\t}", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n ControllerMakeCommand::class,\n ServiceMakeCommand::class,\n RepositoryMakeCommand::class,\n ModelMakeCommand::class,\n RequestRuleMakeCommand::class,\n ]);\n }\n }", "public function boot() {\n $srcDir = __DIR__ . '/../';\n \n $this->package('baseline/baseline', 'baseline', $srcDir);\n \n include $srcDir . 'Http/routes.php';\n include $srcDir . 'Http/filters.php';\n }", "public function boot()\n {\n $this->app->bind('App\\Services\\ProviderAccountService', function() {\n return new ProviderAccountService;\n });\n }", "public function boot()\n {\n $this->loadViewsFrom(__DIR__ . '/resources/views', 'Counters');\n\n $this->loadTranslationsFrom(__DIR__ . '/resources/lang', 'Counters');\n\n\n //To load migration files directly from the package\n// $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n\n\n $this->app->booted(function () {\n $loader = AliasLoader::getInstance();\n $loader->alias('Counters', Counters::class);\n\n });\n\n $this->publishes([\n __DIR__ . '/../config/counter.php' => config_path('counter.php'),\n ], 'config');\n\n\n\n $this->publishes([\n __DIR__.'/../database/migrations/0000_00_00_000000_create_counters_tables.php' => $this->app->databasePath().\"/migrations/0000_00_00_000000_create_counters_tables.php\",\n ], 'migrations');\n\n\n if ($this->app->runningInConsole()) {\n $this->commands([\\Maher\\Counters\\Commands\\MakeCounter::class]);\n }\n\n\n }", "public function boot(Application $app)\n {\n\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }" ]
[ "0.7344842", "0.7212776", "0.7207748", "0.7123287", "0.7109729", "0.70822036", "0.7076881", "0.70718396", "0.7051853", "0.7025475", "0.7011949", "0.70043486", "0.6955807", "0.69322443", "0.69319373", "0.69272774", "0.6911386", "0.69069713", "0.6898877", "0.6898432", "0.6896597", "0.6889767", "0.6886577", "0.6880688", "0.6875815", "0.6874972", "0.68696195", "0.6864291", "0.6864246", "0.68631536", "0.68599164", "0.6857919", "0.685537", "0.68552583", "0.68522125", "0.6839775", "0.683261", "0.6831196", "0.68272495", "0.68250644", "0.68241394", "0.68181944", "0.68132496", "0.68117976", "0.6811785", "0.6808445", "0.68066794", "0.680175", "0.68005246", "0.67994386", "0.67969066", "0.67912513", "0.67884964", "0.678574", "0.678558", "0.6783794", "0.67782456", "0.6773669", "0.6766658", "0.6766194", "0.67617613", "0.67611295", "0.6758855", "0.6756636", "0.6754412", "0.6751842", "0.6747439", "0.6744991", "0.67441815", "0.6743506", "0.67400324", "0.6739403", "0.6738356", "0.6738189", "0.6731425", "0.6730627", "0.67293024", "0.6726232", "0.67261064", "0.67192256", "0.6716676", "0.6716229", "0.671442", "0.6713091", "0.6702467", "0.66990495", "0.66913867", "0.6689953", "0.66861963", "0.66840357", "0.66826946", "0.6681548", "0.6680455", "0.6676407", "0.6675645", "0.6672465", "0.66722375", "0.66722375", "0.66722375", "0.66722375", "0.66722375" ]
0.0
-1
Test to get the path
public function testGetStructure() { $expectedValue = array('structure'); $interface = $this->getMock( 'Shwager\IO\PathAdapterInterface' ); $interface->expects($this->exactly(1)) ->method('getPath') ->will($this->returnValue($expectedValue)); $adapter = new Filesystem($interface); $this->assertEquals( $expectedValue, $adapter->getStructure() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _getPath():string {\n\n # Declare result\n $result = self::PATH;\n\n # check constant\n if(Env::has(\"phpunit_test\") && Env::get(\"phpunit_test\"))\n\n # Set result\n $result = self::PATH_TEST;\n\n # Strange reaction... Allow to debug next command... ¯\\_(ツ)_/¯\n Env::get(\"crazyphp_root\");\n\n # Process result\n $result = File::path($result);\n\n # Return result\n return $result;\n\n }", "public function getFoundPath() {}", "protected function _checkPath()\n {\n if (class_exists('tracer_class')) {\n tracer_class::marker(array(\n 'check that path is given on error or normal page',\n debug_backtrace(),\n '#006400'\n ));\n }\n\n $path = array();\n\n if ($this->_get) {\n $path[0] = $this->_get->path();\n $path[1] = $this->_get->path(TRUE);\n } else {\n $path[0] = $path[1] = get::realPath($this->_options['test']);\n }\n\n return $path;\n }", "abstract protected function getPath();", "public function path();", "public function path() {}", "public function path() {}", "public function testGetPath()\n {\n $this->assertEquals($this->packagePath, $this->path->getPath());\n }", "function test_common_get_url_by_path() {\n\t\t$thing = \\trailingslashit(\\ABSPATH) . 'tmp.php';\n\t\t$result = \\common_get_url_by_path($thing);\n\t\t$this->assertNotEquals(false, $result);\n\t\t$this->assertEquals(0, \\strpos($thing, \\site_url()));\n\t}", "protected abstract function getPath();", "function test_common_get_path_by_url() {\n\t\t$thing = \\site_url('tmp.php');\n\t\t$result = \\common_get_path_by_url($thing);\n\t\t$this->assertNotEquals(false, $result);\n\t\t$this->assertEquals(0, \\strpos($thing, \\ABSPATH));\n\t}", "public function getPath() {}", "public function getPath() {}", "public function getPath() {}", "public function getPath() {}", "public function getPath() {}", "public function getPath() {}", "public function path(): string;", "public function path(): string;", "public function testGetPath()\n {\n $this->assertEquals('hello', $this->_req->getPath());\n }", "public function path() {\n\t\t$args = func_get_args();\n\t\tif (count($args)) {\n\t\t\t$this->path = $this->verify($args[0]);\n\t\t}\n\t\treturn $this->path;\n\t}", "function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getFullPath();", "public function getFullPath(): string;", "public function testRetrieveFilePath()\n {\n $this->file = 'test';\n\n self::assertEquals('test', $this->getFile());\n }", "public function getIsAbsolutePath() {}", "public function getFilepath();", "public function getPath(){ }", "public function getPath(){ }", "public function getPath() : string;", "protected function getTestFilePath($path)\n {\n return __DIR__ . \"/html/$path\";\n }", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "public function getPath();", "private static function getPath() : string {\n return getBasePath() . '/miaus';\n }", "public function getPath() {\n\t\t$path = $this->path;\n\t\tif (isset($this->plugin)) {\n\t\t\t$path = $this->_pluginPath($this->plugin) . 'Test' . DS;\n\t\t}\n\n\t\treturn $path;\n\t}", "abstract public function getCurrentPath();", "function test_common_upload_path() {\n\t\t$thing = \\common_upload_path('foobar');\n\n\t\t$this->assertEquals(true, false !== \\strpos($thing, 'uploads/foobar'));\n\t}", "function getAbsolutePath() ;", "public function getAbsolutePath() {}", "public function getAbsolutePath() {}", "public static function getPath()\n {\n }", "public function path(): ?string;", "public function getLocalPath();", "public function testGetPath(): void\n {\n $this->class->setPath($this->value);\n\n self::assertSame($this->value, $this->class->getPath());\n }", "public function get_path(): string\n {\n return $this->path;\n }", "private function determineFixturesPath() {}", "public function testGetPath(): void\n {\n $model = Hash::load([\n \"path\" => \"path\",\n ], $this->container);\n\n $this->assertSame(\"path\", $model->getPath());\n }", "private function getPath()\n {\n return $this->path;\n }", "abstract public function gotPath( array $path );", "public function getPathToFile(): string;", "public function getFolderPath(){}", "private function validatePath()\n {\n $locator = new FileLocator();\n $locator->locate($this->path); // throws exception on failure\n }", "public function getPathLocation(): string;", "public function getTestDirectory();", "public function get_path() {\n\t\treturn $this->path;\n\t}", "public function get_path() {\n\t\treturn $this->path;\n\t}", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "protected abstract function getAbsolutePath(): string;", "public function get_path() : string\n {\n return $this->path;\n }", "public function it_has_a_path()\n {\n $chapter = Chapter::factory()->create();\n\n $this->assertEquals(\n '/stories/' . $chapter->story->id . '/chapters/' . StoryChapterFacade::getChapterNumFromId($chapter->id), \n $chapter->path());\n }", "public function testGetPathDefault(): void\n {\n self::assertNull($this->class->getPath());\n }", "public function testDir_GetPath()\n {\n $config = Config::with($this->dir);\n \n $config['abc'] = new Config_File(array('ext'=>'mock')); \n $this->assertType('Q\\Config_File', $config['abc']);\n $this->assertEquals(\"{$this->dir}/abc.mock\", (string)$config['abc']->getPath());\n \n $config['dir_test'] = new Config_Dir(array('ext'=>'mock')); \n $this->assertType('Q\\Config_Dir', $config['dir_test']);\n $this->assertEquals(\"{$this->dir}/dir_test\", (string)$config['dir_test']->getPath());\n \n }", "public function print_path()\n\t{\n\t\t\n\t}", "public function getAbsolutePath();", "function path($path='') {\n return $this->base_dir . $path;\n }", "public function testPath() {\r\n if (!JFactory::getUser()->authorise('simplecustomrouter.test', 'com_simplecustomrouter')) {\r\n return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));\r\n }\r\n \r\n $path = JFactory::getApplication()->input->get('path', '', 'string');\r\n \r\n $model = $this->getModel('Test', 'SimpleCustomRouterModel');\r\n \r\n $generatedQuery = $model->testPath($path);\r\n \r\n JFactory::getApplication()->setUserState('com_simplecustomrouter.test.path', $path);\r\n JFactory::getApplication()->setUserState('com_simplecustomrouter.test.generatedQuery', $generatedQuery);\r\n \r\n $this->setRedirect(JRoute::_('index.php?option=com_simplecustomrouter&view=test', false));\r\n return true;\r\n }", "public function test_get_wrapper_path() {\n /**\n * Test test stream wrapper implementation\n */\n $actual = WP_Stream::new_wrapper_instance('test://')->get_wrapper_path();\n $this->assertEquals($this->test_dir, $actual);\n\n /**\n * Test local stream wrapper implementation\n */\n $actual = WP_Stream::new_wrapper_instance('local://')->get_wrapper_path();\n $this->assertEquals(WP_CONTENT_DIR, $actual);\n }", "public function testGetRealPath()\n {\n $directory = sys_get_temp_dir();\n $fileResource = $this->getFileResource($directory);\n $resource = new MaterializedResource($fileResource, $directory);\n $realpath = realpath($directory.'/'.$fileResource->getPath());\n $this->assertEquals($realpath, $resource->getRealPath());\n }", "public function getAbsolutePath()\n {\n }", "public function validPathStrDataProvider() {}", "public function testGetRoutePath()\n {\n $this->assertEquals('/default', $this->uut->getRoutePath('default'));\n }", "public function testGetPath(): void\n {\n $model = ProcessMemoryMap::load([\n \"path\" => \"path\",\n ], $this->container);\n\n $this->assertSame(\"path\", $model->getPath());\n }", "protected function getTestPath(): string\n {\n return $this->getPackageRootPath() . 'Tests/';\n }", "abstract protected function paths();", "public function path($path = null);", "public function path($path = null);", "public function abspath()\n {\n }", "protected function get_path()\n {\n $path_found = false;\n $found_path = null;\n foreach ($this->get_paths() as $path) {\n if ($path_found) {\n continue;\n }\n $path = wp_normalize_path($path);\n if (file_exists($path)) {\n $path_found = true;\n $found_path = $path;\n }\n }\n\n return $found_path;\n\n }" ]
[ "0.731153", "0.7238162", "0.7201637", "0.719667", "0.7112976", "0.70449513", "0.7042499", "0.7033169", "0.6951757", "0.69472307", "0.69304365", "0.69269663", "0.6926702", "0.6926702", "0.6926702", "0.6926702", "0.6926468", "0.6877609", "0.6877609", "0.6860982", "0.6836426", "0.67829317", "0.6734425", "0.6734425", "0.6734425", "0.6734425", "0.6734425", "0.6734425", "0.6734425", "0.6734425", "0.67201364", "0.66998", "0.6685005", "0.668444", "0.66286975", "0.6617386", "0.6617386", "0.66073847", "0.6595725", "0.65867776", "0.65867776", "0.65867776", "0.65867776", "0.65867776", "0.65867776", "0.65867776", "0.65867776", "0.65867776", "0.65867776", "0.65867776", "0.65867776", "0.65867776", "0.65867776", "0.65653926", "0.6563503", "0.6534108", "0.6527924", "0.6514124", "0.65092415", "0.65092415", "0.6507273", "0.650528", "0.6485509", "0.6465615", "0.6460577", "0.6437406", "0.6431604", "0.6429179", "0.6415659", "0.6411814", "0.640632", "0.6399532", "0.6388383", "0.6386992", "0.63844776", "0.63844776", "0.6368404", "0.6368404", "0.6368404", "0.6368404", "0.6357796", "0.6346494", "0.6318445", "0.6317513", "0.6317406", "0.63170296", "0.6313329", "0.6296742", "0.62944746", "0.62834364", "0.6279704", "0.6269191", "0.6253871", "0.62532467", "0.6245608", "0.6241319", "0.6217778", "0.6205603", "0.6205603", "0.6201147", "0.61998606" ]
0.0
-1
Create the event listener.
public function __construct() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addRequestCreateListener($listener);", "public function onEvent();", "private function init_event_listeners() {\n\t\t// add_action('wp_ajax_example_action', [$this, 'example_function']);\n\t}", "public function listener(Listener $listener);", "protected function setupListeners()\n {\n //\n }", "function eventRegister($eventName, EventListener $listener);", "public function listen($event, $listener);", "private function createStreamCallback()\n {\n $read =& $this->readListeners;\n $write =& $this->writeListeners;\n $this->streamCallback = function ($stream, $flags) use(&$read, &$write) {\n $key = (int) $stream;\n if (\\EV_READ === (\\EV_READ & $flags) && isset($read[$key])) {\n \\call_user_func($read[$key], $stream);\n }\n if (\\EV_WRITE === (\\EV_WRITE & $flags) && isset($write[$key])) {\n \\call_user_func($write[$key], $stream);\n }\n };\n }", "public function addEventListener(string $eventClass, callable $listener, int $priority = 0): EnvironmentBuilderInterface;", "public function setupEventListeners()\r\n\t{\r\n\t\t$blueprints = craft()->courier_blueprints->getAllBlueprints();\r\n\t\t$availableEvents = $this->getAvailableEvents();\r\n\r\n\t\t// Setup event listeners for each blueprint\r\n\t\tforeach ($blueprints as $blueprint) {\r\n\t\t\tif (!$blueprint->eventTriggers) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tforeach ($blueprint->eventTriggers as $event) {\r\n\t\t\t\t// Is event currently enabled?\r\n\t\t\t\tif (!isset($availableEvents[$event])) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tcraft()->on($event, function(Event $event) use ($blueprint) {\r\n\t\t\t\t\tcraft()->courier_blueprints->checkEventConditions($event, $blueprint);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// On the event that an email is sent, create a successful delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailSent', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery'\r\n\t\t]);\r\n\r\n\t\t// On the event that an email fails to send, create a failed delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailFailed', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery',\r\n\t\t]);\r\n\t}", "protected function registerListeners()\n {\n }", "public function listen($listener);", "public function listenForEvents()\n {\n Event::listen(DummyEvent::class, DummyListener::class);\n\n event(new DummyEvent);\n }", "public function createEvent()\n {\n return new Event();\n }", "public function attachEvents();", "public function attachEvents();", "public function add_event_handler($event, $callback);", "function addListener(EventListener $listener): void;", "public static function initListeners() {\n\t\t\n\t\tif(GO::modules()->isInstalled('files') && class_exists('\\GO\\Files\\Controller\\FolderController')){\n\t\t\t$folderController = new \\GO\\Files\\Controller\\FolderController();\n\t\t\t$folderController->addListener('checkmodelfolder', \"GO\\Projects2\\Projects2Module\", \"createParentFolders\");\n\t\t}\n\t\t\n\t\t\\GO\\Base\\Model\\User::model()->addListener('delete', \"GO\\Projects2\\Projects2Module\", \"deleteUser\");\n\n\t}", "public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }", "private static function event()\n {\n $files = ['Event', 'EventListener'];\n $folder = static::$root.'Event'.'/';\n\n self::call($files, $folder);\n\n $files = ['ManyListenersArgumentsException'];\n $folder = static::$root.'Event/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "public function addEventListener($event, $callable){\r\n $this->events[$event] = $callable;\r\n }", "public function testEventCallBackCreate()\n {\n }", "public function listeners($event);", "public function addListener($event, $listener, $priority = 0);", "public function on($name, $listener, $data = null, $priority = null, $acceptedArgs = null);", "public function createWatcher();", "public function __construct()\n\t{\n\t\t$this->delegate = Delegate_1::fromMethod($this, 'onEvent');\n\t}", "public function init_listeners( $callable ) {\n\t}", "public static function events();", "public static function __events () {\n \n }", "public function onEventAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public function addApplicationBuilderListener( \n MyFusesApplicationBuilderListener $listener );", "public function addListener($eventName, $listener, $priority = 0);", "public function __construct(){\n\n\t\t\t$this->listen();\n\n\t\t}", "protected function registerListeners()\n {\n // Login event listener\n #Event::listen('auth.login', function($user) {\n //\n #});\n\n // Logout event subscriber\n #Event::subscribe('Mrcore\\Parser\\Listeners\\MyEventSubscription');\n }", "public function __construct()\n {\n// global $callback;\n // $this->eventsArr = $eventsArr;\n $this->callback = function () {\n\n // echo \"event: message\\n\"; // for onmessage listener\n echo \"event: ping\\n\";\n $curDate = date(DATE_ISO8601);\n echo 'data: {\"time\": \"' . $curDate . '\"}';\n echo \"\\n\\n\";\n\n while (($event = ServerSentEvents::popEvent()) != null) {\n $m = json_encode($event->contents);\n echo \"event: $event->event\\n\";\n echo \"data: $m\";\n echo \"\\n\\n\";\n }\n // echo \"event: message\\n\";\n // $curDate = date(DATE_ISO8601);\n // echo 'data: {\"message-time\": \"' . $curDate . '\"}';\n // echo \"\\n\\n\";\n // while(true){\n // if ($index != $this->eventsCounter){\n // ServerSentEvents::sendEvent($this->event, $this->eventBody);\n // $index = $this->eventsCounter;\n // }\n\n // sleep(1);\n // }\n };\n\n $this->setupResponse();\n }", "private function createMyEvents()\n {\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Frontend_Checkout',\n 'onPostDispatchCheckoutSecure'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_Checkout_PreRedirect',\n 'onPreRedirectToPayPal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch_Frontend_PaymentPaypal',\n 'onPreDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_Webhook',\n 'onPaymentPaypalWebhook'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_PlusRedirect',\n 'onPaymentPaypalPlusRedirect'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Frontend_Account',\n 'onPostDispatchAccount'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Javascript',\n 'onCollectJavascript'\n );\n $this->subscribeEvent(\n 'Shopware_Components_Document::assignValues::after',\n 'onBeforeRenderDocument'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Backend_Config',\n 'onPostDispatchConfig'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_Order',\n 'onPostDispatchOrder'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_PaymentPaypal',\n 'onPostDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Less',\n 'addLessFiles'\n );\n $this->subscribeEvent(\n 'Enlight_Bootstrap_InitResource_paypal_plus.rest_client',\n 'onInitRestClient'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Dispatcher_ControllerPath_Api_PaypalPaymentInstruction',\n 'onGetPaymentInstructionsApiController'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Front_StartDispatch',\n 'onEnlightControllerFrontStartDispatch'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch',\n 'onPreDispatchSecure'\n );\n }", "public static function creating(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATING, $listener, $priority);\n }", "public function listen();", "public function listen() {\n $this->source->listen($this->id);\n }", "public function addEventListener($event, $callback, $weight = null);", "public function testAddListener()\n {\n // Arrange\n $listenerCalled = false;\n $communicator = new Communicator();\n\n // Act\n $communicator->addListener(function () use (&$listenerCalled) {\n $listenerCalled = true;\n });\n\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertTrue($listenerCalled);\n }", "public function addListener($name, $listener, $priority = 0);", "public static function created(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATED, $listener, $priority);\n }", "public function on($event, $callback){ }", "public function appendListenerForEvent(string $eventType, callable $listener): callable;", "public function initEventLogger()\n {\n $dispatcher = static::getEventDispatcher();\n\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "protected function getCron_EventListenerService()\n {\n return $this->services['cron.event_listener'] = new \\phpbb\\cron\\event\\cron_runner_listener(${($_ = isset($this->services['cron.lock_db']) ? $this->services['cron.lock_db'] : $this->getCron_LockDbService()) && false ?: '_'}, ${($_ = isset($this->services['cron.manager']) ? $this->services['cron.manager'] : $this->getCron_ManagerService()) && false ?: '_'}, ${($_ = isset($this->services['request']) ? $this->services['request'] : ($this->services['request'] = new \\phpbb\\request\\request(NULL, true))) && false ?: '_'});\n }", "public function getListener(/* ... */)\n {\n return $this->_listener;\n }", "protected function _listener($name) {\n\t\treturn $this->_crud()->listener($name);\n\t}", "private function listeners()\n {\n foreach ($this['config']['listeners'] as $eventName => $classService) {\n $this['dispatcher']->addListener($classService::NAME, [new $classService($this), 'dispatch']);\n }\n }", "public function initializeListeners()\n {\n $this->eventsEnabled = false;\n $this->setPreloads();\n $this->setEvents();\n $this->eventsEnabled = true;\n }", "protected function listenForEvents()\n {\n $callback = function ($event) {\n foreach ($this->logWriters as $writer) {\n $writer->log($event);\n }\n };\n\n $this->events->listen(JobProcessing::class, $callback);\n $this->events->listen(JobProcessed::class, $callback);\n $this->events->listen(JobFailed::class, $callback);\n $this->events->listen(JobExceptionOccurred::class, $callback);\n }", "protected function registerListeners()\n {\n $this->container['listener.server'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\ServerListener($c['filesystem'], $c['generator.server']);\n });\n\n $this->container['listener.gateway'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\GatewayListener($c['filesystem'], $c['generator.gateway']);\n });\n }", "public function listeners($eventName);", "public static function create()\n {\n list(\n $message,\n $callbackService,\n $callbackMethod,\n $callbackParams\n ) = array_pad( func_get_args(), 4, null);\n\n static::addToEventQueue( array(\n 'type' => \"alert\",\n 'properties' => array(\n 'message' => $message\n ),\n 'service' => $callbackService,\n 'method' => $callbackMethod,\n 'params' => $callbackParams ?? []\n ));\n }", "public function requestCreateEvent()\n {\n $ch = self::curlIni('event_new', $this->eventParams);\n\n return $ch;\n }", "function __construct()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}", "public function __construct()\n {\n Hook::listen(__CLASS__);\n }", "function add_listener($hook, $function_name){\n\t\tglobal $listeners;\n\n\t\t$listeners[$hook][] = $function_name;\n\t}", "public function __construct()\n {\n $this->events = new EventDispatcher();\n }", "protected function initEventLogger(): void\n {\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $this->dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "public function listen($events, $listener = null): void;", "public function onCreate($callback)\n {\n $this->listeners[] = $callback;\n return $this;\n }", "public static function listen() {\n $projectId = \"sunday-1601040613995\";\n\n # Instantiates a client\n $pubsub = new PubSubClient([\n 'projectId' => $projectId\n ]);\n\n # The name for the new topic\n $topicName = 'gmail';\n\n # Creates the new topic\n $topic = $pubsub->createTopic($topicName);\n\n echo 'Topic ' . $topic->name() . ' created.';\n }", "protected function registerEventListeners()\n {\n Event::listen(Started::class, function (Started $event) {\n $this->progress = $this->output->createProgressBar($event->objects->count());\n });\n\n Event::listen(Imported::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(ImportFailed::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(DeletedMissing::class, function (DeletedMissing $event) {\n $event->deleted->isEmpty()\n ? $this->info(\"\\n No missing users found. None have been soft-deleted.\")\n : $this->info(\"\\n Successfully soft-deleted [{$event->deleted->count()}] users.\");\n });\n\n Event::listen(Completed::class, function (Completed $event) {\n if ($this->progress) {\n $this->progress->finish();\n }\n });\n }", "public function addBeforeCreateListener(IBeforeCreateListener $listener)\n {\n $this->_lifecyclers[BeanLifecycle::BeforeCreate][] = $listener;\n }", "protected function registerInputEvents() {\n\t\t$this->getEventLoop()->addEventListener('HANG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->offHook = (bool)$event['value'];\n\n\t\t\t// Trigger specific events for receiver up and down states\n\t\t\t$eventName = $this->isOffHook() ? 'RECEIVER_UP' : 'RECEIVER_DOWN';\n\t\t\t$this->fireEvents($eventName, $event);\n\t\t});\n\n\t\t$this->getEventLoop()->addEventListener('TRIG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->dialling = (bool)$event['value'];\n\t\t});\n\n\t\t// Proxy registration for all EventLoop events to pass them back up to our own listeners\n\t\t$this->getEventLoop()->addEventListener(true, function ($event, $type) {\n\t\t\t// Fire event to our own listeners\n\t\t\t$this->fireEvents($type, $event);\n\t\t});\n\t}", "public static function creating($callback)\n {\n self::listenEvent('creating', $callback);\n }", "public function attach(string $event, callable $listener, int $priority = 0): void;", "public function __construct()\n {\n $this->listnerCode = config('settings.listener_code.DeletingVoucherEventListener');\n }", "protected function registerEventListener()\n {\n $subscriber = $this->getConfig()->get('audit-trail.subscriber', AuditTrailEventSubscriber::class);\n $this->getDispatcher()->subscribe($subscriber);\n }", "function listenTo(string $eventName, callable $callback)\n {\n EventManager::register($eventName, $callback);\n }", "public function attach($identifier, $event, callable $listener, $priority = 1)\n {\n }", "public function testRegisiterListenerMethodAddsAListener()\n\t{\n\t\t$instance = new Dispatcher();\n\n\t\t$instance->register_listener('some_event', 'my_function');\n\n\t\t$this->assertSame(array('some_event' => array('my_function')), $instance->listeners);\n\t\t$this->assertAttributeSame(array('some_event' => array('my_function')), 'listeners', $instance);\n\t}", "protected function getPhpbb_Viglink_ListenerService()\n {\n return $this->services['phpbb.viglink.listener'] = new \\phpbb\\viglink\\event\\listener(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['template']) ? $this->services['template'] : $this->getTemplateService()) && false ?: '_'});\n }", "public static function create($className, array &$extraTabs, $selectedTabId)\r\n {\r\n $createClass = XenForo_Application::resolveDynamicClass($className, 'listener_th');\r\n if (!$createClass) {\r\n throw new XenForo_Exception(\"Invalid listener '$className' specified\");\r\n }\r\n \r\n return new $createClass($extraTabs, $selectedTabId);\r\n }", "function listen($listener)\n{\n return XPSPL::instance()->listen($listener);\n}", "function getEventListeners()\n {\n $listeners = array();\n \n $listener = new Listener($this);\n \n $listeners[] = array(\n 'event' => RoutesCompile::EVENT_NAME,\n 'listener' => array($listener, 'onRoutesCompile')\n );\n\n $listeners[] = array(\n 'event' => GetAuthenticationPlugins::EVENT_NAME,\n 'listener' => array($listener, 'onGetAuthenticationPlugins')\n );\n\n return $listeners;\n }", "protected static function loadListeners() {\n\t\t\n\t\t// default var\n\t\t$configDir = Config::getOption(\"configDir\");\n\t\t\n\t\t// make sure the listener data exists\n\t\tif (file_exists($configDir.\"/listeners.json\")) {\n\t\t\t\n\t\t\t// get listener list data\n\t\t\t$listenerList = json_decode(file_get_contents($configDir.\"/listeners.json\"), true);\n\t\t\t\n\t\t\t// get the listener info\n\t\t\tforeach ($listenerList[\"listeners\"] as $listenerName) {\n\t\t\t\t\n\t\t\t\tif ($listenerName[0] != \"_\") {\n\t\t\t\t\t$listener = new $listenerName();\n\t\t\t\t\t$listeners = $listener->getListeners();\n\t\t\t\t\tforeach ($listeners as $event => $eventProps) {\n\t\t\t\t\t\t$eventPriority = (isset($eventProps[\"priority\"])) ? $eventProps[\"priority\"] : 0;\n\t\t\t\t\t\tself::$instance->addListener($event, array($listener, $eventProps[\"callable\"]), $eventPriority);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "function __construct()\n\t{\n\t\t$this->events[\"BeforeShowList\"]=true;\n\n\t\t$this->events[\"BeforeProcessList\"]=true;\n\n\t\t$this->events[\"BeforeProcessPrint\"]=true;\n\n\t\t$this->events[\"BeforeShowPrint\"]=true;\n\n\t\t$this->events[\"BeforeQueryList\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeProcessEdit\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"BeforeProcessView\"]=true;\n\n\t\t$this->events[\"BeforeShowView\"]=true;\n\n\n\n\n\t\t$this->events[\"ProcessValuesView\"]=true;\n\n\t\t$this->events[\"ProcessValuesEdit\"]=true;\n\n\t\t$this->events[\"CustomAdd\"]=true;\n\n\t\t$this->events[\"CustomEdit\"]=true;\n\n\t\t$this->events[\"ProcessValuesAdd\"]=true;\n\n\t\t$this->events[\"BeforeQueryEdit\"]=true;\n\n\t\t$this->events[\"BeforeQueryView\"]=true;\n\n\n\t\t$this->events[\"BeforeProcessAdd\"]=true;\n\n\n//\tonscreen events\n\t\t$this->events[\"calmonthly_snippet2\"] = true;\n\t\t$this->events[\"calmonthly_snippet1\"] = true;\n\t\t$this->events[\"Monthly_Next_Prev\"] = true;\n\n\t}", "function defineHandlers() {\n EventsManager::listen('on_rawtext_to_richtext', 'on_rawtext_to_richtext');\n EventsManager::listen('on_daily', 'on_daily');\n EventsManager::listen('on_wireframe_updates', 'on_wireframe_updates');\n }", "public function createEvents()\n {\n //\n\n return 'something';\n }", "public static function createInstance()\n {\n return new GridPrintEventManager('ISerializable');\n }", "public function setUp()\n {\n if ($this->getOption('listener') === true) \n $this->addListener(new BlameableListener($this->_options));\n }", "public static function created($callback)\n {\n self::listenEvent('created', $callback);\n }", "public function addListener()\n {\n $dispatcher = $this->wrapper->getDispatcher();\n $listener = new TestListener();\n\n $dispatcher->addListener(PsKillEvents::PSKILL_PREPARE, [$listener, 'onPrepare']);\n $dispatcher->addListener(PsKillEvents::PSKILL_SUCCESS, [$listener, 'onSuccess']);\n $dispatcher->addListener(PsKillEvents::PSKILL_ERROR, [$listener, 'onError']);\n $dispatcher->addListener(PsKillEvents::PSKILL_BYPASS, [$listener, 'onBypass']);\n\n return $listener;\n }", "public static function addEventListener($event, $listenerClassName) {\n\t\tif (!is_a($listenerClassName, EventListenerInterface::class, TRUE)) {\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\tsprintf(\n\t\t\t\t\t'Invalid CMIS Service EventListener: %s must implement %s',\n\t\t\t\t\t$listenerClassName,\n\t\t\t\t\tEventListenerInterface::class\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tstatic::$eventListeners[get_called_class()][$event][] = $listenerClassName;\n\t}", "public function makeListener($listener, $wildcard = false): Closure;", "public function createSubscriber();", "public function listener() {\n\t\treturn $this->_runtime['listener'];\n\t}", "public function addEventListener($events, $eventListener)\n {\n $this->eventListeners[] = array('events' => $events, 'listener' => $eventListener);\n }", "function __construct()\r\n\t{\r\n\t\t$this->events[\"BeforeAdd\"]=true;\r\n\r\n\r\n\t}", "function __construct()\n\t{\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\n\t\t$this->events[\"BeforeShowAdd\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"IsRecordEditable\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"AfterDelete\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\n//\tonscreen events\n\n\t}", "public function startListening();", "public function addEntryAddedListener(callable $listener): SubscriptionInterface;", "function __construct()\n\t{\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}", "function GetEventListeners() {\n $my_file = '{%IEM_ADDONS_PATH%}/dynamiccontenttags/dynamiccontenttags.php';\n $listeners = array ();\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_SENDSTUDIOFUNCTIONS_GENERATEMENULINKS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'SetMenuItems'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_USERAPI_GETPERMISSIONTYPES',\n 'trigger_details' => array (\n 'Interspire_Addons',\n 'GetAddonPermissions',\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_DCT_HTMLEDITOR_TINYMCEPLUGIN',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'DctTinyMCEPluginHook'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_EDITOR_TAG_BUTTON',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'CreateInsertTagButton'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_GETALLTAGS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'getAllTags'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_REPLACETAGCONTENT',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'replaceTagContent'\n ),\n 'trigger_file' => $my_file\n );\n\n return $listeners;\n }", "function on_creation() {\n $this->init();\n }", "public function addEventListener(ListenerInterface $eventListener)\n {\n $this->eventListeners[] = $eventListener;\n }" ]
[ "0.65685207", "0.62875676", "0.6221792", "0.6197413", "0.61627764", "0.6129312", "0.6096226", "0.6056844", "0.6051069", "0.6041841", "0.596228", "0.596194", "0.5957539", "0.59439605", "0.58821785", "0.58821785", "0.5874665", "0.5864387", "0.5856076", "0.584338", "0.5824244", "0.5820997", "0.5791637", "0.57913053", "0.57893854", "0.57716024", "0.5764599", "0.5744472", "0.57417566", "0.57387024", "0.5721539", "0.57068586", "0.5699624", "0.56838834", "0.5675836", "0.56686187", "0.5661412", "0.56601405", "0.56584114", "0.5649107", "0.5638085", "0.56257224", "0.56172097", "0.56064796", "0.55919635", "0.5579062", "0.55775297", "0.5559927", "0.5546297", "0.5546121", "0.5545537", "0.5539715", "0.55295366", "0.55276597", "0.5527287", "0.551302", "0.5497285", "0.5495119", "0.54845315", "0.54834753", "0.54812366", "0.5478984", "0.5474917", "0.5471286", "0.54693574", "0.54684293", "0.5466594", "0.5465012", "0.5450231", "0.5450062", "0.5450001", "0.544321", "0.54308116", "0.54218924", "0.5389615", "0.53857446", "0.5378957", "0.5378836", "0.53771406", "0.5368413", "0.5360908", "0.5356685", "0.5349897", "0.53419805", "0.5340825", "0.53330225", "0.53323317", "0.5330117", "0.53270465", "0.5326564", "0.5307367", "0.52996707", "0.52980274", "0.52973336", "0.52886003", "0.528163", "0.5276869", "0.5269541", "0.5268173", "0.5265876", "0.52629435" ]
0.0
-1
Return new link position in list
protected function _getNewPosition($position = 0) { if (intval($position) > 0) { while (isset($this->_links[$position])) { $position++; } } else { $position = 0; foreach ($this->_links as $k=>$v) { $position = $k; } $position += 10; } return $position; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AddLink()\n\t\t{\n\t\t\t$n=count($this->links)+1;\n\t\t\t$this->links[$n]=array(0,0);\n\t\t\treturn $n;\n\t\t}", "public function getSortNewItemsPosition()\n\t{\n\t\treturn $this->new_items_position;\n\t}", "public function getNextPosition(): Position;", "abstract function incrementPosition();", "private function _incrementEntryPointer()\n\t{\n\t\t$this->_setEntryPointer($this->_getEntryPointer() + 1);\n\t}", "abstract public function getNextIndex();", "function linkId() \n \t{\n \t\treturn $this->linkId;\n \t}", "public function get_next_nav_position()\n\t{\n\t\t// get the last record\n\t\t$row = $this->db->order_by('position', 'DESC')->limit(1)->get($this->_table['navigation'])->row();\n\n\t\t// return that record position number +1\n\t\treturn $row->position + 1;\n\t}", "public function getNext ()\n {\n return prev ( $this->_list ) ;\n }", "public function link_id()\n {\n return $this->Link_ID;\n }", "function get_next_mod_index() {\n\t\t$index = $this->mod_index;\n\t\t$this->mod_index++;\n\t\treturn $index;\n\t}", "public function next_link()\n\t{\n\t\treturn $this->link_to_page($this->get_cur_page() + 1);\n\t}", "public function get_position(){ return $this->_position;}", "function getPosition() ;", "public function getNewLineNo(): int\n {\n return intval($this->newLineNo);\n }", "public function getPosition(): int\n {\n return $this->position;\n }", "public function getPosition(): int\n {\n return $this->position;\n }", "public function position()\n {\n return $this->i;\n }", "public function key(): int\n {\n return $this->position;\n }", "public function key(): int\n {\n return $this->position;\n }", "public function key(): int\n {\n return $this->position;\n }", "public function getPosition() : int\n {\n $rtn = $this->data['position'];\n\n return $rtn;\n }", "function getPosition() {\n\t\t}", "public function getPosition() {}", "public function getPosition() {}", "public function setSortNewItemsPosition($a_position)\n\t{\n\t\t$this->new_items_position = (int)$a_position;\n\t}", "function key() {\r\n return $this->_position;\r\n }", "function getLink($hash, $newHash) {\n\t\t$link = getDbConnect();\n\t\n\t\t//get the id\n\t\tif ($newHash) \n\t\t\t$id = base_convert($hash, 36, 10);\n\t\telse\n\t\t\t$id = hexdec($hash);\n\n\t\t//do our search\n\t\t$preparedStatement = $link->prepare(\"SELECT url FROM urls WHERE id = :id;\");\n\t\t$preparedStatement->execute(array(\":id\" => $id));\n\t\t$results = $preparedStatement->fetchAll();\n\t\n\t\t//cleanup our URL\n\t\t$url = stripslashes($results[0][\"url\"]);\n\t\t\n\t\t$preparedStatement = $link->prepare(\"UPDATE urls SET visits = visits+1 WHERE id = :id;\");\n\t\t$preparedStatement->execute(array(\":id\" => $id));\n\t\treturn $url;\n\t}", "public function getPosition()\n {\n return -1;\n }", "private function incCurrentSitemap()\n {\n $this->current_sitemap = $this->current_sitemap + 1;\n }", "public function getCurrentPosition(): int;", "function key()\n {\n return $this->_position;\n }", "function key() \n {\n return $this->position;\n }", "public function getNextSeq(): int\n\t{\n\t\treturn (int) (new \\App\\Db\\Query())->from($this->getTableName())->max('sortorderid') + 1;\n\t}", "public function getLinkId()\n {\n return $this->linkId;\n }", "private function addUrl(string $url): int\r\n {\r\n // TODO: Find links with similar attributes and compare them\r\n // $parsed_url = parse_url($url);\r\n // for now though, let's just strip any excess slashes\r\n $url = chop($url, \"/\");\r\n $url_md5 = md5($url);\r\n\r\n $stmt = $this->pdo->prepare(\"SELECT * FROM urls WHERE md5=?\");\r\n $stmt->execute([$url_md5]);\r\n if ($stmt->rowCount()) {\r\n $url_id = $stmt->fetch()->url_id;\r\n // Update the links_to_url count for this url\r\n $stmt = $this->pdo->prepare(\"UPDATE urls SET links_to_url = links_to_url + 1 WHERE md5=?\");\r\n $stmt->execute([$url_md5]);\r\n return $url_id;\r\n } else {\r\n $stmt = $this->pdo->prepare(\"INSERT INTO urls (url_base64, url_plain, md5) VALUES(?, ?, ?)\");\r\n $stmt->execute([base64_encode($url), $url, $url_md5]);\r\n return $this->pdo->lastInsertId();\r\n }\r\n }", "public function push_at($newElement, $position) { \n $newNode = new Node(); \n $newNode->data = $newElement;\n $newNode->next = null;\n if($position < 1) {\n echo \"\\nposition should be >= 1.\";\n } else if ($position == 1) {\n $newNode->next = $this->head;\n $this->head = $newNode;\n } else {\n $temp = new Node();\n $temp = $this->head;\n for($i = 1; $i < $position-1; $i++) {\n if($temp != null) {\n $temp = $temp->next;\n }\n }\n if($temp != null) {\n $newNode->next = $temp->next;\n $temp->next = $newNode; \n\n } else {\n echo \"\\nThe previous node is null.\";\n } \n }\n }", "function getPosition() {\n return sprintf(\"%010d\", $this->_position);\n }", "public function getNextPosition()\n {\n $parentPos = trim($this->getPosition());\n $sql=\"select position from \" . strtolower(get_class($this)) . \" where active = 1 and position like '\" . $parentPos . str_repeat('_', self::POS_LENGTH_PER_LEVEL). \"' order by position asc\";\n $result = Dao::getResultsNative($sql);\n if(count($result) === 0)\n return $parentPos . str_repeat('0', self::POS_LENGTH_PER_LEVEL);\n \n $expectedAccountNos = array_map(create_function('$a', 'return \"' . $parentPos . '\".str_pad($a, ' . self::POS_LENGTH_PER_LEVEL . ', 0, STR_PAD_LEFT);'), range(0, str_repeat('9', self::POS_LENGTH_PER_LEVEL)));\n $usedAccountNos = array_map(create_function('$a', 'return $a[\"position\"];'), $result);\n $unUsed = array_diff($expectedAccountNos, $usedAccountNos);\n sort($unUsed);\n if (count($unUsed) === 0)\n \tthrow new EntityException(\"Position over loaded (parentId = \" . $this->getId() . \")!\");\n \n return $unUsed[0];\n }", "public function addLink()\n {\n $this->_pdfDocument->internalLinks[] = array(0, 0);\n return count($this->_pdfDocument->internalLinks);\n }", "public function assertListCorrect() {\n\t\t$activeRecordModel = $this->getTestActiveRecordFinder();\n\t\t$positionAttributeName = $activeRecordModel->getPositionAttributeName();\n\t\t$records = $activeRecordModel->findAll(array('order' => \"{$positionAttributeName} ASC\"));\n\t\tforeach ($records as $recordNumber => $record) {\n\t\t\t$this->assertEquals($record->$positionAttributeName, $recordNumber+1, 'List positions have been broken!');\n\t\t}\n\t}", "public function getMenuPosition(): int;", "function key()\n\t\t{\n\t\t\t$this->current();\n\t\t\treturn $this->offset;\n\t\t}", "public function internallink($match, $state, $pos) {\n $link = preg_replace(array('/^\\[\\[/','/\\]\\]$/u'),'',$match);\n\n // Split title from URL\n $link = explode('|',$link,2);\n if ( !isset($link[1]) ) {\n $link[1] = NULL;\n }\n $link[0] = trim($link[0]);\n\n\n //decide which kind of link it is\n\n if ( preg_match('/^[a-zA-Z0-9\\.]+>{1}.*$/u',$link[0]) ) {\n // Interwiki\n $this->calls .= $match;\n }elseif ( preg_match('/^\\\\\\\\\\\\\\\\[^\\\\\\\\]+?\\\\\\\\/u',$link[0]) ) {\n // Windows Share\n $this->calls .= $match;\n }elseif ( preg_match('#^([a-z0-9\\-\\.+]+?)://#i',$link[0]) ) {\n // external link (accepts all protocols)\n $this->calls .= $match;\n }elseif ( preg_match('<'.PREG_PATTERN_VALID_EMAIL.'>',$link[0]) ) {\n // E-Mail (pattern above is defined in inc/mail.php)\n $this->calls .= $match;\n }elseif ( preg_match('!^#.+!',$link[0]) ){\n // local link\n $this->calls .= $match;\n }else{\n $id = $link[0];\n\n $hash = '';\n $parts = explode('#', $id, 2);\n if (count($parts) === 2) {\n $id = $parts[0];\n $hash = $parts[1];\n }\n\n $params = '';\n $parts = explode('?', $id, 2);\n if (count($parts) === 2) {\n $id = $parts[0];\n $params = $parts[1];\n }\n\n\n $new_id = $this->adaptRelativeId($id);\n\n if ($id == $new_id) {\n $this->calls .= $match;\n } else {\n if ($params !== '') {\n $new_id.= '?'.$params;\n }\n\n if ($hash !== '') {\n $new_id .= '#'.$hash;\n }\n\n if ($link[1] != NULL) {\n $new_id .= '|'.$link[1];\n }\n\n $this->calls .= '[['.$new_id.']]';\n }\n\n }\n\n return true;\n\n }", "protected function getItemLink($item)\n {\n return $this->arrLinks[($item - 1)];\n }", "function reorderItem($db, $resource_pk, $item_pk, $new_pos) {\r\n\r\n $item = getItem($db, $resource_pk, $item_pk);\r\n\r\n $ok = !empty($item->item_pk);\r\n if ($ok) {\r\n $old_pos = $item->sequence;\r\n $ok = ($old_pos != $new_pos);\r\n }\r\n if ($ok) {\r\n $prefix = DB_TABLENAME_PREFIX;\r\n if ($new_pos <= 0) {\r\n $sql = <<< EOD\r\nUPDATE {$prefix}item\r\nSET sequence = sequence - 1\r\nWHERE (resource_link_pk = :resource_pk) AND (sequence > :old_pos)\r\nEOD;\r\n } else if ($old_pos < $new_pos) {\r\n $sql = <<< EOD\r\nUPDATE {$prefix}item\r\nSET sequence = sequence - 1\r\nWHERE (resource_link_pk = :resource_pk) AND (sequence > :old_pos) AND (sequence <= :new_pos)\r\nEOD;\r\n } else {\r\n $sql = <<< EOD\r\nUPDATE {$prefix}item\r\nSET sequence = sequence + 1\r\nWHERE (resource_link_pk = :resource_pk) AND (sequence < :old_pos) AND (sequence >= :new_pos)\r\nEOD;\r\n }\r\n\r\n $query = $db->prepare($sql);\r\n $query->bindValue('resource_pk', $resource_pk, PDO::PARAM_INT);\r\n $query->bindValue('old_pos', $old_pos, PDO::PARAM_INT);\r\n if ($new_pos > 0) {\r\n $query->bindValue('new_pos', $new_pos, PDO::PARAM_INT);\r\n }\r\n\r\n $ok = $query->execute();\r\n\r\n if ($ok && ($new_pos > 0)) {\r\n $item->sequence = $new_pos;\r\n $ok = saveItem($db, $resource_pk, $item);\r\n }\r\n\r\n }\r\n\r\n return $ok;\r\n\r\n }", "public function getPosition(): string;", "public function key()\n {\n if(is_null($this->paginationVar))\n return 0;\n return $this->curIndex + $this->paginationVar->GetOffset();\n }", "public function getPosition();", "public function getPosition();", "public function getPosition();", "function get_edit_bookmark_link($link = 0)\n {\n }", "private static function pushOriginalHtmlList($originalHtml) {\n\tarray_push( self::$ORIGINAL_HTML_LIST , $originalHtml);\n\treturn count( self::$ORIGINAL_HTML_LIST ) - 1;\n }", "function prev() {\n\n $next = $this->find('first', array('conditions'=>array('position <'=>$this->data['Ringsite']['position']),\n 'order'=>'position DESC'));\n\n if (empty($next)) {\n $next = $this->find('first', array('conditions'=>array('position >='=>0),\n 'order'=>'position DESC'));\n }\n\n return $next;\n }", "public function getPosition(){ }", "public function key(): int\n {\n return $this->pointer;\n }", "public function add(HTMLNode $node): int\n {\n array_push($this -> nodes, $node);\n return key(array_slice($this -> nodes, -1, 1, true));\n }", "function GetHistoryItem($val) /*12_05_2007 возвращает адрес из истории со смещением назад равным $val*/\n\t\t{\n\t\tif($this->history[count($this->history)-$val])\n\t\t\t$ret = $this->history[count($this->history)-$val];\n\t\telse\n\t\t\t$ret = $_SERVER['SERVER_NAME'];\n//\t\treturn $this->history[count($this->history)-1]; \n\t\treturn $ret;\n\t\t}", "public function moveNext() {\n\t\tif($this->getPointer() <= $this->getLast()) {\n\t\t\t$this->pointer++;\n\t\t\t\n\t\t\treturn $this->pointer;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function getNextLink()\n {\n return $this->getAlbum()->getNextLink($this);\n }", "public function getPointer()\n {\n return $this->uuid;\n }", "public function numLinks();", "public function getPos() {}", "public function getPos() {}", "public function getPos() {}", "public function getPos() {}", "public function getPos() {}", "protected function num() {\n $this->siblings = $this->siblings->not($this->page)->sortBy('num', 'asc');\n\n // special keywords and sanitization\n if($this->to == 'last') {\n $this->to = $this->siblings->count() + 1;\n } else if($this->to == 'first') {\n $this->to = 1;\n } else if($this->to === false) {\n $this->to = false;\n } else if($this->to < 1) {\n $this->to = 1; \n }\n\n // start the index\n $n = 0;\n\n if($this->to === false) {\n foreach($this->siblings as $sibling) {\n $n++; $sibling->_sort($n);\n }\n } else {\n\n // go through all items before the selected page\n foreach($this->siblings->slice(0, $this->to - 1) as $sibling) {\n $n++; $sibling->_sort($n);\n }\n\n // add the selected page\n $n++; $this->page->_sort($n);\n\n // go through all the items after the selected page\n foreach($this->siblings->slice($this->to - 1) as $sibling) {\n $n++; $sibling->_sort($n);\n }\n\n }\n\n }", "public function func_refindex() {}", "function getNextSortID() {\n if($this->Page()->ID) $getDataList = $this->Page()->MetroImage();\n else return NULL;\n// $parentID = $this->HeroPage()->ID;\n// $ParentImages = $this->HeroPage()->Images();\n// $ParentLastImageSortID = $this->HeroPage()->Images()->last()->SortID;\n\n if (!$getDataList || $getDataList->Count() == 0) {\n return NULL;\n } else {\n\n return $getDataList->first()->SortID + 1;\n }\n }", "public function lastModification() : int;", "protected function _get_next_incrementer() {\n\t\t// Get the old integer\n\t\t$channel_id = $this->EE->input->get('channel_id');\n\t\t$old_number = $this->EE->db->select($this->field_name)\n\t\t\t\t\t\t\t\t ->where('channel_id', $this->EE->input->get('channel_id'))\n\t\t\t\t\t\t\t\t ->order_by('entry_id DESC')\n\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t ->get('channel_data')\n\t\t\t\t\t\t\t\t ->row();\n\t\t\n\t\t// Do we have one?\n\t\tif ($old_number) {\n\t\t\t// Increment\n\t\t\t$new_number = (int)$old_number->{$this->field_name} + 1;\n\t\t} else {\n\t\t\t// Start at 1\n\t\t\t$new_number = 1;\n\t\t}\n\t\t\n\t\t// Return it\n\t\treturn $new_number;\n\t}", "public function ahead(): int\n {\n if ($this->hasNodeId()) {\n if ($this->nodeId !== head($this->ranks)) {\n $ranks = $this->ranks;\n $ranks = array_diff($ranks, [$this->nodeId]);\n $this->commit(array_merge([$this->nodeId], $ranks));\n }\n\n return 1;\n }\n }", "public function getCurrHyperlink()\n {\n return $this->currHyperlink;\n }", "private function set_itemCurrentNumber()\n {\n // RETURN maxItemsPerHtmlRow is false\n if ( $this->itemsPerHtmlRow[ 'maxItemsPerHtmlRow' ] === false )\n {\n return;\n }\n // RETURN maxItemsPerHtmlRow is false\n // Increase item number\n // #40354, #40354, 4.1.7, 1+\n $this->itemsPerHtmlRow[ 'currItemNumberAbsolute' ] ++;\n $this->itemsPerHtmlRow[ 'currItemNumberInRow' ] ++;\n }", "protected function get_line() { \n\t\t$line = $this->lines[$this->cursor]; \n\t\t$this->cursor++; return $line; \n\t}", "function add($pos,$url,$img,$title,$accesskey='')\n{\n\tif($pos==0)\n\t\t$this->reflist[]=array($url,$img,$title,$accesskey);\n\telse\n\t\tarray_unshift($this->reflist,array($url,$img,$title,$accesskey));\n}", "public function incrementPosition()\n {\n ++$this->positionA;\n }", "public function SetHookModulePosition()\n {\n $idShops = [];\n\n $sql = 'SELECT distinct id_shop FROM '._DB_PREFIX_.'hook_module';\n if ($results = $this->db->ExecuteS($sql)) {\n foreach ($results as $row) {\n $idShops[] = $row['id_shop'];\n }\n }\n\n $sql = 'SELECT id_hook FROM '._DB_PREFIX_.'hook where name = \"actionUpdateQuantity\"';\n $idHook = $this->db->getValue($sql);\n\n foreach ($idShops as $idShop) {\n $sql = 'SELECT * FROM '._DB_PREFIX_.'hook_module WHERE id_shop = '.$idShop.' AND id_hook = '.$idHook.' ORDER BY position';\n if ($results = $this->db->ExecuteS($sql)) {\n $pos = 2;\n foreach ($results as $row) {\n if ($row['id_module'] == $this->id) {\n $query = 'UPDATE '._DB_PREFIX_.'hook_module SET position = '. 1 .' WHERE id_shop = '.$row['id_shop'].' AND id_hook = '.$row['id_hook'].' AND id_module = '.$row['id_module'];\n } else {\n $query = 'UPDATE '._DB_PREFIX_.'hook_module SET position = '.$pos.' WHERE id_shop = '.$row['id_shop'].' AND id_hook = '.$row['id_hook'].' AND id_module = '.$row['id_module'];\n $pos++;\n }\n $this->db->Execute($query);\n }\n }\n }\n\n return true;\n }", "public function key()\n {\n return $this->_position;\n }", "private function getNewID()\n\t{\n\t\t$ids = array_keys($this->metadata['posts']);\n\t\t$lastId = (count($ids) > 0) ? max($ids) : 0;\n\n\t\treturn $lastId + 1;\n\t}", "public function getOffset(): int;", "function set_direct_links($member_id,$product_id,$cat,$rating,$previous)\n{\n\tglobal $vogoo;\n\t$operation = '';\n\tif ($rating >= VG_THRESHOLD_RATING && $previous < VG_THRESHOLD_RATING)\n\t{\n\t\t$operation = '+1';\n\t}\n\telse if ($rating < VG_THRESHOLD_RATING && $previous >= VG_THRESHOLD_RATING)\n\t{\n\t\t$operation = '-1';\n\t}\n\tif ($operation != '')\n\t{\n\t\t$threshold = VG_THRESHOLD_RATING;\n\t\t$sql = <<<EOF\nSELECT product_id\nFROM vogoo_ratings\nWHERE member_id = {$member_id}\nAND category = {$cat}\nAND rating >= {$threshold}\nAND product_id <> {$product_id}\nEOF;\n\t\tif ( !($result = $vogoo->db->sql_query($sql)) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$id1 = $product_id;\n\t\twhile ($row = $vogoo->db->sql_fetchrow($result))\n\t\t{\n\t\t\t$id2 = $row['product_id'];\n\t\t\t$sql = <<<EOF\nSELECT cnt\nFROM vogoo_links\nWHERE item_id1={$id1}\nAND item_id2={$id2}\nAND category={$cat}\nEOF;\n\t\t\tif ( !($res3 = $vogoo->db->sql_query($sql)) )\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ($vogoo->db->sql_numrows($res3) == 1)\n\t\t\t{\n\t\t\t\t$sql = <<<EOF\nUPDATE vogoo_links\nSET cnt=cnt{$operation}\nWHERE item_id1={$id1}\nAND item_id2={$id2}\nAND category={$cat}\nEOF;\n\t\t\t\tif ( !($res4 = $vogoo->db->sql_query($sql)) )\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$sql = <<<EOF\nUPDATE vogoo_links\nSET cnt=cnt{$operation}\nWHERE item_id1={$id2}\nAND item_id2={$id1}\nAND category={$cat}\nEOF;\n\t\t\t\tif ( !($res4 = $vogoo->db->sql_query($sql)) )\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif ($operation == '-1') {\n\t\t\t\t\t$sql = <<<EOF\nDELETE FROM vogoo_links\nWHERE cnt=0\nEOF;\n\t\t\t\t\t$vogoo->db->sql_query($sql);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse if ($operation == '+1')\t// We should not get anything other than +1 here but it is a good idea to check it\n\t\t\t{\n\t\t\t\t$sql = <<<EOF\nINSERT INTO vogoo_links(item_id1,item_id2,category,cnt,diff_slope)\nVALUES ({$id1},{$id2},{$cat},1,0.0)\nEOF;\n\t\t\t\tif ( !($res4 = $vogoo->db->sql_query($sql)) )\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$sql = <<<EOF\nINSERT INTO vogoo_links(item_id1,item_id2,category,cnt,diff_slope)\nVALUES ({$id2},{$id1},{$cat},1,0.0)\nEOF;\n\t\t\t\tif ( !($res4 = $vogoo->db->sql_query($sql)) )\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$vogoo->db->sql_freeresult($res3);\n\t\t}\n\t\t$vogoo->db->sql_freeresult($result);\n\t}\n}", "public function getPos();", "public function getPos();", "public function key()\n\t{\n\t\treturn $this->_position;\n\t}", "public function getPosition() {\n return $this->getValue('position');\n }", "function getUniqueId()\n {\n $a = count($this->_ref_store);\n while(in_array($a, $this->_ref_store)) {\n $a++;\n }\n return $a;\n }", "public function getPosition() {\n }", "function offset_pos(){\n\t // $this->count_uri();\n\n\t \tif(isset($this->uri_array['osp']))\n\t\t{\n\t \t\t//ops without and with offset page value\n\t \t\tif(count($this->uri_array['osp'])==1){\n\t \t\t\t$pos = $this->count_uri()+1;\n\t \t\t}else{\n\t\t\t\t$segment_array = $this->uri->segment_array();\n\t\t\t\t$pos = array_search(RAPYD_URI_OSP,$segment_array)+1;\n\t \t\t}\n\t \t}\n\n\t \t/*****************************************************************************\n\t \t * We take care of this case even if we have added it in explode_uri for more\n\t \t * security in URI reading\n\t \t *****************************************************************************/\n\t \telse{\n\t \t\t$pos = $this->count_uri()+2;\n\t \t}\n\t\treturn $pos;\n\t}", "public function position() {\n\t\treturn $this->position;\n\t}", "function next() {\r\n $this->index++;\r\n return $this->list[$this->index];\r\n }", "public function key()\n\t{\n\t\treturn $this->__position;\n\t}", "public function getFilePos() {\n\t\treturn $this->linepointer;\n\t}", "public function position();", "function getIndex() ;", "function adjustPosition($i) {\n global $connection, $user;\n\n // Look up current position\n $sql = 'select ub.position, b.tr_batch_id from TR_USER_BATCH ub left join TR_BATCH b on ub.tr_batch_id = b.tr_batch_id where b.tr_batch_id = ? and username = ?';\n if ($statement = $connection->prepare($sql)) {\n $statement->bind_param(\"is\",$this->getBatchId(),$_SESSION[\"username\"]);\n $statement->execute();\n $statement->bind_result($position, $batch_id);\n $statement->store_result();\n if ($statement->fetch()) {\n // nothing\n } else {\n throw new Exception(\"Could not find current batch/position for tr_batch_id [{$this->getBatchId()}]\");\n }\n $statement->close();\n } else {\n throw new Exception(\"Database connection failed\");\n }\n\n return movePosition($position + $i);\n }", "public function key()\n {\n return $this->position;\n }", "public function key()\n {\n return $this->position;\n }", "public function key()\n {\n return $this->position;\n }" ]
[ "0.6248835", "0.6009544", "0.5550225", "0.54498684", "0.5420793", "0.5336731", "0.5322765", "0.53133106", "0.52839047", "0.52218425", "0.5215148", "0.52128255", "0.5184581", "0.517296", "0.5140279", "0.51061803", "0.51061803", "0.5105887", "0.50225216", "0.50225216", "0.50225216", "0.4965805", "0.495663", "0.4954861", "0.4954861", "0.49428004", "0.49401236", "0.49398336", "0.49257234", "0.49231276", "0.49168816", "0.49111044", "0.49060687", "0.4890979", "0.4886226", "0.48850998", "0.48846462", "0.48789907", "0.48776925", "0.48616102", "0.48516566", "0.48479897", "0.48422366", "0.48412085", "0.48226428", "0.48194438", "0.48174104", "0.48136178", "0.48074466", "0.48074466", "0.48074466", "0.48012772", "0.4799779", "0.47963515", "0.47925863", "0.47829115", "0.47790694", "0.47785884", "0.47731146", "0.47722813", "0.47683898", "0.47682917", "0.47620305", "0.47620305", "0.47620305", "0.47620305", "0.47620305", "0.47448543", "0.47447288", "0.47319102", "0.4723047", "0.471875", "0.47124276", "0.4711505", "0.47084582", "0.47056946", "0.4697148", "0.46938986", "0.46918297", "0.46910167", "0.46795732", "0.4676151", "0.46760452", "0.46683672", "0.46683672", "0.46683168", "0.46650386", "0.46620953", "0.46604997", "0.46525338", "0.46520758", "0.46495506", "0.46365607", "0.4634959", "0.46348172", "0.46290046", "0.46288338", "0.46244487", "0.46244487", "0.46244487" ]
0.67542017
0
Called after the check that all required registry values have been set correctly has run.
public function afterRegistry() { parent::afterRegistry(); $setOnSave = \MUtil_Model_ModelAbstract::SAVE_TRANSFORMER; $switches = $this->getTextSettings(); // Make sure the calculated name is saved if (! isset($switches['gaf_calc_name'], $switches['gaf_calc_name'][$setOnSave])) { $switches['gaf_calc_name'][$setOnSave] = array($this, 'calcultateAndCheckName'); } // Make sure the class name is always saved $className = $this->getFilterClass(); $switches['gaf_class'][$setOnSave] = $className; // Check all the fields for ($i = 1; $i <= $this->_fieldCount; $i++) { $field = 'gaf_filter_text' . $i; if (! isset($switches[$field])) { $switches[$field] = array('label' => null, 'elementClass' => 'Hidden'); } } $this->addSwitches(array($className => $switches)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function afterRegistry()\n {\n // parent::afterRegistry();\n }", "public function _postSetup()\n {\n }", "protected function _afterInit() {\n\t}", "protected function _afterLoad()\n {\n $value = $this->getValue();\n $value = $this->makeArrayFieldValue($value);\n $this->setValue($value);\n }", "public function afterSetup()\n {\n }", "protected function checkRegistry()\n {\n foreach ($this->getExpectedClassrooms() as $classId => $classroom) {\n $this->assertTrue(\n $this->registry->offsetExists($classId),\n sprintf('Parser did not add class room \"%s\" to registry', $classId)\n );\n\n $this->assertEquals(\n $classroom,\n $this->registry->offsetGet($classId),\n sprintf('Parser created invalid class room for class \"%s\"', $classId)\n );\n }\n }", "protected function _afterLoad()\n {\n $value = $this->getValue();\n $value = $this->_helper->makeArrayFieldValue($value);\n $this->setValue($value);\n }", "public function afterRegistry()\n {\n parent::afterRegistry();\n\n if ($this->showForRespondents && is_bool($this->showForRespondents)) {\n $this->showForRespondents = $this->_('Respondents');\n }\n if ($this->showForStaff && is_bool($this->showForStaff)) {\n $this->showForStaff = $this->_('Staff');\n }\n if ($this->showForTracks && is_bool($this->showForTracks)) {\n $this->showForTracks = $this->_('Tracks');\n }\n if ($this->showTitle && is_bool($this->showTitle)) {\n $this->showTitle = $this->_('Add');\n }\n }", "protected function onFinishSetup()\n {\n }", "public function postConfigure()\n\t{\n\t\tforeach ($this->restrictions as $type => $restrictions)\n\t\t{\n\t\t\tif (!empty($restrictions))\n\t\t\t{\n\t\t\t\t$this->debug->setFlag($type, $restrictions);\n\t\t\t}\n\t\t}\n\n\t\t$this->config->force_winner = $this->force_winner;\n\n\t\t$factory = new OLPBlackbox_Factory_Legacy_OLPBlackbox();\n\t\t$this->blackbox = $factory->getBlackbox();\n\t}", "protected function setupValidation()\n {\n }", "public function afterRegistry()\n {\n $agenda = $this->loader->getAgenda();\n\n if ($agenda) {\n $this->addColumn(\n \"CASE WHEN gap_status IN ('\" .\n implode(\"', '\", $agenda->getStatusKeysInactive()) .\n \"') THEN 'deleted' ELSE '' END\",\n 'row_class'\n );\n\n $codes = $agenda->getStatusCodesInactive();\n if (isset($codes['CA'])) {\n $cancelCode = 'CA';\n } elseif ($codes) {\n reset($codes);\n $cancelCode = key($codes);\n } else {\n $cancelCode = null;\n }\n if ($cancelCode) {\n $this->setDeleteValues('gap_status', $cancelCode);\n }\n }\n }", "protected function setUp()\n {\n $this->name = '.test';\n $this->registry = new Registry($this->name);\n\n // Make sure the registry is clear.\n $this->registry->clearOld(-9999);\n }", "public function onAfterInitPlugins()\n {\n $cache = Registry::get('Cache');\n $validated_prefix = 'validated-';\n\n $this->check = CACHE_DIR . $validated_prefix .$cache->getKey();\n\n if(!file_exists($this->check)) {\n\n // Run through potential issues\n $this->active = $this->problemChecker();\n\n // If no issues remain, save a state file in the cache\n if (!$this->active) {\n // delete any exising validated files\n foreach (glob(CACHE_DIR . $validated_prefix. '*') as $filename) {\n unlink($filename);\n }\n\n // create a file in the cache dir so it only runs on cache changes\n touch($this->check);\n }\n\n }\n\n\n }", "public function ApplyChanges()\n {\n parent::ApplyChanges();\n\n $this->RegisterVariableString ( \"GUID\", \"GUID\", \"~HTMLBox\", 0 );\n\t\t$this->ValidateConfiguration();\n\t\n }", "protected function afterConfigurationSet()\n {\n }", "protected function setUp() {\n\t\t$this->objectRegistry = new \\F3\\FLOW3\\Object\\TransientRegistry();\n\t}", "public function afterInstall()\n\t{}", "protected function after() {\n }", "protected function afterFill() {}", "protected function _afterLoad()\n {\n $value = $this->getValue();\n\n $value = Mage::helper('mail/connectfields')->makeArrayFieldValue($value);\n $this->setValue($value);\n }", "protected function prepareValidations() {}", "private function _postInit()\n {\n // Register all the listeners for config items\n $this->_registerConfigListeners();\n\n // Register all the listeners for invalidating GraphQL Cache.\n $this->_registerGraphQlListeners();\n\n // Load the plugins\n $this->getPlugins()->loadPlugins();\n\n $this->_isInitialized = true;\n\n // Fire an 'init' event\n if ($this->hasEventHandlers(WebApplication::EVENT_INIT)) {\n $this->trigger(WebApplication::EVENT_INIT);\n }\n\n if (!$this->getUpdates()->getIsCraftDbMigrationNeeded()) {\n // Possibly run garbage collection\n $this->getGc()->run();\n }\n }", "protected function afterAdd() {\n\t}", "abstract protected function checkInitialization();", "protected function afterInstall()\n {\n }", "protected function afterPopulate()\n {\n\n }", "public function after_custom_props() {}", "protected function registered()\n {\n //\n }", "abstract protected function afterSuccessValidation();", "public function afterRegistry()\n {\n if ($this->tokenIdentifier) {\n $this->token = $this->loader->getTracker()->getToken($this->tokenIdentifier);\n if ($this->token->exists) {\n $this->patientId = $this->token->getPatientNumber();\n $this->organizationId = $this->token->getOrganizationId();\n }\n } else {\n $this->loadDefault();\n }\n\n parent::afterRegistry();\n\n if ($this->token && $this->token->hasRelation() && $relation = $this->token->getRelation()) {\n // If we have a token with a relation, remove the respondent and use relation in to field\n $this->to = array();\n $this->addTo($relation->getEmail(), $relation->getName());\n }\n }", "protected function after() {\n\t\t// Empty default implementation. Should be implemented by descendant classes if needed\n\t}", "protected function _after() {\n\t\t$this->startup = null;\n\t}", "public function bootingCallback()\n {\n BaseField::$configKeys[] = 'validations';\n OptionManager::$configKeys[] = 'validations';\n\n $this->setMacros();\n\n Validation::extendValidatorOptions();\n }", "protected function _after()\n {\n }", "protected function after()\n {\n }", "protected function after()\n {\n }", "protected function tearDown()\n {\n oxTestModules::addFunction('oxManufacturer', 'cleanRootManufacturer', '{oxManufacturer::$_aRootManufacturer = array();}');\n oxNew('oxManufacturer')->cleanRootManufacturer();\n parent::tearDown();\n }", "public function testRegistrationFieldsMissing(): void { }", "protected function tearDown()\n {\n Zend_Registry::_unsetInstance();\n }", "protected function afterLoad()\n {\n }", "protected function assertLoaded()\n\t{\n\t\tif (!$this->hasLoaded) {\n\t\t\t$this->settings = $this->loadSettings();\n\n\t\t\t$this->hasLoaded = true;\n\t\t}\n\t}", "protected function _after()\n\t{\n\t\t\n\t}", "protected function _after()\n\t{\n\t\t\n\t}", "function after_validation() {}", "public function admin_init()\n\t{\n\t\tforeach( (array) $this->InstanceRegistred as $id => $args ) :\n\t\t\t\\register_setting( $this->page, $args['name'] );\n\t\tendforeach;\n\t}", "public function after_run() {}", "function setDefaultValues() {}", "function register_initial_settings()\n {\n }", "public function afterUpdate()\n {\n //only clean and change custom fields if they have been set\n if (!empty($this->customFields)) {\n $this->deleteAllCustomFields();\n $this->saveCustomFields();\n }\n }", "protected function setErrorsExist() {}", "protected function assertPostConditions() {\n\t\tprint \"---------------------------------------------------------------- \\n\";\n\t}", "protected function _after() {\n\t\t$this->yumlModelsCreator = null;\n\t\tparent::_after ();\n\t}", "protected static function init()\n {\n if (empty(static::$registry)) {\n static::$registry = new LogEngineRegistery();\n }\n\n if (static::$dirtyConfig) {\n echo '111';\n }\n\n static::$dirtyConfig = false;\n }", "protected function setUp() {\n $this->object = new Qwin_ValidationResult;\n\n\n }", "protected function afterUninstall()\n {\n }", "public function afterRegistry()\n {\n parent::afterRegistry();\n\n $this->contentTitle = sprintf($this->_('Quick view %s track'), $this->trackEngine->getTrackName());\n }", "protected function setUp()\n {\n $this->_validator = new Zend_Validate_Sitemap_Lastmod();\n }", "protected function afterValidate()\n {\n \tparent::afterValidate();\n \tif(!$this->hasErrors())\n \t\t$this->password = $this->hashPassword($this->password);\n }", "protected function _after()\n {\n }", "protected function after(){}", "protected function after(){}", "protected function after(){}", "private function _after_install() {\n global $COURSE, $DB;\n \n if(!$this->_found) { // if the block's instance hasn't been cached\n // lookup the DB to check if this block instance already exists\n $result = $DB->get_record('block_group_choice', array('course_id' => $COURSE->id, 'instance_id' => $this->instance->id));\n if($result) { // if the block's instance already exist in the DB\n $this->_found = true;\n }\n else { // if this block instance doesn't exist we insert a first set of preferences\n $entries = new stdClass();\n $entries->instance_id = $this->instance->id;\n $entries->course_id = $COURSE->id;\n $entries->showgroups = 1;\n $entries->maxmembers = 2;\n $entries->allowchangegroups = 0;\n $entries->allowstudentteams = 1;\n $entries->allowmultipleteams = 0;\n $DB->insert_record('block_group_choice', $entries);\n }\n }\n }", "protected function setUp()\n\t{\n\t\tparent::setUp();\n\t\t// Сбросим валидатор, чтобы не было влияния одних тестов на другие\n\t\tValidator::reset();\n\t}", "protected function pre_populate(){\n\t\t\n\t\t$values = $this->get_values();\n\t\t\n\t\tif ( ! empty( $values ) ){\n\t\t\t\n\t\t\tforeach( $this->get_values() as $slug => $name ){\n\t\t\t\t\n\t\t\t\tif ( ! term_exists( $slug , $this->get_slug() ) ){\n\t\t\t\t\t\n\t\t\t\t\twp_insert_term( $name, $this->get_slug(), $args = array('slug' => $slug ) );\n\t\t\t\t\t\n\t\t\t\t} // end if\n\t\t\t\t\n\t\t\t} // end foreach\n\t\t\t\n\t\t} // end if\n\t\t\n\t}", "protected function localValidation()\n\t\t{\n\t\t}", "function after_change()\n\t{\n\t\treturn true;\n\t}", "public function performChecks(){\n\t\t\n\t}", "protected function prepareForValidation()\n {\n // no default action\n }", "protected function _afterLoad()\n {\n\n $value = $this->getValue();\n $value = $this->currencyexponent->makeArrayFieldValue($value);\n $this->setValue($value);\n }", "public function ensureDefaultKeys() {}", "protected function afterUpdating()\n {\n }", "public function afterLoadRegisterControlsUI(){\n\t\t\n\t}", "public function checkSetup()\n {\n if ($this->itemType == \"\") {\n die(\"No itemType provided!\");\n }\n if ($this->classPathBase == \"\") {\n die(\"No classPathBase provided!\");\n }\n if ($this->listView == \"\" && empty($this->listNames)) {\n die(\"Provide either a list view OR fields!\");\n }\n if ($this->createView == \"\" && empty($this->editSettings)) {\n die(\"No create view OR editSettings provided!\");\n }\n\n if (! empty($this->editSettings)) {\n $fields = ['label','type'];\n foreach ($this->editSettings as $key => $es) {\n foreach ($fields as $f) {\n if (empty($es[$f])) {\n die(\"An edit parameter - {$f} - is missing or blank in your config for \\\"{$key}\\\".\");\n }\n }\n }\n }\n }", "protected function setDefaultValues()\n {\n parent::setDefaultValues();\n\t}", "public function setUp()\n {\n $this->paramErrors = new ParamErrors();\n }", "public function setup()\n {\n //\n // we need to make sure that it is empty at the start of every\n // test\n InvokeMethod::onString(AllMatchingTypesList::class, 'resetCache');\n }", "protected function setDefaults()\n {\n return;\n }", "public function afterFind()\n {\n $this->roles = $this->getRoles();\n }", "public function testRegistrationValuesTooShort(): void { }", "protected function setUp() {\n $this->expectedErrors = [];\n set_error_handler([$this, \"errorHandler\"]);\n }", "public function initCheckInformations()\n\t{\n\t\t$this->collCheckInformations = array();\n\t}", "protected function setupDefaultsRules()\n { }", "public function afterLoad() { }", "public function afterRegistry()\n {\n parent::afterRegistry();\n\n $this->addColumn(new \\Zend_Db_Expr(sprintf(\n \"CASE WHEN gla_by IS NULL THEN '%s'\n ELSE CONCAT(\n COALESCE(gsf_last_name, '-'),\n ', ',\n COALESCE(CONCAT(gsf_first_name, ' '), ''),\n COALESCE(gsf_surname_prefix, '')\n )\n END\",\n $this->_('(no user)')\n )), 'staff_name');\n $this->addColumn(new \\Zend_Db_Expr(sprintf(\n \"CASE WHEN grs_id_user IS NULL THEN '%s'\n ELSE CONCAT(\n COALESCE(grs_last_name, '-'),\n ', ',\n COALESCE(CONCAT(grs_first_name, ' '), ''),\n COALESCE(grs_surname_prefix, '')\n )\n END\",\n $this->_('(no respondent)')\n )), 'respondent_name');\n }", "public function checkRegistryRequestsAnswers()\n {\n return $this->tracker && $this->translate && $this->util;\n }", "protected function MetaAfterLoad() {\n\t\t}", "public function validateResolved()\n {\n $this->addRequestChecks();\n\n parent::validateResolved();\n }", "protected function populate_value()\n {\n }", "public function after_run(){}", "protected function after(): void\n {\n }", "protected function after(){\n\n }", "protected function checkUnsetProperties()\r\n {\r\n $ar = get_object_vars($this);\r\n if (self::$DEBUG)\r\n {\r\n //echo \"Object Vars:\" .PHP_EOL;\r\n // var_dump(get_object_vars($this));\r\n }\r\n foreach ($ar as $key => $val) {\r\n if (!isset($ar[$key]))\r\n trigger_error(\"{$key} not set in \" . get_class($this) . \". Try setting the value in __construct method.\");\r\n }\r\n }", "public function after_setup_theme()\n {\n }", "protected function preValidate() {}", "function ajb_options_init(){\n\tregister_setting( 'ajb_option_group', 'ajb_options', 'ajb_options_validate' );\n}", "public function cfields_setup_restore()\r\n {\r\n $this->fields = self::custom_fields();\r\n }", "private static function setup() {\n if(!isset(self::$settings)) {\n require 'regain/global_settings.php';\n self::$settings = $settings;\n }\n }", "protected function _after()\n {\n putenv('APM_ACTIVE');\n putenv('APM_APPNAME');\n putenv('APM_APPVERSION');\n putenv('APM_ENVIRONMENT');\n putenv('APM_SERVERURL');\n putenv('APM_SECRETTOKEN');\n putenv('APM_USEROUTEURI');\n putenv('APM_MAXTRACEITEMS');\n putenv('APM_BACKTRACEDEPTH');\n putenv('APM_QUERYLOG');\n putenv('APM_THRESHOLD');\n\n putenv('ELASTIC_APM_ENABLED');\n putenv('ELASTIC_APM_SERVICE_NAME');\n putenv('ELASTIC_APM_SERVER_URL');\n putenv('ELASTIC_APM_SERVICE_VERSION');\n putenv('ELASTIC_APM_SECRET_TOKEN');\n putenv('ELASTIC_APM_HOSTNAME');\n putenv('ELASTIC_APM_STACK_TRACE_LIMIT');\n putenv('ELASTIC_APM_TRANSACTION_SAMPLE_RATE');\n }" ]
[ "0.68310964", "0.6183567", "0.6080569", "0.58820194", "0.5874268", "0.5823956", "0.57339865", "0.5690948", "0.56816816", "0.5657382", "0.56545395", "0.5621424", "0.56193453", "0.55444795", "0.55439675", "0.55289674", "0.55206746", "0.54871184", "0.5470702", "0.5470258", "0.544616", "0.5436105", "0.54311216", "0.541076", "0.54021657", "0.5398025", "0.5385745", "0.538043", "0.53770137", "0.5362182", "0.5361189", "0.5359482", "0.5358447", "0.53521675", "0.53478026", "0.5345299", "0.5345299", "0.5329674", "0.53277373", "0.53250957", "0.53166735", "0.5310185", "0.53025264", "0.53025264", "0.52990764", "0.5296795", "0.5288966", "0.528777", "0.5283879", "0.5281952", "0.5276027", "0.52640104", "0.52602124", "0.52453536", "0.5242072", "0.5237109", "0.5223161", "0.5207754", "0.52025956", "0.5200318", "0.5199833", "0.5199833", "0.5199833", "0.51994497", "0.51990837", "0.51927084", "0.5176582", "0.5169931", "0.5168818", "0.51670957", "0.5155507", "0.5154733", "0.5152668", "0.51405215", "0.5140446", "0.51297283", "0.5129569", "0.51240706", "0.5107572", "0.5107212", "0.510297", "0.5097006", "0.5095959", "0.5094051", "0.5091217", "0.5090098", "0.50899035", "0.50879973", "0.5085971", "0.5083005", "0.5073465", "0.5065182", "0.506507", "0.5065012", "0.50601697", "0.5056229", "0.50500005", "0.5047035", "0.50463635", "0.5043581" ]
0.61463535
2
A ModelAbstract>setOnSave() function that returns the input date as a valid date.
public function calcultateAndCheckName($value, $isNew = false, $name = null, array $context = array()) { return substr($this->calcultateName($value, $isNew, $name, $context), 0, $this->_maxNameCalcLength); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save()\n\t{\n\t\tif ( ! isset($this->object['date_created']))\n\t\t\t$this->date_created = time();\n\n\t\treturn parent::save();\n\t}", "public function save()\n {\n if ( ! $start_date = $this->getData(\"start_date\"))\n {\n $start_date = time();\n }\n\n $start_date = strtotime($start_date);\n $this->setData(\"start_date\", date(\"Y-m-d\", $start_date));\n\n // We only need to do end dates if they are provided.\n if ($end_date = $this->getData(\"end_date\"))\n {\n $end_date = strtotime($end_date);\n $this->setData(\"end_date\", date(\"Y-m-d\", $end_date));\n }\n else\n {\n $this->setData(\"end_date\", NULL);\n }\n\n parent::save();\n }", "public function save() {\n\t\tif (!$this->created)\n\t\t\t$this->created = date('Y-m-d H:i:s');\n\t\treturn parent::save();\n\t}", "public function save_dates() {\n\t\t// Nothing to do here.\n\t}", "protected function beforeSave() {\n $this->formatDate('date', DomainConst::DATE_FORMAT_BACK_END, DomainConst::DATE_FORMAT_DB);\n $this->formatDate('compensatory_date', DomainConst::DATE_FORMAT_BACK_END, DomainConst::DATE_FORMAT_DB);\n \n if ($this->isNewRecord) {\n $this->created_by = Yii::app()->user->id;\n \n // Handle created date\n $this->created_date = CommonProcess::getCurrentDateTime();\n }\n \n return parent::beforeSave();\n }", "public function setDate($date);", "public function makeDate(Model $model)\n {\n if ($model->usesTimestamps()) {\n $column = $model->getUpdatedAtColumn();\n return $model->$column;\n }\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'date' => 'required',\n 'model_id'=>'required'\n\n ]);\n\n $date =new Date() ;\n $date->date = request('date');\n $date->model_id = request('model_id');\n\n $date->save();\n\n return redirect('admin/date')->with('success',trans('lang.saveb')); }", "protected function beforeSave()\n {\n// $this->create_time = strtotime($this->create_time);\n return parent::beforeSave();\n }", "public abstract function save();", "public function beforeSave() {\n foreach ($this->dateFields as $item) {\n $this->data[$this->name][$item] = $this->_date4Db($this->data[$this->name][$item]);\n }\n return parent::beforeSave();\n }", "public function setInput_date($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->input_date !== null || $dt !== null) {\n if ($this->input_date === null || $dt === null || $dt->format(\"Y-m-d H:i:s.u\") !== $this->input_date->format(\"Y-m-d H:i:s.u\")) {\n $this->input_date = $dt === null ? null : clone $dt;\n $this->modifiedColumns[BiblioTableMap::COL_INPUT_DATE] = true;\n }\n } // if either are not null\n\n return $this;\n }", "protected function _beforeSave()\n {\n if (!$this->hasCreatedAt()) {\n $this->setCreatedAt($this->_getResource()->formatDate(time(), true));\n }\n\n return parent::_beforeSave();\n }", "protected function beforeSave()\r\n \t{\r\n \t\tif (parent::beforeSave()) {\r\n \t\t\tif (!empty($this->date_open)) {\r\n \t\t\t\tif (!is_numeric($this->date_open)) {\r\n \t\t\t\t\t$this->date_open = strtotime($this->date_open);\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\tif (!empty($this->date_close)) {\r\n \t\t\t\tif (!is_numeric($this->date_close)) {\r\n \t\t\t\t\t$this->date_close = strtotime($this->date_close);\r\n \t\t\t\t}\r\n \t\t\t}\r\n\r\n \t\t\t// auto deal with date added and date modified\r\n \t\t\tif ($this->isNewRecord) {\r\n \t\t\t\t$this->date_added = $this->date_modified = time();\r\n \t\t\t} else {\r\n \t\t\t\t$this->date_modified = time();\r\n \t\t\t}\r\n\r\n \t\t\t// json\r\n \t\t\t$this->json_structure = json_encode($this->jsonArray_structure);\r\n \t\t\tif ($this->json_structure == 'null') {\r\n \t\t\t\t$this->json_structure = null;\r\n \t\t\t}\r\n \t\t\t$this->json_stage = json_encode($this->jsonArray_stage);\r\n \t\t\tif ($this->json_stage == 'null') {\r\n \t\t\t\t$this->json_stage = null;\r\n \t\t\t}\r\n \t\t\t$this->json_event_mapping = json_encode($this->jsonArray_event_mapping);\r\n \t\t\tif ($this->json_event_mapping == 'null') {\r\n \t\t\t\t$this->json_event_mapping = null;\r\n \t\t\t}\r\n \t\t\t$this->json_extra = json_encode($this->jsonArray_extra);\r\n \t\t\tif ($this->json_extra == 'null') {\r\n \t\t\t\t$this->json_extra = null;\r\n \t\t\t}\r\n\r\n \t\t\t// save as null if empty\r\n \t\t\tif (empty($this->slug)) {\r\n \t\t\t\t$this->slug = null;\r\n \t\t\t}\r\n \t\t\tif (empty($this->json_structure)) {\r\n \t\t\t\t$this->json_structure = null;\r\n \t\t\t}\r\n \t\t\tif (empty($this->json_stage)) {\r\n \t\t\t\t$this->json_stage = null;\r\n \t\t\t}\r\n \t\t\tif (empty($this->text_short_description)) {\r\n \t\t\t\t$this->text_short_description = null;\r\n \t\t\t}\r\n \t\t\tif (empty($this->timezone)) {\r\n \t\t\t\t$this->timezone = null;\r\n \t\t\t}\r\n \t\t\tif (empty($this->text_note)) {\r\n \t\t\t\t$this->text_note = null;\r\n \t\t\t}\r\n \t\t\tif (empty($this->json_event_mapping)) {\r\n \t\t\t\t$this->json_event_mapping = null;\r\n \t\t\t}\r\n \t\t\tif (empty($this->json_extra)) {\r\n \t\t\t\t$this->json_extra = null;\r\n \t\t\t}\r\n\r\n \t\t\treturn true;\r\n \t\t} else {\r\n \t\t\treturn false;\r\n \t\t}\r\n \t}", "abstract public function save(Model $model): Model;", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "public function save($model, $value, $loaded)\n\t{\n\t\tif (( ! $loaded AND $this->auto_now_create) OR ($loaded AND $this->auto_now_update))\n\t\t{\n\t\t\t$value = time();\n\t\t}\n\n\t\t// Convert if necessary\n\t\tif ($this->format)\n\t\t{\n\t\t\t$value = date($this->format, $value);\n\t\t}\n\n\t\treturn $value;\n\t}", "public function setDateDuJour()\n{\n$this->setDateSysteme(date(\"Y-m-d\"));\n$this->setDateUtilisateur(date(\"d/m/Y\"));\n}", "private function date ($param)\n {\n $this->type = 'date';\n $time = strtotime($this->value);\n if (FALSE === $time)\n {\n $this->SetError('date', 'The '.$this->SpacedKey.' field must be a valid date');\n return false;\n }\n return true;\n }", "public function test_datefield_gets_converted_to_ar_datetime()\n {\n $author = Author::first();\n $author->some_date = new DateTime();\n $author->save();\n\n $author = Author::first();\n $this->assertInstanceOf('ActiveRecord\\\\DateTime', $author->some_date);\n }", "public function getFormatedDateAttribute() {\n return date('d.m.Y', strtotime($this->date));\n }", "protected function beforeSave()\n {\n if ($this->isNewRecord) \n $this->date_created = date('Y-m-d H:i:s');\n \n return parent::beforeSave();\n }", "public function save_the_date( $post_id ) {\n\t\t \n\t\t // If the user has permission to save the meta data...\n\t\t if( $this->user_can_save( $post_id, 'wp-jquery-date-picker-nonce' ) ) { \n\t\t \n\t\t \t// Delete any existing meta data for the owner\n\t\t\tif( get_post_meta( $post_id, 'the_date' ) ) {\n\t\t\t\tdelete_post_meta( $post_id, 'the_date' );\n\t\t\t} // end if\n\t\t\tupdate_post_meta( $post_id, 'the_date', strip_tags( $_POST[ 'the_date' ] ) );\t\t\t\n\t\t\t \n\t\t } // end if\n\t\t \n\t }", "public function insertDate()\n {\n //\n }", "protected function beforeSave()\n \t{\n \t\tif (parent::beforeSave()) {\n \t\t\tif (!empty($this->date_started)) {\n \t\t\t\tif (!is_numeric($this->date_started)) {\n \t\t\t\t\t$this->date_started = strtotime($this->date_started);\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (!empty($this->date_ended)) {\n \t\t\t\tif (!is_numeric($this->date_ended)) {\n \t\t\t\t\t$this->date_ended = strtotime($this->date_ended);\n \t\t\t\t}\n \t\t\t}\n\n \t\t\t// auto deal with date added and date modified\n \t\t\tif ($this->isNewRecord) {\n \t\t\t\t$this->date_added = $this->date_modified = time();\n \t\t\t} else {\n \t\t\t\t$this->date_modified = time();\n \t\t\t}\n\n \t\t\t// json\n \t\t\t$this->json_extra = json_encode($this->jsonArray_extra);\n \t\t\tif ($this->json_extra == 'null') {\n \t\t\t\t$this->json_extra = null;\n \t\t\t}\n\n \t\t\t// save as null if empty\n \t\t\tif (empty($this->slug)) {\n \t\t\t\t$this->slug = null;\n \t\t\t}\n \t\t\tif (empty($this->text_oneliner)) {\n \t\t\t\t$this->text_oneliner = null;\n \t\t\t}\n \t\t\tif (empty($this->text_short_description)) {\n \t\t\t\t$this->text_short_description = null;\n \t\t\t}\n \t\t\tif (empty($this->image_logo)) {\n \t\t\t\t$this->image_logo = null;\n \t\t\t}\n \t\t\tif (empty($this->date_started) && $this->date_started !== 0) {\n \t\t\t\t$this->date_started = null;\n \t\t\t}\n \t\t\tif (empty($this->date_ended) && $this->date_ended !== 0) {\n \t\t\t\t$this->date_ended = null;\n \t\t\t}\n \t\t\tif (empty($this->json_extra)) {\n \t\t\t\t$this->json_extra = null;\n \t\t\t}\n \t\t\tif (empty($this->date_added) && $this->date_added !== 0) {\n \t\t\t\t$this->date_added = null;\n \t\t\t}\n \t\t\tif (empty($this->date_modified) && $this->date_modified !== 0) {\n \t\t\t\t$this->date_modified = null;\n \t\t\t}\n\n \t\t\treturn true;\n \t\t} else {\n \t\t\treturn false;\n \t\t}\n \t}", "public function beforeSave(){\n //$this->updated = date('Y-m-d H:i:s');\n return parent::beforeSave();\n }", "public function save(PropelPDO $con = null)\n {\n if ($this->isNew()) $this->setReportDate(time());\n\n return parent::save($con);\n }", "public function testSaveWrongDate()\n\t{\n\t\ttry{\n\t\t\t$result = $this->Employee->save(\n\t\t\t\tarray('id' => '2', 'birthday' => '01-01-2001', 'salary' => '650.30')\n\t\t\t);\n\n\t\t\t$this->assertFalse($result);\n\t\t}\n\t\tcatch(LocaleException $e)\n\t\t{\n\t\t\t$this->assertEqual($e->getMessage(), 'Data inválida para localização');\n\t\t}\n\t}", "function uiToDBdate() {\r\n\r\n\t\t$month = (int) substr($this->date, -10, 2);\r\n\t\t$day = (int) substr($this->date, -7, 2);\r\n\t\t$year = (int) substr($this->date, -4, 4);\r\n\r\n\t\t$formattedDate = $year . \"-\" . $month . \"-\" . $day;\r\n\r\n\t\t$this->date = $formattedDate;\r\n\t}", "#[Property('date')]\n\tprotected function getDateExt(): Date|string {\n\t\treturn new Date($this);\n\t}", "protected function saveDate()\n\t{\n\t\t$this->year = FilterSingleton::number($_POST['year']);\n\t\t$this->month = FilterSingleton::number($_POST['month']); \n\n\t\tif($this->year !== 0 && $this->month !== 0){\n\t\t\tsetcookie(\"date\", json_encode([$this->year, $this->month]), time()+3600, '/');\n\t\t}\n\t\telse {\n\t\t\tif( isset($_COOKIE['date']) ){\n\t\t\t\t$date = json_decode($_COOKIE['date'], true);\n\t\t\t\t$this->year = $date[0];\n\t\t\t\t$this->month = $date[1];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->year = getdate()['year'];\n\t\t\t\t$this->month = getdate()['mon'];\n\t\t\t}\n\t\t}\n\t}", "private function validateDate($value) {\n\n is_a($value, 'DateTime') ||\n $value = strtotime($value);\n\n $value = date('Y-m-d', $value);\n\n if (!$value)\n $this->errors[] = 'Date ' . $value . ' is not a valid date';\n\n return $value;\n\n }", "public function setDateAttribute($input)\n {\n if ($input != null && $input != '') {\n $this->attributes['date'] = Carbon::createFromFormat(config('app.date_format'), $input)->format('Y-m-d');\n } else {\n $this->attributes['date'] = null;\n }\n }", "public function setDateAttribute($input)\n {\n if ($input != null && $input != '') {\n $this->attributes['date'] = Carbon::createFromFormat(config('app.date_format'), $input)->format('Y-m-d');\n } else {\n $this->attributes['date'] = null;\n }\n }", "public function Date()\n {\n $action = 'rakelley\\jhframe\\classes\\ArgumentValidator';\n $arguments = [\n 'requires' => [\n 'date' => ['filters' => ['date' => 'Y-m-d']],\n ],\n 'method' => 'post',\n ];\n\n $result = $this->actionController->executeAction($action, $arguments);\n $content = ($result->getSuccess()) ?:\n 'Field must be a valid \"YYYY-MM-DD\" Date';\n\n $result->setContent($content)\n ->Render();\n }", "public function save() {\n $this->lastModified = new \\DateTime();\n parent::save();\n }", "public function save($validate = null);", "public function sanitizarFecha($fecha)\n{\n $date = date_create($fecha);\n return date_format($date,'Y-m-d');\n}", "public function sanitizarFecha($fecha)\n{\n $date = date_create($fecha);\n return date_format($date,'Y-m-d');\n}", "public function sanitizarFecha($fecha)\n{\n $date = date_create($fecha);\n return date_format($date,'Y-m-d');\n}", "public function sanitizarFecha($fecha)\n{\n $date = date_create($fecha);\n return date_format($date,'Y-m-d');\n}", "public function sanitizarFecha($fecha)\n{\n $date = date_create($fecha);\n return date_format($date,'Y-m-d');\n}", "public function save() {\r\n $data = array(\r\n 'HolidayDate' => date('Y-m-d', strtotime($this->input->post('HolidayDate'))),\r\n 'Category' => $this->Category\r\n );\r\n $this->db->insert('tbl_holidays', $data);\r\n }", "public function saveBirthDate()\n {\n $this->updateValue(\n 'birth_date',\n $this->birthDate,\n 'Customer birth date updated successfully.'\n );\n\n $this->birthDateUpdate = false;\n $this->birthDateFormatted = $this->customer->birth_date_formatted;\n }", "public function setCreateDate($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->create_date !== null || $dt !== null) {\n $currentDateAsString = ($this->create_date !== null && $tmpDt = new DateTime($this->create_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '2021-06-07 11:49:57') // or the entered value matches the default\n ) {\n $this->create_date = $newDateAsString;\n $this->modifiedColumns[] = SanitasiPeer::CREATE_DATE;\n }\n } // if either are not null\n\n\n return $this;\n }", "abstract public function save(Model $model);", "public function setDateOfBirth()\n {\n $dateOfBirth = request('dob_year') . '-' . request('dob_month') . '-' . request('dob_day');\n\n $this->date_of_birth = $dateOfBirth;\n $this->save();\n }", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save()\n\t{\n\t\tself::$db->model = $this;\n\t\t$boolean = $this->validate();\n\t\tif($boolean){\n\t\t\treturn self::$db->saveNow();\n\t\t}\n\t}", "public static final function save ($prDate)\n {\n\n $format = 'Y-m-d';\n\n if (strpos($prDate, ':') !== false)\n {\n\n $format .= ' H:i:s';\n\n }\n\n return $prDate != NULL ? date ($format,strtotime(str_replace('/','-',$prDate))) : NULL;\n\n }", "public function save(array $options = array())\n {\n $this->upd_date = Carbon::now()->format('Y-m-d H:i:s');\n return parent::save($options);\n }", "protected function _beforeSave()\n\t{\n\t\tparent::_beforeSave();\n\n $date = Mage::getModel('core/date')->date('Y-m-d H:i:s');\n\t\tif ($this->isObjectNew()) {\n\t\t\t$this->setCreatedAt($date);\n\t\t\t$this->setUpdatedAt($date);\n\t\t} else {\n\t\t\t$this->setUpdatedAt($date);\n\t\t}\t\n\t\t\n\t\treturn $this;\n\t}", "public\n\tfunction setPostDate($newPostDate = null): void {\n\t\t// base case: if the date is null, use the current date and time\n\t\tif($newPostDate === null) {\n\t\t\t$this->postDate = new \\DateTime();\n\t\t\treturn;\n\t\t}\n\n\n\n\t//store the like date using the ValidateDate trait\n\ttry {\n\t\t$newPostDate = self::validateDateTime($newPostDate);\n\t} catch(\\InvalidArgumentException |\\RangeException $exception) {\n\t\t$exceptionType = get_class($exception);\n\t\tthrow(new $exceptionType($exception->getMessage(), 0, $exception));\n\t}\n\t$this->postDate = $newPostDate;\n\n}", "function format_date_form_field($model, $field, $default = 'MM/DD/YYYY')\n{\n $oldDate = old($field);\n\n if ($oldDate) {\n return $oldDate;\n }\n\n $attribute = $model->getAttribute($field);\n\n if ($attribute && $attribute instanceof Carbon) {\n return $attribute->format('Y-m-d');\n }\n\n return $default;\n}", "public function getEffectiveDate(): DateTimeInterface;", "function engagements_save_date( $post_id ){\n\tif ( !isset( $_POST['engagements_date_box_nonce'] ) || !wp_verify_nonce( $_POST['engagements_date_box_nonce'], basename( __FILE__ ) ) ){\n\treturn;}\n \n // Check the user's permissions.\nif ( ! current_user_can( 'edit_post', $post_id ) ){\n\treturn;\n}\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {\n return $post->ID;\n}\n //save value\n if ( isset( $_REQUEST['engagements_date'] ) ) {\n\tupdate_post_meta( $post_id, '_engagements_date', sanitize_text_field( $_POST['engagements_date'] ) );\n}\n \n}", "public function getStarthiredateinputThAttribute(){\n return date('d/m/' , strtotime( $this->starthiredate ) ).(date('Y',strtotime($this->starthiredate))+543);\n }", "function dateToDBDate($date)\n\t{\n\n\t\tif (is_numeric($date))\n\t\t{\n\t\t\treturn date('Y-m-d', $date);\n\t\t}\n\t\telse if (preg_match('/\\d{2}\\.\\d{2}\\.\\d{4}/', $date))\n\t\t{\n\t\t\t$arDate = explode('.', $date);\n\n\t\t\treturn $arDate[2].'-'.$arDate[1].'-'.$arDate[0];\n\t\t}\n\t\telse if (strtotime($date) > 0)\n\t\t{\n\t\t\treturn date('Y-m-d', strtotime($date));\n\t\t}\n\n\t\treturn '0000-00-00';\n\n\t}", "public function onSave()\n {\n if ($this->getPerson()->getEmail() === null) {\n throw new \\RuntimeException(\n 'A user entity\\'s related Person\\'s email property cannot be null'\n );\n }\n if (! $this->id) {\n $this->created = new \\DateTime();\n }\n }", "public function getDueDate(): DateTimeInterface;", "protected function beforeSave() {\n $date = $this->month;\n $this->month = CommonProcess::convertDateTime($date, DomainConst::DATE_FORMAT_13, DomainConst::DATE_FORMAT_4);\n if ($this->isNewRecord) {\n $this->created_by = Yii::app()->user->id;\n \n // Handle created date\n $this->created_date = CommonProcess::getCurrentDateTime();\n }\n $this->amount = str_replace(DomainConst::SPLITTER_TYPE_2, '', $this->amount);\n \n return parent::beforeSave();\n }", "public function convert($new_mask, $save = true)\n {\n $newdate = adodb_date($new_mask, $this->date_time_stamp);\n //if they want to save and apply this new mask to $this->date_time, save it\n if ($save == true) {\n $this->date_time_mask = $new_mask;\n $this->date_time = $newdate;\n }\n return $newdate;\n }", "public function dateTime()\n {\n $action = 'rakelley\\jhframe\\classes\\ArgumentValidator';\n $arguments = [\n 'requires' => [\n 'date' => ['filters' => ['date' => 'Y-m-d H:i:s']],\n ],\n 'method' => 'post',\n ];\n\n $result = $this->actionController->executeAction($action, $arguments);\n $content = ($result->getSuccess()) ?:\n 'Field must be a valid \"YYYY-MM-DD HH:MM:SS\" Date';\n\n $result->setContent($content)\n ->Render();\n }", "public function setCreateDate($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->create_date !== null || $dt !== null) {\n $currentDateAsString = ($this->create_date !== null && $tmpDt = new DateTime($this->create_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '2020-04-16 09:40:03') // or the entered value matches the default\n ) {\n $this->create_date = $newDateAsString;\n $this->modifiedColumns[] = SekolahPaudPeer::CREATE_DATE;\n }\n } // if either are not null\n\n\n return $this;\n }", "public function beforeSave()\n {\n $this->CreatedAt = new \\DateTime('now', new \\DateTimeZone('UTC'));\n }", "public function save(array $options = array(),\n array $rules = array(),\n array $customMessages = array()\n ) {\n foreach ($this->dates as $date) {\n if ( ! $this->isDirty($date)) {\n $this->attributes[$date] = $this->asDateTime($this->attributes[$date])->toDateString();\n }\n }\n\n $this->validate($rules, $customMessages);\n // Convert to UTCDateTime before of save the model\n foreach ($this->dates as $date) {\n $this->attributes[$date] = $this->fromDateTime($this->attributes[$date]);\n }\n\n try {\n return parent::save($options);\n } catch (\\Exception $e) {\n Log::info('Error saving data: ' . $e->getMessage());\n throw new \\Exception('An internal error occurred during saving data.');\n }\n }", "public function beforeSave() {\n if( parent::beforeSave() ) {\n $this->createdAt = date( \"Y-m-d H:i:s\" );\n $this->email = strtolower( $this->email );\n return true;\n }\n return false;\n }", "public function beforeSave() {\n if ($this->isNewRecord) {\n $this->created_date = new CDbExpression(\"now()\");\n }\n $this->updated_date = new CDbExpression(\"now()\");\n\n return true;\n }", "public function save() {}", "public function save() {}", "public function save() {}", "public function setPreferredDate($v)\n\t{\n\t\t// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')\n\t\t// -- which is unexpected, to say the least.\n\t\tif ($v === null || $v === '') {\n\t\t\t$dt = null;\n\t\t} elseif ($v instanceof DateTime) {\n\t\t\t$dt = $v;\n\t\t} else {\n\t\t\t// some string/numeric value passed; we normalize that so that we can\n\t\t\t// validate it.\n\t\t\ttry {\n\t\t\t\tif (is_numeric($v)) { // if it's a unix timestamp\n\t\t\t\t\t$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));\n\t\t\t\t\t// We have to explicitly specify and then change the time zone because of a\n\t\t\t\t\t// DateTime bug: http://bugs.php.net/bug.php?id=43003\n\t\t\t\t\t$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));\n\t\t\t\t} else {\n\t\t\t\t\t$dt = new DateTime($v);\n\t\t\t\t}\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->preferred_date !== null || $dt !== null ) {\n\t\t\t// (nested ifs are a little easier to read in this case)\n\n\t\t\t$currNorm = ($this->preferred_date !== null && $tmpDt = new DateTime($this->preferred_date)) ? $tmpDt->format('Y-m-d') : null;\n\t\t\t$newNorm = ($dt !== null) ? $dt->format('Y-m-d') : null;\n\n\t\t\tif ( ($currNorm !== $newNorm) // normalized values don't match \n\t\t\t\t\t)\n\t\t\t{\n\t\t\t\t$this->preferred_date = ($dt ? $dt->format('Y-m-d') : null);\n\t\t\t\t$this->modifiedColumns[] = VpoRequestPeer::PREFERRED_DATE;\n\t\t\t}\n\t\t} // if either are not null\n\n\t\treturn $this;\n\t}", "public function requireDate($key, $allowEmpty = false)\n {\n\n $value = trim($this->getParam($key));\n if(empty($value) && $allowEmpty){\n return trim($value);\n }\n\n $unixTimeStamp = strtotime($value);\n if(!$unixTimeStamp){\n throw new InvalidParameterException($key, $value, __FUNCTION__);\n }\n\n return date(\"Y-m-d\", $unixTimeStamp);\n }", "protected function beforeSave() {\n if (parent::beforeSave()) {\n if ($this->isNewRecord) {\n $this->created_date = $this->updated_date = date('Y-m-d');\n $this->created_by = Yii::app()->user->id;\n } else {\n $this->updated_by = Yii::app()->user->id;\n $this->updated_date = date('Y-m-d');\n }\n return true;\n } else\n return false;\n }", "public function setRequestPostedDate($v)\n\t{\n\t\t// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')\n\t\t// -- which is unexpected, to say the least.\n\t\tif ($v === null || $v === '') {\n\t\t\t$dt = null;\n\t\t} elseif ($v instanceof DateTime) {\n\t\t\t$dt = $v;\n\t\t} else {\n\t\t\t// some string/numeric value passed; we normalize that so that we can\n\t\t\t// validate it.\n\t\t\ttry {\n\t\t\t\tif (is_numeric($v)) { // if it's a unix timestamp\n\t\t\t\t\t$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));\n\t\t\t\t\t// We have to explicitly specify and then change the time zone because of a\n\t\t\t\t\t// DateTime bug: http://bugs.php.net/bug.php?id=43003\n\t\t\t\t\t$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));\n\t\t\t\t} else {\n\t\t\t\t\t$dt = new DateTime($v);\n\t\t\t\t}\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->request_posted_date !== null || $dt !== null ) {\n\t\t\t// (nested ifs are a little easier to read in this case)\n\n\t\t\t$currNorm = ($this->request_posted_date !== null && $tmpDt = new DateTime($this->request_posted_date)) ? $tmpDt->format('Y-m-d') : null;\n\t\t\t$newNorm = ($dt !== null) ? $dt->format('Y-m-d') : null;\n\n\t\t\tif ( ($currNorm !== $newNorm) // normalized values don't match \n\t\t\t\t\t)\n\t\t\t{\n\t\t\t\t$this->request_posted_date = ($dt ? $dt->format('Y-m-d') : null);\n\t\t\t\t$this->modifiedColumns[] = VpoRequestPeer::REQUEST_POSTED_DATE;\n\t\t\t}\n\t\t} // if either are not null\n\n\t\treturn $this;\n\t}", "function validate_date() {\n # Check the date is in ISO date format\n if (ereg('(19|20)[0-9]{2}[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])', $this->cur_val)) {\n # Remove any existing error message\n $this->error_message = \"\";\n\n # Return Value\n return $this->cur_val;\n }\n else {\n # Set Error Message\n $this->set_error(\"Validation for date ({$this->cur_val}) failed. This is type \" . gettype($this->cur_val));\n\n # Return Blank Date\n return \"0000-00-00\";\n }\n }", "public function getWillSave() {}", "protected function beforeSave()\r\n\t{\r\n\t\tif(parent::beforeSave())\r\n\t\t{\r\n\t\t\tif($this->isNewRecord)\r\n\t\t\t{\r\n\t\t\t\t$this->created=date('Y-m-d H:i:s');\r\n $this->updated=date('Y-m-d H:i:s');\r\n\t\t\t\t$this->user_id=Yii::app()->user->id;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$this->updated=date('Y-m-d H:i:s');\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}", "public function beforeSave()\n\t{\n\t\t//Set null for empty field in table\n\t\tif($this->sale_date=='') $this->sale_date = NULL;\n\t\tif($this->next_sale_date=='') $this->next_sale_date = NULL;\n\t\treturn true;\n\t}", "public function beforeSave()\n {\n $this->created = new \\DateTime('now', new \\DateTimeZone('UTC'));\n }" ]
[ "0.63212705", "0.62854666", "0.6247112", "0.6004694", "0.5854927", "0.5808116", "0.57486296", "0.57179886", "0.57044554", "0.5703642", "0.56785107", "0.5657695", "0.562837", "0.56162703", "0.5582937", "0.55817187", "0.55817187", "0.55817187", "0.55817187", "0.55817187", "0.557783", "0.55746436", "0.5557867", "0.55503964", "0.5539387", "0.5515174", "0.5514157", "0.55064464", "0.5502802", "0.54998857", "0.5494613", "0.5485172", "0.54782057", "0.54743254", "0.54669833", "0.54640335", "0.54572713", "0.54572713", "0.5451522", "0.5451013", "0.54471296", "0.54273146", "0.54273146", "0.54273146", "0.54273146", "0.54273146", "0.5391007", "0.5390655", "0.538793", "0.5372007", "0.53129023", "0.53033894", "0.53033894", "0.53033894", "0.53033894", "0.53033894", "0.53033894", "0.53033894", "0.53033894", "0.53033894", "0.53033894", "0.53033894", "0.53033894", "0.53033894", "0.53033894", "0.53033894", "0.53033894", "0.53033894", "0.53033894", "0.5299697", "0.5296582", "0.52803797", "0.52792585", "0.52724385", "0.5250352", "0.52477676", "0.5245207", "0.52437764", "0.5238084", "0.52359533", "0.5233937", "0.52327317", "0.5230774", "0.5221814", "0.52164817", "0.52153164", "0.5208821", "0.52063763", "0.5201826", "0.5189219", "0.5189219", "0.51885617", "0.5187837", "0.51839185", "0.51821196", "0.5172342", "0.5165987", "0.5164865", "0.5163299", "0.5157571", "0.51527953" ]
0.0
-1
A ModelAbstract>setOnSave() function that returns the input date as a valid date.
abstract public function calcultateName($value, $isNew = false, $name = null, array $context = array());
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save()\n\t{\n\t\tif ( ! isset($this->object['date_created']))\n\t\t\t$this->date_created = time();\n\n\t\treturn parent::save();\n\t}", "public function save()\n {\n if ( ! $start_date = $this->getData(\"start_date\"))\n {\n $start_date = time();\n }\n\n $start_date = strtotime($start_date);\n $this->setData(\"start_date\", date(\"Y-m-d\", $start_date));\n\n // We only need to do end dates if they are provided.\n if ($end_date = $this->getData(\"end_date\"))\n {\n $end_date = strtotime($end_date);\n $this->setData(\"end_date\", date(\"Y-m-d\", $end_date));\n }\n else\n {\n $this->setData(\"end_date\", NULL);\n }\n\n parent::save();\n }", "public function save() {\n\t\tif (!$this->created)\n\t\t\t$this->created = date('Y-m-d H:i:s');\n\t\treturn parent::save();\n\t}", "public function save_dates() {\n\t\t// Nothing to do here.\n\t}", "protected function beforeSave() {\n $this->formatDate('date', DomainConst::DATE_FORMAT_BACK_END, DomainConst::DATE_FORMAT_DB);\n $this->formatDate('compensatory_date', DomainConst::DATE_FORMAT_BACK_END, DomainConst::DATE_FORMAT_DB);\n \n if ($this->isNewRecord) {\n $this->created_by = Yii::app()->user->id;\n \n // Handle created date\n $this->created_date = CommonProcess::getCurrentDateTime();\n }\n \n return parent::beforeSave();\n }", "public function setDate($date);", "public function makeDate(Model $model)\n {\n if ($model->usesTimestamps()) {\n $column = $model->getUpdatedAtColumn();\n return $model->$column;\n }\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'date' => 'required',\n 'model_id'=>'required'\n\n ]);\n\n $date =new Date() ;\n $date->date = request('date');\n $date->model_id = request('model_id');\n\n $date->save();\n\n return redirect('admin/date')->with('success',trans('lang.saveb')); }", "public abstract function save();", "protected function beforeSave()\n {\n// $this->create_time = strtotime($this->create_time);\n return parent::beforeSave();\n }", "public function beforeSave() {\n foreach ($this->dateFields as $item) {\n $this->data[$this->name][$item] = $this->_date4Db($this->data[$this->name][$item]);\n }\n return parent::beforeSave();\n }", "public function setInput_date($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->input_date !== null || $dt !== null) {\n if ($this->input_date === null || $dt === null || $dt->format(\"Y-m-d H:i:s.u\") !== $this->input_date->format(\"Y-m-d H:i:s.u\")) {\n $this->input_date = $dt === null ? null : clone $dt;\n $this->modifiedColumns[BiblioTableMap::COL_INPUT_DATE] = true;\n }\n } // if either are not null\n\n return $this;\n }", "protected function _beforeSave()\n {\n if (!$this->hasCreatedAt()) {\n $this->setCreatedAt($this->_getResource()->formatDate(time(), true));\n }\n\n return parent::_beforeSave();\n }", "protected function beforeSave()\r\n \t{\r\n \t\tif (parent::beforeSave()) {\r\n \t\t\tif (!empty($this->date_open)) {\r\n \t\t\t\tif (!is_numeric($this->date_open)) {\r\n \t\t\t\t\t$this->date_open = strtotime($this->date_open);\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\tif (!empty($this->date_close)) {\r\n \t\t\t\tif (!is_numeric($this->date_close)) {\r\n \t\t\t\t\t$this->date_close = strtotime($this->date_close);\r\n \t\t\t\t}\r\n \t\t\t}\r\n\r\n \t\t\t// auto deal with date added and date modified\r\n \t\t\tif ($this->isNewRecord) {\r\n \t\t\t\t$this->date_added = $this->date_modified = time();\r\n \t\t\t} else {\r\n \t\t\t\t$this->date_modified = time();\r\n \t\t\t}\r\n\r\n \t\t\t// json\r\n \t\t\t$this->json_structure = json_encode($this->jsonArray_structure);\r\n \t\t\tif ($this->json_structure == 'null') {\r\n \t\t\t\t$this->json_structure = null;\r\n \t\t\t}\r\n \t\t\t$this->json_stage = json_encode($this->jsonArray_stage);\r\n \t\t\tif ($this->json_stage == 'null') {\r\n \t\t\t\t$this->json_stage = null;\r\n \t\t\t}\r\n \t\t\t$this->json_event_mapping = json_encode($this->jsonArray_event_mapping);\r\n \t\t\tif ($this->json_event_mapping == 'null') {\r\n \t\t\t\t$this->json_event_mapping = null;\r\n \t\t\t}\r\n \t\t\t$this->json_extra = json_encode($this->jsonArray_extra);\r\n \t\t\tif ($this->json_extra == 'null') {\r\n \t\t\t\t$this->json_extra = null;\r\n \t\t\t}\r\n\r\n \t\t\t// save as null if empty\r\n \t\t\tif (empty($this->slug)) {\r\n \t\t\t\t$this->slug = null;\r\n \t\t\t}\r\n \t\t\tif (empty($this->json_structure)) {\r\n \t\t\t\t$this->json_structure = null;\r\n \t\t\t}\r\n \t\t\tif (empty($this->json_stage)) {\r\n \t\t\t\t$this->json_stage = null;\r\n \t\t\t}\r\n \t\t\tif (empty($this->text_short_description)) {\r\n \t\t\t\t$this->text_short_description = null;\r\n \t\t\t}\r\n \t\t\tif (empty($this->timezone)) {\r\n \t\t\t\t$this->timezone = null;\r\n \t\t\t}\r\n \t\t\tif (empty($this->text_note)) {\r\n \t\t\t\t$this->text_note = null;\r\n \t\t\t}\r\n \t\t\tif (empty($this->json_event_mapping)) {\r\n \t\t\t\t$this->json_event_mapping = null;\r\n \t\t\t}\r\n \t\t\tif (empty($this->json_extra)) {\r\n \t\t\t\t$this->json_extra = null;\r\n \t\t\t}\r\n\r\n \t\t\treturn true;\r\n \t\t} else {\r\n \t\t\treturn false;\r\n \t\t}\r\n \t}", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save(Model $model): Model;", "public function save($model, $value, $loaded)\n\t{\n\t\tif (( ! $loaded AND $this->auto_now_create) OR ($loaded AND $this->auto_now_update))\n\t\t{\n\t\t\t$value = time();\n\t\t}\n\n\t\t// Convert if necessary\n\t\tif ($this->format)\n\t\t{\n\t\t\t$value = date($this->format, $value);\n\t\t}\n\n\t\treturn $value;\n\t}", "public function setDateDuJour()\n{\n$this->setDateSysteme(date(\"Y-m-d\"));\n$this->setDateUtilisateur(date(\"d/m/Y\"));\n}", "private function date ($param)\n {\n $this->type = 'date';\n $time = strtotime($this->value);\n if (FALSE === $time)\n {\n $this->SetError('date', 'The '.$this->SpacedKey.' field must be a valid date');\n return false;\n }\n return true;\n }", "public function test_datefield_gets_converted_to_ar_datetime()\n {\n $author = Author::first();\n $author->some_date = new DateTime();\n $author->save();\n\n $author = Author::first();\n $this->assertInstanceOf('ActiveRecord\\\\DateTime', $author->some_date);\n }", "public function getFormatedDateAttribute() {\n return date('d.m.Y', strtotime($this->date));\n }", "public function save_the_date( $post_id ) {\n\t\t \n\t\t // If the user has permission to save the meta data...\n\t\t if( $this->user_can_save( $post_id, 'wp-jquery-date-picker-nonce' ) ) { \n\t\t \n\t\t \t// Delete any existing meta data for the owner\n\t\t\tif( get_post_meta( $post_id, 'the_date' ) ) {\n\t\t\t\tdelete_post_meta( $post_id, 'the_date' );\n\t\t\t} // end if\n\t\t\tupdate_post_meta( $post_id, 'the_date', strip_tags( $_POST[ 'the_date' ] ) );\t\t\t\n\t\t\t \n\t\t } // end if\n\t\t \n\t }", "protected function beforeSave()\n {\n if ($this->isNewRecord) \n $this->date_created = date('Y-m-d H:i:s');\n \n return parent::beforeSave();\n }", "public function insertDate()\n {\n //\n }", "protected function beforeSave()\n \t{\n \t\tif (parent::beforeSave()) {\n \t\t\tif (!empty($this->date_started)) {\n \t\t\t\tif (!is_numeric($this->date_started)) {\n \t\t\t\t\t$this->date_started = strtotime($this->date_started);\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (!empty($this->date_ended)) {\n \t\t\t\tif (!is_numeric($this->date_ended)) {\n \t\t\t\t\t$this->date_ended = strtotime($this->date_ended);\n \t\t\t\t}\n \t\t\t}\n\n \t\t\t// auto deal with date added and date modified\n \t\t\tif ($this->isNewRecord) {\n \t\t\t\t$this->date_added = $this->date_modified = time();\n \t\t\t} else {\n \t\t\t\t$this->date_modified = time();\n \t\t\t}\n\n \t\t\t// json\n \t\t\t$this->json_extra = json_encode($this->jsonArray_extra);\n \t\t\tif ($this->json_extra == 'null') {\n \t\t\t\t$this->json_extra = null;\n \t\t\t}\n\n \t\t\t// save as null if empty\n \t\t\tif (empty($this->slug)) {\n \t\t\t\t$this->slug = null;\n \t\t\t}\n \t\t\tif (empty($this->text_oneliner)) {\n \t\t\t\t$this->text_oneliner = null;\n \t\t\t}\n \t\t\tif (empty($this->text_short_description)) {\n \t\t\t\t$this->text_short_description = null;\n \t\t\t}\n \t\t\tif (empty($this->image_logo)) {\n \t\t\t\t$this->image_logo = null;\n \t\t\t}\n \t\t\tif (empty($this->date_started) && $this->date_started !== 0) {\n \t\t\t\t$this->date_started = null;\n \t\t\t}\n \t\t\tif (empty($this->date_ended) && $this->date_ended !== 0) {\n \t\t\t\t$this->date_ended = null;\n \t\t\t}\n \t\t\tif (empty($this->json_extra)) {\n \t\t\t\t$this->json_extra = null;\n \t\t\t}\n \t\t\tif (empty($this->date_added) && $this->date_added !== 0) {\n \t\t\t\t$this->date_added = null;\n \t\t\t}\n \t\t\tif (empty($this->date_modified) && $this->date_modified !== 0) {\n \t\t\t\t$this->date_modified = null;\n \t\t\t}\n\n \t\t\treturn true;\n \t\t} else {\n \t\t\treturn false;\n \t\t}\n \t}", "public function beforeSave(){\n //$this->updated = date('Y-m-d H:i:s');\n return parent::beforeSave();\n }", "public function save(PropelPDO $con = null)\n {\n if ($this->isNew()) $this->setReportDate(time());\n\n return parent::save($con);\n }", "public function testSaveWrongDate()\n\t{\n\t\ttry{\n\t\t\t$result = $this->Employee->save(\n\t\t\t\tarray('id' => '2', 'birthday' => '01-01-2001', 'salary' => '650.30')\n\t\t\t);\n\n\t\t\t$this->assertFalse($result);\n\t\t}\n\t\tcatch(LocaleException $e)\n\t\t{\n\t\t\t$this->assertEqual($e->getMessage(), 'Data inválida para localização');\n\t\t}\n\t}", "function uiToDBdate() {\r\n\r\n\t\t$month = (int) substr($this->date, -10, 2);\r\n\t\t$day = (int) substr($this->date, -7, 2);\r\n\t\t$year = (int) substr($this->date, -4, 4);\r\n\r\n\t\t$formattedDate = $year . \"-\" . $month . \"-\" . $day;\r\n\r\n\t\t$this->date = $formattedDate;\r\n\t}", "#[Property('date')]\n\tprotected function getDateExt(): Date|string {\n\t\treturn new Date($this);\n\t}", "protected function saveDate()\n\t{\n\t\t$this->year = FilterSingleton::number($_POST['year']);\n\t\t$this->month = FilterSingleton::number($_POST['month']); \n\n\t\tif($this->year !== 0 && $this->month !== 0){\n\t\t\tsetcookie(\"date\", json_encode([$this->year, $this->month]), time()+3600, '/');\n\t\t}\n\t\telse {\n\t\t\tif( isset($_COOKIE['date']) ){\n\t\t\t\t$date = json_decode($_COOKIE['date'], true);\n\t\t\t\t$this->year = $date[0];\n\t\t\t\t$this->month = $date[1];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->year = getdate()['year'];\n\t\t\t\t$this->month = getdate()['mon'];\n\t\t\t}\n\t\t}\n\t}", "private function validateDate($value) {\n\n is_a($value, 'DateTime') ||\n $value = strtotime($value);\n\n $value = date('Y-m-d', $value);\n\n if (!$value)\n $this->errors[] = 'Date ' . $value . ' is not a valid date';\n\n return $value;\n\n }", "public function setDateAttribute($input)\n {\n if ($input != null && $input != '') {\n $this->attributes['date'] = Carbon::createFromFormat(config('app.date_format'), $input)->format('Y-m-d');\n } else {\n $this->attributes['date'] = null;\n }\n }", "public function setDateAttribute($input)\n {\n if ($input != null && $input != '') {\n $this->attributes['date'] = Carbon::createFromFormat(config('app.date_format'), $input)->format('Y-m-d');\n } else {\n $this->attributes['date'] = null;\n }\n }", "public function save() {\n $this->lastModified = new \\DateTime();\n parent::save();\n }", "public function save($validate = null);", "public function Date()\n {\n $action = 'rakelley\\jhframe\\classes\\ArgumentValidator';\n $arguments = [\n 'requires' => [\n 'date' => ['filters' => ['date' => 'Y-m-d']],\n ],\n 'method' => 'post',\n ];\n\n $result = $this->actionController->executeAction($action, $arguments);\n $content = ($result->getSuccess()) ?:\n 'Field must be a valid \"YYYY-MM-DD\" Date';\n\n $result->setContent($content)\n ->Render();\n }", "public function sanitizarFecha($fecha)\n{\n $date = date_create($fecha);\n return date_format($date,'Y-m-d');\n}", "public function sanitizarFecha($fecha)\n{\n $date = date_create($fecha);\n return date_format($date,'Y-m-d');\n}", "public function sanitizarFecha($fecha)\n{\n $date = date_create($fecha);\n return date_format($date,'Y-m-d');\n}", "public function sanitizarFecha($fecha)\n{\n $date = date_create($fecha);\n return date_format($date,'Y-m-d');\n}", "public function sanitizarFecha($fecha)\n{\n $date = date_create($fecha);\n return date_format($date,'Y-m-d');\n}", "public function save() {\r\n $data = array(\r\n 'HolidayDate' => date('Y-m-d', strtotime($this->input->post('HolidayDate'))),\r\n 'Category' => $this->Category\r\n );\r\n $this->db->insert('tbl_holidays', $data);\r\n }", "public function saveBirthDate()\n {\n $this->updateValue(\n 'birth_date',\n $this->birthDate,\n 'Customer birth date updated successfully.'\n );\n\n $this->birthDateUpdate = false;\n $this->birthDateFormatted = $this->customer->birth_date_formatted;\n }", "public function setCreateDate($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->create_date !== null || $dt !== null) {\n $currentDateAsString = ($this->create_date !== null && $tmpDt = new DateTime($this->create_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '2021-06-07 11:49:57') // or the entered value matches the default\n ) {\n $this->create_date = $newDateAsString;\n $this->modifiedColumns[] = SanitasiPeer::CREATE_DATE;\n }\n } // if either are not null\n\n\n return $this;\n }", "abstract public function save(Model $model);", "public function setDateOfBirth()\n {\n $dateOfBirth = request('dob_year') . '-' . request('dob_month') . '-' . request('dob_day');\n\n $this->date_of_birth = $dateOfBirth;\n $this->save();\n }", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save()\n\t{\n\t\tself::$db->model = $this;\n\t\t$boolean = $this->validate();\n\t\tif($boolean){\n\t\t\treturn self::$db->saveNow();\n\t\t}\n\t}", "public static final function save ($prDate)\n {\n\n $format = 'Y-m-d';\n\n if (strpos($prDate, ':') !== false)\n {\n\n $format .= ' H:i:s';\n\n }\n\n return $prDate != NULL ? date ($format,strtotime(str_replace('/','-',$prDate))) : NULL;\n\n }", "public function save(array $options = array())\n {\n $this->upd_date = Carbon::now()->format('Y-m-d H:i:s');\n return parent::save($options);\n }", "protected function _beforeSave()\n\t{\n\t\tparent::_beforeSave();\n\n $date = Mage::getModel('core/date')->date('Y-m-d H:i:s');\n\t\tif ($this->isObjectNew()) {\n\t\t\t$this->setCreatedAt($date);\n\t\t\t$this->setUpdatedAt($date);\n\t\t} else {\n\t\t\t$this->setUpdatedAt($date);\n\t\t}\t\n\t\t\n\t\treturn $this;\n\t}", "public\n\tfunction setPostDate($newPostDate = null): void {\n\t\t// base case: if the date is null, use the current date and time\n\t\tif($newPostDate === null) {\n\t\t\t$this->postDate = new \\DateTime();\n\t\t\treturn;\n\t\t}\n\n\n\n\t//store the like date using the ValidateDate trait\n\ttry {\n\t\t$newPostDate = self::validateDateTime($newPostDate);\n\t} catch(\\InvalidArgumentException |\\RangeException $exception) {\n\t\t$exceptionType = get_class($exception);\n\t\tthrow(new $exceptionType($exception->getMessage(), 0, $exception));\n\t}\n\t$this->postDate = $newPostDate;\n\n}", "function format_date_form_field($model, $field, $default = 'MM/DD/YYYY')\n{\n $oldDate = old($field);\n\n if ($oldDate) {\n return $oldDate;\n }\n\n $attribute = $model->getAttribute($field);\n\n if ($attribute && $attribute instanceof Carbon) {\n return $attribute->format('Y-m-d');\n }\n\n return $default;\n}", "function engagements_save_date( $post_id ){\n\tif ( !isset( $_POST['engagements_date_box_nonce'] ) || !wp_verify_nonce( $_POST['engagements_date_box_nonce'], basename( __FILE__ ) ) ){\n\treturn;}\n \n // Check the user's permissions.\nif ( ! current_user_can( 'edit_post', $post_id ) ){\n\treturn;\n}\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {\n return $post->ID;\n}\n //save value\n if ( isset( $_REQUEST['engagements_date'] ) ) {\n\tupdate_post_meta( $post_id, '_engagements_date', sanitize_text_field( $_POST['engagements_date'] ) );\n}\n \n}", "public function getEffectiveDate(): DateTimeInterface;", "public function getStarthiredateinputThAttribute(){\n return date('d/m/' , strtotime( $this->starthiredate ) ).(date('Y',strtotime($this->starthiredate))+543);\n }", "public function onSave()\n {\n if ($this->getPerson()->getEmail() === null) {\n throw new \\RuntimeException(\n 'A user entity\\'s related Person\\'s email property cannot be null'\n );\n }\n if (! $this->id) {\n $this->created = new \\DateTime();\n }\n }", "function dateToDBDate($date)\n\t{\n\n\t\tif (is_numeric($date))\n\t\t{\n\t\t\treturn date('Y-m-d', $date);\n\t\t}\n\t\telse if (preg_match('/\\d{2}\\.\\d{2}\\.\\d{4}/', $date))\n\t\t{\n\t\t\t$arDate = explode('.', $date);\n\n\t\t\treturn $arDate[2].'-'.$arDate[1].'-'.$arDate[0];\n\t\t}\n\t\telse if (strtotime($date) > 0)\n\t\t{\n\t\t\treturn date('Y-m-d', strtotime($date));\n\t\t}\n\n\t\treturn '0000-00-00';\n\n\t}", "protected function beforeSave() {\n $date = $this->month;\n $this->month = CommonProcess::convertDateTime($date, DomainConst::DATE_FORMAT_13, DomainConst::DATE_FORMAT_4);\n if ($this->isNewRecord) {\n $this->created_by = Yii::app()->user->id;\n \n // Handle created date\n $this->created_date = CommonProcess::getCurrentDateTime();\n }\n $this->amount = str_replace(DomainConst::SPLITTER_TYPE_2, '', $this->amount);\n \n return parent::beforeSave();\n }", "public function getDueDate(): DateTimeInterface;", "public function convert($new_mask, $save = true)\n {\n $newdate = adodb_date($new_mask, $this->date_time_stamp);\n //if they want to save and apply this new mask to $this->date_time, save it\n if ($save == true) {\n $this->date_time_mask = $new_mask;\n $this->date_time = $newdate;\n }\n return $newdate;\n }", "public function dateTime()\n {\n $action = 'rakelley\\jhframe\\classes\\ArgumentValidator';\n $arguments = [\n 'requires' => [\n 'date' => ['filters' => ['date' => 'Y-m-d H:i:s']],\n ],\n 'method' => 'post',\n ];\n\n $result = $this->actionController->executeAction($action, $arguments);\n $content = ($result->getSuccess()) ?:\n 'Field must be a valid \"YYYY-MM-DD HH:MM:SS\" Date';\n\n $result->setContent($content)\n ->Render();\n }", "public function beforeSave()\n {\n $this->CreatedAt = new \\DateTime('now', new \\DateTimeZone('UTC'));\n }", "public function setCreateDate($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->create_date !== null || $dt !== null) {\n $currentDateAsString = ($this->create_date !== null && $tmpDt = new DateTime($this->create_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '2020-04-16 09:40:03') // or the entered value matches the default\n ) {\n $this->create_date = $newDateAsString;\n $this->modifiedColumns[] = SekolahPaudPeer::CREATE_DATE;\n }\n } // if either are not null\n\n\n return $this;\n }", "public function save(array $options = array(),\n array $rules = array(),\n array $customMessages = array()\n ) {\n foreach ($this->dates as $date) {\n if ( ! $this->isDirty($date)) {\n $this->attributes[$date] = $this->asDateTime($this->attributes[$date])->toDateString();\n }\n }\n\n $this->validate($rules, $customMessages);\n // Convert to UTCDateTime before of save the model\n foreach ($this->dates as $date) {\n $this->attributes[$date] = $this->fromDateTime($this->attributes[$date]);\n }\n\n try {\n return parent::save($options);\n } catch (\\Exception $e) {\n Log::info('Error saving data: ' . $e->getMessage());\n throw new \\Exception('An internal error occurred during saving data.');\n }\n }", "public function beforeSave() {\n if( parent::beforeSave() ) {\n $this->createdAt = date( \"Y-m-d H:i:s\" );\n $this->email = strtolower( $this->email );\n return true;\n }\n return false;\n }", "public function beforeSave() {\n if ($this->isNewRecord) {\n $this->created_date = new CDbExpression(\"now()\");\n }\n $this->updated_date = new CDbExpression(\"now()\");\n\n return true;\n }", "public function save() {}", "public function save() {}", "public function save() {}", "public function setPreferredDate($v)\n\t{\n\t\t// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')\n\t\t// -- which is unexpected, to say the least.\n\t\tif ($v === null || $v === '') {\n\t\t\t$dt = null;\n\t\t} elseif ($v instanceof DateTime) {\n\t\t\t$dt = $v;\n\t\t} else {\n\t\t\t// some string/numeric value passed; we normalize that so that we can\n\t\t\t// validate it.\n\t\t\ttry {\n\t\t\t\tif (is_numeric($v)) { // if it's a unix timestamp\n\t\t\t\t\t$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));\n\t\t\t\t\t// We have to explicitly specify and then change the time zone because of a\n\t\t\t\t\t// DateTime bug: http://bugs.php.net/bug.php?id=43003\n\t\t\t\t\t$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));\n\t\t\t\t} else {\n\t\t\t\t\t$dt = new DateTime($v);\n\t\t\t\t}\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->preferred_date !== null || $dt !== null ) {\n\t\t\t// (nested ifs are a little easier to read in this case)\n\n\t\t\t$currNorm = ($this->preferred_date !== null && $tmpDt = new DateTime($this->preferred_date)) ? $tmpDt->format('Y-m-d') : null;\n\t\t\t$newNorm = ($dt !== null) ? $dt->format('Y-m-d') : null;\n\n\t\t\tif ( ($currNorm !== $newNorm) // normalized values don't match \n\t\t\t\t\t)\n\t\t\t{\n\t\t\t\t$this->preferred_date = ($dt ? $dt->format('Y-m-d') : null);\n\t\t\t\t$this->modifiedColumns[] = VpoRequestPeer::PREFERRED_DATE;\n\t\t\t}\n\t\t} // if either are not null\n\n\t\treturn $this;\n\t}", "protected function beforeSave() {\n if (parent::beforeSave()) {\n if ($this->isNewRecord) {\n $this->created_date = $this->updated_date = date('Y-m-d');\n $this->created_by = Yii::app()->user->id;\n } else {\n $this->updated_by = Yii::app()->user->id;\n $this->updated_date = date('Y-m-d');\n }\n return true;\n } else\n return false;\n }", "public function requireDate($key, $allowEmpty = false)\n {\n\n $value = trim($this->getParam($key));\n if(empty($value) && $allowEmpty){\n return trim($value);\n }\n\n $unixTimeStamp = strtotime($value);\n if(!$unixTimeStamp){\n throw new InvalidParameterException($key, $value, __FUNCTION__);\n }\n\n return date(\"Y-m-d\", $unixTimeStamp);\n }", "public function setRequestPostedDate($v)\n\t{\n\t\t// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')\n\t\t// -- which is unexpected, to say the least.\n\t\tif ($v === null || $v === '') {\n\t\t\t$dt = null;\n\t\t} elseif ($v instanceof DateTime) {\n\t\t\t$dt = $v;\n\t\t} else {\n\t\t\t// some string/numeric value passed; we normalize that so that we can\n\t\t\t// validate it.\n\t\t\ttry {\n\t\t\t\tif (is_numeric($v)) { // if it's a unix timestamp\n\t\t\t\t\t$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));\n\t\t\t\t\t// We have to explicitly specify and then change the time zone because of a\n\t\t\t\t\t// DateTime bug: http://bugs.php.net/bug.php?id=43003\n\t\t\t\t\t$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));\n\t\t\t\t} else {\n\t\t\t\t\t$dt = new DateTime($v);\n\t\t\t\t}\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->request_posted_date !== null || $dt !== null ) {\n\t\t\t// (nested ifs are a little easier to read in this case)\n\n\t\t\t$currNorm = ($this->request_posted_date !== null && $tmpDt = new DateTime($this->request_posted_date)) ? $tmpDt->format('Y-m-d') : null;\n\t\t\t$newNorm = ($dt !== null) ? $dt->format('Y-m-d') : null;\n\n\t\t\tif ( ($currNorm !== $newNorm) // normalized values don't match \n\t\t\t\t\t)\n\t\t\t{\n\t\t\t\t$this->request_posted_date = ($dt ? $dt->format('Y-m-d') : null);\n\t\t\t\t$this->modifiedColumns[] = VpoRequestPeer::REQUEST_POSTED_DATE;\n\t\t\t}\n\t\t} // if either are not null\n\n\t\treturn $this;\n\t}", "public function getWillSave() {}", "protected function beforeSave()\r\n\t{\r\n\t\tif(parent::beforeSave())\r\n\t\t{\r\n\t\t\tif($this->isNewRecord)\r\n\t\t\t{\r\n\t\t\t\t$this->created=date('Y-m-d H:i:s');\r\n $this->updated=date('Y-m-d H:i:s');\r\n\t\t\t\t$this->user_id=Yii::app()->user->id;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$this->updated=date('Y-m-d H:i:s');\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}", "function validate_date() {\n # Check the date is in ISO date format\n if (ereg('(19|20)[0-9]{2}[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])', $this->cur_val)) {\n # Remove any existing error message\n $this->error_message = \"\";\n\n # Return Value\n return $this->cur_val;\n }\n else {\n # Set Error Message\n $this->set_error(\"Validation for date ({$this->cur_val}) failed. This is type \" . gettype($this->cur_val));\n\n # Return Blank Date\n return \"0000-00-00\";\n }\n }", "public function beforeSave()\n\t{\n\t\t//Set null for empty field in table\n\t\tif($this->sale_date=='') $this->sale_date = NULL;\n\t\tif($this->next_sale_date=='') $this->next_sale_date = NULL;\n\t\treturn true;\n\t}", "public function beforeSave()\n {\n $this->created = new \\DateTime('now', new \\DateTimeZone('UTC'));\n }" ]
[ "0.6323972", "0.6289273", "0.6249922", "0.6007786", "0.5855204", "0.5807395", "0.5749008", "0.57190585", "0.57075435", "0.57050157", "0.5679343", "0.5655015", "0.5628862", "0.5618347", "0.5585396", "0.5585396", "0.5585396", "0.5585396", "0.5585396", "0.5584679", "0.55816185", "0.5574938", "0.55557364", "0.5549186", "0.5538774", "0.55163753", "0.5515367", "0.5506806", "0.5504106", "0.5501134", "0.5496744", "0.54849184", "0.5478595", "0.547229", "0.5468748", "0.5461515", "0.54558873", "0.54558873", "0.5453942", "0.5449692", "0.54494995", "0.5426843", "0.5426843", "0.5426843", "0.5426843", "0.5426843", "0.53937656", "0.5392493", "0.5386913", "0.5375004", "0.53129214", "0.530772", "0.530772", "0.530772", "0.530772", "0.530772", "0.530772", "0.530772", "0.530772", "0.530772", "0.530772", "0.530772", "0.530772", "0.530772", "0.530772", "0.530772", "0.530772", "0.530772", "0.530772", "0.5302012", "0.52975786", "0.5285225", "0.52797055", "0.5271596", "0.52501804", "0.52474445", "0.524616", "0.5243097", "0.5237448", "0.5236605", "0.52329737", "0.52326226", "0.5232115", "0.5220095", "0.52166665", "0.5215579", "0.5211341", "0.5206548", "0.5202208", "0.5193509", "0.5193509", "0.5192849", "0.51862705", "0.51823676", "0.5181336", "0.517116", "0.51668364", "0.5163535", "0.51632035", "0.5157735", "0.515417" ]
0.0
-1
Get the class name for the filters, the part after _Agenda_Filter_
abstract public function getFilterClass();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function getFilterClassName($string);", "abstract public function getFilterName();", "public static function getFiltername(): string\n {\n return self::FILTERNAME;\n }", "public function getFilterClass()\n {\n return 'XorAppointmentFilter';\n }", "protected function filterName(): string\n {\n return Str::snake(class_basename($this));\n }", "public function getClassFilter()\n {\n return $this->get(self::CLASS_FILTER, null);\n }", "public static function GET_FILTERS_CLASS(): array\n\t{\n\t\treturn self::$filtersClass;\n\t}", "public function getName()\n {\n return \"apihour_contractors_filters_type\";\n }", "function getClassName() {\n\t\treturn 'lib.pkp.plugins.citationParser.paracite.filter.ParaciteRawCitationNlm30CitationSchemaFilter';\n\t}", "function getClassName() {\n\t\treturn 'lib.pkp.plugins.citationParser.parscit.filter.ParscitRawCitationNlm30CitationSchemaFilter';\n\t}", "public function getName() {\n return 'apihour_product_list_filters_type';\n }", "protected function classFilterName($class)\n {\n if (is_object($class)) {\n $class = get_class($class);\n }\n return substr($class, strrpos($class, '\\\\') + 1);\n }", "function getFilterFileName($filter_name)\n {\n return dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Filter'\n . DIRECTORY_SEPARATOR . $filter_name . '.php';\n }", "public function getFormClassToExtend() {\n return null === ($model = $this->getParentModel()) ? 'BaseFormFilterDoctrine' : sprintf('%sFormFilter', $model);\n }", "static public function rootNameSpaceForFilters()\n {\n return __NAMESPACE__ .\"\\\\Filter\";\n }", "public function getFilter(): string;", "public function getName() {\n return 'apihour_settings_datagrid_filters_type';\n }", "public function name()\n {\n return __('nova.filters.log_type');\n }", "function getName($filter=null)\n {\n return _transform('SQLite',$filter);\n }", "public function getFilterFormClass()\n {\n return 'ClientListFormFilter';\n }", "public function getName()\n {\n return 'fibe_content_topicfiltertype';\n }", "public function getConvertedBy()\n {\n return FilterConverter::class;\n }", "public function getFilter();", "public function getFilter();", "function vcex_image_filter_class( $filter = '' ) {\n\tif ( function_exists( 'wpex_image_filter_class' ) ) {\n\t\treturn wpex_image_filter_class( $filter );\n\t}\n}", "public function getSortFilterName(): string\n {\n return $this->sortFilterName;\n }", "public function getUllFilterClassName()\n {\n return 'ullPhoneQuickSearchForm';\n }", "function getName($filter=null)\n {\n return $this->factory->getName($filter);\n }", "public static function getAfterFilterName()\n {\n return self::$afterFilterName;\n }", "public function getFilter(){ }", "private function get_filter_search($filter) {\n $names = array();//assume no mod names\n $modnames = get_module_types_names(); //get all the names avaliable\n $mods = $filter->mods;//get all mods in this filter\n\n //go through each mod in the filter and and keep its name\n foreach ($mods as $mod) {\n array_push($names, $modnames[$mod]);\n }\n\n //convert list of names into a comma deliminated string of names\n return implode(\",\", $names);\n }", "public function getTag()\n\t{\n\t\treturn 'filter';\n\t}", "public function onGetFilterKey()\n\t{\n\t\t$this->filterKey = JString::strtolower(str_ireplace('PlgFabrik_List', '', get_class($this)));\n\t\treturn $this->filterKey;\n\t}", "public function getFilters()\n\t{\n\t\treturn [\n\t\t\tnew \\Twig_SimpleFilter('basename', 'basename'),\n\t\t\tnew \\Twig_SimpleFilter('get_class', 'get_class'),\n\t\t\tnew \\Twig_SimpleFilter('json_decode', 'json_decode'),\n\t\t\tnew \\Twig_SimpleFilter('_', 'echo'),\n\t\t];\n\t}", "public function get_name()\n {\n return 'post-filter';\n }", "public function dumpDefinition()\n {\n $definition = array();\n\n foreach ($this->filters as $index => $filter)\n {\n $definition[] = get_class($filter);\n }\n\n return $definition;\n }", "abstract protected function getFilters();", "public function getAttributeName()\n\t{\n\t\treturn 'FilterBase';\n\t}", "public function getClassName() ;", "public function getFilter()\n {\n return $this->get(self::FILTER);\n }", "public function getName() : string\n {\n return (string) DefaultOkFileFilter::class;\n }", "public function getFilterString()\n {\n return $this->filterString;\n }", "protected function getFilterQueryMethod(FilterContract $filter): string\n {\n return match ($filter->getOperator()) {\n FilterOperator::INCLUDED_IN => 'whereIn',\n FilterOperator::NOT_INCLUDED_IN => 'whereNotIn',\n FilterOperator::IN_RANGE => 'whereBetween',\n FilterOperator::NOT_IN_RANGE => 'whereNotBetween',\n FilterOperator::IS_NULL => 'whereNull',\n FilterOperator::IS_NOT_NULL => 'whereNotNull',\n FilterOperator::CONTAINS => 'whereJsonContains',\n FilterOperator::DOES_NOT_CONTAIN => 'whereJsonDoesntContain',\n default => 'where',\n };\n }", "public function GetFilters ();", "public function filters()\n {\n return [\n 'name' => 'trim|capitalize|escape'\n ];\n }", "public function getFilter(string $name);", "public static function getFilterType() {\n return array(\n self::RG_FILTER_TYPE_DROPDN => Yii::t('RgdesignerModule.rgattr', 'DropDown List'),\n self::RG_FILTER_TYPE_TEXTINP => Yii::t('RgdesignerModule.rgattr', 'Text filter'),\n self::RG_FILTER_TYPE_NONE => Yii::t('RgdesignerModule.rgattr', 'Not specified'),\n );\n }", "public function getFilterName()\n {\n return $this->_('NOT ANY (XOR) combination filter');\n }", "function GetFilter ( )\n{\n\treturn $this->FilterExp();\n}", "public function getEventClass() :string {\n $class = get_class($this);\n $classParts = explode(\"\\\\\", $class);\n\n return $classParts[count($classParts) - 1];\n }", "public function makeFilter($class = '\\Nayjest\\Grids\\FilterConfig')\n {\n $filter = new $class;\n $this->addFilter($filter);\n return $filter;\n }", "function filter_method_name()\r\n\t{\r\n\t\t// TODO:\tDefine your filter method here\r\n\t}", "protected function getRouteNameFilter()\n {\n if ($this->routeNameFilter instanceof FilterChain) {\n return $this->routeNameFilter;\n }\n\n $this->routeNameFilter = new FilterChain();\n $this->routeNameFilter->attachByName('WordCamelCaseToDash')\n ->attachByName('StringToLower');\n return $this->routeNameFilter;\n }", "public function getClassName();", "public function getClassName();", "public function getFullQualifiedClassname() : string\n {\n return $this->fqcn;\n \n }", "public function component()\n {\n return 'mega-filter';\n }", "private function buildFilters()\n {\n $return = '';\n\n if (count($this->filters) > 0) {\n $return = 'f=' . implode(',', array_values($this->filters));\n }\n\n return $return;\n }", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public static function getBeforeFilterName()\n {\n return self::$beforeFilterName;\n }", "public function getMetaPropertyFilterName(): string\n {\n return $this->metaPropertyFilterName;\n }", "function getName($filter=null)\n {\n return _transform(\"PostgreSQL\",$filter);\n }", "public static function fqcn(): string {\n return self::class;\n }", "public static function fqcn(): string {\n return self::class;\n }", "public function getFilters();", "public function getFilter()\n\t{\n\t\treturn $this->filter;\n\t}", "public function getName()\n {\n return \"MJanssen_Filters_LikeFilter\";\n }", "public function getFormattedEventTypes(): string\n {\n return $this->getFormattedFilter($this->event_type_filter);\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function createFilter();", "public function genFilter($filter = array())\n {\n $filter = $this->genFilterPreProcess ($filter);\n return '';\n }", "function flatsome_main_classes(){\n echo implode(' ', apply_filters( 'flatsome_main_class', array() ) );\n}", "public function getFilter()\n\t{\n\t\treturn 'array';\n\t}", "public function getOptionalFilterType(): string\n {\n return $this->filterType;\n }", "private static function _getFilter() {}", "protected function getFilter()\n {\n return $this->filter;\n }", "public function getSbFilter()\n {\n return $this->getAdditionalParam('shortBreak', '');\n }", "private function getPluralizedName($filterType)\n {\n if($filterType === 'Category')\n return 'Categories';\n return 'Products';\n }", "function getFilter()\n\t{\n\t\treturn $this->_filter;\n\t}", "function getFilter() {\n\t\treturn $this->_filter;\n\t}", "public function getBusinessNameFilter()\n {\n return $this->business_name_filter;\n }" ]
[ "0.76527405", "0.73842394", "0.72981423", "0.72673875", "0.70962036", "0.70402944", "0.6758032", "0.6728297", "0.65830535", "0.6531211", "0.6508014", "0.64513385", "0.6425756", "0.64106566", "0.6368361", "0.6333866", "0.632712", "0.6317778", "0.6281755", "0.62220657", "0.6213948", "0.61842644", "0.6152717", "0.6152717", "0.61476743", "0.61445767", "0.60811454", "0.6073757", "0.6026578", "0.5997935", "0.59905183", "0.5969629", "0.5966616", "0.5927236", "0.59238243", "0.59162116", "0.5852821", "0.5851935", "0.5849182", "0.5816471", "0.5806842", "0.580601", "0.57864064", "0.5780424", "0.5775789", "0.5759569", "0.57465345", "0.5725477", "0.5717028", "0.5715178", "0.56851345", "0.5683844", "0.56815064", "0.5678886", "0.5678886", "0.5671069", "0.5657435", "0.56559163", "0.5653075", "0.5653075", "0.5653075", "0.5653075", "0.56449056", "0.56410277", "0.5619992", "0.56063473", "0.56063473", "0.55815154", "0.5579545", "0.55745614", "0.55649847", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5559409", "0.5558905", "0.55366063", "0.5514226", "0.5504774", "0.55031675", "0.54995733", "0.54988796", "0.54936016", "0.5475513", "0.5468406", "0.5462977", "0.5459517" ]
0.77549744
0
Get the name for this filter class
abstract public function getFilterName();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function filterName(): string\n {\n return Str::snake(class_basename($this));\n }", "public static function getFiltername(): string\n {\n return self::FILTERNAME;\n }", "function getName($filter=null)\n {\n return $this->factory->getName($filter);\n }", "public function name()\n {\n return __('nova.filters.log_type');\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 return 'post-filter';\n }", "public function getName() {\n return get_class($this);\n }", "public function getName() {\n return get_class($this);\n }", "public function getSortFilterName(): string\n {\n return $this->sortFilterName;\n }", "public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}", "function getName($filter=null)\n {\n return _transform('SQLite',$filter);\n }", "public function getName() {\n return 'apihour_product_list_filters_type';\n }", "public function getName() \n { \n return $this->getType().\"_\".substr(md5(implode($this->getParameters())), 0, 20);\n }", "public static function name()\n {\n return isset(static::$name) ? static::$name : self::getClassShortName();\n }", "function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}", "public function getName() : string\n {\n return (string) DefaultOkFileFilter::class;\n }", "public function getName()\n {\n return \"apihour_contractors_filters_type\";\n }", "function getName()\n {\n return get_class($this);\n }", "public function getName(){\n\t\treturn get_class($this);\n\t}", "public function getName()\n {\n return static::CLASS;\n }", "protected function getNameInput(): string\n {\n $name = trim($this->argument('name'));\n\n if (! Str::endsWith($name, 'Filter')) {\n $name .= 'Filter';\n }\n\n $this->type = ucfirst($name);\n\n return $this->type;\n }", "public function getName() {\n return 'apihour_settings_datagrid_filters_type';\n }", "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}", "protected function name() {\n\t\treturn strtolower(str_replace('\\\\', '_', get_class($this)));\n\t}", "public function getName() {\r\n $parsed = Parser::parseClassName(get_class());\r\n return $parsed['className'];\r\n }", "public function get_name()\n {\n return 'local_questionbanktagfilter|tags';\n }", "function getName() {\n // $this is used to refer to an attribute of a class\n return $this->name;\n }", "public function getName() {\n if ( $this->reflectionSource instanceof ReflectionFunction ) {\n return $this->reflectionSource->getName();\n } else {\n return parent::getName();\n }\n }", "public function getName() {\n $path = explode('\\\\', get_class($this->object[\"data\"]));\n return array_pop($path);\n }", "public function getName()\n {\n return \"MJanssen_Filters_LikeFilter\";\n }", "public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}", "function getName() {\n return $this->instance->getName();\n }", "public function getMetaPropertyFilterName(): string\n {\n return $this->metaPropertyFilterName;\n }", "public function getName()\n {\n $class = get_class($this);\n\n return str_replace($this->getObjectType(), '',\n str_replace(CADRE_appNameSpace.$this->getObjectTypePlural().'\\\\', '', $class));\n }", "public function getName()\n {\n return 'fibe_content_topicfiltertype';\n }", "public function getName()\n {\n return __CLASS__;\n }", "public function getAttributeName()\n\t{\n\t\treturn 'FilterBase';\n\t}", "public function getName(): string\n {\n return match ($this) {\n self::Debug => 'DEBUG',\n self::Info => 'INFO',\n self::Notice => 'NOTICE',\n self::Warning => 'WARNING',\n self::Error => 'ERROR',\n self::Critical => 'CRITICAL',\n self::Alert => 'ALERT',\n self::Emergency => 'EMERGENCY',\n };\n }", "abstract protected function getFilterClassName($string);", "public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }", "public function getClassName() {\r\n\t\treturn($this->class_name);\r\n\t}", "public function getClassFilter()\n {\n return $this->get(self::CLASS_FILTER, null);\n }", "function getName($filter=null)\n {\n return _transform(\"PostgreSQL\",$filter);\n }", "public static function name()\n {\n return lcfirst(self::getClassShortName());\n }", "public static function getAfterFilterName()\n {\n return self::$afterFilterName;\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 {\n return $this->getName();\n }", "public function name()\n {\n return $this->getName();\n }", "protected static function _getName()\n {\n return isset(static::$_name) ? static::$_name : get_called_class();\n }", "abstract public function getFilterClass();", "public function getName() {\n return self::NAME;\n }", "public function getClassName()\n {\n return $this->class_name;\n }", "function getFilterFileName($filter_name)\n {\n return dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Filter'\n . DIRECTORY_SEPARATOR . $filter_name . '.php';\n }", "function getClassName() {\n\t\treturn 'lib.pkp.plugins.citationParser.parscit.filter.ParscitRawCitationNlm30CitationSchemaFilter';\n\t}", "public function getClassName() ;", "public function getName()\n {\n return $this->__get(\"name\");\n }", "public function getName()\n {\n return $this->__get(\"name\");\n }", "public function getName() {\n return ($this->isInit()) ? $this->name : null;\n }", "public function getName(): string {\n\t\t\treturn $this->type;\n\t\t}", "function getName () {\n\t\treturn $this->name;\n\t}", "function getClassName() {\n\t\treturn 'lib.pkp.plugins.citationParser.paracite.filter.ParaciteRawCitationNlm30CitationSchemaFilter';\n\t}", "public function getName() {\n return $this->get(self::NAME);\n }", "public function getName() {\n return $this->get(self::NAME);\n }", "public function getName() {\n return $this->get(self::NAME);\n }", "protected function getName() {}", "public function getName(): string\n {\n return __CLASS__;\n }", "public function getName ();", "public static 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();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();" ]
[ "0.8418346", "0.8402424", "0.78485614", "0.75618035", "0.7304917", "0.72832954", "0.7238969", "0.7238969", "0.7219807", "0.71873677", "0.7166284", "0.71581054", "0.7144649", "0.7128745", "0.71146184", "0.7111811", "0.71107036", "0.7081323", "0.7078025", "0.70708716", "0.7025194", "0.7024856", "0.70015025", "0.70015025", "0.6991971", "0.6991775", "0.698667", "0.695975", "0.69141054", "0.689184", "0.6878938", "0.6868968", "0.6867192", "0.68628025", "0.68575203", "0.6832671", "0.68149424", "0.68123513", "0.68113494", "0.67988634", "0.6793261", "0.67881054", "0.6779455", "0.6757777", "0.6755804", "0.67454344", "0.6740346", "0.6740346", "0.6740346", "0.6740346", "0.6740346", "0.6740346", "0.6740346", "0.6728982", "0.6728982", "0.67275983", "0.66960216", "0.6695189", "0.6680804", "0.66700387", "0.66655326", "0.6663288", "0.6659026", "0.6659026", "0.6657768", "0.665135", "0.66471434", "0.6645935", "0.66432446", "0.66432446", "0.66432446", "0.6638984", "0.66381025", "0.6626907", "0.66228944", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756", "0.6622756" ]
0.80865985
2
Get the settings for the gaf_filter_textN fields Fields not in this array are not shown in any way
abstract public function getTextSettings();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function advanced_settings_fields_filter1($fields) {\n $model_config = WYSIJA::get('config', 'model');\n if ($model_config->getValue('premium_key')) {\n unset($fields['bounce_email']);\n }\n return $fields;\n }", "private static function get_ignored_fields() {\n\n\t\t// TODO: 'captcha' should be dropped from the list when the WPForms Captcha 1.3.2/1.4 is released.\n\t\t$ignored_fields = [ 'hidden', 'captcha' ];\n\n\t\t/**\n\t\t * List of ignored fields for the entry preview field.\n\t\t *\n\t\t * @since 1.6.9\n\t\t *\n\t\t * @param array $fields List of ignored fields.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\treturn (array) apply_filters( 'wpforms_pro_fields_entry_preview_get_ignored_fields', $ignored_fields );\n\t}", "protected function filterSliderFields(): array\n {\n return [];\n }", "function getEnableFieldsToBeIgnored() ;", "public static function text_filters() {\n\t\t\treturn self::$text_filters;\n\t\t}", "function getIgnoreEnableFields() ;", "public static function getFilterList()\n {\n return ['nospaces'];\n }", "function message_notify_field_text_list() {\n $options = array(FALSE => '- ' . t('None') . ' -');\n\n\n foreach (field_info_instances('message') as $message_type => $instances) {\n foreach ($instances as $field_name => $instance) {\n if (!empty($options[$field_name])) {\n // Field is already in the options array.\n continue;\n }\n $field = field_info_field($field_name);\n if (!in_array($field['type'], array('text', 'text_long', 'text_with_summary'))) {\n // Field is not a text field.\n continue;\n }\n\n $options[$field_name] = $instance['label'];\n }\n }\n\n return $options;\n}", "public static function getExcludeFields() {}", "public function filters() {\n\t\treturn array(\n\t\t TRUE => array(array('trim')),\n\t\t);\n\t}", "private static function getFilterFields($filter = null)\n\t{\n\t\t$fields = $filter??static::getUiFilterFields();\n\t\t$fields = is_array($fields) ? $fields : array();\n\t\t$fields[] = array(\n\t\t\t\"id\" => self::FIELD_FOR_PRESET_ALL,\n\t\t\t\"name\" => Loc::getMessage('SENDER_CONNECTOR_BASE_FILTER'),\n\t\t\t'type' => 'checkbox',\n\t\t\t\"default\" => false,\n\t\t\t\"sender_segment_filter\" => false,\n\t\t);\n\n\t\treturn $fields;\n\t}", "function variable_fields()\n\t{\n\t\t$vf=$this->variable_fields;\n\n\t\tif (!is_array($vf))\n\t\t{\n\t\t\t//default search field if nothing is selected\n\t\t\treturn array('labl,qstn,catgry');\n\t\t}\n\n\t\t$tmp=NULL;\n\t\tforeach($vf as $field)\n\t\t{\n\t\t\tif (in_array($field,$this->variable_allowed_fields))\n\t\t\t{\n\t\t\t\t$tmp[]=$field;\n\t\t\t}\n\t\t}\n\n\t\t//no allowed fields found\n\t\tif ($tmp==NULL)\n\t\t{\n\t\t\treturn array('labl');\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $tmp;\n\t\t}\n\t}", "function snax_admin_get_settings_fields() {\n\treturn (array) apply_filters( 'snax_admin_get_settings_fields', array(\n\n\t\t/** General Section **************************************************** */\n\n\t\t'snax_settings_general' => array(\n\t\t\t'snax_active_formats' => array(\n\t\t\t\t'title' => __( 'Active formats', 'snax' ) . '<br /><span style=\"font-weight: normal;\">' . __( '(drag to reorder)', 'snax' ) . '</span>',\n\t\t\t\t'callback' => 'snax_admin_setting_callback_active_formats',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_text_array',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_formats_order' => array(\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t),\n\t\t\t'snax_featured_media_required' => array(\n\t\t\t\t'title' => __( 'Featured image field', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_featured_media_required',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_category_required' => array(\n\t\t\t\t'title' => __( 'Category field', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_category_required',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_category_multi' => array(\n\t\t\t\t'title' => __( 'Multiple categories selection?', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_category_multi',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_category_whitelist' => array(\n\t\t\t\t'title' => __( 'Category whitelist', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_category_whitelist',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_category_whitelist',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_category_auto_assign' => array(\n\t\t\t\t'title' => __( 'Auto assign to categories', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_category_auto_assign',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_category_whitelist',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_allow_snax_authors_to_add_referrals' => array(\n\t\t\t\t'title' => __( 'Referral link field ', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_allow_snax_authors_to_add_referrals',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_froala_for_items' => array(\n\t\t\t\t'title' => __( 'Allow rich editor for items in Frontend Submission', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_froala_for_items',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_froala_for_list_items' => array(\n\t\t\t\t'title' => __( 'Allow rich editor for items in open lists', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_froala_for_list_items',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_single_post_page_header' => array(\n\t\t\t\t'title' => '<h2>' . __( 'Single Post Page', 'snax' ) . '</h2>',\n\t\t\t\t'callback' => '__return_empty_string',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_show_featured_images_for_formats' => array(\n\t\t\t\t'title' => __( 'Show featured images for single:', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_show_featured_images_for_formats',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_text_array',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_display_comments_on_lists' => array(\n\t\t\t\t'title' => __( 'Display items comments on list view ', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_display_comments_on_lists',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_show_origin' => array(\n\t\t\t\t'title' => __( 'Show the \"This post was created with our nice and easy submission form.\" text', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_show_origin',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_misc_header' => array(\n\t\t\t\t'title' => '<h2>' . __( 'Misc', 'snax' ) . '</h2>',\n\t\t\t\t'callback' => '__return_empty_string',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_show_item_count_in_title' => array(\n\t\t\t\t'title' => __( 'Show items count in title', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_item_count_in_title',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_disable_admin_bar' => array(\n\t\t\t\t'title' => __( 'Disable admin bar for non-administrators', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_disable_admin_bar',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_disable_dashboard_access' => array(\n\t\t\t\t'title' => __( 'Disable Dashboard access for non-administrators', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_disable_dashboard_access',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_disable_wp_login' => array(\n\t\t\t\t'title' => __( 'Disable WP login form', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_disable_wp_login',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_enable_login_popup' => array(\n\t\t\t\t'title' => __( 'Enbable the login popup ', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_enable_login_popup',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_skip_verification' => array(\n\t\t\t\t'title' => __( 'Moderate new posts?', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_skip_verification',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_mail_notifications' => array(\n\t\t\t\t'title' => __( 'Send mail to admin when new post/item was added?', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_mail_notifications',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t),\n\n\t\t/** Lists Section ****************************************************** */\n\n\t\t'snax_settings_lists' => array(\n\t\t\t'snax_active_item_forms' => array(\n\t\t\t\t'title' => __( 'Item forms', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_active_item_forms',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_text_array',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_show_open_list_in_title' => array(\n\t\t\t\t'title' => __( 'Show list status in title', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_list_status_in_title',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t),\n\n\t\t/** Pages Section ***************************************************** */\n\n\t\t'snax_settings_pages' => array(\n\t\t\t// Frontend Submission.\n\t\t\t'snax_frontend_submission_page_id' => array(\n\t\t\t\t'title' => __( 'Frontend Submission', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_frontend_submission_page',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_published_post',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t// Terms & Conditions.\n\t\t\t'snax_legal_page_id' => array(\n\t\t\t\t'title' => __( 'Terms and Conditions', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_legal_page',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_published_post',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t// Report.\n\t\t\t'snax_report_page_id' => array(\n\t\t\t\t'title' => __( 'Report', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_report_page',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_published_post',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t),\n\n\t\t/** Voting Section **************************************************** */\n\n\t\t'snax_settings_voting' => array(\n\t\t\t'snax_voting_is_enabled' => array(\n\t\t\t\t'title' => __( 'Enable voting?', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_voting_enabled',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_guest_voting_is_enabled' => array(\n\t\t\t\t'title' => __( 'Guests can vote?', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_guest_voting_enabled',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_voting_post_types' => array(\n\t\t\t\t'title' => __( 'Allow users to vote on post types', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_voting_post_types',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_text_array',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_fake_vote_count_base' => array(\n\t\t\t\t'title' => __( 'Fake vote count base', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_fake_vote_count_base',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t),\n\n\t\t/** Limits Section **************************************************** */\n\n\t\t'snax_settings_limits' => array(\n\n\t\t\t/* IMAGES UPLOAD */\n\n\t\t\t'snax_limits_image_header' => array(\n\t\t\t\t'title' => '<h2>' . __( 'Image upload', 'snax' ) . '</h2>',\n\t\t\t\t'callback' => '__return_empty_string',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_image_upload_allowed' => array(\n\t\t\t\t'title' => __( 'Allowed?', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_upload_allowed',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array( 'type' => 'image' ),\n\t\t\t),\n\t\t\t'snax_max_upload_size' => array(\n\t\t\t\t'title' => __( 'Maximum file size', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_upload_max_size',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array( 'type' => 'image' ),\n\t\t\t),\n\t\t\t'snax_image_allowed_types' => array(\n\t\t\t\t'title' => __( 'Allowed types', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_upload_allowed_types',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_text_array',\n\t\t\t\t'args' => array( 'type' => 'image' ),\n\t\t\t),\n\n\t\t\t/* AUDIO UPLOAD */\n\n\t\t\t'snax_limits_audio_header' => array(\n\t\t\t\t'title' => '<h2>' . __( 'Audio upload', 'snax' ) . '</h2>',\n\t\t\t\t'callback' => '__return_empty_string',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_audio_upload_allowed' => array(\n\t\t\t\t'title' => __( 'Allowed?', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_upload_allowed',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array( 'type' => 'audio' ),\n\t\t\t),\n\t\t\t'snax_audio_max_upload_size' => array(\n\t\t\t\t'title' => __( 'Maximum file size', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_upload_max_size',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array( 'type' => 'audio' ),\n\t\t\t),\n\t\t\t'snax_audio_allowed_types' => array(\n\t\t\t\t'title' => __( 'Allowed types', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_upload_allowed_types',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_text_array',\n\t\t\t\t'args' => array( 'type' => 'audio' ),\n\t\t\t),\n\n\t\t\t/* VIDEO UPLOAD */\n\n\t\t\t'snax_limits_video_header' => array(\n\t\t\t\t'title' => '<h2>' . __( 'Video upload', 'snax' ) . '</h2>',\n\t\t\t\t'callback' => '__return_empty_string',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_video_upload_allowed' => array(\n\t\t\t\t'title' => __( 'Allowed?', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_upload_allowed',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array( 'type' => 'video' ),\n\t\t\t),\n\t\t\t'snax_video_max_upload_size' => array(\n\t\t\t\t'title' => __( 'Maximum file size', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_upload_max_size',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array( 'type' => 'video' ),\n\t\t\t),\n\t\t\t'snax_video_allowed_types' => array(\n\t\t\t\t'title' => __( 'Allowed types', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_upload_allowed_types',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_text_array',\n\t\t\t\t'args' => array( 'type' => 'video' ),\n\t\t\t),\n\n\t\t\t/* POSTS */\n\n\t\t\t'snax_limits_posts_header' => array(\n\t\t\t\t'title' => '<h2>' . __( 'Posts', 'snax' ) . '</h2>',\n\t\t\t\t'callback' => '__return_empty_string',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_items_per_page' => array(\n\t\t\t\t'title' => __( 'List items per page', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_items_per_page',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_user_posts_per_day' => array(\n\t\t\t\t'title' => __( 'User can submit', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_new_posts_limit',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_new_post_items_limit' => array(\n\t\t\t\t'title' => __( 'User can submit', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_new_post_items_limit',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_user_submission_limit' => array(\n\t\t\t\t'title' => __( 'User can submit', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_user_submission_limit',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_tags_limit' => array(\n\t\t\t\t'title' => __( 'Tags', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_tags_limit',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_post_title_max_length' => array(\n\t\t\t\t'title' => __( 'Title length', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_post_title_max_length',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_post_description_max_length' => array(\n\t\t\t\t'title' => __( 'Description length', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_post_description_max_length',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_post_content_max_length' => array(\n\t\t\t\t'title' => __( 'Content length', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_post_content_max_length',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\n\t\t\t/* ITEMS */\n\n\t\t\t'snax_limits_items_header' => array(\n\t\t\t\t'title' => '<h2>' . __( 'Items', 'snax' ) . '</h2>',\n\t\t\t\t'callback' => '__return_empty_string',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_item_title_max_length' => array(\n\t\t\t\t'title' => __( 'Title length', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_item_title_max_length',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_item_content_max_length' => array(\n\t\t\t\t'title' => __( 'Description length', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_item_content_max_length',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_item_source_max_length' => array(\n\t\t\t\t'title' => __( 'Source length', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_item_source_max_length',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_item_ref_link_max_length' => array(\n\t\t\t\t'title' => __( 'Referral link length', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_item_ref_link_max_length',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t),\n\n\t\t/** Auth Section ***************************************************** */\n\n\t\t'snax_settings_auth' => array(\n\t\t\t'snax_facebook_app_id' => array(\n\t\t\t\t'title' => __( 'Facebook App ID', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_facebook_app_id',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_login_recaptcha' => array(\n\t\t\t\t'title' => __( 'reCaptcha for login form', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_login_recaptcha',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_recaptcha_site_key' => array(\n\t\t\t\t'title' => __( 'reCaptcha Site Key', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_recaptcha_site_key',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_recaptcha_secret' => array(\n\t\t\t\t'title' => __( 'reCaptcha Secret', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_recaptcha_secret',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t),\n\n\t\t/** Demo Section ***************************************************** */\n\n\t\t'snax_settings_demo' => array(\n\t\t\t'snax_demo_mode' => array(\n\t\t\t\t'title' => __( 'Enable demo mode?', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_demo_mode',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_demo_image_post_id' => array(\n\t\t\t\t'title' => __( 'Image', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_demo_post',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array( 'format' => 'image' ),\n\t\t\t),\n\t\t\t'snax_demo_gallery_post_id' => array(\n\t\t\t\t'title' => __( 'Gallery', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_demo_post',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array( 'format' => 'gallery' ),\n\t\t\t),\n\t\t\t'snax_demo_embed_post_id' => array(\n\t\t\t\t'title' => __( 'Embed', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_demo_post',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array( 'format' => 'embed' ),\n\t\t\t),\n\t\t\t'snax_demo_list_post_id' => array(\n\t\t\t\t'title' => __( 'List', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_demo_post',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array( 'format' => 'list' ),\n\t\t\t),\n\t\t\t'snax_demo_meme_post_id' => array(\n\t\t\t\t'title' => __( 'Meme', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_demo_post',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array( 'format' => 'meme' ),\n\t\t\t),\n\t\t),\n\n\t\t/** Embedly Section ********************************************** */\n\n\t\t'snax_settings_embedly' => array(\n\t\t\t'snax_embedly_enable' => array(\n\t\t\t\t'title' => __( 'Enable Embedly support?', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_embedly_enable',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_embedly_dark_skin' => array(\n\t\t\t\t'title' => __( 'Dark skin', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_embedly_dark_skin',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_embedly_buttons' => array(\n\t\t\t\t'title' => __( 'Share buttons', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_embedly_buttons',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_embedly_width' => array(\n\t\t\t\t'title' => __( 'Width', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_embedly_width',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_embedly_alignment' => array(\n\t\t\t\t'title' => __( 'Alignment', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_embedly_alignment',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_embedly_api_key' => array(\n\t\t\t\t'title' => __( 'Embedly cards API key', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_embedly_api_key',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t),\n\t\t/** Permalinks Section ********************************************** */\n\n\t\t'snax_permalinks' => array(\n\t\t\t'snax_item_slug' => array(\n\t\t\t\t'title' => __( 'Item url', 'snax' ),\n\t\t\t\t'callback' => 'snax_permalink_callback_item_slug',\n\t\t\t\t'sanitize_callback' => 'sanitize_text',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_url_var_prefix' => array(\n\t\t\t\t'title' => __( 'URL variable', 'snax' ),\n\t\t\t\t'callback' => 'snax_permalink_callback_url_var_prefix',\n\t\t\t\t'sanitize_callback' => 'sanitize_text',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t),\n\t) );\n}", "public function getEnableFieldsToBeIgnored() {}", "public static function getFieldBlacklist()\n {\n $fieldBlacklist = array();\n if ( eZINI::instance( 'ocopendata.ini' )->hasVariable( 'ContentSettings', 'IdentifierBlackListForExternal' ) )\n {\n $fieldBlacklist = array_fill_keys(\n eZINI::instance( 'ocopendata.ini' )->variable( 'ContentSettings', 'IdentifierBlackListForExternal' ),\n true\n );\n }\n return $fieldBlacklist;\n }", "protected function getExcludeFields() {}", "public function getSearchFields(): array {\n # TODO move this to database\n $ignoreValues = ['SortNum' => '', 'Accession Numerical' => '', 'Imaged' => '', 'IIFRNo' => '',\n 'Photographs::photoFileName' => '', 'Event::eventDate' => '', 'card01' => '', 'Has Image' => '', 'imaged' => ''];\n return array_diff_key($this->search_layout->getFields(), $ignoreValues);\n }", "function get_fields_text()\n\t{\n\t\t$fields_text\t=\tarray(); \n\t\t$fields\t\t=\t$this->_get_fields();\n\t\tforeach ( $fields as $field )\n\t\t{\n\t\t\tif ( $field->type == 'varchar' ||\n\t\t\t $field->type == 'text'\n\t\t\t )\n\t\t\t{\n\t\t\t\t$fields_text[]->name\t= $field->name;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $fields_text;\n\t}", "abstract public function getSettingsFields();", "public static function getUiFilterFields()\n\t{\n\t\treturn array();\n\t}", "public function get_config_field_subtext()\n\t{\n\t\treturn array(\n\t\t\t'site_url'\t\t\t\t\t=> array('url_explanation'),\n\t\t\t'is_site_on'\t\t\t\t=> array('is_site_on_explanation'),\n\t\t\t'is_system_on'\t\t\t\t=> array('is_system_on_explanation'),\n\t\t\t'debug'\t\t\t\t\t\t=> array('debug_explanation'),\n\t\t\t'show_profiler'\t\t\t\t=> array('show_profiler_explanation'),\n\t\t\t'max_caches'\t\t\t\t=> array('max_caches_explanation'),\n\t\t\t'use_newrelic'\t\t\t\t=> array('use_newrelic_explanation'),\n\t\t\t'newrelic_app_name'\t\t\t=> array('newrelic_app_name_explanation'),\n\t\t\t'gzip_output'\t\t\t\t=> array('gzip_output_explanation'),\n\t\t\t'server_offset'\t\t\t\t=> array('server_offset_explain'),\n\t\t\t'default_member_group'\t\t=> array('group_assignment_defaults_to_two'),\n\t\t\t'smtp_server'\t\t\t\t=> array('only_if_smpte_chosen'),\n\t\t\t'smtp_port'\t\t\t\t\t=> array('only_if_smpte_chosen'),\n\t\t\t'smtp_username'\t\t\t\t=> array('only_if_smpte_chosen'),\n\t\t\t'smtp_password'\t\t\t\t=> array('only_if_smpte_chosen'),\n\t\t\t'email_batchmode'\t\t\t=> array('batchmode_explanation'),\n\t\t\t'email_batch_size'\t\t\t=> array('batch_size_explanation'),\n\t\t\t'webmaster_email'\t\t\t=> array('return_email_explanation'),\n\t\t\t'cookie_domain'\t\t\t\t=> array('cookie_domain_explanation'),\n\t\t\t'cookie_prefix'\t\t\t\t=> array('cookie_prefix_explain'),\n\t\t\t'cookie_path'\t\t\t\t=> array('cookie_path_explain'),\n\t\t\t'deny_duplicate_data'\t\t=> array('deny_duplicate_data_explanation'),\n\t\t\t'redirect_submitted_links'\t=> array('redirect_submitted_links_explanation'),\n\t\t\t'require_secure_passwords'\t=> array('secure_passwords_explanation'),\n\t\t\t'allow_dictionary_pw'\t\t=> array('real_word_explanation', 'dictionary_note'),\n\t\t\t'censored_words'\t\t\t=> array('censored_explanation', 'censored_wildcards'),\n\t\t\t'censor_replacement'\t\t=> array('censor_replacement_info'),\n\t\t\t'password_lockout'\t\t\t=> array('password_lockout_explanation'),\n\t\t\t'password_lockout_interval' => array('login_interval_explanation'),\n\t\t\t'require_ip_for_login'\t\t=> array('require_ip_explanation'),\n\t\t\t'allow_multi_logins'\t\t=> array('allow_multi_logins_explanation'),\n\t\t\t'name_of_dictionary_file'\t=> array('dictionary_explanation'),\n\t\t\t'force_query_string'\t\t=> array('force_query_string_explanation'),\n\t\t\t'image_resize_protocol'\t\t=> array('image_resize_protocol_exp'),\n\t\t\t'image_library_path'\t\t=> array('image_library_path_exp'),\n\t\t\t'thumbnail_prefix'\t\t\t=> array('thumbnail_prefix_exp'),\n\t\t\t'member_theme'\t\t\t\t=> array('member_theme_exp'),\n\t\t\t'require_terms_of_service'\t=> array('require_terms_of_service_exp'),\n\t\t\t'email_console_timelock'\t=> array('email_console_timelock_exp'),\n\t\t\t'log_email_console_msgs'\t=> array('log_email_console_msgs_exp'),\n\t\t\t'use_membership_captcha'\t=> array('captcha_explanation'),\n\t\t\t'strict_urls'\t\t\t\t=> array('strict_urls_info'),\n\t\t\t'enable_template_routes'\t=> array('enable_template_routes_exp'),\n\t\t\t'tmpl_display_mode'\t\t\t=> array('tmpl_display_mode_exp'),\n\t\t\t'site_404'\t\t\t\t\t=> array('site_404_exp'),\n\t\t\t'channel_nomenclature'\t\t=> array('channel_nomenclature_exp'),\n\t\t\t'enable_sql_caching'\t\t=> array('enable_sql_caching_exp'),\n\t\t\t'email_debug'\t\t\t\t=> array('email_debug_exp'),\n\t\t\t'use_category_name'\t\t\t=> array('use_category_name_exp'),\n\t\t\t'reserved_category_word'\t=> array('reserved_category_word_exp'),\n\t\t\t'auto_assign_cat_parents'\t=> array('auto_assign_cat_parents_exp'),\n\t\t\t'save_tmpl_revisions'\t\t=> array('template_rev_msg'),\n\t\t\t'max_tmpl_revisions'\t\t=> array('max_revisions_exp'),\n\t\t\t'max_page_loads'\t\t\t=> array('max_page_loads_exp'),\n\t\t\t'time_interval'\t\t\t\t=> array('time_interval_exp'),\n\t\t\t'lockout_time'\t\t\t\t=> array('lockout_time_exp'),\n\t\t\t'banishment_type'\t\t\t=> array('banishment_type_exp'),\n\t\t\t'banishment_url'\t\t\t=> array('banishment_url_exp'),\n\t\t\t'banishment_message'\t\t=> array('banishment_message_exp'),\n\t\t\t'enable_search_log'\t\t\t=> array('enable_search_log_exp'),\n\t\t\t'dynamic_tracking_disabling'=> array('dynamic_tracking_disabling_info')\n\t\t);\n\t}", "protected function filterDropdownFields(): array\n {\n return [];\n }", "function advanced_settings_fields_filter2($fields) {\n $model_config = WYSIJA::get('config', 'model');\n if ($model_config->getValue('premium_key')) {\n $fields['dkim'] = array(\n 'type' => 'dkim',\n 'label' => __('DKIM signature', WYSIJA),\n 'desc' => __('Improve your spam score. Mailpoet can sign all your emails with DKIM. [link]Read more.[/link]', WYSIJA),\n 'link' => '<a href=\"http://docs.mailpoet.com/article/21-email-authentication-spf-and-dkim\" target=\"_blank\" title=\"' . __(\"Preview page\", WYSIJA) . '\">');\n }\n return $fields;\n }", "public function Filter_Not() {\r\n\t\treturn array(\r\n\t\t\t'where' => '0'\r\n\t\t);\r\n\t}", "private function getPreviewFields() \r\n\t{\r\n\t\t$sql = \"select field1, field2, field3, field4, field5 \r\n\t\t\t\tfrom redcap_ddp_preview_fields where project_id = \" . $this->project_id;\r\n\t\t$q = db_query($sql);\r\n\t\tif (db_num_rows($q)) {\r\n\t\t\t// Remove all blank instances\r\n\t\t\t$preview_fields = db_fetch_assoc($q);\r\n\t\t\tforeach ($preview_fields as $key=>$field) {\r\n\t\t\t\tif ($field == '') unset($preview_fields[$key]);\r\n\t\t\t}\r\n\t\t\treturn array_values($preview_fields);\r\n\t\t} else {\r\n\t\t\treturn array();\r\n\t\t}\r\n\t}", "public function filters() {\n\t\treturn array(\n\t\t 'name' => array(array('trim')),\n\t\t);\n\t}", "protected function filterNumericFields(): array\n {\n return [];\n }", "protected function getFilterableFields() {\n $fields = $this->config->getFilterableFields();\n\n if(count($fields) == 0) {\n return false;\n }\n\n return $fields;\n }", "function getCustomFields($settings, $which)\n\t{\n\t\tif (IsSet($settings->saml_settings[$which]))\n\t\t{\n\t\t\treturn array_keys($settings->saml_settings[$which]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$empty = array();\n\t\t\treturn $empty;\n\t\t}\n\t}", "protected function getConfigFormValuesSearchLayer()\n {\n $fields = [];\n $fields['DF_INSTALLATION_ID'] = Configuration::get('DF_INSTALLATION_ID');\n $fields['DF_SHOW_LAYER'] = Configuration::get('DF_SHOW_LAYER', null, null, null, true);\n $fields['DF_SHOW_LAYER_MOBILE'] = Configuration::get('DF_SHOW_LAYER_MOBILE', null, null, null, true);\n\n return $fields;\n }", "function culturefeed_search_ui_default_filter_options($filter_form_number) {\n\n $defaults = array(\n 1 => array(\n array(\n 'exposed' => TRUE,\n 'title' => 'Free only',\n 'query-string' => 'free-only',\n 'api-filter-query' => 'price:0'\n ),\n array(\n 'exposed' => TRUE,\n 'title' => 'No courses and workshops',\n 'query-string' => 'no-courses-workshops',\n 'api-filter-query' => '!category_id:0.3.1.0.0'\n ),\n array(\n 'exposed' => TRUE,\n 'title' => 'For toddlers',\n 'query-string' => 'voor-kinderen',\n 'api-filter-query' => '(agefrom:[* TO 12] OR keywords:\"ook voor kinderen\")'\n ),\n array(\n 'exposed' => TRUE,\n 'title' => 'For UiTPAS and Paspartoe',\n 'query-string' => 'uitpas',\n 'api-filter-query' => '(keywords:uitpas* OR Paspartoe)'\n ),\n ),\n 2 => array(\n array(\n 'exposed' => TRUE,\n 'title' => 'Hide long-running events',\n 'query-string' => 'no-periods',\n 'api-filter-query' => 'periods:false'\n ),\n array(\n 'exposed' => TRUE,\n 'title' => 'Hide permanent events',\n 'query-string' => 'no-permanent',\n 'api-filter-query' => 'permanent:false'\n ),\n ),\n 3 => array(\n array(\n 'exposed' => TRUE,\n 'title' => 'Free only',\n 'query-string' => 'free-only',\n 'api-filter-query' => 'price:0'\n ),\n array(\n 'exposed' => TRUE,\n 'title' => 'No courses and workshops',\n 'query-string' => 'no-courses-workshops',\n 'api-filter-query' => '!category_id:0.3.1.0.0'\n ),\n array(\n 'exposed' => TRUE,\n 'title' => 'For toddlers',\n 'query-string' => 'voor-kinderen',\n 'api-filter-query' => '(agefrom:[* TO 12] OR keywords:\"ook voor kinderen\")'\n ),\n array(\n 'exposed' => TRUE,\n 'title' => 'For UiTPAS and Paspartoe',\n 'query-string' => 'uitpas',\n 'api-filter-query' => '(keywords:uitpas* OR Paspartoe)'\n ),\n ),\n );\n\n return isset($defaults[$filter_form_number]) ? $defaults[$filter_form_number] : array();\n\n}", "public function getDefaultFields()\n {\n /*\n $defaultFields = array(\n array(\n 'gtf_field_name' => 'Treatment',\n 'gtf_field_code' => 'treatment',\n 'gtf_field_description' => 'Enter the shorthand code for the treatment here',\n 'gtf_field_values' => null,\n 'gtf_field_type' => 'text',\n 'gtf_required' => 1,\n 'gtf_readonly' => 0\n ),\n array(\n 'gtf_field_name' => 'Physician',\n 'gtf_field_code' => 'physicion',\n 'gtf_field_description' => '',\n 'gtf_field_values' => null,\n 'gtf_field_type' => 'text',\n 'gtf_required' => 0,\n 'gtf_readonly' => 0\n )\n );\n return $defaultFields;\n */\n\n return [];\n }", "public function getAllowedExcludeFields() {}", "protected static function get_non_ui_options() {\n\t\treturn array_filter(self::get_options(), function($option) {\n\t\t\treturn $option['type'] !== 'tab' &&\n\t\t\t $option['type'] !== 'title' &&\n\t\t\t $option['type'] !== 'description' &&\n\t\t\t $option['type'] !== 'code';\n\t\t});\n\t}", "public function get_filter_options()\n {\n \t$filters = [\n \t\t'date' => \"Date\",\n\t\t\t'headers' => \"Headers\",\n\t\t\t'mailwatch_id' => \"Message ID\",\n\t\t\t'size' => \"Size (bytes)\",\n\t\t\t'from_address' => \"From\",\n\t\t\t'from_domain' => \"From Domain\",\n\t\t\t'to_address' => \"To\",\n\t\t\t'to_domain' => \"To Domain\",\n\t\t\t'subject' => \"Subject\",\n\t\t\t'clientip' => \"Received from (IP Address)\",\n\t\t\t'is_spam' => \"is Spam (&gt;0 = TRUE)\",\n\t\t\t'is_highspam' => \"is High Scoring Spam (&gt;0 = TRUE)\",\n\t\t\t'is_sa_spam' => \"is Spam according to SpamAssassin (&gt;0 = TRUE)\",\n\t\t\t'is_rbl_spam' => \"is Listed in one or more RBL's (&gt;0 = TRUE)\",\n\t\t\t'spam_whitelisted' => \"is Whitelisted (&gt;0 = TRUE)\",\n\t\t\t'spam_blacklisted' => \"is Blacklisted (&gt;0 = TRUE)\",\n\t\t\t'sa_score' => \"SpamAssassin Score\",\n\t\t\t'spam_report' => \"Spam Report\",\n\t\t\t'is_mcp' => \"is MCP (&gt;0 = TRUE)\",\n\t\t\t'is_highmcp' => \"is High Scoring MCP (&gt;0 = TRUE)\",\n\t\t\t'is_sa_mcp' => \"is MCP according to SpamAssassin (&gt;0 = TRUE)\",\n\t\t\t'mcp_whitelisted' => \"is MCP Whitelisted (&gt;0 = TRUE)\",\n\t\t\t'mcp_blacklisted' => \"is MCP Blacklisted (&gt;0 = TRUE)\",\n\t\t\t'mcp_score' => \"MCP Score\",\n\t\t\t'mcp_report' => \"MCP Report\",\n\t\t\t'virus_infected' => \"contained a Virus (&gt;0 = TRUE)\",\n\t\t\t'name_infected' => \"contained an Unacceptable Attachment (&gt;0 = TRUE)\",\n\t\t\t'other_infected' => \"contained other infections (&gt;0 = TRUE)\",\n\t\t\t'report' => \"Virus Report\",\n\t\t\t'hostname' => \"MailScanner Hostname\",\n \t];\n \t$active_filters = session('reports_filter_domain', []);\n \tforeach ($active_filters as $key => $filter) {\n \t\tif(array_key_exists($key, $filters))\n \t\t{\n \t\t\tunset($filters[$key]);\n \t\t}\n \t}\n $remaining_filters = array_diff_key($filters, array_keys($active_filters));\n $filter_options = [];\n foreach ($remaining_filters as $key => $value) {\n $filter_options[] = [\n 'text' => $value,\n 'value' => $key\n ];\n }\n //return ['filter_options' => array_diff_key($filters, array_keys($active_filters)), 'active_filters' => $active_filters];\n \treturn ['filter_options' => $filter_options, 'active_filters' => $active_filters];\n }", "public static function withWhiteText(): array {\n $allLines = self::all();\n return array_filter($allLines, function($line) {\n return $line['text'] === '#FFFFFF';\n });\n }", "protected function getEmptyFilter()\n {\n return array('filters' => array());\n }", "public function filters()\n {\n return [\n 'first_name' => 'trim|escape',\n 'last_name' => 'trim|escape',\n 'email_address' => 'trim|escape',\n 'message' => 'trim|escape',\n 'business_name' => 'trim|escape'\n ];\n }", "public function getIgnoreEnableFields() {}", "public static function getTextFields(): array\n {\n $Qb = GlobalContainer::getConnection()\n ->createQueryBuilder()\n ->select('ff.*')\n ->from('pqr_form_fields', 'ff')\n ->join('ff', 'pqr_html_fields', 'hf', 'ff.fk_pqr_html_field=hf.id')\n ->where(\"hf.type_saia='Text' and ff.active=1\")\n ->orderBy('ff.orden');\n\n $data = [];\n if ($records = PqrFormField::findByQueryBuilder($Qb)) {\n foreach ($records as $PqrFormField) {\n $data[] = [\n 'id' => $PqrFormField->getPK(),\n 'text' => $PqrFormField->label\n ];\n }\n }\n\n return $data;\n }", "private function _exclude_setting_system_fields($settings) {\n\t\tif (isset($settings[\"title\"])) {\n\t\t\tunset($settings[\"title\"]);\n\t\t}\n\n\t\tif (isset($settings[\"eid\"])) {\n\t\t\tunset($settings[\"eid\"]);\n\t\t}\n\n\t\treturn $settings;\n\t}", "protected function getGeneralAdditionalFields() {\n\t\t$additionalFields = array();\n\n\t\t$fieldId = 'configuredWidgets';\n\t\t$count = (count($this->availableWidgetList) <= 10 ?\n\t\t\tcount($this->availableWidgetList) :\n\t\t\t10);\n\t\t$fieldCode = $this->getSelect($fieldId, '', $this->availableWidgetList, $this->currentWidgetList, TRUE, $count);\n\n\t\t$additionalFields[$fieldId] = array(\n\t\t\t'code' => $fieldCode,\n\t\t\t'label' => 'LLL:EXT:geckoboard/Resources/Private/Language/locallang_be.xml:label.configuredWidgets',\n\t\t\t'cshKey' => '_MOD_tools_txgeckoboardM1',\n\t\t\t'cshLabel' => 'task_' . $fieldId\n\t\t);\n\n\t\treturn $additionalFields;\n\t}", "function filterFields ( $fields )\n\t{\n\t\tif (!is_array($fields) )\n\t\t{\n\t\t\treturn array() ;\n\t\t}\n\t\t\n\t\tif ( empty($fields) )\n\t\t{\n\t\t\treturn $fields ;\n\t\t}\n\t\t$ffields = array () ;\n\t\tforeach ( $fields as &$f )\n\t\t{\n\t\t\tif ( ake ( $f , $this->_fields ) )\n\t\t\t{\n\t\t\t\t$ffields[] = $f ;\n\t\t\t}\n\t\t}\n\t\treturn $ffields ;\n\t}", "function NonTextFilterApplied(&$fld) {\n\t\tif (is_array($fld->DefaultDropDownValue) && is_array($fld->DropDownValue)) {\n\t\t\tif (count($fld->DefaultDropDownValue) <> count($fld->DropDownValue))\n\t\t\t\treturn TRUE;\n\t\t\telse\n\t\t\t\treturn (count(array_diff($fld->DefaultDropDownValue, $fld->DropDownValue)) <> 0);\n\t\t}\n\t\telse {\n\t\t\t$v1 = strval($fld->DefaultDropDownValue);\n\t\t\tif ($v1 == EWRPT_INIT_VALUE)\n\t\t\t\t$v1 = \"\";\n\t\t\t$v2 = strval($fld->DropDownValue);\n\t\t\tif ($v2 == EWRPT_INIT_VALUE || $v2 == EWRPT_ALL_VALUE)\n\t\t\t\t$v2 = \"\";\n\t\t\treturn ($v1 <> $v2);\n\t\t}\n\t}", "function NonTextFilterApplied(&$fld) {\n\t\tif (is_array($fld->DefaultDropDownValue) && is_array($fld->DropDownValue)) {\n\t\t\tif (count($fld->DefaultDropDownValue) <> count($fld->DropDownValue))\n\t\t\t\treturn TRUE;\n\t\t\telse\n\t\t\t\treturn (count(array_diff($fld->DefaultDropDownValue, $fld->DropDownValue)) <> 0);\n\t\t}\n\t\telse {\n\t\t\t$v1 = strval($fld->DefaultDropDownValue);\n\t\t\tif ($v1 == EWRPT_INIT_VALUE)\n\t\t\t\t$v1 = \"\";\n\t\t\t$v2 = strval($fld->DropDownValue);\n\t\t\tif ($v2 == EWRPT_INIT_VALUE || $v2 == EWRPT_ALL_VALUE)\n\t\t\t\t$v2 = \"\";\n\t\t\treturn ($v1 <> $v2);\n\t\t}\n\t}", "public function toArray(): array\n {\n return [\n 'type' => 'not',\n 'field' => $this->filter->toArray(),\n ];\n }", "public function mt_supportedTextFilters()\n {\n }", "public static function getFilterOptions()\n\t{\n\t\t$filtOptions = array(\n\t\t\tJHtml::_('select.option', '1', JText::_('COM_ARTOFGM_OPTION_FILTER_1')),\n\t\t\tJHtml::_('select.option', '0', JText::_('COM_ARTOFGM_OPTION_FILTER_0')),\n\t\t\tJHtml::_('select.option', 's', JText::_('COM_ARTOFGM_OPTION_FILTER_S')),\n\t\t\tJHtml::_('select.option', 'p', JText::_('COM_ARTOFGM_OPTION_FILTER_P')),\n\t\t);\n\n\t\treturn $filtOptions;\n\t}", "public function filters()\n {\n return [\n 'team_name' => 'trim|escape'\n ];\n }", "public static function get_input_fields() {\n\t\t$allowed_settings = DataSource::get_allowed_settings();\n\n\t\t$input_fields = [];\n\n\t\tif ( ! empty( $allowed_settings ) ) {\n\n\t\t\t/**\n\t\t\t * Loop through the $allowed_settings and build fields\n\t\t\t * for the individual settings\n\t\t\t */\n\t\t\tforeach ( $allowed_settings as $key => $setting ) {\n\n\t\t\t\t/**\n\t\t\t\t * Determine if the individual setting already has a\n\t\t\t\t * REST API name, if not use the option name.\n\t\t\t\t * Sanitize the field name to be camelcase\n\t\t\t\t */\n\t\t\t\tif ( ! empty( $setting['show_in_rest']['name'] ) ) {\n\t\t\t\t\t$individual_setting_key = lcfirst( $setting['group'] . 'Settings' . str_replace( '_', '', ucwords( $setting['show_in_rest']['name'], '_' ) ) );\n\t\t\t\t} else {\n\t\t\t\t\t$individual_setting_key = lcfirst( $setting['group'] . 'Settings' . str_replace( '_', '', ucwords( $key, '_' ) ) );\n\t\t\t\t}\n\n\t\t\t\t$replaced_setting_key = preg_replace( '[^a-zA-Z0-9 -]', ' ', $individual_setting_key );\n\n\t\t\t\tif ( ! empty( $replaced_setting_key ) ) {\n\t\t\t\t\t$individual_setting_key = $replaced_setting_key;\n\t\t\t\t}\n\n\t\t\t\t$individual_setting_key = lcfirst( $individual_setting_key );\n\t\t\t\t$individual_setting_key = lcfirst( str_replace( '_', ' ', ucwords( $individual_setting_key, '_' ) ) );\n\t\t\t\t$individual_setting_key = lcfirst( str_replace( '-', ' ', ucwords( $individual_setting_key, '_' ) ) );\n\t\t\t\t$individual_setting_key = lcfirst( str_replace( ' ', '', ucwords( $individual_setting_key, ' ' ) ) );\n\n\t\t\t\t/**\n\t\t\t\t * Dynamically build the individual setting,\n\t\t\t\t * then add it to the $input_fields\n\t\t\t\t */\n\t\t\t\t$input_fields[ $individual_setting_key ] = [\n\t\t\t\t\t'type' => $setting['type'],\n\t\t\t\t\t'description' => $setting['description'],\n\t\t\t\t];\n\n\t\t\t}\n\t\t}\n\n\t\treturn $input_fields;\n\t}", "private function getDefaultNodeFilters() {\r\n if(!empty($this->defaultNodeFilters)){\r\n return $this->defaultNodeFilters;\r\n }\r\n // Regular filters\r\n $this->defaultNodeFilters = array();\r\n $this->defaultNodeFilters['status'] = array(\r\n 'title' => t('status'),\r\n 'options' => array(\r\n '[any]' => t('any'),\r\n 'status-1' => t('published'),\r\n 'status-0' => t('not published'),\r\n 'promote-1' => t('promoted'),\r\n 'promote-0' => t('not promoted'),\r\n 'sticky-1' => t('sticky'),\r\n 'sticky-0' => t('not sticky'),\r\n ),\r\n );\r\n \r\n // Include translation states if we have this module enabled\r\n if (module_exists('translation')) {\r\n $this->defaultNodeFilters['status']['options'] += array(\r\n 'translate-0' => t('Up to date translation'),\r\n 'translate-1' => t('Outdated translation'),\r\n );\r\n }\r\n \r\n //Set type filter field\r\n $this->defaultNodeFilters['type'] = array('title' => t('type'),'options' => array('[any]' => t('any')));\r\n $this->defaultNodeFilters['type']['options'] += node_type_get_names();\r\n \r\n // Language filter if there is a list of languages\r\n if ($languages = module_invoke('locale', 'language_list')) {\r\n $languages = array(LANGUAGE_NONE => t('Language neutral')) + $languages;\r\n $this->defaultNodeFilters['language'] = array(\r\n 'title' => t('language'),\r\n 'options' => array('[any]' => t('any'))\r\n );\r\n $this->defaultNodeFilters['language']['options'] += $languages;\r\n }\r\n\r\n return $this->defaultNodeFilters;\r\n }", "function getExcludedValues()\n{\n $excludedValue = \"\";\n $excludedValue .= getExcludedValueByName(\"Process_Rewrite\");\n $excludedValue .= getExcludedValueByName(\"Process_Extension\");\n $excludedValue .= getExcludedValueByName(\"Process_StranglerPattern\");\n $excludedValue .= getExcludedValueByName(\"Process_ContinuousEvolution\");\n $excludedValue .= getExcludedValueByName(\"Process_Split\");\n $excludedValue .= getExcludedValueByName(\"Process_Others\");\n $excludedValue .= getExcludedValueByName(\"Decomposition_DDD\");\n $excludedValue .= getExcludedValueByName(\"Decomposition_FunctionalDecomposition\");\n $excludedValue .= getExcludedValueByName(\"Decomposition_ExistingStructure\");\n $excludedValue .= getExcludedValueByName(\"Decomposition_Others\");\n $excludedValue .= getExcludedValueByName(\"Technique_SCA\");\n $excludedValue .= getExcludedValueByName(\"Technique_MDA\");\n $excludedValue .= getExcludedValueByName(\"Technique_WDA\");\n $excludedValue .= getExcludedValueByName(\"Technique_DMC\");\n $excludedValue .= getExcludedValueByName(\"Technique_Others\");\n $excludedValue .= getExcludedValueByName(\"Applicability_GR\");\n $excludedValue .= getExcludedValueByName(\"Applicability_MO\");\n $excludedValue .= getExcludedValueByName(\"Input_SourceCode\");\n $excludedValue .= getExcludedValueByName(\"Input_UseCase\");\n $excludedValue .= getExcludedValueByName(\"Input_SystemSpecification\");\n $excludedValue .= getExcludedValueByName(\"Input_API\");\n $excludedValue .= getExcludedValueByName(\"Input_Others\");\n $excludedValue .= getExcludedValueByName(\"Output_List\");\n $excludedValue .= getExcludedValueByName(\"Output_Archi\");\n $excludedValue .= getExcludedValueByName(\"Output_Others\");\n $excludedValue .= getExcludedValueByName(\"Validation_Experiment\");\n $excludedValue .= getExcludedValueByName(\"Validation_Example\");\n $excludedValue .= getExcludedValueByName(\"Validation_CaseStudy\");\n $excludedValue .= getExcludedValueByName(\"Validation_NoValidation\");\n $excludedValue .= getExcludedValueByName(\"Quality_Maintainability\");\n $excludedValue .= getExcludedValueByName(\"Quality_Performance\");\n $excludedValue .= getExcludedValueByName(\"Quality_Reliability\");\n $excludedValue .= getExcludedValueByName(\"Quality_Scalability\");\n $excludedValue .= getExcludedValueByName(\"Quality_Security\");\n $excludedValue .= getExcludedValueByName(\"Quality_Others\");\n\n return $excludedValue;\n}", "private function getSectionSettingFields(){\n\t\t\t\n\t\t\t$fields = array(\n\n\t\t\t\tField::text(\n\t\t\t\t\t'name',\n\t\t\t\t\t__( 'Template name', 'chefsections' )\n\t\t\t\t),\n\n\t\t\t\tField::text( \n\t\t\t\t\t'classes',\n\t\t\t\t\t__( 'CSS Classes', 'chefsections' ),\n\t\t\t\t\tarray( \n\t\t\t\t\t\t'placeholder' => __( 'Seperate with commas\\'s', 'chefsections' ),\n\t\t\t\t\t)\n\t\t\t\t),\n\n\t\t\t\tField::checkbox(\n\t\t\t\t\t'hide_container',\n\t\t\t\t\t__( 'Hide Container', 'chefsections' )\n\t\t\t\t),\n\n\t\t\t);\n\n\t\t\t$fields = apply_filters( 'chef_sections_setting_fields', $fields, $this );\n\n\t\t\treturn $fields;\n\t\t}", "private function getHiddenFieldsWithoutAccess(): array\n\t{\n\t\treturn [\n\t\t\t'STORE_TO',\n\t\t\t'STORE_TO_INFO',\n\t\t\t'STORE_TO_TITLE',\n\t\t\t'STORE_TO_AMOUNT',\n\t\t\t'STORE_TO_RESERVED',\n\t\t\t'STORE_TO_AVAILABLE_AMOUNT',\n\t\t\t'STORE_FROM',\n\t\t\t'STORE_FROM_INFO',\n\t\t\t'STORE_FROM_TITLE',\n\t\t\t'STORE_FROM_AMOUNT',\n\t\t\t'STORE_FROM_RESERVED',\n\t\t\t'STORE_FROM_AVAILABLE_AMOUNT',\n\t\t\t'PURCHASING_PRICE',\n\t\t\t'BASE_PRICE',\n\t\t\t'TOTAL_PRICE',\n\t\t\t'AMOUNT',\n\t\t];\n\t}", "function readfilter()\n\t{\n\t\t$field = $this->input->post(\"namafield\");\n\t\t$value = $this->input->post(\"valfilter\");\n\n\t\treturn array(\n\t\t\t\t\"field\" => $field,\n\t\t\t\t\"value\" => $value\n\t\t\t);\n\t}", "abstract protected function filterFieldvalue();", "function mace_admin_get_settings_fields() {\n\t$fields = array();\n\t$settings_pages = mace_get_settings_pages();\n\n\tforeach( $settings_pages as $page_id => $page_config ) {\n\t\t$fields[ $page_id ] = $page_config['fields'];\n\t}\n\n\treturn (array) apply_filters( 'mace_admin_get_settings_fields', $fields );\n}", "private function getFilteredConfig()\n {\n return array_diff_key($this->resolvedBaseSettings, array_flip($this->primaryReadReplicaConfigIgnored));\n }", "abstract public function filterFields();", "protected function getFilterField(){\n $aField = parent::getFilterField();\n $oRequest = AMI::getSingleton('env/request');\n if(!$oRequest->get('category', 0)){\n $aField['disableSQL'] = TRUE;\n }\n return $aField;\n }", "public static function get_output_fields() {\n\t\t$output_fields = [];\n\n\t\t/**\n\t\t * Get the allowed setting groups and their fields\n\t\t */\n\t\t$allowed_setting_groups = DataSource::get_allowed_settings_by_group();\n\n\t\tif ( ! empty( $allowed_setting_groups ) && is_array( $allowed_setting_groups ) ) {\n\t\t\tforeach ( $allowed_setting_groups as $group => $setting_type ) {\n\n\t\t\t\t$replaced_group = preg_replace( '[^a-zA-Z0-9 -]', ' ', $group );\n\n\t\t\t\tif ( ! empty( $replaced_group ) ) {\n\t\t\t\t\t$group = $replaced_group;\n\t\t\t\t}\n\n\t\t\t\t$setting_type = lcfirst( $group );\n\t\t\t\t$setting_type = lcfirst( str_replace( '_', ' ', ucwords( $setting_type, '_' ) ) );\n\t\t\t\t$setting_type = lcfirst( str_replace( '-', ' ', ucwords( $setting_type, '_' ) ) );\n\t\t\t\t$setting_type = lcfirst( str_replace( ' ', '', ucwords( $setting_type, ' ' ) ) );\n\n\t\t\t\t$output_fields[ $setting_type . 'Settings' ] = [\n\t\t\t\t\t'type' => $setting_type . 'Settings',\n\t\t\t\t\t'resolve' => function () use ( $setting_type ) {\n\t\t\t\t\t\treturn $setting_type;\n\t\t\t\t\t},\n\t\t\t\t];\n\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Get all of the settings, regardless of group\n\t\t */\n\t\t$output_fields['allSettings'] = [\n\t\t\t'type' => 'Settings',\n\t\t\t'resolve' => function () {\n\t\t\t\treturn true;\n\t\t\t},\n\t\t];\n\n\t\treturn $output_fields;\n\t}", "function get_character_filter_options() {\n return drupal_map_assoc([\n 'html_strip',\n 'mapping',\n 'pattern_replace',\n ]);\n}", "public function getDontlognullAllowableValues()\n {\n return [\n self::DONTLOGNULL_ENABLED,\nself::DONTLOGNULL_DISABLED, ];\n }", "public function filters()\n {\n return [\n \"info.gravatar\" => \"trim|cast:boolean\",\n \"info.first_name\" => \"trim|strip_tags|cast:string\",\n \"info.last_name\" => \"trim|strip_tags|cast:string\",\n \"info.gender\" => \"trim|strip_tags|cast:string\",\n \"info.birthday\" => \"trim|strip_tags|cast:string\",\n \"info.mobile_phone\" => \"trim|strip_tags|cast:string\",\n \"info.address\" => \"trim|strip_tags|cast:string\",\n \"info.city\" => \"trim|strip_tags|cast:string\",\n \"info.country\" => \"trim|strip_tags|cast:string\",\n\n \"info.username\" => \"trim|strip_tags|cast:string\",\n \"info.displayname\" => \"trim|strip_tags|cast:string\",\n \"info.email\" => \"trim|strip_tags|cast:string\",\n \"info.password\" => \"trim|strip_tags|cast:string\",\n\n \"action\" => \"trim|strip_tags|cast:string\",\n \"_token\" => \"trim|strip_tags|cast:string\",\n \"_method\" => \"trim|strip_tags|cast:string\"\n ];\n }", "private function ignore_fields()\n\t {\n\t\t// --------------------------------------------\n\t\t// Remove These\n\t\t// - Nothing for images (maybe in the future we can import images, not today)\n\t\t// - All stats and dates\n\t\t// --------------------------------------------\n\n\t\t$list[] = 'member_id';\n\t\t$list[] = 'authcode';\n\t\t$list[] = 'salt';\n\t\t$list[] = 'crypt_key';\n\n\t\t$list[] = 'avatar_filename';\n\t\t$list[] = 'avatar_width';\n\t\t$list[] = 'avatar_height';\n\t\t$list[] = 'photo_filename';\n\t\t$list[] = 'photo_width';\n\t\t$list[] = 'photo_height';\n\t\t$list[] = 'sig_img_filename';\n\t\t$list[] = 'sig_img_width';\n\t\t$list[] = 'sig_img_height';\n\n\t\t$list[] = 'total_comments';\n\t\t$list[] = 'total_forum_topics';\n\t\t$list[] = 'total_forum_posts';\n\t\t$list[] = 'last_view_bulletins';\n\t\t$list[] = 'last_bulletin_date';\n\t\t$list[] = 'last_entry_date';\n\t\t$list[] = 'last_comment_date';\n\t\t$list[] = 'last_forum_post_date';\n\t\t$list[] = 'last_email_date';\n\t\t$list[] = 'total_entries';\n\t\t$list[] = 'last_activity';\n\t\t$list[] = 'last_visit';\n\n\t\t// And these just seem uninteresting for an import\n\t\t// If someone complains, it is easy enough to comment items out\n\n\t\t$list[] = 'tracker';\n\t\t$list[] = 'pmember_id';\n\t\t$list[] = 'rte_enabled';\n\t\t$list[] = 'rte_toolset_id';\n\t\t$list[] = 'private_messages';\n\t\t$list[] = 'ignore_list';\n\t\t$list[] = 'smart_notifications';\n\t\t$list[] = 'show_sidebar';\n\t\t$list[] = 'quick_tabs';\n\t\t$list[] = 'localization_is_site_default';\n\t\t$list[] = 'notify_of_pm';\n\t\t$list[] = 'notify_by_default';\n\t\t$list[] = 'display_signatures';\n\t\t$list[] = 'display_avatars';\n\t\t$list[] = 'parse_smileys';\n\t\t$list[] = 'msn_im'; // Seriously, does anyone use this?\n\n\t\treturn $list;\n\t }", "public static function lineSettings( \n\t\tstring\t\t$text, \n\t\tint\t\t$lim, \n\t\tstring\t\t$filter = '' \n\t) : array {\n\t\t$ln = \\array_unique( static::lines( $text ) );\n\t\t\n\t\t$rt = ( ( count( $ln ) > $lim ) && $lim > -1 ) ? \n\t\t\t\\array_slice( $ln, 0, $lim ) : $ln;\n\t\t\n\t\treturn \n\t\t( !empty( $filter ) && \\is_callable( $filter ) ) ? \n\t\t\t\\array_map( $filter, $rt ) : $rt;\n\t}", "function bdpp_settings_tab() {\n\t\n\t$result_arr = array();\n\n\t$settings_arr = apply_filters('bdpp_settings_tab', array(\n\t\t\t\t\t\t\t'general'\t=> __('General', 'blog-designer-pack'),\n\t\t\t\t\t\t\t'trending'\t=> __('Trending Post', 'blog-designer-pack'),\n\t\t\t\t\t\t\t'taxonomy'\t=> __('Taxonomy', 'blog-designer-pack'),\n\t\t\t\t\t\t\t'sharing'\t=> __('Sharing', 'blog-designer-pack'),\n\t\t\t\t\t\t\t'css'\t\t=> __('CSS', 'blog-designer-pack'),\n\t\t\t\t\t\t\t'misc'\t\t=> __('Misc', 'blog-designer-pack'),\n\t\t\t\t\t\t));\n\n\tforeach ($settings_arr as $sett_key => $sett_val) {\n\t\tif( !empty($sett_key) && !empty($sett_val) ) {\n\t\t\t$result_arr[trim($sett_key)] = trim($sett_val);\n\t\t}\n\t}\n\n\treturn $result_arr;\n}", "protected function getConfigFieldsValues()\n {\n return array(\n $this->mod_prefix.'SHOW_WEBPAGE' => Configuration::get($this->mod_prefix.'SHOW_WEBPAGE'),\n $this->mod_prefix.'SHOW_WEBSITE' => Configuration::get($this->mod_prefix.'SHOW_WEBSITE'),\n $this->mod_prefix.'SHOW_WEBSITE_SEARCHBOX' => Configuration::get($this->mod_prefix.'SHOW_WEBSITE_SEARCHBOX'),\n $this->mod_prefix.'SHOW_ORGANIZATION' => Configuration::get($this->mod_prefix.'SHOW_ORGANIZATION'),\n $this->mod_prefix.'SHOW_ORGANIZATION_LOGO' => Configuration::get($this->mod_prefix.'SHOW_ORGANIZATION_LOGO'),\n $this->mod_prefix.'SHOW_ORGANIZATION_CONTACT' => Configuration::get($this->mod_prefix.'SHOW_ORGANIZATION_CONTACT'),\n $this->mod_prefix.'ORGANIZATION_CONTACT_EMAIL' => Configuration::get($this->mod_prefix.'ORGANIZATION_CONTACT_EMAIL'),\n $this->mod_prefix.'ORGANIZATION_CONTACT_TELEPHONE' => Configuration::get($this->mod_prefix.'ORGANIZATION_CONTACT_TELEPHONE'),\n $this->mod_prefix.'SHOW_ORGANIZATION_FACEBOOK' => Configuration::get($this->mod_prefix.'SHOW_ORGANIZATION_FACEBOOK'),\n $this->mod_prefix.'ORGANIZATION_FACEBOOK' => Configuration::get($this->mod_prefix.'ORGANIZATION_FACEBOOK'),\n $this->mod_prefix.'SHOW_LOCALBUSINESS' => Configuration::get($this->mod_prefix.'SHOW_LOCALBUSINESS'),\n $this->mod_prefix.'LOCALBUSINESS_TYPE' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_TYPE'),\n $this->mod_prefix.'LOCALBUSINESS_STORENAME' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_STORENAME'),\n $this->mod_prefix.'LOCALBUSINESS_DESC' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_DESC'),\n $this->mod_prefix.'LOCALBUSINESS_VAT' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_VAT'),\n $this->mod_prefix.'LOCALBUSINESS_PHONE' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_PHONE'),\n $this->mod_prefix.'LOCALBUSINESS_PRANGE_SHOW' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_PRANGE_SHOW'),\n //$this->mod_prefix.'LOCALBUSINESS_PRANGE' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_PRANGE'),\n $this->mod_prefix.'LOCALBUSINESS_STREET' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_STREET'),\n $this->mod_prefix.'LOCALBUSINESS_COUNTRY' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_COUNTRY'),\n $this->mod_prefix.'LOCALBUSINESS_REGION' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_REGION'),\n $this->mod_prefix.'LOCALBUSINESS_CODE' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_CODE'),\n $this->mod_prefix.'LOCALBUSINESS_LOCALITY' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_LOCALITY'),\n $this->mod_prefix.'LOCALBUSINESS_GPS_SHOW' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_GPS_SHOW'),\n $this->mod_prefix.'LOCALBUSINESS_GPS_LAT' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_GPS_LAT'),\n $this->mod_prefix.'LOCALBUSINESS_GPS_LON' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_GPS_LON')\n );\n }", "public function getNonMetadataFields(): array\n\t{\n\t\t$values = $this->fields;\n\t\t$values['name'] = $this->name;\n\t\t$values['slug'] = $this->slug;\n\t\t$values['_archived'] = $this->archived;\n\t\t$values['_draft'] = $this->draft;\n\n\t\treturn $values;\n\t}", "public function getPreparedFieldFilterValues () {\n return MLI18n::gi()->get(ucfirst(MLModul::gi()->getMarketPlaceName()).'_Productlist_Filter_aPreparedStatus');\n }", "function filter_field($data, $field)\n {\n return array_intersect_key($data, array_fill_keys($field, ''));\n }", "public function getFulltextFields($only_indexed = TRUE) {\n $i = $only_indexed ? 1 : 0;\n if (!isset($this->fulltext_fields[$i])) {\n $this->fulltext_fields[$i] = array();\n $fields = $only_indexed ? $this->options['fields'] : $this->getFields(FALSE);\n foreach ($fields as $key => $field) {\n if (search_api_is_text_type($field['type'])) {\n $this->fulltext_fields[$i][] = $key;\n }\n }\n }\n return $this->fulltext_fields[$i];\n }", "protected function getDynamicConfigFields()\n {\n $statuses = $this->statusCollectionFactory->create()->toOptionArray();\n $dynamicConfigFields = [];\n foreach ($statuses as $status) {\n $configId = 'sendsms_settings_status_'.$status['value'];\n $dynamicConfigFields[$configId] = [\n 'id' => $configId,\n 'type' => 'textarea',\n 'sortOrder' => 10,\n 'showInDefault' => '1',\n 'showInWebsite' => '0',\n 'showInStore' => '0',\n 'label' => 'Mesaj: '.$status['label'],\n 'comment' => 'Variabile disponibile: {billing_first_name}, {billing_last_name}, {shipping_first_name}, {shipping_last_name}, {order_number}, {order_date}, {order_total}<p class=\"sendsms-char-count\">160 caractere ramase</p>',\n '_elementType' => 'field',\n 'path' => 'sendsms/sendsms'\n ];\n }\n return $dynamicConfigFields;\n }", "function get_fields()\n\t{\n\t\trequire_code('ocf_members');\n\n\t\t$indexes=collapse_2d_complexity('i_fields','i_name',$GLOBALS['FORUM_DB']->query_select('db_meta_indices',array('i_fields','i_name'),array('i_table'=>'f_member_custom_fields'),'ORDER BY i_name'));\n\n\t\t$fields=array();\n\t\tif (has_specific_permission(get_member(),'view_profiles'))\n\t\t{\n\t\t\t$rows=ocf_get_all_custom_fields_match(NULL,1,1);\n\t\t\trequire_code('fields');\n\t\t\tforeach ($rows as $row)\n\t\t\t{\n\t\t\t\tif (!array_key_exists('field_'.strval($row['id']),$indexes)) continue;\n\n\t\t\t\t$ob=get_fields_hook($row['cf_type']);\n\t\t\t\t$temp=$ob->get_search_inputter($row);\n\t\t\t\tif (is_null($temp))\n\t\t\t\t{\n\t\t\t\t\t$type='_TEXT';\n\t\t\t\t\t$special=make_string_tempcode(get_param('option_'.strval($row['id']),''));\n\t\t\t\t\t$display=$row['trans_name'];\n\t\t\t\t\t$fields[]=array('NAME'=>strval($row['id']),'DISPLAY'=>$display,'TYPE'=>$type,'SPECIAL'=>$special);\n\t\t\t\t} else $fields=array_merge($fields,$temp);\n\t\t\t}\n\n\t\t\t$age_range=get_param('option__age_range',get_param('option__age_range_from','').'-'.get_param('option__age_range_to',''));\n\t\t\t$fields[]=array('NAME'=>'_age_range','DISPLAY'=>do_lang_tempcode('AGE_RANGE'),'TYPE'=>'_TEXT','SPECIAL'=>$age_range);\n\t\t}\n\n\t\t$map=has_specific_permission(get_member(),'see_hidden_groups')?array():array('g_hidden'=>0);\n\t\t$group_count=$GLOBALS['FORUM_DB']->query_value('f_groups','COUNT(*)');\n\t\tif ($group_count>300) $map['g_is_private_club']=0;\n\t\tif ($map==array()) $map=NULL;\n\t\t$rows=$GLOBALS['FORUM_DB']->query_select('f_groups',array('id','g_name'),$map,'ORDER BY g_order');\n\t\t$groups=form_input_list_entry('',true,'---');\n\t\t$default_group=get_param('option__user_group','');\n\t\t$group_titles=array();\n\t\tforeach ($rows as $row)\n\t\t{\n\t\t\t$row['text_original']=get_translated_text($row['g_name'],$GLOBALS['FORUM_DB']);\n\n\t\t\tif ($row['id']==db_get_first_id()) continue;\n\t\t\t$groups->attach(form_input_list_entry(strval($row['id']),strval($row['id'])==$default_group,$row['text_original']));\n\t\t\t$group_titles[$row['id']]=$row['text_original'];\n\t\t}\n\t\tif (strpos($default_group,',')!==false)\n\t\t{\n\t\t\t$bits=explode(',',$default_group);\n\t\t\t$combination=new ocp_tempcode();\n\t\t\tforeach ($bits as $bit)\n\t\t\t{\n\t\t\t\tif (!$combination->is_empty()) $combination->attach(do_lang_tempcode('LIST_SEP'));\n\t\t\t\t$combination->attach(escape_html(@$group_titles[intval($bit)]));\n\t\t\t}\n\t\t\t$groups->attach(form_input_list_entry(strval($default_group),true,do_lang_tempcode('USERGROUP_SEARCH_COMBO',escape_html($combination))));\n\t\t}\n\t\t$fields[]=array('NAME'=>'_user_group','DISPLAY'=>do_lang_tempcode('GROUP'),'TYPE'=>'_LIST','SPECIAL'=>$groups);\n\t\tif (has_specific_permission(get_member(),'see_hidden_groups'))\n// $fields[]=array('NAME'=>'_photo_thumb_url','DISPLAY'=>do_lang('PHOTO'),'TYPE'=>'','SPECIAL'=>'','CHECKED'=>false);\n\t\t{\n\t\t\t//$fields[]=array('NAME'=>'_emails_only','DISPLAY'=>do_lang_tempcode('EMAILS_ONLY'),'TYPE'=>'_TICK','SPECIAL'=>'');\tCSV export better now\n\t\t}\n\n\t\treturn $fields;\n\t}", "function GetFieldSettings($i){\n if ($this->debug_mode)\n echo $this->ClassName . \"::GetFieldSettings($i);\" . \"<HR>\";\n $_field = array();\n $_field[\"number\"] = $i;\n if ($this->listSettings->HasItem(\"FIELD_\" . $i, \"FIELD_NAME\")) {\n $_field[\"field_name\"] = $this->listSettings->GetItem(\"FIELD_\" . $i, \"FIELD_NAME\");\n }\n else {\n $this->AddEditErrorMessage(\"EMPTY_FIELDNAME_SETTINGS\", array(\n $i), true);\n }\n //set database column parameters\n for ($k = 0; $k < sizeof($this->Storage->columnparameters); $k ++)\n if ($this->listSettings->HasItem(\"FIELD_\" . $i, \"DBFIELD_\" . strtoupper($this->Storage->columnparameters[$k]))) {\n $_field[\"dbfield_\" . strtolower($this->Storage->columnparameters[$k])] = $this->listSettings->GetItem(\"FIELD_\" . $i, \"DBFIELD_\" . strtoupper($this->Storage->columnparameters[$k]));\n }\n if ($this->listSettings->HasItem(\"FIELD_\" . $i, \"EDIT_CONTROL\")) {\n $_field[\"control\"] = $this->listSettings->GetItem(\"FIELD_\" . $i, \"EDIT_CONTROL\");\n }\n else {\n $this->AddEditErrorMessage(\"EMPTY_EDIT_CONTROL_SETTINGS\", array($i), true);\n }\n if ($this->listSettings->HasItem(\"FIELD_\" . $i, \"LENGTH\")) {\n $_field[\"length\"] = $this->listSettings->GetItem(\"FIELD_\" . $i, \"LENGTH\");\n }\n else {\n $_field[\"length\"] = \"\";\n }\n\n if ($this->listSettings->HasItem(\"FIELD_\" . $i, \"FIELD_DUBLICATE\")) {\n $_field[\"field_dublicate\"] = $this->listSettings->GetItem(\"FIELD_\" . $i, \"FIELD_DUBLICATE\");\n }\n else {\n $_field[\"field_dublicate\"] = false;\n }\n\n //--check if have additional events\n if ($this->listSettings->HasItem(\"FIELD_\" . $i, \"FIELD_EVENT\")) {\n $_field[\"field_event\"] = $this->listSettings->GetItem(\"FIELD_\" . $i, \"FIELD_EVENT\");\n }\n\n //-- if field belong of any additional groups\n if ($this->listSettings->HasItem(\"FIELD_\" . $i, \"GROUP\")) {\n $_field[\"group\"] = strtoupper($this->listSettings->GetItem(\"FIELD_\" . $i, \"GROUP\"));\n }\n switch ($_field[\"control\"]) {\n case \"date\":\n EditPageHelper::GetDateSettings($i, $_field, $this);\n break;\n case \"text\":\n case \"password\":\n EditPageHelper::GetTextSettings($i, $_field, $this);\n break;\n\n case \"textarea\":\n EditPageHelper::GetTextAreaSettings($i, $_field, $this);\n break;\n case \"machtmleditor\":\n EditPageHelper::GetMacHtmlEditorSettings($i, $_field, $this);\n break;\n\n case \"checkbox\":\n case \"radio\":\n EditPageHelper::GetCheckboxSettings($i, $_field, $this);\n break;\n\n case \"radiogroup\":\n case \"checkboxgroup\":\n case \"caption\":\n case \"combobox\":\n EditPageHelper::GetComboSettings($i, $_field, $this);\n break; //select\n\n\n case \"dbtext\":\n case \"dbstatictext\":\n EditPageHelper::GetDbTextSettings($i, $_field, $this);\n\n case \"dbcombobox\":\n case \"dbtreecombobox\":\n case \"dbtreetext\":\n case \"dbradiogroup\":\n case \"dbcheckboxgroup\":\n //case \"checkboxgroup\":\n EditPageHelper::GetDbComplexSettings($i, $_field, $this);\n break;\n case \"dbeditblock2\":\n EditPageHelper::GetDbEditBlockSettings($i, $_field, $this);\n break;\n\n case \"dbtreepath\":\n EditPageHelper::GetDbTreePathSettings($i, $_field, $this);\n break;\n\n case \"file\":\n EditPageHelper::GetFileSettings($i, $_field, $this);\n break;\n case \"file2\":\n EditPageHelper::GetFile2Settings($i, $_field, $this);\n break;\n\n case \"fileslistbox\":\n EditPageHelper::GetFilesListBoxSettings($i, $_field, $this);\n break;\n\n case \"hidden\":\n EditPageHelper::GetHiddenSettings($i, $_field, $this);\n break;\n case \"spaweditor\":\n case \"extrahtmleditor\":\n EditPageHelper::GetExtraHtmlEditorSettings($i, $_field, $this);\n break;\n\n case \"autocomplete\":\n EditPageHelper::GetAutocompleteSettings($i, $_field, $this);\n break;\n\n default: $this->GetCustomFieldSettings($i, $_field); break;\n } // switch\n //Get\n //if this is multilanguage field\n if ($this->listSettings->HasItem(\"FIELD_\" . $i, \"IS_MULTILANG\") && $this->listSettings->GetItem(\"FIELD_\" . $i, \"IS_MULTILANG\")) {\n for ($j = 0; $j < sizeof($this->Kernel->Languages); $j ++) {\n $_field1 = $_field;\n $_field1[\"field_name\"] = sprintf($_field1[\"field_name\"], $this->Kernel->Languages[$j]);\n $_field1[\"lang_version\"] = $this->Kernel->Languages[$j];\n $this->form_fields[$this->Kernel->Languages[$j]][] = $_field1;\n }\n }\n else {\n if (strlen($_field[\"group\"]) == 0) {\n $_group = \"main\";\n }\n else {\n $_group = $_field[\"group\"];\n }\n $this->form_fields[$_group][] = $_field;\n //if this is password\n if ($_field[\"control\"] == \"password\") {\n $old_field = $_field;\n $_field[\"field_name\"] = $_field[\"field_name\"] . \"_2\";\n if ($_field[\"field_dublicate\"]) {\n $this->Storage->setColumnParameter($old_field[\"field_name\"], \"dublicate\", 1);\n $_field[\"notnull\"] = 1;\n $this->form_fields[$_group][] = $_field;\n }\n }\n }\n }", "public function getModlogOmitFields();", "function getOptionsListHiddenArray()\n {\n $cc_types = modApiFunc(\"Configuration\", \"getCreditCardSettings\", false);\n\n $OptionsListHiddenArray = array();\n foreach ($cc_types as $type)\n {\n array_push($OptionsListHiddenArray, $type['id']);\n }\n return $OptionsListHiddenArray;\n }", "public function getStandardFields() {\n $standardFields = array();\n //Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . \"] Gravity Forms Fields: \" . print_r($this->_fields, true));\n if(is_array($this->_fields) && count($this->_fields)) {\n foreach($this->_fields as $field) {\n Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . \"] Gravity Forms Field Data: \" . print_r($field, true));\n \n if(!isset($field['inputs']) || !is_array($field['inputs'])) {\n $standardFields[$field['id']] = $field['label'];\n }\n else {\n if($field['type'] == 'product' && (!isset($field['disableQuantity']) || $field['disableQuantity'] != 1) ) {\n if(isset($field['inputs']) && is_array($field['inputs'])) {\n foreach($field['inputs'] as $input) {\n if($input['label'] == 'Quantity') {\n Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . \"] Gravity Forms Product Quantity ID: \" . $input['id']);\n $standardFields[\"'\" . $input['id'] . \"'\"] = $field['label'] . ' Quantity';\n break;\n }\n }\n }\n }\n }\n \n }\n }\n Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . \"] Gravity Forms Standard Fields: \" . print_r($standardFields, true));\n return $standardFields;\n }", "private function get_hidden_cashflow_fields(){\n\t\treturn $this->obj->get_values_as_array( get_class( $this->obj ) );\n\t}", "public static function get_allowed_settings()\n {\n }", "public static function getFilterableFields(): array\n {\n return ['name', 'accessCode'];\n }", "private function getFields()\n {\n return [\n [\n \"field_type\" => \"text\",\n \"field_name\" => \"first_name\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => null,\n ],\n [\n \"field_type\" => \"text\",\n \"field_name\" => \"last_name\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => null,\n ],\n [\n \"field_type\" => \"checkbox\",\n \"field_name\" => \"happy\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => null,\n ],\n [\n \"field_type\" => \"select\",\n \"field_name\" => \"character\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => [\n [\"value\" => \"biff\", \"label\" => \"Biff\"],\n [\"value\" => \"marty\", \"label\" => \"Marty\"],\n [\"value\" => \"doc\", \"label\" => \"Doc Brown\"],\n [\"value\" => \"jennifer\", \"label\" => \"Jennifer\"],\n [\"value\" => \"needles\", \"label\" => \"Needles\"],\n ]\n ],\n [\n \"field_type\" => \"checkbox\",\n \"field_name\" => \"kids\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => null,\n ],\n ];\n }", "public static function withBlackText(): array {\n $allLines = self::all();\n return array_filter($allLines, function($line) {\n return $line['text'] === '#000000';\n });\n }", "private function set_fields() {\r\n\r\n\t\t$fields = array();\r\n\r\n\t\t$temp_fields = get_option( 'wc_fields_billing' );\r\n\r\n\t\tif ( $temp_fields !== false ) {\r\n\t\t\t$fields = array_merge( $fields, $temp_fields );\r\n\t\t}\r\n\r\n\t\t$temp_fields = get_option( 'wc_fields_shipping' );\r\n\r\n\t\tif ( $temp_fields !== false ) {\r\n\t\t\t$fields = array_merge( $fields, $temp_fields );\r\n\t\t}\r\n\r\n\t\t$temp_fields = get_option( 'wc_fields_additional' );\r\n\r\n\t\tif ( $temp_fields !== false ) {\r\n\t\t\t$fields = array_merge( $fields, $temp_fields );\r\n\t\t}\r\n\r\n\t\treturn $fields;\r\n\t}", "private function getFacetFields()\n {\n $fields = [];\n\n foreach ($this->getConfig()->getFacetConfig() as $facet) {\n $fields[] = $facet['field'];\n }\n\n return array_unique($fields);\n }", "function _get_avail_fields() {\n\t\t$avail_fields = array();\n\t\tif ($this->MODE == \"SIMPLE\") {\n\t\t\t$avail_fields = $this->_get_fields_map_simple();\n\t\t} else {\n\t\t\t$avail_fields = $this->_get_fields_map_dynamic(true);\n\t\t}\n\t\treturn $avail_fields;\n\t}", "private function getCheckableFields()\n {\n return ['index', 'city', 'countryIso', 'text', 'region'];\n }", "function validate_cpjr3_settings( $input ) {\n \n $output = array(); \n \n foreach( $input as $key => $value ) { \n \n if( isset( $input[$key] ) ) { \n \n $output[$key] = strip_tags( stripslashes( $input[ $key ] ) ); \n \n } \n \n } \n \n return apply_filters( 'validate_cpjr3_settings', $output, $input ); \n\n}", "function basel_get_compare_fields() {\n\t\t$fields = array(\n\t\t\t'basic' => '',\n\t\t);\n\n\t\t$fields_settings = basel_get_opt('fields_compare');\n\n\t\tif ( class_exists( 'XTS\\Options' ) && count( $fields_settings ) > 1 ) {\n\t\t\t$fields_labels = basel_compare_available_fields( true );\n\n\t\t\tforeach ( $fields_settings as $field ) {\n\t\t\t\tif ( isset( $fields_labels [ $field ] ) ) {\n\t\t\t\t\t$fields[ $field ] = $fields_labels [ $field ]['name'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $fields;\n\t\t}\n\n\t\tif ( isset( $fields_settings['enabled'] ) && count( $fields_settings['enabled'] ) > 1 ) {\n\t\t\t$fields = $fields + $fields_settings['enabled'];\n\t\t\tunset( $fields['placebo'] );\n\t\t}\n\n\t\treturn $fields;\n\t}", "private function getDisallowedFunding(): array\n {\n $disallowedFunding = $this->config->getValue('disable_funding_options');\n return $disallowedFunding ? explode(',', $disallowedFunding) : [];\n }", "protected function defaultSearchFields()\n {\n return [\n 'name' => '',\n 'device_imei' => '',\n 'province' => ''\n ];\n }", "private function filterFields() {\n\n // Initialize an associate array of our field name and value pairs.\n $values = array();\n\n // Initialize an associate array of our field name and filters pairs.\n $filters = array();\n\n // Populate the arrays.\n foreach ($this->fields as $field) {\n if ($field->getFilters()) {\n $values[$field->getName()] = $field->getValue();\n $filters[$field->getName()] = $field->getFilters();\n }\n }\n\n // Load an instance of GUMP to use to sanitize and filter our field values.\n $gump = new \\GUMP();\n\n // Sanitize the field values.\n $values = $gump->sanitize($values);\n\n // Pass the arrays to GUMP and let it do the heavy-lifting.\n $values = $gump->filter($values, $filters);\n\n // Set the values of all fields to their filtered values.\n foreach ($values as $name => $value) {\n $this->passValue($name, $value);\n }\n }", "public function submissionFields()\n {\n return array(\n 'missing domain' => array('domain'),\n );\n }", "function scorm_get_skip_view_array(){\n return array(0 => get_string('never'),\n 1 => get_string('firstaccess','scorm'),\n 2 => get_string('always'));\n}", "protected function getFieldOptions()\n {\n return explode(',', $this->option('fields'));\n }", "function dblog_filters() {\n $filters = array();\n\n foreach (_dblog_get_message_types() as $type) {\n $types[$type] = t($type);\n }\n\n if (!empty($types)) {\n $filters['type'] = array(\n 'title' => t('Type'),\n 'where' => \"w.type = ?\",\n 'options' => $types,\n );\n }\n\n $filters['severity'] = array(\n 'title' => t('Severity'),\n 'where' => 'w.severity = ?',\n 'options' => watchdog_severity_levels(),\n );\n\n return $filters;\n}", "public function getFieldsForFilter()\n {\n $options = [];\n foreach ($this->getFieldsForExport() as $field) {\n $options[] = [\n 'label' => $field,\n 'value' => $field\n ];\n }\n return [$this->getEntityTypeCode() => $options];\n }", "public function getFieldsForFilter()\n {\n $options = [];\n foreach ($this->getFieldsForExport() as $field) {\n $options[] = [\n 'label' => $field,\n 'value' => $field\n ];\n }\n return [$this->getEntityTypeCode() => $options];\n }", "protected function getHiddenFacets(): array {\n return [];\n }", "public function feed_settings_fields() {\n\n return array(\n\t\t\tarray(\n\t\t\t\t'title' => esc_html__( 'Configurações do Feed BuddyPress', 'gravityformsbuddy' ),\n\t\t\t\t'description' => '',\n\t\t\t\t'fields' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'feedName',\n\t\t\t\t\t\t'label' => esc_html__( 'Nome', 'gravityformsbuddy' ),\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t'class' => 'medium',\n\t\t\t\t\t\t'tooltip' => sprintf(\n\t\t\t\t\t\t\t'<h6>%s</h6>%s',\n\t\t\t\t\t\t\tesc_html__( 'Nome', 'gravityformsbuddy' ),\n\t\t\t\t\t\t\tesc_html__( 'Entre com um nome para o Feed para identificá-lo.', 'gravityformsbuddy' )\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'toUser',\n\t\t\t\t\t\t'label' => esc_html__( 'Para quem enviar?', 'gravityformsbuddy' ),\n\t\t\t\t\t\t'type' => 'select_custom',\n\t\t\t\t\t\t'choices' => $this->get_buddy_users_as_choices( 'outgoing_numbers' ),\n\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t'input_class' => 'merge-tag-support mt-position-right',\n\t\t\t\t\t\t'tooltip' => sprintf(\n\t\t\t\t\t\t\t'<h6>%s</h6>%s',\n\t\t\t\t\t\t\tesc_html__( 'Para quem enviar?', 'gravityformsbuddy' ),\n\t\t\t\t\t\t\tesc_html__( 'Usuário o qual receberá as notificações', 'gravityformsbuddy' )\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'pathUrl',\n\t\t\t\t\t\t'label' => esc_html__( 'URL para redirecionar?', 'gravityformsbuddy' ),\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t\t'class' \t => 'medium',\n\t\t\t\t\t\t'tooltip' => sprintf(\n\t\t\t\t\t\t\t'<h6>%s</h6>%s',\n\t\t\t\t\t\t\tesc_html__( 'URL para redirecionar?', 'gravityformsbuddy' ),\n\t\t\t\t\t\t\tesc_html__( 'Link que será redirecionado para quando o usuário clicar na notificação', 'gravityformsbuddy' )\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'message',\n\t\t\t\t\t\t'label' => esc_html__( 'Mensagem Padrão', 'gravityformsbuddy' ),\n\t\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t\t'class' => 'medium merge-tag-support mt-position-right',\n\t\t\t\t\t\t'tooltip' => sprintf(\n\t\t\t\t\t\t\t'<h6>%s</h6>%s',\n\t\t\t\t\t\t\tesc_html__( 'Mensagem', 'gravityformstwilio' ),\n\t\t\t\t\t\t\tesc_html__( 'Escreva uma mensagem que será mostrada como notificação', 'gravityformsbuddy' )\n\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t}" ]
[ "0.65086347", "0.6114594", "0.61078006", "0.610134", "0.6061441", "0.58987826", "0.58746034", "0.58203727", "0.58059883", "0.57897055", "0.57860893", "0.5742404", "0.57175267", "0.5700774", "0.5685038", "0.56740046", "0.566802", "0.56651014", "0.5658513", "0.5651581", "0.5647043", "0.5613531", "0.5609823", "0.5605835", "0.5603745", "0.55762017", "0.55660075", "0.55416006", "0.5538794", "0.5528935", "0.5519746", "0.5497032", "0.54840624", "0.54819024", "0.5471202", "0.5452921", "0.54456", "0.5445182", "0.5442983", "0.5428097", "0.5427352", "0.54211915", "0.54053813", "0.54013544", "0.54013544", "0.53977716", "0.5381472", "0.5353149", "0.5349267", "0.53389007", "0.53388596", "0.5335996", "0.53337604", "0.53329384", "0.53290653", "0.5327897", "0.5323238", "0.53170025", "0.53149265", "0.53148395", "0.5312988", "0.530851", "0.53074414", "0.53068495", "0.5300102", "0.52861786", "0.5281553", "0.52795947", "0.52682126", "0.52659845", "0.526196", "0.52489144", "0.524255", "0.52249664", "0.5219959", "0.52137184", "0.520736", "0.5204306", "0.51961607", "0.5193516", "0.51922774", "0.5190152", "0.5180537", "0.51791406", "0.5175505", "0.5170641", "0.5160366", "0.51570183", "0.51531816", "0.5133193", "0.513088", "0.51299524", "0.5128354", "0.5127865", "0.5127226", "0.51225525", "0.511529", "0.511529", "0.5113217", "0.5109293" ]
0.5144086
89
Set the maximum length of the calculated name field
public function setMaximumCalcLength($length = 200) { $this->_maxNameCalcLength = $length; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setMaxLength($maxLength) {}", "function set_field_length($len) \n {\n $this->attribs['maxlength'] = $len;\n }", "public function setMaxLength($length);", "function setMaxLength($length) {\n\n $this->field['maxlength'] = $length;\n return $this;\n\n }", "public function setMaxUsernameLength($length);", "public function getMaxLength() {}", "public function getMaxLength();", "public function setMaxLength($length) {\n $this->maxlength = $length;\n }", "public function getMaxUsernameLength();", "public function setMaxLength($max)\n {\n $this->__set(self::FIELD_MAXLENGTH,$max);\n return $this;\n }", "public function getMaxLength()\n {\n return $this->__get(self::FIELD_MAXLENGTH); \n }", "public function getLengthMax()\n {\n return $this->lengthMax;\n }", "public function getLengthLimit()\n {\n }", "public function getMaxColumnNameLength();", "protected static function _maxLength() {\n if (self::$_ruleValue) {\n if (strlen(trim(self::$_elementValue)) > self::$_ruleValue) {\n self::setErrorMessage(\"Enter at most \" . self::$_ruleValue . \" charachters only\");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }", "public function getMaxLength()\n {\n return $this->maxLength;\n }", "public function setLengthMax($length)\n {\n if (!$length) {\n $length = self::LENGTH_MAX_MAX;\n }\n \n $this->lengthMax = \\RandData\\Checker::int(\n $length,\n self::LENGTH_MAX_MIN,\n self::LENGTH_MAX_MAX,\n \"lengthMax\"\n );\n }", "protected function max($length, $field_name, $data)\n {\n if (strlen($data) <= $length) {\n return true;\n } else {\n $this->errors[$field_name][] = \"maximum {$length} char\";\n }\n// $this->errors[$field_name][] = \"maximum {$length} char\";\n// return empty(strlen($data) <= $length) ? false : true;\n }", "public function setMaxLength(int $max):void {\r\n\t\t$this->maxLength = $max;\r\n\t}", "public function max($field_name, $value, $max_length)\n {\n if (strlen($value) <= $max_length) {\n return true;\n }\n return ucfirst($field_name).' must have max length of '.$max_length.'.';\n }", "public function setMaxLength($maxLength) {\n $this->maxLength = $maxLength;\n return $this;\n }", "function edd_stripe_max_length_statement_descriptor( $html, $args ) {\n\tif ( 'stripe_statement_descriptor' !== $args['id'] ) {\n\t\treturn $html;\n\t}\n\n\t$html = str_replace( '<input type=\"text\"', '<input type=\"text\" maxlength=\"22\"', $html );\n\n\treturn $html;\n}", "public function getMaxLength() {\n return $this->maxLength;\n }", "public function setMaxLength($maxLength)\n {\n $this->maxLength = $maxLength;\n return $this;\n }", "function setLongName($longName)\n {\n if (strlen($longName) > 48) {\n throw new InvalidArgumentException(\"Input must be 48 characters or less\n in length!\");\n }\n $this->_longName = $longName;\n }", "function testMaxlen(){\n\t\t#mdx:maxlen\t\t\n\t\tParam::get('description')->filters()->maxlen(30, \"Description must be less than %d characters long!\");\n\t\t$error = Param::get('description')\n\t\t\t->process(['description'=>str_repeat('lorem ipsum', 10)])\n\t\t\t->error;\n\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertContains(\"less than 30\", $error);\n\t}", "public function setLength($length);", "function maxlength($text, $max, $shorten=true)\n{\nif(strlen($text) >= $max) {\nif($shorten) {\n$text = substr($text, 0, ($max-3)).\"...\";\n} else {\n$text = substr($text, 0, ($max));\n} }\nreturn $text;\n}", "public function increaseLength($minLength = 100) {}", "public function increaseLength($minLength = 100) {}", "public function getMaxCustomEntityFieldNameSize()\n {\n $subtractSize = max(\n strlen(self::RELATION_DEFAULT_COLUMN_PREFIX),\n strlen(self::RELATION_COLUMN_SUFFIX),\n strlen(self::SNAPSHOT_COLUMN_SUFFIX)\n );\n\n return $this->getMaxIdentifierSize() - $subtractSize;\n }", "function setMaxWidth($width) {\n $this->field['max_width'] = $width;\n\n return $this;\n }", "public function getMaxLength()\n {\n return 254;\n }", "public function setMaxLength($length)\n {\n $this->max_length = $length;\n return $this;\n }", "function set_length($length) {\n $this->length = $length;\n }", "public function getMaxCustomEntityNameSize()\n {\n return $this->getMaxIdentifierSize() - strlen(self::CUSTOM_TABLE_PREFIX);\n }", "public function setLenom(string $lenom):string\n {\n //checking the name for injection in db with strip_tags and trim\n $lenom = strip_tags(trim($lenom));\n // checking is empty\n if(empty($lenom)){\n trigger_error(\"The name can't be empty\",E_USER_NOTICE);\n //checking lenght name is not superieur for 45caratcters\n }else if (strlen($lenom) > 45){\n trigger_error(\"The lenght of your name cannot exceed 45 characters!!\",E_USER_NOTICE);\n }else{\n\n $this->lenom = $lenom;\n }\n }", "function __construct($name, $title = null, $value = \"\", $maxLength = null) {\n\t\t$this->maxLength = $maxLength;\n\t\tparent::__construct($name, $title, $value);\n\t}", "public function increaseLength($minLength = 100);", "public static function setGlobalMaxLength(int $maxLength):void {\r\n\t\tself::$globalMaxLength = $maxLength;\r\n\t}", "protected function get_max_length(): int\n\t{\n\t\treturn $this->end < $this->total ? $this->length : -1;\n\t}", "function shortenName($name, $maxChars=10, $ellipse='...') {\n\tif (strlen($name) - strlen($ellipse)>$maxChars) {\n\t\treturn substr($name, 0, $maxChars).$ellipse;\n\t} else {\n\t\treturn $name;\n\t}\n}", "public function getMaxAttributeLength()\n {\n return (int)$this->floatValue('recorded.value.max.length', 1200);\n }", "public function setMinUsernameLength($length);", "function adr_link_length($link, $max)\n{\n\tif (strlen($link) > $max)\n\t\t$newlink = substr($link, 0, ($max - 3)) .'...';\n\telse\n\t\t$newlink = $link;\nreturn $newlink;\n}", "function max_length($array){\n\t$message = [];\n\tforeach($array as $field=>$limit){\n\t\t$length = strlen(trim($_POST[$field]));\n\t\tif($length > $limit){\n\t\t\t$message[$field] = readable_name($field).\" cannot exceed \".$limit.\" characters. \";\n\t\t}\n\t}\n\n\treturn $message;\n}", "public function field_len($result, $index){\r\n\t\t$obj_field = new ADOFieldObject();\r\n\t\t$obj_field = $result->FetchField($index);\r\n\t\treturn isset($obj_field->max_length) ? $obj_field->max_length : \"\";\r\n\t}", "public function setMaxLength(int $maxLength)\n {\n $this->getElement()->setAttribute('maxlength', $maxLength);\n return $this;\n }", "public function length($name, $length, $type = 'min', $message = 'The field need more')\n {\n //StringLength \n $msgkey = 'messageMinimum';\n if($type !== 'min')\n {\n $msgkey = 'messageMaximum';\n }\n $this->validation->add($name, new \\Phalcon\\Validation\\Validator\\StringLength(array(\n $type => $length,\n $msgkey => $message\n )));\n return $this;\n }", "public function setMaximumStringKeyLength($value)\n {\n $this->maximumStringKeyLength = (int) $value;\n\n return $this;\n }", "public function longestFieldLength($idless=false) {\n $len = 0;\n foreach ($this->fields as $field) {\n if ($len < strlen($idless ? $field->getNameWithoutId() : $field->getName())) {\n $len = strlen($idless ? $field->getNameWithoutId() : $field->getName());\n }\n }\n return $len;\n }", "private static function add_html_length( $field, array &$add_html ) {\n\t\tif ( FrmField::is_option_empty( $field, 'max' ) || in_array( $field['type'], array( 'textarea', 'rte', 'hidden', 'file' ) ) ) {\n return;\n }\n\n if ( FrmAppHelper::is_admin_page('formidable' ) ) {\n // don't load on form builder page\n return;\n }\n\n\t\t$add_html['maxlength'] = 'maxlength=\"' . esc_attr( $field['max'] ) . '\"';\n }", "public function getMinUsernameLength();", "function adjustLength($string, $max)\r\n {\r\n if (strlen($string) <=$max)\r\n {\r\n return $string;\r\n }\r\n else\r\n {\r\n return substr($string, 0, $max) . '..';\r\n }\r\n }", "public function setMaxChars($value)\n {\n if (is_int($value) === false)\n throw new SystemException(SystemException::EX_INVALIDPARAMETER, 'Parameter = value');\n if ($value <= 0)\n throw new SystemException(SystemException::EX_INVALIDPARAMETER, 'Parameter = value; value must be greater than 0.');\n \n $this->maxChars = $value;\n }", "public static function setLength ($length){\n\t\tself::$_length = $length;\n\t}", "public function getMaxChars()\n {\n return $this->maxChars;\n }", "public function param_character_limit($value = 0)\n {\n return form_input(array(\n 'type' => 'text',\n 'name' => 'character_limit'\n ), $value);\n }", "function _get_field_size() \n {\n if (isset($this->attribs['size'])) {\n return $this->attribs['size'];\n }\n elseif ($this->attribs['maxlength'] > $this->max_size) {\n return $this->max_size;\n }\n else {\n return $this->attribs['maxlength'];\n }\n }", "public function setMaxlength(int $maxlength): self\n {\n $this->maxlength = $maxlength;\n\n return $this;\n }", "function wp_get_comment_fields_max_lengths()\n {\n }", "public function testRegisterWithLongName()\n {\n $generic = new GenericValidationTests($this);\n $generic->testMaxStringAttribute('register', 'POST', self::$headers, self::$body, 'name', 255);\n }", "public function maxTextFields(): self\n {\n $this->arguments[] = 'MAXTEXTFIELDS';\n\n return $this;\n }", "public function __construct($objectName, $maxLength, $message = '')\n {\n //$this->setMaxLength($maxLength);\n parent::__construct($objectName, $message);\n }", "abstract public function increaseLength($length = 100);", "public function maxLength($name, $maxLength, $displayName = null)\n {\n if (trim($this->data[$name]) != ''\n && strlen($this->data[$name]) > $maxLength\n ) {\n $this->errors->add(\n '<b>' .\n $this->displayName($name, $displayName) .\n '</b> must be ' . $maxLength . ' characters or shorter.'\n );\n return false;\n }\n return true;\n }", "function has_max_length($value, $max) {\n\t\treturn strlen($value) <= $max;\n\t\t}", "public function setLength($length) {\r\n $this->length = $length;\r\n }", "public function setTextLimit($l = 150)\n {\n $this->shorteningLimit = $l;\n }", "function has_max_length($value, $max) {\r\n\treturn strlen($value) <= $max;\r\n}", "public function get_max_length_code() {\n\t\treturn self::MAX_LENGTH_CODE;\n\t}", "public function get_max_length_code() {\n\t\treturn self::MAX_LENGTH_CODE;\n\t}", "public function get_max_length_code() {\n\t\treturn self::MAX_LENGTH_CODE;\n\t}", "public function setLength($length)\n {\n $this->length = $length;\n }", "public function setLength($length)\n {\n $this->length = $length;\n }", "function has_length($value, $options=array()) {\n //for first/last name [1,256]\n //for username [7, 256]\n if(strlen($value) > $options[0] && strlen($value) < $options[1]) {\n return 1;\n }\n return 0;\n }", "public function lengthMax($lengthMax, $error) {\n if ($this->_exist) {\n array_push($this->_constraints, ['type' => self::LENGTHMIN, 'value' => $lengthMax, 'message' => $error]);\n }\n\n return $this;\n }", "public static function _maxlength($value, $field, $max_length) {\n\t\treturn strlen($value) <= $max_length;\n\t}", "function clean($name, $max) {\n\t\t# fake other fields or extra entries\n\t\t$name = ereg_replace(\"[[:space:]]\", ' ', $name);\n\t\t# Escape < > and and & so they \n\t\t# can't mess withour HTML markup\n\t\t$name = ereg_replace('&', '&amp;', $name);\n\t\t$name = ereg_replace('<', '&lt;', $name);\n\t\t$name = ereg_replace('>', '&gt;', $name);\n\t\t# Don't allow excessively long entries\n\t\t$name = substr($name, 0, $max);\n\t\t# Undo PHP's \"magic quotes\" feature, which has\n\t\t# inserted a \\ in front of any \" characters.\n\t\t# We undo this because we're using a file, not a\n\t\t# database, so we don't want \" escaped. Those\n\t\t# using databases should do the opposite:\n\t\t# call addslashes if get_magic_quotes_gpc()\n\t\t# returns false.\n\t\treturn $name;\n\t}", "function addMax($field, $name) {\n\t\t$name = \"`\".$this->db->escape_string($name).\"`\";\n\t\t$this->fields[] = array(\"MAX(\".$name.\")\", $this->db->escape_string($field));\n\t\treturn $this;\n\t}", "public function setMaxLineLength(?int $maxLineLength): void {\n\t\t$this->maxLineLength = $maxLineLength;\n\t}", "public function setMaxKeyLength($length)\n {\n $this->maxKeyLength = $length;\n\n return $this;\n }", "public function install_create_custom_field($name, $length)\n {\n $this->connection->query('ALTER TABLE ' . $this->connection->get_table_prefix() . 'users ADD cms_' . $name . ' TEXT', null, null, true);\n return true;\n }", "public function maxAlias($maxdigits=8){\n $alias = '';\n for ($bit=0;$bit<$maxdigits;$bit++){\n $alias .= substr($this->base[$bit % $this->l],-1);\n }\n return $alias;\n }", "public function setMaximumWordLength($maximum)\n {\n return $this->setOption('maximumwordlength', $maximum);\n }", "public function __construct($name, $caption, $value = '', $isRequired = true, $helpMessage = '')\n {\n $this->maxChars = 255;\n parent::__construct($name, $caption, $value, $isRequired, $helpMessage);\n }", "function has_max_length($value, $max) {\n\treturn strlen($value) <= $max;\n}", "function has_max_length($value, $max) {\n\treturn strlen($value) <= $max;\n}", "public function setMaxLength($maxLength) {\n if (!is_integer($maxLength) || $maxLength < 0) {\n throw new \\InvalidArgumentException('Maximal length must be numeric and greather or equal to zero. Get: \"' . $maxLength . '\"');\n }\n $this->maxLength = $maxLength;\n return $this;\n }", "function setMax($max) {\n $this->field['max'] = (int) $max;\n\n return $this;\n }", "protected function maxLen(string $field, string $value, $param = null)\n {\n if (!empty($value)) {\n\n $error = false;\n\n if (function_exists('mb_strlen')) {\n if (mb_strlen($value) > (int)$param) {\n $error = true;\n }\n } else {\n if (strlen($value) > (int)$param) {\n $error = true;\n }\n }\n\n if ($error) {\n $this->addError($field, 'maxLen', $param);\n }\n }\n\n }", "public function setMaxChars($value)\n {\n if (!is_int($value))\n throw new SystemException(SystemException::EX_INVALIDPARAMETER, 'Parameter \\'value\\' must be of type \\'int\\'');\n $this->maxChars = $value;\n }", "abstract protected function validateFieldLength($fieldLength);", "public function setMaxSize($max){\n $this->maxSize = $max;\n return $this;\n }", "function medigroup_mikado_excerpt_length($length) {\n\n if(medigroup_mikado_options()->getOptionValue('number_of_chars') !== '') {\n return esc_attr(medigroup_mikado_options()->getOptionValue('number_of_chars'));\n } else {\n return 45;\n }\n }", "function set_leng_description($leng = 150)\t{\n \t\t$this->description= substr($this->description, 0, $leng).'...';\n \t\t \t\t\t\n \t}", "public function setAdvanceWidthMax($value) {}", "public function limitLength($days)\n {\n $this->_maxDays = $days;\n }", "public function maxLength($field, $length) {\n\t\t$length = intval($length);\n\t\t$postData = $_POST[$field['name']];\n\t\t\n\t\tif ( ! is_string($postData))\n\t\t\tstrval($postData);\n\t\t\t\n\t\tif (strlen($postData) > intval($length)) {\n\t\t\t$this->_errors[$field['name']]['param'] = $length;\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}", "public function set_max_font_size($val) \n {\n $this->max_font_size = $val;\n }" ]
[ "0.74492687", "0.73886585", "0.7307014", "0.7132721", "0.6975488", "0.6970148", "0.68450147", "0.6787955", "0.67832434", "0.6746053", "0.6727918", "0.67233795", "0.66960144", "0.65862185", "0.6548397", "0.65476453", "0.6528528", "0.65157795", "0.6489467", "0.6470448", "0.6462307", "0.64474016", "0.64416933", "0.6405121", "0.6366826", "0.63519627", "0.6342862", "0.6339687", "0.63129395", "0.63126343", "0.6292552", "0.62914777", "0.62885636", "0.6273262", "0.62330705", "0.6188671", "0.615569", "0.6135605", "0.61320263", "0.61090064", "0.6092065", "0.60739297", "0.6067129", "0.6051941", "0.60357094", "0.6009429", "0.600611", "0.5984218", "0.596459", "0.5960936", "0.59278756", "0.5904747", "0.5884744", "0.58798176", "0.58747894", "0.58652365", "0.58651", "0.58612007", "0.58610475", "0.5815669", "0.5815217", "0.58092993", "0.57992446", "0.57981384", "0.57965326", "0.57851404", "0.578148", "0.57677764", "0.5760978", "0.57518685", "0.57501096", "0.57501096", "0.57501096", "0.5747241", "0.5747241", "0.5745537", "0.5745006", "0.57209074", "0.5718261", "0.5711777", "0.5709907", "0.5704149", "0.5701044", "0.56977123", "0.5686128", "0.56773496", "0.5669776", "0.5669776", "0.5664738", "0.56598794", "0.5655312", "0.5644025", "0.5637528", "0.5632761", "0.5625487", "0.5609198", "0.56046313", "0.55952406", "0.5590177", "0.55779785" ]
0.7674192
0
Set response error status and message
public function error($message = '') { $this->success = false; $this->message($message); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setErrorHeader() {\n\t\tif ($this->response_code >= 400 && $this->response_code < 500) {\n\t\t\theader('HTTP/1.1 ' . $this->response_code . \" \" . SVException::g($this->response_code));\n\t\t\texit(0);\n\t\t}\n\t}", "private function reset_response() {\n // Defautl is server error because it wasnt set so we dont know what\n // the error was\n $this->code = 500;\n // Message is blank\n $this->message = \"Unknown Error\";\n }", "public function setResponseStatus($status) {}", "public function setErrorResponse($message)\r\n {\r\n $this->setResponse(self::STATUS_CODE_ERROR, $message);\r\n }", "protected function setResponse($status_code, $message='')\r\n {\r\n $this->response_vars['status_code'] = $status_code;\r\n $this->response_vars['message'] = $message;\r\n }", "function setErrorHeader($message){\n\thttp_response_code(404);\n\theader('Content-Type: application/json');\n\techo $message;\n}", "public static function sendError($status_code,$message=null) {\n\t\thttp_response_code($status_code);\n\t\techo $message;\n\t}", "public function error(int $status, $message = null, array $headers = []): ResponseInterface;", "public function error(BaseResponse $response);", "protected function error()\n {\n $this->response = $this->response->withStatus(500);\n $this->jsonBody([\n 'input' => $this->payload->getInput(),\n 'error' => $this->payload->getOutput(),\n ]);\n }", "private function setErrorResponse($message, $errorCode = 200)\n {\n $this->_response->setHttpResponseCode($errorCode);\n $this->_helper->json(array(\n 'message' => $message\n ));\n }", "function errorMessage($status, $message)\n {\n return response([\n 'status' => $status,\n 'message' => $message\n ]);\n }", "public function setStatusCode($status);", "public function setStatusCode($code, $text);", "public static function sendErrorResponse($error = null){\n http_response_code(500);\n echo $error;\n die();\n }", "public function setResponseCode($code) {}", "protected function setResponsesError(int $code, string $message = '')\n {\n foreach ($this->responses as $response) {\n $response->setError($code, $message);\n }\n }", "function setStatusCode($code);", "public function setStatusCode($code)\r\n {\r\n http_response_code($code);\r\n }", "public static function respondWithError($status,$message)\n {\n $array = [\n \"error\" => [\n \"message\" => $message\n ]\n ];\n return self::respond($status,$array);\n }", "public function actionError() {\n if ($error = Yii::app()->errorHandler->error) {\n\t\t\t$this->sendRestResponse(500,array(\n\t\t\t\t'status' => false,\n\t\t\t\t'message' => $error['message'],\n\t\t\t\t'data' => $error,\n\t\t\t));\t\t\t\n }\n\t}", "private function errorResponse($error)\n {\n $response['status_code_header'] = 'HTTP/1.1 404 Not Found';\n $response['status'] = '400';\n $response['error'] = $error;\n header('HTTP/1.1 404 Not Found');\n echo json_encode($response);\n }", "function errorHandler($message, $code){\n echo '{\"errors\":\"'.$message.'\"}';\n http_response_code($code);\n return false;\n }", "protected function set_valid_response_codes()\n {\n //@todo manage response codes\n $this->valid_response_codes = array(200);\n }", "protected function response_error(int $status_code, string $status_message, int $header_code = 200)\n {\n $this->log->write_log('debug', $this->TAG . ': response_error: ');\n $response =\n $this->generate_response(\n VALUE_STATUS_ERROR,\n $status_code,\n $status_message,\n VALUE_DATA_ERROR);\n $this->send($header_code, $response);\n }", "function respondWithError($message, $httpCode = 500) {\n header('Content-Type: application/json');\n http_response_code($httpCode);\n $json = json_encode([\n 'ok' => false,\n 'error' => $message,\n ], JSON_PRETTY_PRINT);\n echo $json;\n exit();\n}", "protected function setHTTPstatus($code)\n {\n $realCode = Response::$statusTexts;\n\n if (isset($realCode[$code])) {\n $this->HTTPstatus = $code;\n }\n }", "private function error($response) {\n\t\tif(property_exists($response, \"error\") AND $response->code != 200) {\n\t\t\tthrow new MystoreAPI_exception(\"Error \".$response->code.\"<br />\".$response->error->message);\n\t\t}\n\t}", "function setFailedValidationStatusCode();", "public function testAbleToSetStatus()\n {\n $this->response->setStatus(404);\n $this->assertEquals(\n 404, $this->response->getStatus(),\n 'Unable to set Status'\n );\n }", "public function setErrors($error) {\n\t\t$params = $this->controller->request->params; \n\t\t$message = $error->getMessage();\n\t\t$url = $this->controller->request->here();\n\t\t$code = ($error->getCode() > 500 && $error->getCode() < 506) ? $error->getCode() : 500;\n\t\t$this->controller->response->statusCode($code);\n\t\t$this->controller->set(array(\n\t\t\t'name' => $message,\n\t\t\t'message' => h($url),\n\t\t\t'error' => $error,\n\t\t));\n\t\tif(isset($params['admin'])){\n\t\t\t$this->controller->render('/Errors/admin_error','admin_login');\n\t\t}else{\n\t\t\techo \"asdsadsadsa\"; die;\n\t\t\t$this->controller->render('/Errors/error','error');\n\t\t}\n\t}", "public function setResponseCode($code);", "public static function error($status,$message){\r\n throw new \\Luracast\\Restler\\RestException($status, $message);\r\n }", "public function error()\n {\n $this->status = JSendResponse::STATUS_ERROR;\n\n return $this;\n }", "function errorHandler($status, $code, $message = null) {\n switch ($code) {\n case 406:\n header(\"HTTP/1.1 $code User $status\");\n if ($message == null)\n $message = 'Wrong credentials provided'; \n break;\n case 409:\n header(\"HTTP/1.1 $code $status\");\n if ($message == null)\n $message = 'There was a conflict with the data being sent'; \n break;\n case 500:\n header(\"HTTP/1.1 $code $status. Bad connection, portal is down\");\n if ($message == null)\n $message = \"The server is down, we couldn't retrieve data from the database\";\n break;\n }\n die($message);\n }", "function setResponseMessage($message) {\n $this->responseMessage = $message;\n }", "public static function send_http_error( $data )\n {\n \\HttpResponse::status( 400 );\n \\HttpResponse::setContentType( 'application/json' ); \n \\HttpResponse::setData( $data );\n \\HttpResponse::send();\n }", "function set_status_header(int $p_code = 200, string $p_text = '') {\n if (flcCommon::is_cli()) {\n return;\n }\n\n /* if (empty($p_code) or !is_numeric($p_code)) {\n $p_text = 'Status code must be numeric';\n $p_code = 500;\n }*/\n\n if (empty($p_text)) {\n is_int($p_code) or $p_code = (int)$p_code;\n\n if (isset(self::$status_codes[$p_code])) {\n $p_text = self::$status_codes[$p_code];\n } else {\n $p_text = '(null)';\n $p_code = 500;\n }\n }\n\n if (strpos(PHP_SAPI, 'cgi') === 0) {\n header('Status: '.$p_code.' '.$p_text, true);\n } else {\n header($this->get_protocol_version().' '.$p_code.' '.$p_text, true, $p_code);\n }\n }", "function response($code){\n $this->response_code = $code;\n }", "public function errorAction()\n {\n $code = $this->_request->getParam('errorCode');\n $this->view->errorCode = $code;\n $this->getResponse()->setRawHeader('HTTP/1.1 500 Internal Server Error');\n }", "public function setError(string $value = ''): Response {\n\t\t$this->error = $value;\n\n\t\treturn $this;\n\t}", "function errorResponse ($messsage) {\n header('HTTP/1.1 500 Internal Server Error');\n die(json_encode(array('message' => $messsage)));\n }", "public function error($statusCode = 400)\n {\n $this->statusCode = $statusCode;\n $this->success = false;\n $this->result = array();\n \n if ($errors = \\Phork::error()->getErrors()->items()) {\n $this->result['errors'] = array_values($errors);\n \\Phork::error()->clear();\n }\n }", "static function set_status_header($code = 200, $text = '')\n\t{\n\t\t$stati = array(\n\t\t\t\t\t\t200\t=> 'OK',\n\t\t\t\t\t\t201\t=> 'Created',\n\t\t\t\t\t\t202\t=> 'Accepted',\n\t\t\t\t\t\t203\t=> 'Non-Authoritative Information',\n\t\t\t\t\t\t204\t=> 'No Content',\n\t\t\t\t\t\t205\t=> 'Reset Content',\n\t\t\t\t\t\t206\t=> 'Partial Content',\n\n\t\t\t\t\t\t300\t=> 'Multiple Choices',\n\t\t\t\t\t\t301\t=> 'Moved Permanently',\n\t\t\t\t\t\t302\t=> 'Found',\n\t\t\t\t\t\t304\t=> 'Not Modified',\n\t\t\t\t\t\t305\t=> 'Use Proxy',\n\t\t\t\t\t\t307\t=> 'Temporary Redirect',\n\n\t\t\t\t\t\t400\t=> 'Bad Request',\n\t\t\t\t\t\t401\t=> 'Unauthorized',\n\t\t\t\t\t\t403\t=> 'Forbidden',\n\t\t\t\t\t\t404\t=> 'Not Found',\n\t\t\t\t\t\t405\t=> 'Method Not Allowed',\n\t\t\t\t\t\t406\t=> 'Not Acceptable',\n\t\t\t\t\t\t407\t=> 'Proxy Authentication Required',\n\t\t\t\t\t\t408\t=> 'Request Timeout',\n\t\t\t\t\t\t409\t=> 'Conflict',\n\t\t\t\t\t\t410\t=> 'Gone',\n\t\t\t\t\t\t411\t=> 'Length Required',\n\t\t\t\t\t\t412\t=> 'Precondition Failed',\n\t\t\t\t\t\t413\t=> 'Request Entity Too Large',\n\t\t\t\t\t\t414\t=> 'Request-URI Too Long',\n\t\t\t\t\t\t415\t=> 'Unsupported Media Type',\n\t\t\t\t\t\t416\t=> 'Requested Range Not Satisfiable',\n\t\t\t\t\t\t417\t=> 'Expectation Failed',\n\n\t\t\t\t\t\t500\t=> 'Internal Server Error',\n\t\t\t\t\t\t501\t=> 'Not Implemented',\n\t\t\t\t\t\t502\t=> 'Bad Gateway',\n\t\t\t\t\t\t503\t=> 'Service Unavailable',\n\t\t\t\t\t\t504\t=> 'Gateway Timeout',\n\t\t\t\t\t\t505\t=> 'HTTP Version Not Supported'\n\t\t\t\t\t);\n\n\t\tif ($code == '' OR ! is_numeric($code))\n\t\t{\n\t\t\tself::show_error('Status codes must be numeric', 500);\n\t\t}\n\n\t\tif (isset($stati[$code]) AND $text == '')\n\t\t{\t\t\t\t\n\t\t\t$text = $stati[$code];\n\t\t}\n\t\n\t\tif ($text == '')\n\t\t{\n\t\t\tself::show_error('No status text available. Please check your status code number or supply your own message text.', 500);\n\t\t}\n\t\n\t\t$server_protocol = (isset($_SERVER['SERVER_PROTOCOL'])) ? $_SERVER['SERVER_PROTOCOL'] : FALSE;\n\n\t\tif (substr(php_sapi_name(), 0, 3) == 'cgi')\n\t\t{\n\t\t\theader(\"Status: {$code} {$text}\", TRUE);\n\t\t}\n\t\telseif ($server_protocol == 'HTTP/1.1' OR $server_protocol == 'HTTP/1.0')\n\t\t{\n\t\t\theader($server_protocol.\" {$code} {$text}\", TRUE, $code);\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader(\"HTTP/1.1 {$code} {$text}\", TRUE, $code);\n\t\t}\n\t}", "public function markError()\n {\n $this->setStatus(self::STATE_ERROR);\n }", "function raiseError($errorMessage, $responseCode){\n\t global $errors;\n\n\t\thttp_response_code($responseCode);\n\n\t die(json_encode(array(\n\t \t\"error\" => $errorMessage\n\t )));\n\t}", "protected function set_status($code)\n {\n }", "function status() { return $this->err->status;}", "public function setError($err);", "protected function set_status( $code ) {\n\t\tstatus_header( $code );\n\t}", "public function testRollbarLoggerResponseStatusError(): void\n {\n Rollbar::init([\n // Invalid access token should cause a 403 response.\n 'access_token' => '00000000000000000000000000000000',\n 'environment' => 'testing-php',\n 'verbose_logger' => $this->verboseLogger,\n ]);\n Rollbar::log(LogLevel::INFO, \"Testing PHP Notifier\");\n $this->assertVerboseLogContains('Occurrence rejected by the API: with status 403: ', LogLevel::ERROR);\n }", "function setStatusCode($code,$message = null){\n\t\tif(preg_match('/^([0-9]{3}) (.+)/',$code,$matches)){\n\t\t\t$code = $matches[1];\n\t\t\t$message = $matches[2];\n\t\t}\n\n\t\tsettype($code,\"integer\");\n\t\t$this->_StatusCode_Redefined = true;\n\t\t$this->_StatusCode = $code;\n\t\t$this->_StatusMessage = $message;\n\t}", "public function error(string $error, int $status = 500)\n {\n $this->setOutput($error, $status);\n }", "public function status($code)\n {\n $this['response']->setStatus($code);\n }", "public function set_status($code)\n {\n }", "public function set_status($code)\n {\n }", "public function error($str, $code = Response::STATUS_ERROR)\n {\n $this->addError(new Error($str, $code));\n Container::get('response')->setStatus($code);\n if (!Container::get('response')->isStatus(Response::STATUS_OK)) {\n $this->serve();\n }\n }", "public static function sendError($errMessage = \"\") {\n //TODO: send 404\n $responseObj = new Response();\n $body = array();\n $body['error']['code'] = 400;\n $body['error']['type'] = \"error_unknown\";\n $body['error']['message'] = $errMessage;\n $responseObj->setContent(json_encode($body));\n $responseObj->setStatus('400');\n $responseObj->setHeader('Content-Type: application/json');\n\n $responseObj->sendResponse();\n }", "public function setError($status, string $message = null)\n {\n $this->setDot('json.error', $status);\n\n if (!is_null($message)) {\n $this->setDot('json.message', $message);\n }\n\n return $this;\n }", "public function getStatusError($code = false)\n {\n switch ($code) {\n case 204:\n return 204;\n break;\n case 400: //Bad Request\n return 400;\n break;\n case 401:\n return 401;\n break;\n case 403:\n return 403;\n break;\n case 404:\n return 404;\n break;\n case 502:\n return 502;\n break;\n case 504:\n return 504;\n break;\n default:\n return 500;\n break;\n }\n }", "private function setErrors()\n {\n $this->errors = [\n 'error_no' => curl_errno($this->curl),\n 'error' => curl_error($this->curl),\n ];\n }", "public function setError($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Rpc\\Status::class);\n $this->error = $var;\n\n return $this;\n }", "public function setError($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Rpc\\Status::class);\n $this->error = $var;\n\n return $this;\n }", "public function setError($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Rpc\\Status::class);\n $this->error = $var;\n\n return $this;\n }", "public function responseError($key, $value) {\n return response()->json([\n 'code' => $key,\n 'message' => $value\n ]\n );\n }", "public function setResponseCode($responseCode);", "private function _setHttpResponseHeader($code = null) {\n\t\t$httpCode = $this->controller->response->httpCodes($code);\n\t\tif ($httpCode[$code]) {\n\t\t\t$this->controller->response->statusCode($code);\n\t\t} else {\n\t\t\t$this->controller->response->statusCode(500);\n\t\t\t$code = 500;\n\t\t}\n\t}", "function rest_show_error($code = NULL, $message = NULL, $override = FALSE)\r\n\t{\r\n\t\tif ($override == FALSE) {\r\n\t\t\tif (array_key_exists ( $code, $this->errors )) {\r\n\t\t\t\t$message = $this->errors [$code];\r\n\t\t\t} else {\r\n\t\t\t\t$message = ($code != NULL) ? ($message != NULL) ? $message : 'Unknown error.' : $this->errors ['400'];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($this->response_format == \"json\"){\r\n\t\t\texit(json_encode(\r\n\t\t\t\t\tarray (\r\n\t\t\t\t\t'code' => $code, \r\n\t\t\t\t\t'message' => $message \r\n\t\t\t\t\t)\r\n\t\t\t));\t\r\n\t\t}\r\n\t\t$result = $this->load->view ( 'api/rest/error', array (\r\n\t\t\t\t'code' => $code, \r\n\t\t\t\t'message' => $message \r\n\t\t), TRUE );\r\n\t\texit($result);\r\n\t}", "function newErr($type, $message) {\n $response = array(\n 'error' => $type,\n 'message' => $message\n );\n return json_encode($response);\n \n }", "private function setStatusCode()\n {\n $this->status_code = curl_getinfo($this->curl, CURLINFO_HTTP_CODE);\n }", "public function client_error($status_code = 404)\n {\n $data = array('status_code' => $status_code);\n\n view('error/client_error', $data);\n }", "private function error()\n {\n $json = array_merge($this->data, ['message' => $this->error, 'class' => 'error']);\n wp_send_json($json);\n }", "function set_status_header($code = 200, $text = '') {\n $stati = array(\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 203 => 'Non-Authoritative Information',\n 204 => 'No Content',\n 205 => 'Reset Content',\n 206 => 'Partial Content',\n\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Found',\n 304 => 'Not Modified',\n 305 => 'Use Proxy',\n 307 => 'Temporary Redirect',\n\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not Allowed',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Timeout',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable',\n 417 => 'Expectation Failed',\n\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Timeout',\n 505 => 'HTTP Version Not Supported'\n );\n\n if ($code == '' OR !is_numeric($code)) {\n show_error('Status codes must be numeric', 500);\n }\n\n if (isset($stati[$code]) AND $text == '') {\n $text = $stati[$code];\n }\n\n if ($text == '') {\n show_error('No status text available. Please check your status code number or supply your own message text.', 500);\n }\n\n $server_protocol = (isset($_SERVER['SERVER_PROTOCOL'])) ? $_SERVER['SERVER_PROTOCOL'] : FALSE;\n\n if (substr(php_sapi_name(), 0, 3) == 'cgi') {\n header(\"Status: {$code} {$text}\", TRUE);\n }\n elseif ($server_protocol == 'HTTP/1.1' OR $server_protocol == 'HTTP/1.0') {\n header($server_protocol . \" {$code} {$text}\", TRUE, $code);\n }\n else {\n header(\"HTTP/1.1 {$code} {$text}\", TRUE, $code);\n }\n}", "function throw_user_error($error_code, $error_text) {\n http_response_code($error_code);\n echo $error_text;\n exit;\n}", "private function assertError($response, $code = 500) {\n $response->assertStatus($code)\n ->assertJson([\n 'status' => 'error',\n 'http_status_code' => $code\n ]);\n }", "function setResponseCode($code) {\n $this->responseCode = $code;\n }", "public static function error_response() {\r\n header(\"HTTP/1.1 404 Recurso no encontrado\");\r\n exit();\r\n }", "protected function setError($message, $code)\n\t{\n\t\t$this->error = true;\n\t\t$this->errorMessage = $message;\n\t\t$this->errorCode = $code;\n\t}", "function httpError($code, $message = null, $die = true, $only_headers = false) {\n if($message === null) {\n $errors = array(\n 100 => \"HTTP/1.1 100 Continue\",\n 101 => \"HTTP/1.1 101 Switching Protocols\",\n 200 => \"HTTP/1.1 200 OK\",\n 201 => \"HTTP/1.1 201 Created\",\n 202 => \"HTTP/1.1 202 Accepted\",\n 203 => \"HTTP/1.1 203 Non-Authoritative Information\",\n 204 => \"HTTP/1.1 204 No Content\",\n 205 => \"HTTP/1.1 205 Reset Content\",\n 206 => \"HTTP/1.1 206 Partial Content\",\n 300 => \"HTTP/1.1 300 Multiple Choices\",\n 301 => \"HTTP/1.1 301 Moved Permanently\",\n 302 => \"HTTP/1.1 302 Found\",\n 303 => \"HTTP/1.1 303 See Other\",\n 304 => \"HTTP/1.1 304 Not Modified\",\n 305 => \"HTTP/1.1 305 Use Proxy\",\n 307 => \"HTTP/1.1 307 Temporary Redirect\",\n 400 => \"HTTP/1.1 400 Bad Request\",\n 401 => \"HTTP/1.1 401 Unauthorized\",\n 402 => \"HTTP/1.1 402 Payment Required\",\n 403 => \"HTTP/1.1 403 Forbidden\",\n 404 => \"HTTP/1.1 404 Not Found\",\n 405 => \"HTTP/1.1 405 Method Not Allowed\",\n 406 => \"HTTP/1.1 406 Not Acceptable\",\n 407 => \"HTTP/1.1 407 Proxy Authentication Required\",\n 408 => \"HTTP/1.1 408 Request Time-out\",\n 409 => \"HTTP/1.1 409 Conflict\",\n 410 => \"HTTP/1.1 410 Gone\",\n 411 => \"HTTP/1.1 411 Length Required\",\n 412 => \"HTTP/1.1 412 Precondition Failed\",\n 413 => \"HTTP/1.1 413 Request Entity Too Large\",\n 414 => \"HTTP/1.1 414 Request-URI Too Large\",\n 415 => \"HTTP/1.1 415 Unsupported Media Type\",\n 416 => \"HTTP/1.1 416 Requested range not satisfiable\",\n 417 => \"HTTP/1.1 417 Expectation Failed\",\n 500 => \"HTTP/1.1 500 Internal Server Error\",\n 501 => \"HTTP/1.1 501 Not Implemented\",\n 502 => \"HTTP/1.1 502 Bad Gateway\",\n 503 => \"HTTP/1.1 503 Service Unavailable\",\n 504 => \"HTTP/1.1 504 Gateway Time-out\" \n );\n \n $message = array_var($errors, $code);\n if(trim($message) == '') {\n $message = 'Unknown';\n } // if\n } // if\n \n header(\"HTTP/1.1 $code $message\");\n print '<h1>' . clean($message) . '</h1>';\n \n if($die) {\n die();\n } // if\n }", "public function get_response() {\n $view = View::factory('Errors/default');\n\n // Remembering that `$this` is an instance of HTTP_Exception_404\n $view->message = $this->getMessage();\n\n $view->error_code = 500;\n $view->error_rant = \"something's wrong with our server\";\n $view->error_message = \"probably another rat ate our server cable. Please wait patiently :)\";\n\n $response = Response::factory()\n ->status(500)\n ->body($view->render());\n\n return $response;\n }", "public function prefillBaseFieldsForBadRequestResponse(): void\n {\n $this->setCode(Response::HTTP_BAD_REQUEST);;\n $this->setSuccess(false);\n }", "private function exceptionWithResponseCode($code, $message) {\n $this->httpResponseCode = $code;\n throw new \\Exception($message);\n }", "protected function setResponseStatus(ResponseStatus $value)\n {\n $this->responseStatus = $value;\n }", "private function throwJsonError($status, $error)\n\t\t{\n\t\t\t$response = array('status' => $status, 'error' => $error);\n\t\t\techo json_encode($response);\n\t\t\texit;\n\t\t}", "public static function getError(\n $message = 'you got an error.',\n $status = 'error',\n $code = 500,\n $data = null\n ) {\n // try {\n self::$errorResponse['error']['message'] = $message;\n self::$errorResponse['error']['status'] = $status;\n self::$errorResponse['error']['code'] = $code;\n $data != null ? self::$errorResponse['error']['data'] = $data : null;\n return self::$errorResponse;\n // } catch (Exception $e) {\n // throw new Exception(\"Something wrong with package.\");\n // }\n }", "public function baseError($data,$statusCode=400, $options=null){\n\t\t$contents = array('status' => 'error', 'response' => $data, 'options' => $options);\n\n\t\t$response = Response::make($contents, $statusCode);\n\n\t\t$response->header('Content-Type', $this->contentType);\n\n\t\treturn $response;\n\n\n\t}", "protected function set_error( $code, $message) {\n\t\t$this->errors->add($code, $message);\n\t}", "public function error($status = '') {\n\n switch ($status) {\n case '404':\n return $this->render('views:errors/404.php', ['mp' => $this->mp]);\n break;\n }\n\n }", "function setResponse(){\n\t// Set the response message header\n\t// This example just sets a basic header response but you may need to \n\t// add some more checks, authentication, etc \n\t$header = array(\n\t\t'status'\t=> 'ok',\n\t\t'message'\t=> 'Service call was successful'\n\t);\n\t\n\treturn $header; \n}", "public function setStatus(int $code): void\n {\n http_response_code($code);\n }", "public static function sendErrorMessage($message, $code = 'ERROR', $status = 400)\n\t{\n\t\twp_send_json([\n 'error' => [\n\t\t\t\t'code' => $code,\n\t\t\t\t'message' => $message\n\t\t\t]\n ], $status);\n\t}", "function admin_error($code = 5000, $data = [], $msg = '')\n{\n if (empty($data)) $data = (object)[];\n if ($msg == '') {\n $msg = config('admin_response_code')[$code];\n }\n $json = [\n 'code'=>$code,\n 'data'=>$data,\n 'msg'=>$msg\n ];\n return response()->json($json);\n}", "static function error( $code, $desc ) {\n\t\t$codes = array();\n\t\t$codes[400] = 'Bad Request';\n\t\t$codes[401] = 'Unauthorized';\n\t\t$codes[403] = 'Forbidden';\n\t\t$codes[404] = 'Not Found';\n\t\t$codes[405] = 'Method Not Allowed';\n\t\t$codes[406] = 'Not Acceptable';\n\t\t$codes[501] = 'Not Implemented';\n\t\t$codes[503] = 'Service unavailable';\n\t\t\n\t\theader('Content-Type: text/html');\n\t\theader( 'HTTP/1.1 '. $code . ' '. @$codes[$code] );\n\t\tdie( $desc );\n\t}", "function errorOutput($output, $code = 500) {\n http_response_code($code);\n echo json_encode($output);\n}", "function Error(){\n header('Content-Type: application/json');\n echo ('false');\n http_response_code(200);\n }", "public function badRequestResponse(){\n $this->response->statusCode(400);\n return $this->response;\n }", "public function setErrorResponse(?Error $error): void\n {\n $this->errorResponse = $error;\n }", "public function error(string $msg = '', int $status = HttpStatusCode::INTERNAL_SERVER_ERROR) {\n $this->content = $msg;\n $this->status = $status;\n throw new \\Exception($msg, $status);\n }", "public function withResponse($request, $response)\n {\n $statusHttp = $this->statusHttp;\n if ($this->model instanceof Exception) {\n if ($this->model instanceof ApiException) {\n $statusHttp = $this->model->statusHttp;\n } else {\n $statusHttp = 500;\n }\n }\n\n $response->setStatusCode($statusHttp);\n }", "function internalServerError($message = null){\n\t\t$this->setStatusCode(500);\n\t\t$this->clearOutputBuffer();\n\t\tif(!isset($message)){\n\t\t\t$message = \"Internal server error.\";\n\t\t}\n\t\t$this->_writeStatusMessage($message);\n\t}", "public function setResponseCode(HttpStatusCode|int|null $code = 200): void\n {\n $codeObject = $code;\n\n if (!$codeObject)\n {\n return;\n }\n\n if (is_int($code))\n {\n $codeObject = HttpStatus::fromInt($code);\n }\n\n http_response_code($codeObject->code);\n }" ]
[ "0.7454058", "0.72934115", "0.7241961", "0.71591866", "0.7121617", "0.6962635", "0.6898001", "0.68863374", "0.68378025", "0.68201274", "0.67206264", "0.6700685", "0.6657028", "0.66181225", "0.6586576", "0.65821564", "0.6556671", "0.6527565", "0.6524617", "0.651788", "0.6506458", "0.6501345", "0.6492055", "0.6462246", "0.6454492", "0.64223933", "0.64197797", "0.64191777", "0.6402429", "0.6393177", "0.6392226", "0.63859624", "0.63854563", "0.63628393", "0.62972003", "0.62773407", "0.6265063", "0.62624025", "0.6261802", "0.626096", "0.62608343", "0.6253574", "0.6253167", "0.62530404", "0.62500376", "0.62376046", "0.6225877", "0.62247354", "0.62111396", "0.61830586", "0.61775285", "0.6175379", "0.6166198", "0.616368", "0.6149132", "0.61467505", "0.61373717", "0.6135017", "0.6111746", "0.6091182", "0.608993", "0.6088974", "0.6088974", "0.6088974", "0.60776603", "0.6077542", "0.60775286", "0.60748905", "0.60711926", "0.6062636", "0.6060107", "0.605723", "0.6056438", "0.6041334", "0.6040224", "0.60364026", "0.60352814", "0.6032441", "0.6032362", "0.6030469", "0.6030081", "0.6028822", "0.6022818", "0.60177904", "0.60160327", "0.60124505", "0.60067195", "0.60023475", "0.5995234", "0.599318", "0.5993094", "0.5992036", "0.5982714", "0.59747654", "0.59713596", "0.59592986", "0.5957363", "0.59511805", "0.5949282", "0.5948699", "0.59478843" ]
0.0
-1
Get the instance as an array
public function toArray() { return [ 'success' => $this->success, 'error' => !$this->success, 'message' => $this->message, ] + $this->data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function instanceToArray() : array{\n\n if(!method_exists(self::class,'instance')):\n return [];\n endif;\n\n return self::instance()->toArray();\n }", "public function toArray($instance): array;", "public function getAsArray();", "function asArray(){\n\t\t\t$array = $this->toArray( $this );\n\t\t\treturn $array;\n\t\t}", "public function toArray() : array{\n return get_object_vars( $this );\n }", "public function toArray() {\n return (array)$this;\n }", "public function toArray() :array {\n return get_object_vars($this);\n }", "public function toArray() {\n\t\treturn $this->array;\n\t}", "public function as_array()\n\t{\n\t\treturn $this->getArrayCopy();\n\t}", "public function toArray()\n {\n return (array)$this;\n }", "public function toArray()\n {\n return (array)$this;\n }", "public function toArray()\n {\n return (array)$this;\n }", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {\n return $this->array;\n }", "public function toArray()\n {\n return $this->cast('array');\n }", "public function __toArray(): array\n {\n return call_user_func('get_object_vars', $this);\n }", "public function toArray()\n {\n return get_object_vars($this);\n }", "public function toArray() {\n return get_object_vars($this);\n }", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "public function & toArray()\n\t{\n\t\t$x = new ArrayObject($this->data);\n\t\treturn $x;\n\t}", "public function toArray() {\n return json_decode(json_encode($this), true);\n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray() // untested\n {\n return $this->data;\n }", "public function asArray()\r\n {\r\n return $this->data;\r\n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray(): array\r\n {\r\n return get_object_vars($this);\r\n }", "function toArray(){\r\n\t\treturn $this->data;\r\n\t}", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function getArray() : array {\n return $this->getArrayCopy();\n }", "public function toArray()\n\t{\n\t\treturn array();\n\t}", "public function toArray()\n {\n return json_decode(json_encode($this), true);\n }", "public function toArray()\n {\n return json_decode(json_encode($this), true);\n }", "public function __toArray()\n {\n return $this->toArray();\n }", "public function asArray(){\n return $this->data;\n }", "public function toArray()\n {\n return get_object_vars($this);\n }", "public function toArray()\n {\n return get_object_vars($this);\n }", "public function toArray(): array {\n\t\treturn $this->array;\n\t}", "public function toArray(){\n $this->buildArray();\n return $this->array;\n }", "public function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "public function asArray()\n {\n return $this->data;\n }", "public function getAsArray()\n\t{\n\t\t\n\t\t$path = $this->get();\n\t\t\n\t\treturn self::toArray($path);\n\t\t\n\t}", "public function toArray() {\n return get_object_vars($this);\n }", "public function to_array()\n\t{\n\t\treturn $this->getArrayCopy();\n\t}", "public function toArray() {\n\t\treturn $this->data;\n\t}", "public function toArray()\n {\n // TODO: Implement toArray() method.\n }", "public function toArray()\n {\n // TODO: Implement toArray() method.\n }", "public function asArray()\n {\n return iterator_to_array($this, false);\n }", "public /*array*/ function toArray()\n\t{\n\t\treturn $this->_data;\n\t}", "public function asArray() : array\n {\n return $this->a;\n }", "public function toArray()\n {\n return $this->_data;\n }", "public function toArray()\n {\n return $this->_data;\n }", "public function asArray()\n {\n }", "public function toArray()\r\n\t{\r\n\t\treturn $this->m_data;\r\n\t}", "public function toArray()\r\n {\r\n return $this->data;\r\n }", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;" ]
[ "0.864675", "0.8238217", "0.8088638", "0.8003329", "0.7867979", "0.7858977", "0.78543174", "0.77583474", "0.774783", "0.77462906", "0.77462906", "0.77462906", "0.7745846", "0.7745846", "0.7745597", "0.7745597", "0.7745597", "0.7745597", "0.7745164", "0.7745164", "0.7745164", "0.7745164", "0.7745164", "0.7745164", "0.7745164", "0.7745164", "0.7745164", "0.7745164", "0.77137697", "0.76899487", "0.76759475", "0.76652724", "0.7656419", "0.76391697", "0.76391697", "0.76391697", "0.76391697", "0.76391697", "0.76391697", "0.76391697", "0.76391697", "0.76391697", "0.7630268", "0.76279", "0.7623933", "0.7623933", "0.7607699", "0.7598759", "0.75982606", "0.7598201", "0.75884694", "0.7584917", "0.7584917", "0.7584917", "0.7584917", "0.7584917", "0.7584917", "0.7583161", "0.7580985", "0.75803596", "0.75803596", "0.7578457", "0.75772816", "0.75615764", "0.75615764", "0.75582594", "0.7556674", "0.75561994", "0.7552925", "0.75399476", "0.7534533", "0.7532344", "0.7531046", "0.7513831", "0.7513831", "0.7499114", "0.74770826", "0.7468904", "0.74537283", "0.74537283", "0.74424404", "0.7437458", "0.7434166", "0.74319345", "0.74319345", "0.74319345", "0.74319345", "0.74319345", "0.74319345", "0.74319345", "0.74319345", "0.74319345", "0.74319345", "0.74319345", "0.74319345", "0.74319345", "0.74319345", "0.74319345", "0.74319345", "0.74319345", "0.74319345" ]
0.0
-1
Convert the object to its JSON representation
public function toJson($options = JSON_UNESCAPED_UNICODE) { return json_encode($this->toArray(), $options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toJson($object);", "public function json(){ return json_encode( $this->objectify() ); }", "public function toJson();", "public function toJson();", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function toJSON(){\n return json_encode($this);\n }", "public function toObject() \n {\n return $this->toJson();\n }", "public function toJson() {\n\t\treturn json_encode($this->jsonSerialize());\n\t}", "public function jsonize()\n {\n return json_encode($this->toArray());\n }", "public function toJson(){\n\t\t$array = $this->toArray();\n\t\treturn json_encode($array);\n\t}", "public function toJson($object){\n\t\t// FIXME: right now this only supports the official PHP JSON extension,\n\t\t// which is officially part of the language as of 5.2, and exists\n\t\t// as a PECL extension prior to that. It might be good to update\n\t\t// this to support PEAR JSON, Zend_Json, etc...\n\t\treturn json_encode($object);\n\t}", "public function toObject(){\r\n return json_decode($this->toJson());\r\n }", "public function toJson() {\r\n\t\t// Returns:\t\tReturns JSON encoded string\r\n\t\treturn json_encode($this);\r\n\t}", "public function toJson()\n {\n return json_encode($this->jsonSerialize(), JSON_THROW_ON_ERROR);\n }", "function toJSON()\n {\n return json_encode($this->toArray());\n }", "public function toJson() {\n return $this->jsonSerialize();\n }", "public function toJson() {\n return json_encode(get_object_vars($this));\n }", "public function toJson()\n {\n return $this->serializer()->serialize($this);\n }", "public function toJSON()\n {\n return json_encode( $this->toArray() );\n }", "public function _jsonSerialize();", "public function jsonSerialize()\n {\n return $this->toJson();\n }", "public function makeJSON()\n {\n return(json_encode($this));\n }", "public function makeJSON()\n {\n return(json_encode($this));\n }", "public function toJson()\n {\n return json_encode($this->toArray(), JSON_FORCE_OBJECT | JSON_NUMERIC_CHECK);\n }", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function toJSON()\n\t{\n\t\treturn $this->json;\n\t}", "public function toJson()\n {\n return json_decode(json_encode($this->toArray()));\n }", "function asJSON(){\n\t\t\treturn json_encode($this->asArray());\n\t\t}", "public function toJSON( ) {\n\n\t\t$data = $this->_toJsonOrXMLDataPrepare();\n\n\t\treturn json_encode( $data );\n\t}", "public function toJSON() {\n return json_encode($this->data);\n }", "public function jsonSerialize()\n {\n }", "public function jsonSerialize()\n {\n }", "private function toJson($object) {\n $array = $this->toArray($object);\n return str_replace('\\\\u0000', \"\", json_encode($array));\n }", "function to_json(tSerializable $object){\r\n return json_encode($object->jsonData());\r\n}", "public function toJson(): string;", "public function toJson(): string;", "public function toJson()\n {\n return json_encode( $this->toArray() );\n }", "public function toJson()\n\t{\n\t\treturn json_encode($this->data());\n\t}", "public function toJSON(): string\n {\n $this->update();\n\n // Copied from DataObjectToJSONTrait. Do not modify here !!!\n $toJSON = function($object): string {\n $result = [];\n\n $vars = get_object_vars($object);\n foreach ($vars as $name => $value) {\n if ($name !== 'internalDataObjectData') {\n $reflectionProperty = new \\ReflectionProperty($object, $name);\n if ($reflectionProperty->isPublic()) {\n $result[$name] = null;\n }\n }\n }\n $propertiesToEncode = [];\n if (isset($object->internalDataObjectData)) {\n foreach ($object->internalDataObjectData as $name => $value) {\n $result[substr($name, 1)] = null;\n if (substr($name, 0, 1) === 'p' && isset($value[7])) { // encodeInJSON is set\n $propertiesToEncode[substr($name, 1)] = true;\n }\n }\n }\n ksort($result);\n foreach ($result as $name => $null) {\n $value = $object instanceof \\ArrayAccess ? $object[$name] : (isset($object->$name) ? $object->$name : null);\n if (method_exists($value, 'toJSON')) {\n $result[$name] = $value->toJSON();\n } else {\n if ($value instanceof \\DateTime) {\n $value = $value->format('c');\n }\n if (isset($propertiesToEncode[$name]) && $value !== null) {\n if (is_string($value)) {\n $value = 'data:;base64,' . base64_encode($value);\n } else {\n throw new \\Exception('The value of the ' . $name . ' property cannot be JSON encoded. It must be of type string!');\n }\n }\n $result[$name] = json_encode($value);\n if ($result[$name] === false) {\n throw new \\Exception('Invalid characters in ' . $name . '! Cannot JSON encode the value: ' . print_r($value, true));\n }\n }\n }\n $json = '';\n foreach ($result as $name => $value) {\n $json .= '\"' . addcslashes($name, '\"\\\\') . '\":' . $value . ',';\n }\n $json = '{' . rtrim($json, ',') . '}';\n return $json;\n };\n\n $json = '';\n foreach ($this->data as $index => $object) {\n $object = $this->updateValueIfNeeded($this->data, $index);\n if (method_exists($object, 'toJSON')) {\n $json .= $object->toJSON() . ',';\n } else {\n $json .= $toJSON($object) . ',';\n }\n }\n $json = '[' . rtrim($json, ',') . ']';\n return $json;\n }", "function encode($object) {\n if ($this->error()) {\n $this->json=json_encode($object);\n return $this->json;\n }\n }", "public function toJson()\n {\n return json_encode($this);\n }", "public function toJson() {\n\t\t$data = $this->getSerializeData();\n\n\t\treturn json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\n\t}", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function toJson() {\n return json_encode($this);\n }", "public function toJson() {\n\t\tdebug($this);\n\t}", "public function serializar() {\n\t return json_encode(get_object_vars($this), JSON_FORCE_OBJECT);\n\t\t}", "public function serializar() {\n\t return json_encode(get_object_vars($this), JSON_FORCE_OBJECT);\n\t\t}", "public function toJson() {\n\t\treturn json_encode($this->toArray());\n\t}", "public function toJson()\n {\n return json_encode($this->toArray(), true);\n }", "public function toJson()\r\n {\r\n return json_encode($this->toArray());\r\n }" ]
[ "0.8347026", "0.79315275", "0.79295844", "0.79295844", "0.7759554", "0.7759554", "0.7759554", "0.7759554", "0.7759554", "0.7759554", "0.7759554", "0.7759554", "0.7759554", "0.7589829", "0.7587483", "0.7549625", "0.7536761", "0.752455", "0.75008", "0.7490271", "0.7486798", "0.74353737", "0.74218917", "0.741925", "0.73875624", "0.7379131", "0.73655236", "0.7364002", "0.73613846", "0.73558825", "0.73558825", "0.7331588", "0.732682", "0.732682", "0.732682", "0.732682", "0.732682", "0.732682", "0.732682", "0.732682", "0.7322103", "0.7315817", "0.73129964", "0.7303219", "0.73030907", "0.72960883", "0.72960883", "0.72861993", "0.72833514", "0.72760636", "0.72760636", "0.72745585", "0.7267171", "0.72636884", "0.72499514", "0.7227287", "0.7224634", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.72225523", "0.7219591", "0.7213388", "0.71971905", "0.71971905", "0.71898216", "0.71867937", "0.71829116" ]
0.0
-1
dodanie pozycji w menu plugins
function smartecruiters_config_page(){ if ( function_exists('add_submenu_page') ){ add_submenu_page('plugins.php', 'Job Manager by SmartRecruiters', 'Job Manager by SmartRecruiters', 'manage_options', 'smartrecruiters-config', 'smartrecruiters_config'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function menus()\n {\n\n }", "public function modMenu() {}", "public function modMenu() {}", "public function modMenu() {}", "function admin_menu()\n {\n }", "function admin_menu()\n {\n }", "function admin_menu()\n {\n }", "protected function getModuleMenu() {}", "protected function getModuleMenu() {}", "protected function getModuleMenu() {}", "function hook_plugin_in_panel(){\n add_menu_page( 'Formularze zamówień', 'Formularze zamówień', 'manage_options', 'Formularze zamówień', 'load_plugin_backend' ); #settings for menu acces\n}", "protected function registerMenu()\n {\n }", "function axial_bottin_import_plugin_setup_menu(){\n\n //Principal menu item\n add_menu_page('Gestion Bottin', //Titre de la page\n 'Gestion Bottin', //Titre du menu\n 'manage_options', //capabilité\n 'bottin_index', //menu slug\n 'bottin_index', //function\n 'dashicons-phone' // icon\n );\n\n //IMPORT BOTTIN\n\n add_submenu_page(bottin_index,\n 'Import Bottin',\n 'Import Bottin',\n 'manage_options',\n 'axial_bottin_import-plugin',\n 'axial_bottin_import_init');//function\n\n //BOTTIN BIGENRE\n\n //submenu\n add_submenu_page(bottin_index,\n 'Liste Bigenre',\n 'Liste des bigenres',\n 'manage_options',\n 'get_table_bigenre',\n 'get_table_bigenre');//function\n\n //submenu CACHÉ\n add_submenu_page(null,\n 'Ajouter',\n 'Ajouter',\n 'manage_options',\n 'create_bigenre',\n 'create_bigenre');//function\n\n //submenu CACHÉ\n add_submenu_page(null,\n 'Update bottin bigenre',\n 'Update',\n 'manage_options',\n 'update_table_bigenre',\n 'update_table_bigenre');//function\n\n //BOTTIN DÉPARTEMENT SERVICE\n\n //submenu\n add_submenu_page(bottin_index,\n 'Bottin Département Service',\n 'Liste des départements et services',\n 'manage_options',\n 'get_table_dept',\n 'get_table_dept');//function\n\n //submenu CACHÉ\n add_submenu_page(null,\n 'Ajouter',\n 'Ajouter',\n 'manage_options',\n 'create_dept',\n 'create_dept');//function\n\n //submenu CACHÉ\n add_submenu_page(null,\n 'Update bottin deptServ',\n 'Update',\n 'manage_options',\n 'update_table_dept',\n 'update_table_dept');//function\n\n //BOTTIN EMAIL GÉNÉRIQUE\n\n //submenu\n add_submenu_page(bottin_index,\n 'Bottin email générique',\n 'Liste des courriels génériques',\n 'manage_options',\n 'get_table_email_generique',\n 'get_table_email_generique');//function\n\n //submenu CACHÉ\n add_submenu_page(null,\n 'Ajouter',\n 'Ajouter',\n 'manage_options',\n 'create_email_generique',\n 'create_email_generique');//function\n\n //submenu CACHÉ\n add_submenu_page(null,\n 'Update bottin deptServ',\n 'Update',\n 'manage_options',\n 'update_table_email',\n 'update_table_email');//function\n}", "public function getMenu();", "public static function menu()\n\t\t\t{\n\t\t\t\t// Create menu tab\n\t\t\t\tadd_options_page(HE_PLUGINOPTIONS_NICK.' Plugin Options', HE_PLUGINOPTIONS_NICK, 'manage_options', HE_PLUGINOPTIONS_ID.'_options', array('HiddenEmpirePluginOptions', 'options_page'));\n\t\t\t}", "public function add_menus()\n {\n }", "function ft_hook_menu() {}", "function wpmu_menu()\n {\n }", "public function onWpAdminMenu() {\n\t}", "function admin_menu() {\n\t\tif ( class_exists( 'Jetpack' ) )\n\t\t\tadd_action( 'jetpack_admin_menu', array( $this, 'load_menu' ) );\n\t\telse\n\t\t\t$this->load_menu();\n\t}", "public function add_menu() {\n\n add_options_page('Форум phpbb3 :: администрирование', 'Форум phpbb3', 'manage_options', 'phpbb3', array($this, 'plugin_options'));\n }", "function menuConfig()\t{\n\t\tglobal $LANG;\n\t\t$this->MOD_MENU = Array (\n\t\t\"function\" => Array (\n\t\t\"1\" => $LANG->getLL(\"function1\"),\n\t\t\"2\" => $LANG->getLL(\"function2\"),\n\t\t)\n\t\t);\n\t\tparent::menuConfig();\n\t}", "function menuConfig() {\n global $LANG;\n $this->MOD_MENU = Array (\n \"function\" => Array (\n \"1\" => $LANG->getLL(\"overview\"),\n \"2\" => $LANG->getLL(\"new\"),\n \"3\" => $LANG->getLL(\"function3\"),\n )\n );\n parent::menuConfig();\n }", "function my_plugin_menu() {\n\t\tadd_options_page( 'Opções do Plugin', 'Marvel SC', 'manage_options', 'my-unique-identifier', 'my_plugin_options' );\n\t}", "function menuConfig()\t{\n\t\t\t\t\tglobal $LANG;\n\t\t\t\t\t$this->MOD_MENU = Array (\n\t\t\t\t\t\t'function' => Array (\n\t\t\t\t\t\t\t'1' => $LANG->getLL('function1')/*,\n\t\t\t\t\t\t\t'2' => $LANG->getLL('function2'),\n\t\t\t\t\t\t\t'3' => $LANG->getLL('function3'),*/\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\tparent::menuConfig();\n\t\t\t\t}", "public function makeMenu() {}", "public function admin_menu(&$menu)\n {\n\n\t}", "function add_menu() {\n // Add \"Telegram Bot\" menu\n $telegram_logo = \"https://upload.wikimedia.org/wikipedia/commons/8/82/Telegram_logo.svg\";\n add_menu_page(\"Telegram Bot\", \"Telegram Bot\", 4, sanitize_key(\"home\"), \"plugin_home_page\", $telegram_logo);\n \n // Add \"Admin panel\" submenu\n add_submenu_page(sanitize_key(\"home\"), \"Admin panel\", \"Admin panel\", 4, sanitize_key(\"admin\"), \"plugin_admin_panel_page\");\n}", "function register_plugin_menu(){\n add_menu_page( 'Rss Multi Updater', 'Rss Multi Updater', 'manage_options', 'RssMultiUpdater', array(&$this, 'admin_page'), '', 26 ); \n \n }", "function menuConfig()\t{\n\t\tglobal $LANG;\n\t\t$this->MOD_MENU = Array (\n\t\t\t'function' => Array (\n\t\t\t\t/*'1' => $LANG->getLL('function1'),\n\t\t\t\t'2' => $LANG->getLL('function2'),\n\t\t\t\t'3' => $LANG->getLL('function3'),*/\n\t\t\t)\n\t\t);\n\t\tparent::menuConfig();\n\t}", "function menuConfig()\t{\n\t\tglobal $LANG;\n\t\t$this->MOD_MENU = Array (\n\t\t\t'function' => Array (\n\t\t\t\t'1' => $LANG->getLL('function1'),\n\t\t\t\t'2' => $LANG->getLL('function2'),\n\t\t\t\t'3' => $LANG->getLL('function3'),\n\t\t\t)\n\t\t);\n\t\tparent::menuConfig();\n\t}", "public function menuConfig() {}", "public function menuConfig() {}", "public function menuConfig() {}", "public function menuConfig() {}", "public function pluginSettingsMenu()\n {\n $hook_suffix = add_options_page(__('Rundizable WP Features', 'rundizable-wp-features'), __('Rundizable WP Features', 'rundizable-wp-features'), 'manage_options', 'rundizable-wp-features-settings', [$this, 'pluginSettingsPage']);\n add_action('load-' . $hook_suffix, [$this, 'registerScripts']);\n unset($hook_suffix);\n\n //add_options_page(__('Rundizable WP Features read settings value', 'rundizable-wp-features'), __('Rundizable WP Features read settings', 'rundizable-wp-features'), 'manage_options', 'rundizable-wp-features-read-settings', [$this, 'pluginReadSettingsPage']);\n }", "public function menuConfig() {}", "public function menuConfig() {}", "public function addMenu(){\n\t\tadd_menu_page(\n\t\t\t$this->plugin->name,\n\t\t\t$this->plugin->name,\n\t\t\t'publish_pages',\n\t\t\t$this->plugin->varName,\n\t\t\tarray($this, 'page'),\n\t\t\t$this->plugin->uri . 'assets/images/icn-menu.png'\n\t\t);\n\t}", "function virustotalscan_admin_tools_menu(&$sub_menu)\r\n{\r\n global $lang;\r\n // se incarca fisierul de limba\r\n $lang->load('virustotalscan');\r\n\t$sub_menu[] = array('id' => 'virustotalscan', 'title' => $lang->virustotalscan_title, 'link' => 'index.php?module=tools-virustotalscan');\r\n}", "function register_plugin_menu(){\r\n add_menu_page( 'Aw Social Tabs', 'Aw Social Tabs', 'manage_options', 'awsocialtabs', array('AwstAdminPages', 'plugin_homepage'), 'dashicons-share', 6 );\r\n add_submenu_page('awsocialtabs', 'Aw Social Tabs | settings', 'Settings', 'manage_options','awst_settings', array('AwstAdminPages', 'awst_settings'));\r\n add_submenu_page('', 'Aw Social Tabs | Likes', 'Likes', 'manage_options','awst_likes', array('AwstAdminPages', 'awst_likes'));\r\n add_submenu_page('', 'Aw Social Tabs | Ratings', 'Ratings', 'manage_options','awst_ratings', array('AwstAdminPages', 'awst_ratings'));\r\n add_submenu_page('', 'Aw Social Tabs | Review', 'Review', 'manage_options','awst_review', array('AwstAdminPages', 'awst_review'));\r\n }", "private function init_menu()\n {\n // it's a sample code you can init some other part of your page\n }", "function menuConfig()\t{\n\t\tglobal $LANG;\n\t\t$this->MOD_MENU = Array (\n\t\t\t\"function\" => Array (\n\t\t\t\t\"2\" => \"Update typo3conf\",\n\t\t\t\t\"1\" => \"Check cluster health\",\n\t\t\t)\n\t\t);\n\t\tparent::menuConfig();\n\t}", "function threed_admin_plugin_menu_links($menu)\n{\n $menu[] = array(\n 'NAME' => 'ThreeD',\n 'URL' => THREED_ADMIN,\n );\n return $menu;\n}", "public function afficheMenu()\r\n\t\t{\r\n\t\t//appel de la vue du menu\r\n\t\trequire 'Vues/menu.php';\r\n\t\t}", "function widget_meteo_menu_items()\n{\n // Create a top-level menu item.\n $hookname = add_menu_page(\n 'Bonjour,', // Page title - Titre de la page\n 'Widget Météo', // Menu title - Titre du menu\n 'manage_options', // Capabilities - Capacités\n 'widget_meteo', // Slug\n 'widget_meteo_markup', // Display callback\n 'dashicons-cloud', // Icon\n // 'dashicons-tickets', // Icon\n 66 // Priority/position. Just after 'Plugins'\n );\n}", "function wpms_home_create_menu() {\n\tdo_action(\"wpms_create_top_menu\");\n\tadd_menu_page( __('Coco\\'s parameters','wp-multilingual-slider'), 'Coco Slider', 'edit_pages', 'settings_page_wp-multilingual-slider', 'home_settings_page', WPMS_DIR.'/images/accueil.png');\n}", "function hook_menu() {\n\t\treturn null;\n\t}", "function getMenuItems()\n {\n }", "public function Menu() {\n $user_role = get_option('oxi_addons_user_permission');\n $role_object = get_role($user_role);\n $first_key = '';\n if (isset($role_object->capabilities) && is_array($role_object->capabilities)) {\n reset($role_object->capabilities);\n $first_key = key($role_object->capabilities);\n } else {\n $first_key = 'manage_options';\n }\n add_submenu_page('oxi-addons', 'Elementor Addons', 'Elementor Addons', $first_key, 'oxi-el-addons', [$this, 'oxi_addons_elementors']);\n }", "function menus();", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "function mt_add_pages() {\n//\t\tadd_menu_page('האימפריה', 'האימפריה', 'administrator', 'hidden-empire', 'mt_toplevel_page');\n//\t\tadd_menu_page(HE_PLUGINOPTIONS_NICK.' Plugin Options', HE_PLUGINOPTIONS_NICK, 'manage_options', HE_PLUGINOPTIONS_ID.'_options', array('HiddenEmpirePluginOptions', 'options_page'));\n\t\tadd_menu_page(HE_PLUGINOPTIONS_NICK.' Plugin Options', HE_PLUGINOPTIONS_NICK, 'administrator', HE_PLUGINOPTIONS_ID.'_options', array('HiddenEmpirePluginOptions', 'options_page'));\n\t\n\t}", "function settings_menu() {\n#\tregister_js(HD_PLUGIN_URL.'production/production.js',100);\n\thd_user_menu('System', 'admin_users','settings_gui', 55);\n}", "function gera_item_no_menu()\n{\n //add_menu_page('Configurações do Plugin Menu', 'Config Plugin Menu', 'administrator', 'Config Plugin Menu', 'abre_config_plugin_menu', 'dashicons-airplane');\n\n //Para criar um sub-item em um menu existente da Sidebar padrão Wordpress\n add_submenu_page('options-general.php', 'Configurações do Plugin Menu', 'Config Plugin Menu', 'administrator', 'config-plugin-menu', 'abre_config_plugin_menu', 2);\n}", "public function addMenu()\n {\n $wpMenu = [\n [\n 'Bolsista',\n 'Bolsista',\n 'edit_pages',\n 'bolsista',\n $this,\n 'doAction',\n 'dashicons-format-aside',\n 2\n ]\n ];\n $wpSubMenu = [];\n $this->addMenuItem($wpMenu, $wpSubMenu);\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}", "public function writeMenu() {}", "public function writeMenu() {}", "public function writeMenu() {}", "public function writeMenu() {}", "function WPLMS_menu_MainMenu(){\n\n add_menu_page('WP LMS School', 'WP LMS School', 'administrator',WPLMS_PLUGIN_ID,'WPLMS_dashboard');\n add_submenu_page(WPLMS_PLUGIN_ID,'Students', 'Students', 'administrator','students','WPLMS_students');\n add_submenu_page(WPLMS_PLUGIN_ID,'Add Course', 'Add Course', 'administrator','course','WPLMS_addcourse');\n add_submenu_page(WPLMS_PLUGIN_ID,'Add Modules', 'Add Modules', 'administrator','modules','WPLMS_addmodule');\n\n add_submenu_page(WPLMS_PLUGIN_ID, false, '<span class=\"wpcw_menu_section\" style=\"display: block; margin: 1px 0 1px -5px; padding: 0; height: 1px; line-height: 1px; background: #CCC;\"></span>', 'manage_options', '#', false);\n\n add_submenu_page(WPLMS_PLUGIN_ID,'Quiz Summary', 'Quiz Summary', 'administrator','WPLMS_quizSummary','WPLMS_quizSummary');\n add_submenu_page(WPLMS_PLUGIN_ID,'Question Pool', 'Question Pool', 'administrator','WPLMS_questionPool','WPLMS_questionPool');\n\n //No Menu\n //add_submenu_page(WPLMS_PLUGIN_ID,'Add Quiz', 'Add Quiz', 'administrator', 'add_quiz', 'WPLMS_addQuiz');\n\n add_submenu_page(null,'Stud','Student Courses', 'administrator','studentCourses','WPLMS_studentcourses');\n add_submenu_page(null,'Add Question', 'Add Question', 'administrator', 'add_question', 'WPLMS_addQuestion');\n //add_submenu_page(null,'Add Quiz', 'Add Quiz', 'administrator', 'WPLMS_addQuiz', 'WPLMS_addQuiz');\n\n\n //add_submenu_page('onlineschool','Packages', 'Packages', 'administrator','addpackage','addpackage_code');\n //add_submenu_page('onlineschool','Sets', 'Sets', 'administrator','sets','sets_code');\n //add_submenu_page('options.php','Students', 'Student Courses', 'administrator','studentCourses','studentCourses_code');\n}", "private function checkMenu()\n {\n\n }", "function tekserve_celebros_menu() {\n\n\tadd_menu_page( 'Celebros', 'Celebros', 'edit_published_pages', 'tekserve_celebros_menu', 'tekserve_celebros_related_settings_menu_page', 'dashicons-search', '8.217' );\n\tadd_submenu_page( 'tekserve_celebros_menu', 'Test Celebros Functions', 'Test Celebros Functions', 'edit_published_pages', 'tekserve_celebros_test_panel_menu', 'tekserve_celebros_test_panel_menu_page');\n\n}", "protected function makeActionMenu() {}", "function wp_admin_bar_my_sites_menu($wp_admin_bar)\n {\n }", "function erp_menu() {\n $menu = [];\n return apply_filters( 'erp_menu', $menu );\n}", "function my_plugin_menu() {\n add_menu_page( 'Nursing Schedule Panel', 'Nursing Schedule Panel ', 'manage_options', 'nursing-panel', 'my_plugin_options' ,'dashicons-calendar-alt',3);\n}", "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 }", "static function addMenus()\n {\n add_menu_page(\n // string $page_title The text to be displayed in the title tags\n // of the page when the menu is selected\n __('Projecten plugin Admin', 'projecten-plugin'),\n // string $menu_title The text to be used for the menu\n __('Projecten plugin', 'projecten-plugin'),\n // string $capability The capability required for this menu to be displayed to the user.\n 'manage_options',\n // string $menu_slug The slug name to refer to this menu by (should be unique for this menu)\n 'projecten plugin',\n // callback $function The function to be called to output the content for this page.\n array('ProjectenPlugin_AdminController', 'adminMenuPage'),\n // string $icon_url The url to the icon to be used for this menu.\n // * Pass a base64-encoded SVG using a data URI, which will becolored to match the color scheme.\n // This should begin with 'data:image/svg+xml;base64,'.\n // * Pass the name of a Dashicons helper class to use a fonticon, e.g.\n 'dashicons-chart-pie' .\n // * Pass 'none' to leave div.wp-menu-image empty so an icon can be added via CSS.\n PROJECTEN_PLUGIN_INCLUDES_IMGS_DIR . '/icon.png'\n // int $position The position in the menu order this one should appear\n );\n add_submenu_page(\n // string $parent_slug The slug name for the parent menu \n // (or the file name of a standard WordPress admin page) \n 'my-event-organiser-admin',\n // string $page_title The text to be displayed in the title tags of the page when the menu is selected \n __('event_type', 'my-event-organiser'),\n // string $menu_title The text to be used for the menu \n __('Event Type', 'my-event-organiser'),\n // string $capability The capability required for this menu to be displayed to the user. \n 'manage_options',\n // string $menu_slug The slug name to refer to this menu by (should be unique for this menu) \n 'meo_admin_event_types',\n // callback $function The function to be called to output the content for this page. \n array('ProjectenPlugin_AdminController', 'adminSubMenuProjecten')\n\n\n );\n }", "function adminMenu() {\r\n\t\t// TODO: This does not only create the menu, it also (only?) *does* sth. with the entries.\r\n\t\t// But those actions must be done before the menu is created (due to the redirects).\r\n\t\t// !Split the function!\r\n\t\t//$page = add_submenu_page('admin.php', __('UWR Ergebnisse'), __('UWR Ergebnisse'), 'edit_posts', 'uwr1results', array('Uwr1resultsController', 'adminAction'));\r\n\t\t$page = add_submenu_page('uwr1menu', __('UWR Ergebnisse'), __('UWR Ergebnisse'), UWR1RESULTS_CAPABILITIES, 'uwr1results', array('Uwr1resultsController', 'adminAction'));\r\n\t\tadd_action( 'admin_print_scripts-' . $page, array('Uwr1resultsView', 'adminScripts') );\r\n\t}", "public function setUpMenuItems()\n {\n $Menu = new DModuleMenu();\n $Menu -> setIcon( '<i class=\"fa fa-money\"></i>' );\n $MenuItem = new DModuleMenuItem( \"show\" , \"Monedas\" );\n $MenuItem -> setIcon( '<i class=\"fa fa-money\"></i>' );\n $Menu -> addItemObject( $MenuItem );\n $this -> setMenu( $Menu );\n }", "function myplugin_Add_My_Admin_Link()\n{\n add_menu_page(\n 'Plugin TOTO Page', // Titre de la page\n 'Plugin TOTO', // Texte du lien dans le menu\n 'manage_options', // capacité nécessaire pour accéder au lien\n 'ShotcodeAndSEO/includes/toto-acp-page.php' // fichier à afficher quand on clique sur le lien\n );\n}", "function tp_add_tools_menu() \n{\n\tadd_submenu_page('tools.php', 'WP Extension Manager', 'WP Extension Manager', 10, basename(__FILE__), 'show_index_page');\n\tadd_action('activate_plugin','em_activate_plugin');\n}", "function bg_AddPluginMenu() {\n global $bg_menuSlug;\n\tadd_options_page( 'BeyondGrammar Options', 'BeyondGrammar', 'manage_options', $bg_menuSlug, 'bg_AddPluginMenuHtml' );\n}", "public function getMenus() {}", "public function activate() {\n MenuItem::add(array(\n 'plugin' => $this->_plugin,\n 'name' => 'menu',\n 'labelKey' => $this->_plugin . '.menu-title',\n 'icon' => 'git-square',\n 'action' => 'h-gitter-index'\n ));\n\n $htracker = PLugin::get('h-tracker');\n if($htracker && !$htracker->isActive()) {\n $htracker->activate();\n\n $items = MenuItem::getPluginMenuItems('h-tracker');\n\n foreach($items as $item) {\n $item->delete();\n }\n }\n }", "function wp_admin_bar_site_menu($wp_admin_bar)\n {\n }", "public static function add_admin_menus()\n\t{\n\t}", "function wp_admin_bar_wp_menu($wp_admin_bar)\n {\n }", "public function filter_adminhandler_post_loadplugins_main_menu( $menu ) {\n\t\t// obtain existing last submenu item\n\t\t$last_used = end( $menu[ 'create' ][ 'submenu' ]);\n\t\t// add a menu item at the bottom\n\t\t$menu[ 'create' ][ 'submenu' ][] = array(\n\t\t\t'title' => _t( 'Create a new Menu', 'termmenus' ),\n\t\t\t'url' => URL::get( 'admin', array( 'page' => 'menus', 'action' => 'create' ) ),\n\t\t\t'text' => _t( 'Menu', 'termmenus' ),\n\t\t\t'hotkey' => $last_used[ 'hotkey' ] + 1, // next available hotkey is last used + 1\n\t\t);\n\t\t$last_used = end( $menu[ 'manage' ][ 'submenu' ]);\n\t\t$menu[ 'manage' ][ 'submenu' ][] = array(\n\t\t\t'title' => _t( 'Manage Menus', 'termmenus' ),\n\t\t\t'url' => URL::get( 'admin', 'page=menus' ), // might as well make listing the existing menus the default\n\t\t\t'text' => _t( 'Menus', 'termmenus' ),\n\t\t\t'hotkey' => $last_used[ 'hotkey' ] + 1,\n\t\t);\n\t\treturn $menu;\n\t}", "public function menuConfig() {\n\t\t$this->MOD_MENU = array(\n\t\t\t'function' => array(\n\t\t\t\t'1' => tx_laterpay_helper_string::tr('Dashboard'),\n\t\t\t\t'2' => tx_laterpay_helper_string::tr('Pricing'),\n\t\t\t\t'3' => tx_laterpay_helper_string::tr('Appearance'),\n\t\t\t\t'4' => tx_laterpay_helper_string::tr('Account'),\n\t\t\t)\n\t\t);\n\t\tparent::menuConfig();\n\t}", "function zeo_options_menu(){\n\tadd_menu_page( 'Wordpress SEO','Wordpress SEO',\t0, SEO_ADMIN_DIRECTORY.'/seo-dashboard.php', '', plugins_url('/images/icon.png', __FILE__));\n\tadd_submenu_page( SEO_ADMIN_DIRECTORY.'/seo-dashboard.php', 'Dashboard ', 'Dashboard', 0,SEO_ADMIN_DIRECTORY.'/seo-dashboard.php' );\n\t add_submenu_page( SEO_ADMIN_DIRECTORY.'/seo-dashboard.php', 'Authorship, Analytics', 'Authorship, Analytics', 9, SEO_ADMIN_DIRECTORY.'/seo-authorship.php' );\n\t\n}", "function register_my_menu() {\n register_nav_menu('main-menu',__( 'Navegador Primario' ));\n }", "public\tfunction\tadminMenues() {\n\t\t\t/**\n\t\t\t * Menu Pages.\n\t\t\t */\n\t\t\t\n\t\t\t//Create a new menu page.\n\t\t\t$this -> pages[]\t=\tadd_menu_page(\n\t\t\t\t\t'FrozenPlugin', //Page title. \n\t\t\t\t\t'FrozenPlugin', //Menu title.\n\t\t\t\t\t'activate_plugins', //Capability.\n\t\t\t\t\t'FrozenPlugin-home', //Slug.\n\t\t\t\t\tarray($this, 'panelHome'), //Function. \n\t\t\t\t\t'dashicons-admin-generic', //Dashicon. \n\t\t\t\t\t68 //Default position underneath plugins. \n\t\t\t);\n\t\t\t\n\t\t\t/**\n\t\t\t * Submenu Pages\n\t\t\t */\n\t\t\t\n\t\t\t//Create a submenu page. \n\t\t\t$this -> pages[]\t=\tadd_submenu_page(\n\t\t\t\t\t'FrozenPlugin-home', //Parent slug.\n\t\t\t\t\t'FrozenPlugin', //Page title.\n\t\t\t\t\t'FP Home', //Menu title. \n\t\t\t\t\t'activate_plugins', //Capability.\n\t\t\t\t\t'FrozenPlugin-home', //Slug - note this is identical to the parent slug. \n\t\t\t\t\tarray($this, 'panelHome') //Function.\n\t\t\t\t\t);\n\t\t\t\n\t\t\t//Create a submenu page.\n\t\t\t$this -> pages[]\t=\tadd_submenu_page(\n\t\t\t\t\t'FrozenPlugin-home', //Parent slug.\n\t\t\t\t\t'FrozenPlugin', //Page title.\n\t\t\t\t\t'Settings', //Menu title.\n\t\t\t\t\t'activate_plugins', //Capability.\n\t\t\t\t\t'FrozenPlugin-settings', //Slug - note this is identical to the parent slug.\n\t\t\t\t\tarray($this, 'panelSettings') //Function.\n\t\t\t\t\t);\n\t\t\t\n\t\t\t/**\n\t\t\t * Actions, filters, and hooks that rely on the current page go here. \n\t\t\t */\n\t\t\t\n\t\t\t//For each page.\n\t\t\tforeach($this -> pages as $page) {\n\t\t\t\t//Add an action to load the help page.\n\t\t\t\tadd_action(\"load-$page\", array($this, 'helpMenu'));\n\t\t\t\t\n\t\t\t\t//Add an action to load admin area related content.\n\t\t\t\tadd_action(\"admin_print_styles-$page\", array($this, 'enqueueAdmin'));\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}", "function oneclick_plugin_menu()\r\r\n{\r\r\n add_menu_page('OneClick Google Map', 'OneClick Map', 'manage_options', 'oneclick-google-map', 'oneclick_google_map_plugin_mainpage', 'dashicons-location' /*plugins_url( 'gmap-iconizer/includes/images/map_marker.png')*/);\r\r\n add_submenu_page('oneclick-google-map', 'OneClick Google Map', 'OneClick Google Map', 'manage_options', 'oneclick-google-map' );\r\r\n\tadd_submenu_page('oneclick-google-map', 'OneClick GeoLocation Finder', 'GeoLocation Finder', 'manage_options', 'oneclick-geolocation-finder', 'oneclick_google_map_plugin_geolocationpage');\r\r\n}", "public function obtenerElementosMenu();", "function jigoshop_admin_menu() {\n\tglobal $menu;\n\t\n\t$menu[] = array( '', 'read', 'separator-jigoshop', '', 'wp-menu-separator jigoshop' );\n\t\n add_menu_page(__('Jigoshop'), __('Jigoshop'), 'manage_options', 'jigoshop' , 'jigoshop_dashboard', jigoshop::plugin_url() . '/assets/images/icons/menu_icons.png', 55);\n add_submenu_page('jigoshop', __('Dashboard', 'jigoshop'), __('Dashboard', 'jigoshop'), 'manage_options', 'jigoshop', 'jigoshop_dashboard'); \n add_submenu_page('jigoshop', __('General Settings', 'jigoshop'), __('Settings', 'jigoshop') , 'manage_options', 'settings', 'jigoshop_settings');\n add_submenu_page('jigoshop', __('System Info','jigoshop'), __('System Info','jigoshop'), 'manage_options', 'sysinfo', 'jigoshop_system_info');\n add_submenu_page('edit.php?post_type=product', __('Attributes','jigoshop'), __('Attributes','jigoshop'), 'manage_options', 'attributes', 'jigoshop_attributes');\n}", "function cacheplugin_admin_menu_old() {\r\n \t\t\t echo '<h3><a href=\"#\">Cache Plugin</a></h3>\r\n \t\t\t\t <ul>\r\n \t\t\t <li><a href=\"' . osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'admin/conf.php') . '\">&raquo; ' . __('Settings', 'cacheplugin') . '</a></li>\r\n \t\t <li><a href=\"' . osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'admin/help.php') . '\">&raquo; ' . __('Help', 'cacheplugin') . '</a></li>\r\n \t\t\t </ul>';\r\n \t\t }", "function register_menus() {\n register_nav_menus(\n array(\n 'header-menu' => __( 'Menu Główne' ),\n 'photo-menu' => __( 'Photo Menu' )\n \n \n )\n );\n}", "function jpa_menu_administrator()\n{\n add_menu_page(JPA_NOMBRE,JPA_NOMBRE,'manage_options',JPA_RUTA . '/admin/jpa-configuration.php');\n add_submenu_page(JPA_RUTA . '/admin/jpa-configuration.php','Add resource','Add resource','manage_options',JPA_RUTA . '/admin/jpa-add_resource.php');\n}", "function network_admin_menu()\n {\n }", "public function admin_menu() {\n\t\tadd_menu_page( 'Sharaz setting', 'sharaz setting', 'manage_options', 'ss_page', array(\n\t\t\t$this,\n\t\t\t'plugin_page'\n\t\t), 'edit', 75 );\n\t}", "function show_my_menus(){\n register_nav_menu('mainmenu', 'Huvudmeny');\n register_nav_menu('footermenu', 'Sociala medier');\n register_nav_menu('sidemenu', 'Sidomeny');\n register_nav_menu('blogsidepage', 'Blogg sidomeny sidor');\n register_nav_menu('blogsidearchive', 'Blogg sidomeny arkiv');\n register_nav_menu('blogsidecategory', 'Blogg sidomeny kategorier');\n}", "function scfw_menu(){\n add_menu_page('SCFW - Order List', 'SCFW', 'manage_options', 'scfw-options', 'scfw_orders_list');\n add_submenu_page( 'scfw-options', 'Settings page title', 'Teste Ajax', 'manage_options', 'scfw-op-settings', 'scfw_theme_func_settings');\n add_submenu_page( 'scfw-options', 'FAQ page title', 'FAQ menu label', 'manage_options', 'scfw-op-faq', 'scfw_theme_func_faq');\n}", "function trimestral_module_init_menu_items()\n{\n $CI = &get_instance();\n\n $CI->app->add_quick_actions_link([\n 'name' => _l('trimestral_name'),\n 'url' => 'trimestral',\n ]);\n\n $CI->app_menu->add_sidebar_children_item('utilities', [\n 'slug' => 'trimestral',\n 'name' => _l('trimestral_name'),\n 'href' => admin_url('trimestral'),\n ]);\n}" ]
[ "0.7531215", "0.743294", "0.74321884", "0.74321276", "0.7372637", "0.7372637", "0.7372637", "0.7358275", "0.7358275", "0.73567337", "0.7338884", "0.72976726", "0.7237124", "0.7204577", "0.7171672", "0.7157253", "0.7107988", "0.7106512", "0.70925164", "0.70593715", "0.7047111", "0.70426273", "0.7021126", "0.7016019", "0.7009553", "0.70055914", "0.700453", "0.6998246", "0.69873846", "0.6986545", "0.6968745", "0.69647986", "0.6962235", "0.6962235", "0.6962235", "0.69605356", "0.69604856", "0.69604856", "0.6958591", "0.69549614", "0.695078", "0.6945727", "0.6936852", "0.6934412", "0.6928822", "0.69208354", "0.69131386", "0.6906802", "0.690404", "0.6892379", "0.68921393", "0.68878514", "0.68878514", "0.68878514", "0.68878514", "0.68878514", "0.68878514", "0.6876466", "0.68576676", "0.685687", "0.685425", "0.6841985", "0.68293506", "0.6828404", "0.6828157", "0.6828157", "0.68159926", "0.6809464", "0.6807504", "0.6796741", "0.6787783", "0.67853063", "0.6784516", "0.6780733", "0.6764398", "0.67626506", "0.6761359", "0.6760799", "0.6760472", "0.6758478", "0.6753498", "0.67489314", "0.67480004", "0.67422324", "0.6722134", "0.6716884", "0.67130995", "0.6707242", "0.67054516", "0.67014647", "0.6701345", "0.6692819", "0.6690179", "0.6687455", "0.66855377", "0.6684429", "0.66831434", "0.6680211", "0.66707456", "0.66702807", "0.6668429" ]
0.0
-1
wyswietlanie strony z konfiguracja pluginu
function smartrecruiters_config(){ $is_connected = get_option('sr_connected'); if($is_connected){ //aplikacja juz polaczona, trzeba pokazac mozliwosc odlaczenia //jesli kliknieto disconnect if(isset($_POST['sr_disconnect']) && $_POST['sr_disconnect']){ //rozlaczyc i odswiezyc strone zeby pokazac formularz logowania update_option('sr_connected', 0); update_option('sr_company', null); $location = 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; echo '<script>window.location = "'.$location.'";</script>'; } //pobieramy joby zeby meic departmenty i lokacje $company_name = get_option('srcompany'); $url = 'https://www.smartrecruiters.com/cgi-bin/WebObjects/share.woa/wa/careersite?wpp_company='.$company_name; //pobieramy joby $get_jobs = @file_get_contents($url); $xml = @simplexml_load_string($get_jobs, 'SimpleXMLElement', LIBXML_NOCDATA); $jobs = json_decode(json_encode($xml), true); if( isset($_POST['template']) ){ update_option('sr_jobDetailsPageTemplate', esc_attr($_POST['template']) ); } $available_templates = get_page_templates(); $active_template = get_option('sr_jobDetailsPageTemplate'); //widok konfigurancji i odlaczania include('configure.php'); }else{ if(!empty($_GET['srcompany']) && $_GET['srcompany']){ update_option('sr_connected', 1); update_option('srcompany', $_GET['srcompany']); $location = 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; echo '<script>window.location = "'.$location.'";</script>'; } //widok laczenia/logowania include('connect.php'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPluginConfig()\n {\n $form = $this->Form();\n $parent = $this->Forms()->findOneBy(array('name' => 'Interface'));\n $form->setParent($parent);\n\n $form->setElement('checkbox', 'fontawesome_add', array(\n 'label' => 'Fontawesome Icons über CDN einbinden?',\n 'value' => true,\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP,\n 'description' => 'Wenn aktiviert wird die Fontawesome Iconbibliothek welche für die Socialmedia Icons benötigt wird im header eingebunden'\n ));\n\n $form->setElement('checkbox', 'social_footer', array(\n 'label' => 'Socialmedia Icons im Footer einbinden?',\n 'value' => true,\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP,\n 'description' => 'Erzeugt einen Socialmedia Block unter dem Newsletter Bereich im Footer. Es werden Icons für alle Socialmedia kanäle erzeugt, für die eine URL hinterlegt ist.'\n ));\n\n $form->setElement('text', 'base_color', array(\n 'scope' => Shopware\\Models\\Config\\Element::SCOPE_SHOP, \n 'label' => 'Social Media Icon Grundfarbe',\n 'value' => '@brand-secondary',\n 'description' => 'Social Media Icon Grundfarbe'\n ));\n\n $form->setElement('text', 'fb_url', array(\n 'scope' => Shopware\\Models\\Config\\Element::SCOPE_SHOP, \n 'label' => 'Facebook URL',\n 'value' => '#',\n 'description' => 'Facebook URL'\n ));\n\n $form->setElement('text', 'fb_color', array(\n 'scope' => Shopware\\Models\\Config\\Element::SCOPE_SHOP, \n 'label' => 'Facebook Farbe Hover',\n 'value' => '#3b5998',\n 'description' => 'Facebook Farbe Hover'\n ));\n\n $form->setElement('text', 'tw_url', array(\n 'scope' => Shopware\\Models\\Config\\Element::SCOPE_SHOP, \n 'label' => 'Twitter URL',\n 'value' => '#',\n 'description' => 'Twitter URL'\n ));\n\n $form->setElement('text', 'tw_color', array(\n 'scope' => Shopware\\Models\\Config\\Element::SCOPE_SHOP, \n 'label' => 'Twitter Farbe Hover',\n 'value' => '#00aced',\n 'description' => 'Twitter Farbe Hover'\n ));\n\n $form->setElement('text', 'gp_url', array(\n 'scope' => Shopware\\Models\\Config\\Element::SCOPE_SHOP, \n 'label' => 'GooglePlus URL',\n 'value' => '#',\n 'description' => 'GooglePlus URL'\n ));\n\n $form->setElement('text', 'gp_color', array(\n 'scope' => Shopware\\Models\\Config\\Element::SCOPE_SHOP, \n 'label' => 'GooglePlus Farbe Hover',\n 'value' => '#dd4b39',\n 'description' => 'GooglePlus Farbe Hover'\n ));\n\n $form->setElement('text', 'yt_url', array(\n 'scope' => Shopware\\Models\\Config\\Element::SCOPE_SHOP, \n 'label' => 'YouTube URL',\n 'value' => '#',\n 'description' => 'YouTube URL'\n ));\n\n $form->setElement('text', 'yt_color', array(\n 'scope' => Shopware\\Models\\Config\\Element::SCOPE_SHOP, \n 'label' => 'Youtube Farbe Hover',\n 'value' => '#bb0000',\n 'description' => 'Youtube Farbe Hover'\n ));\n }", "public function setup_plugin_url()\n {\n }", "function getPluginSettingsPrefix() {\n\t\treturn 'doaj';\n\t}", "public function init_plugin()\n {\n }", "function ptf_customizer_config() {\n\n $args = array(\n 'url_path' => get_template_directory_uri() . '/framework/includes/kirki/',\n );\n\n return $args;\n}", "function kirki_demo_configuration_sample() {\n\n // $url = get_stylesheet_directory_uri() . '/kirki/';\n\n $args = array(\n 'logo_image' => '',\n 'description' => __( 'The theme description.', 'kirki' ),\n // 'url_path' => $url,\n 'color_accent' => '#CE2922',\n 'color_back' => '#EEEEEE',\n 'textdomain' => 'kirki',\n //'i18n' => $strings,\n 'stylesheet_id' => 'secondthought_kirki'\n );\n\n return $args;\n\n}", "function initPlugin()\n {\n $this->getAdminOptions();\n }", "function TS_VCSC_Set_Plugin_Options() {\r\n\t\t// Redirect Option\r\n\t\tadd_option('ts_vcsc_extend_settings_redirect', \t\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_activation', \t\t\t\t\t\t0);\r\n\t\t// Options for Theme Authors\r\n\t\tadd_option('ts_vcsc_extend_settings_posttypes', \t\t\t\t 1);\r\n\t\tadd_option('ts_vcsc_extend_settings_posttypeWidget',\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_posttypeTeam',\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_posttypeTestimonial',\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_posttypeLogo', \t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_posttypeSkillset',\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_additions', \t\t\t\t 1);\r\n\t\tadd_option('ts_vcsc_extend_settings_codeeditors', \t\t\t\t 1);\r\n\t\tadd_option('ts_vcsc_extend_settings_fontimport', \t\t\t\t 1);\r\n\t\tadd_option('ts_vcsc_extend_settings_iconicum', \t\t\t\t \t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_dashboard', \t\t\t\t\t\t1);\r\n\t\t// Options for Custom CSS/JS Editor\r\n\t\tadd_option('ts_vcsc_extend_settings_customCSS',\t\t\t\t\t\t\t'/* Welcome to the Custom CSS Editor! Please add all your Custom CSS here. */');\r\n\t\tadd_option('ts_vcsc_extend_settings_customJS', \t\t\t\t '/* Welcome to the Custom JS Editor! Please add all your Custom JS here. */');\r\n\t\t// Other Options\r\n\t\tadd_option('ts_vcsc_extend_settings_frontendEditor', \t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_buffering', \t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_mainmenu', \t\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_translationsDomain', \t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_previewImages',\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_visualSelector',\t\t\t\t\t1);\r\n add_option('ts_vcsc_extend_settings_nativeSelector',\t\t\t\t\t1);\r\n add_option('ts_vcsc_extend_settings_nativePaginator',\t\t\t\t\t'200');\r\n\t\tadd_option('ts_vcsc_extend_settings_backendPreview',\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_extended', \t\t\t\t 0);\r\n\t\tadd_option('ts_vcsc_extend_settings_systemInfo',\t\t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_socialDefaults', \t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_builtinLightbox', \t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_lightboxIntegration', \t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_allowAutoUpdate', \t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_allowNotification', \t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_allowDeprecated', \t\t\t\t\t0);\r\n\t\t// Font Active / Inactive\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceMedia',\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceIcon',\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceAwesome',\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceBrankic',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCountricons',\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCurrencies',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceElegant',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceEntypo',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceFoundation',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceGenericons',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceIcoMoon',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceMonuments',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceSocialMedia',\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceTypicons',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceFontsAll',\t\t\t\t\t0);\t\t\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceVC_Awesome',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceVC_Entypo',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceVC_Linecons',\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceVC_OpenIconic',\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceVC_Typicons',\t\t\t\t0);\t\t\r\n\t\t// Custom Font Data\r\n\t\tadd_option('ts_vcsc_extend_settings_IconFontSettings',\t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustom',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomArray',\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomJSON',\t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomPath',\t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomPHP', \t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomName',\t\t\t\t\t'Custom User Font');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomAuthor',\t\t\t\t'Custom User');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomCount',\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomDate',\t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomDirectory',\t\t\t'');\r\n\t\t// Row + Column Extensions\r\n\t\tadd_option('ts_vcsc_extend_settings_additionsRows',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_additionsColumns',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_additionsRowEffectsBreak',\t\t\t'600');\r\n\t\tadd_option('ts_vcsc_extend_settings_additionsSmoothScroll',\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_additionsSmoothSpeed',\t\t\t\t'30');\r\n\t\t// Custom Post Types\r\n\t\tadd_option('ts_vcsc_extend_settings_customWidgets',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_customTeam',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_customTestimonial',\t\t\t\t\t0);\t\t\r\n\t\tadd_option('ts_vcsc_extend_settings_customSkillset',\t\t\t\t\t0);\t\t\r\n\t\tadd_option('ts_vcsc_extend_settings_customTimelines', \t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_customLogo', \t\t\t\t\t\t0);\r\n\t\t// tinyMCE Icon Shortcode Generator\r\n\t\tadd_option('ts_vcsc_extend_settings_useIconGenerator',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_useTinyMCEMedia', \t\t\t\t\t1);\r\n\t\t// Standard Elements\r\n\t\tadd_option('ts_vcsc_extend_settings_StandardElements',\t\t\t\t\t'');\r\n\t\t// Demo Elements\r\n\t\tadd_option('ts_vcsc_extend_settings_DemoElements', \t\t\t\t\t\t'');\r\n\t\t// WooCommerce Elements\r\n\t\tadd_option('ts_vcsc_extend_settings_WooCommerceUse',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_WooCommerceElements',\t\t\t\t'');\r\n\t\t// bbPress Elements\r\n\t\tadd_option('ts_vcsc_extend_settings_bbPressUse',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_bbPressElements',\t\t\t\t\t'');\r\n\t\t// Options for External Files\r\n\t\tadd_option('ts_vcsc_extend_settings_loadForcable',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadLightbox', \t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadTooltip', \t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadFonts', \t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadEnqueue',\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadHeader',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadjQuery', \t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadModernizr',\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadWaypoints', \t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadCountTo', \t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadMooTools', \t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadDetector', \t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadHammerNew', \t\t\t\t\t1);\r\n\t\t// Google Font Manager Settings\r\n\t\tadd_option('ts_vcsc_extend_settings_allowGoogleManager', \t\t\t\t1);\r\n\t\t// Single Page Navigator\r\n\t\tadd_option('ts_vcsc_extend_settings_allowPageNavigator', \t\t\t\t0);\r\n\t\t// EnlighterJS - Syntax Highlighter\r\n\t\tadd_option('ts_vcsc_extend_settings_allowEnlighterJS',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_allowThemeBuilder',\t\t\t\t\t0);\r\n\t\t// Post Type Menu Positions\r\n\t\t$TS_VCSC_Menu_Positions_Defaults_Init = array(\r\n\t\t\t'ts_widgets'\t\t\t\t\t=> 50,\r\n\t\t\t'ts_timeline'\t\t\t\t\t=> 51,\r\n\t\t\t'ts_team'\t\t\t\t\t\t=> 52,\r\n\t\t\t'ts_testimonials'\t\t\t\t=> 53,\r\n\t\t\t'ts_skillsets'\t\t\t\t\t=> 54,\r\n\t\t\t'ts_logos'\t\t\t\t\t\t=> 55,\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_menuPositions',\t\t\t\t\t\t$TS_VCSC_Menu_Positions_Defaults_Init);\r\n\t\t// Row Toggle Settings\r\n\t\t$TS_VCSC_Row_Toggle_Defaults_Init = array(\r\n\t\t\t'Large Devices' => 1200,\r\n\t\t\t'Medium Devices' => 992,\r\n\t\t\t'Small Devices' => 768,\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_rowVisibilityLimits', \t\t\t\t$TS_VCSC_Row_Toggle_Defaults_Init);\r\n\t\t// Language Settings: Countdown\r\n\t\t$TS_VCSC_Countdown_Language_Defaults_Init = array(\r\n\t\t\t'DayPlural' => 'Days',\r\n\t\t\t'DaySingular' => 'Day',\r\n\t\t\t'HourPlural' => 'Hours',\r\n\t\t\t'HourSingular' => 'Hour',\r\n\t\t\t'MinutePlural' => 'Minutes',\r\n\t\t\t'MinuteSingular' => 'Minute',\r\n\t\t\t'SecondPlural' => 'Seconds',\r\n\t\t\t'SecondSingular' => 'Second',\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_translationsCountdown', \t\t\t$TS_VCSC_Countdown_Language_Defaults_Init);\r\n\t\t// Language Settings: Google Maps PLUS\r\n\t\t$TS_VCSC_Google_MapPLUS_Language_Defaults_Init = array(\r\n\t\t\t'ListenersStart' => 'Start Listeners',\r\n\t\t\t'ListenersStop' => 'Stop Listeners',\r\n\t\t\t'MobileShow' => 'Show Google Map',\r\n\t\t\t'MobileHide' => 'Hide Google Map',\r\n\t\t\t'StyleDefault' => 'Google Standard',\r\n\t\t\t'StyleLabel' => 'Change Map Style',\r\n\t\t\t'FilterAll' => 'All Groups',\r\n\t\t\t'FilterLabel' => 'Filter by Groups',\r\n\t\t\t'SelectLabel' => 'Zoom to Location',\r\n\t\t\t'ControlsOSM' => 'Open Street',\r\n\t\t\t'ControlsHome' => 'Home',\r\n\t\t\t'ControlsBounds' => 'Fit All',\r\n\t\t\t'ControlsBike' => 'Bicycle Trails',\r\n\t\t\t'ControlsTraffic' => 'Traffic',\r\n\t\t\t'ControlsTransit' => 'Transit',\r\n\t\t\t'TrafficMiles' => 'Miles per Hour',\r\n\t\t\t'TrafficKilometer' => 'Kilometers per Hour',\r\n\t\t\t'TrafficNone' => 'No Data Available',\r\n\t\t\t'SearchButton' => 'Search Location',\r\n\t\t\t'SearchHolder' => 'Enter address to search for ...',\r\n\t\t\t'SearchGoogle' => 'View on Google Maps',\r\n\t\t\t'SearchDirections' => 'Get Directions',\r\n\t\t\t'OtherLink' => 'Learn More!',\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_translationsGoogleMapPLUS', \t\t$TS_VCSC_Google_MapPLUS_Language_Defaults_Init);\r\n\t\t// Language Settings: Google Maps (Deprecated)\r\n\t\t$TS_VCSC_Google_Map_Language_Defaults_Init = array(\r\n\t\t\t'TextCalcShow' => 'Show Address Input',\r\n\t\t\t'TextCalcHide' => 'Hide Address Input',\r\n\t\t\t'TextDirectionShow' => 'Show Directions',\r\n\t\t\t'TextDirectionHide' => 'Hide Directions',\r\n\t\t\t'TextResetMap' => 'Reset Map',\r\n\t\t\t'PrintRouteText' \t\t\t => 'Print Route',\r\n\t\t\t'TextViewOnGoogle' => 'View on Google',\r\n\t\t\t'TextButtonCalc' => 'Show Route',\r\n\t\t\t'TextSetTarget' => 'Please enter your Start Address:',\r\n\t\t\t'TextGeoLocation' => 'Get My Location',\r\n\t\t\t'TextTravelMode' => 'Travel Mode',\r\n\t\t\t'TextDriving' => 'Driving',\r\n\t\t\t'TextWalking' => 'Walking',\r\n\t\t\t'TextBicy' => 'Bicycling',\r\n\t\t\t'TextWP' => 'Optimize Waypoints',\r\n\t\t\t'TextButtonAdd' => 'Add Stop on the Way',\r\n\t\t\t'TextDistance' => 'Total Distance:',\r\n\t\t\t'TextMapHome' => 'Home',\r\n\t\t\t'TextMapBikes' => 'Bicycle Trails',\r\n\t\t\t'TextMapTraffic' => 'Traffic',\r\n\t\t\t'TextMapSpeedMiles' => 'Miles Per Hour',\r\n\t\t\t'TextMapSpeedKM' => 'Kilometers Per Hour',\r\n\t\t\t'TextMapNoData' => 'No Data Available!',\r\n\t\t\t'TextMapMiles' => 'Miles',\r\n\t\t\t'TextMapKilometes' => 'Kilometers',\r\n\t\t\t'TextMapActivate' => 'Show Google Map',\r\n\t\t\t'TextMapDeactivate' => 'Hide Google Map',\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_translationsGoogleMap', \t\t\t$TS_VCSC_Google_Map_Language_Defaults_Init);\r\n\t\t// Language Settings: Isotope Posts\r\n\t\t$TS_VCSC_Isotope_Posts_Language_Defaults_Init = array(\r\n\t\t\t'ButtonFilter'\t\t => 'Filter Posts', \r\n\t\t\t'ButtonLayout'\t\t => 'Change Layout',\r\n\t\t\t'ButtonSort'\t\t => 'Sort Criteria',\r\n\t\t\t// Standard Post Strings\r\n\t\t\t'Date' \t\t\t\t => 'Post Date', \r\n\t\t\t'Modified' \t\t\t => 'Post Modified', \r\n\t\t\t'Title' \t\t\t => 'Post Title', \r\n\t\t\t'Author' \t\t\t => 'Post Author', \r\n\t\t\t'PostID' \t\t\t => 'Post ID', \r\n\t\t\t'Comments' \t\t\t => 'Number of Comments',\r\n\t\t\t// Layout Strings\r\n\t\t\t'SeeAll'\t\t\t => 'See All',\r\n\t\t\t'Timeline' \t\t\t => 'Timeline',\r\n\t\t\t'Masonry' \t\t\t => 'Centered Masonry',\r\n\t\t\t'FitRows'\t\t\t => 'Fit Rows',\r\n\t\t\t'StraightDown' \t\t => 'Straigt Down',\r\n\t\t\t// WooCommerce Strings\r\n\t\t\t'WooFilterProducts' => 'Filter Products',\r\n\t\t\t'WooTitle' => 'Product Title',\r\n\t\t\t'WooPrice' => 'Product Price',\r\n\t\t\t'WooRating' => 'Product Rating',\r\n\t\t\t'WooDate' => 'Product Date',\r\n\t\t\t'WooModified' => 'Product Modified',\r\n\t\t\t// General Strings\r\n\t\t\t'Categories' => 'Categories',\r\n\t\t\t'Tags' => 'Tags',\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_translationsIsotopePosts', \t\t\t$TS_VCSC_Isotope_Posts_Language_Defaults_Init);\r\n\t\t// Options for Lightbox Settings\r\n\t\t$TS_VCSC_Lightbox_Setting_Defaults_Init = array(\r\n\t\t\t'thumbs' => 'bottom',\r\n\t\t\t'thumbsize' => 50,\r\n\t\t\t'animation' => 'random',\r\n\t\t\t'captions' => 'data-title',\r\n\t\t\t'closer' => 1, // true/false\r\n\t\t\t'duration' => 5000,\r\n\t\t\t'share' => 0, // true/false\r\n\t\t\t'social' \t => 'fb,tw,gp,pin',\r\n\t\t\t'notouch' => 1, // true/false\r\n\t\t\t'bgclose'\t\t\t => 1, // true/false\r\n\t\t\t'nohashes'\t\t\t => 1, // true/false\r\n\t\t\t'keyboard'\t\t\t => 1, // 0/1\r\n\t\t\t'fullscreen'\t\t => 1, // 0/1\r\n\t\t\t'zoom'\t\t\t\t => 1, // 0/1\r\n\t\t\t'fxspeed'\t\t\t => 300,\r\n\t\t\t'scheme'\t\t\t => 'dark',\r\n\t\t\t'removelight' => 0,\r\n\t\t\t'customlight' => 0,\r\n\t\t\t'customcolor'\t\t => '#ffffff',\r\n\t\t\t'backlight' \t\t => '#ffffff',\r\n\t\t\t'usecolor' \t\t => 0, // true/false\r\n\t\t\t'background' => '',\r\n\t\t\t'repeat' => 'no-repeat',\r\n\t\t\t'overlay' => '#000000',\r\n\t\t\t'noise' => '',\r\n\t\t\t'cors' => 0, // true/false\r\n\t\t\t'scrollblock' => 'css',\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_defaultLightboxSettings',\t\t\t$TS_VCSC_Lightbox_Setting_Defaults_Init);\r\n\t\tadd_option('ts_vcsc_extend_settings_defaultLightboxAnimation', \t\t\t'random');\r\n\t\t// Options for Envato Sales Data\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoData', \t\t\t\t\t '');\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoInfo', \t\t\t\t\t '');\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoLink', \t\t\t\t\t '');\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoPrice', \t\t\t\t\t '');\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoRating', \t\t\t\t\t '');\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoSales', \t\t\t\t\t '');\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoCheck', \t\t\t\t\t 0);\r\n\t\t$roles \t\t\t\t\t\t\t\t= get_editable_roles();\r\n\t\tforeach ($GLOBALS['wp_roles']->role_objects as $key => $role) {\r\n\t\t\tif (isset($roles[$key]) && $role->has_cap('edit_pages') && !$role->has_cap('ts_vcsc_extend')) {\r\n\t\t\t\t$role->add_cap('ts_vcsc_extend');\r\n\t\t\t}\r\n\t\t}\r\n\t}", "abstract public function register_plugin();", "function createWidgetConfig() {\n // Add the emotion Komponent\n $component = $this->createEmotionComponent(\n array(\n 'name' => 'Social Media Widget',\n 'template' => 'emotion_socialmedia',\n 'description' => 'Bindet Socialmedia Buttons als Widget in den Einkaufswelten ein. Die URLs werden in der Pluginkonfiguration hinterlegt (Pluginmanager)'\n )\n );\n $component->createCheckboxField(\n array(\n 'name' => 'additional_styles',\n 'fieldLabel' => 'Border Box',\n 'supportText' => 'Zusätzliche Styles hinzufügen?',\n 'helpTitle' => 'Border Box',\n 'helpText' => 'Hier können sie dem widget einen optischen Rand verpassen um es optisch an das SW5 Responsive Theme anzupassen',\n 'defaultValue' => true\n ) \n );\n $component->createCheckboxField(\n array(\n 'name' => 'icons_round',\n 'fieldLabel' => 'Runde Icons',\n 'supportText' => 'Icons rund oder Eckig?',\n 'helpTitle' => 'Runde Icons',\n 'helpText' => 'Hier legen sie die Form der Socialmedia Icons fest: Rund oder Eckig',\n 'defaultValue' => true\n ) \n );\n // Facebook\n $component->createCheckboxField(\n array(\n 'name' => 'facebook_active',\n 'fieldLabel' => 'Facebook',\n 'supportText' => 'Facebook Button anzeigen',\n 'defaultValue' => false\n )\n );\n\n // Google Plus\n $component->createCheckboxField(\n array(\n 'name' => 'google_active',\n 'fieldLabel' => 'GooglePlus',\n 'supportText' => 'GooglePlus Button anzeigen',\n 'defaultValue' => false\n )\n );\n\n // Twitter\n $component->createCheckboxField(\n array(\n 'name' => 'twitter_active',\n 'fieldLabel' => 'Twitter',\n 'supportText' => 'Twitter Button anzeigen',\n 'defaultValue' => false\n )\n );\n\n // Youtube\n $component->createCheckboxField(\n array(\n 'name' => 'youtube_active',\n 'fieldLabel' => 'YouTube',\n 'supportText' => 'YouTube Button anzeigen',\n 'defaultValue' => false\n )\n );\n }", "function cmh_init(){\r\n\tregister_setting( 'cmh_plugin_options', 'cmh_options', 'cmh_validate_options' );\r\n}", "public function plugin_info()\n {\n }", "function getConfiguration() ;", "public function create_plugin_settings_page()\n {\n require_once 'views/settings.phtml';\n }", "function zarinpalwg_config() {\n $configarray = array(\n \"FriendlyName\" => array(\"Type\" => \"System\", \"Value\"=>\"زرین پال - وب گیت\"),\n \"merchantID\" => array(\"FriendlyName\" => \"merchantID\", \"Type\" => \"text\", \"Size\" => \"50\", ),\n \"Currencies\" => array(\"FriendlyName\" => \"Currencies\", \"Type\" => \"dropdown\", \"Options\" => \"Rial,Toman\", ),\n\t \"MirrorName\" => array(\"FriendlyName\" => \"نود اتصال\", \"Type\" => \"dropdown\", \"Options\" => \"آلمان,ایران,خودکار\", \"Description\" => \"چناانچه سرور شما در ایران باشد ایران دا انتخاب کنید و در غیر اینصورت آلمان و یا خودکار را انتخاب کنید\", ),\n \"afp\" => array(\"FriendlyName\" => \"افزودن کارمزد به قیمت ها\", \"Type\" => \"yesno\", \"Description\" => \"در صورت انتخاب 2.5 درصد به هزینه پرداخت شده افزوده می شود.\", ),\n );\n\treturn $configarray;\n}", "function plugin_initconfig_crowdtranslator( )\n{\n global $_CROWDTRANSLATOR_CONF, $_CROWDTRANSLATOR_DEFAULT;\n if ( is_array( $_CROWDTRANSLATOR_CONF ) && ( count( $_CROWDTRANSLATOR_CONF ) > 1 ) ) {\n $_CROWDTRANSLATOR_DEFAULT = array_merge( $_CROWDTRANSLATOR_DEFAULT, $_CROWDTRANSLATOR_CONF );\n }\n $me = 'crowdtranslator';\n $c = config::get_instance();\n if ( !$c->group_exists( $me ) ) {\n $c->add( 'sg_main', NULL, 'subgroup', 0, 0, NULL, 0, true, $me, 0 );\n $c->add( 'tab_main', NULL, 'tab', 0, 0, NULL, 0, true, $me, 0 );\n $c->add( 'fs_main', NULL, 'fieldset', 0, 0, NULL, 0, true, $me, 0 );\n // The below two lines add two settings to Geeklog's config UI\n $c->add( 'enabled', $_CROWDTRANSLATOR_DEFAULT[ 'enabled' ], 'select', 0, 0, 0, 10, true, $me, 0 ); // This adds a drop-down box\n }\n return true;\n}", "function __construct() {\n $this->plugin_dir = plugin_dir_path(__FILE__);\n $this->icon_dir = $this->plugin_dir . 'images/icons/';\n\n $this->plugin_url = plugins_url('',__FILE__);\n $this->icon_url = $this->plugin_url . 'images/icons/';\n $this->admin_page = admin_url() . 'admin.php?page=' . $this->plugin_dir;\n\n $this->base_name = plugin_basename(__FILE__);\n\n $this->prefix = ADPRESS_PREFIX;\n\n $this->_configure();\n $this->_includes();\n \n // Extra help : attach the packages\n //\n $this->wpcsl->extrahelp = new ADPRESS_Extra_Help(\n array(\n 'parent' => $this->wpcsl\n )\n ); \n }", "function realstate_admin_configuration() {\n osc_plugin_configure_view(osc_plugin_path(__FILE__));\n}", "public function initializePlugin();", "function plugin_load_configuration_nexcontent($pi_name)\r\n{\r\n global $_CONF;\r\n\r\n $base_path = $_CONF['path'] . 'plugins/' . $pi_name . '/';\r\n\r\n require_once $_CONF['path_system'] . 'classes/config.class.php';\r\n require_once $base_path . 'install_defaults.php';\r\n\r\n return plugin_initconfig_nexcontent();\r\n}", "public static function activate_plugin(){\n\t\t\tadd_option('breakingnews_area_title', __('Breaking news', 'text-domain'));\n\t\t\tadd_option('breakingnews_text_color', '#F0F0F0');\n\t\t\tadd_option('breakingnews_bg_color', '#333333');\n\t\t\tadd_option('breakingnews_autoinsert', '1');\n\t\t}", "static function afficher_le_parametrage() {\n\t\tif (is_plugin_active ( SARBACANE__PLUGIN_DIRNAME . \"/sarbacane.php\" )) {\n\t\t\twp_enqueue_style ( \"sarbacane_global.css\", plugins_url ( \"css/sarbacane_global.css\", __FILE__ ), array (\n\t\t\t\t\t'wp-admin' \n\t\t\t) );\n\t\t\twp_enqueue_style ( \"sarbacane_widget_admin_panel.css\", plugins_url ( \"css/sarbacane_widget_admin_panel.css\", __FILE__ ), array (\n\t\t\t\t\t'wp-admin' \n\t\t\t) );\n\t\t\twp_enqueue_script ( \"sarbacane-widget-adminpanel.js\", plugins_url ( \"js/sarbacane-widget-adminpanel.js\", __FILE__ ), array (\n\t\t\t\t\t'jquery',\n\t\t\t\t\t'jquery-ui-dialog',\n\t\t\t\t\t'underscore' \n\t\t\t) );\n\t\t\twp_enqueue_style ( \"jquery-ui.min.css\", plugins_url ( \"css/jquery-ui.min.css\", __FILE__ ) , array (\n\t\t\t\t\t'wp-admin' \n\t\t\t) );\n\t\t}\n\t\t\n\t\tif (isset ( $_POST ['sarbacane_save_configuration'] )) {\n\t\t\t$sanitized_post = sanitize_post ( $_POST, 'db' );\n\t\t\tSarbacaneNewsWidget::save_parameters ( $sanitized_post );\n\t\t}\n\t\t\n\t\t$title = get_option ( 'sarbacane_news_title', __ ( 'newsletter', 'sarbacane-desktop' ) );\n\t\t$description = get_option ( 'sarbacane_news_description', __ ( 'get_our_news_and_promotion_monthly', 'sarbacane-desktop' ) );\n\t\t$registration_message = get_option ( 'sarbacane_news_registration_message', __ ( 'congrats_you_just_opt_in_our_newsletter', 'sarbacane-desktop' ) );\n\t\t$registration_button = get_option ( 'sarbacane_news_registration_button', __ ( 'Inscription', 'sarbacane-desktop' ) );\n\t\t\n\t\t$fields = get_option ( 'sarbacane_news_fields' );\n\t\tif ($fields == null || sizeof ( $fields ) <= 0) {\n\t\t\t$default_email = new stdClass ();\n\t\t\t$email_field = __ ( 'email', 'sarbacane-desktop' );\n\t\t\t$default_email->label = $email_field;\n\t\t\t$default_email->mandatory = true;\n\t\t\tupdate_option ( 'sarbacane_news_fields', array (\n\t\t\t\t\t$default_email \n\t\t\t) );\n\t\t\t$fields = get_option ( 'sarbacane_news_fields' );\n\t\t}\n\t\t\n\t\t$list_type = \"N\";\n\t\t\n\t\trequire_once 'views/sarbacane-widget-adminpanel.php';\n\t}", "function admin_init() {\r\n register_setting('e_tools_options', 'e_tools');\r\n}", "public function pluginDetails()\n {\n return [\n 'name' => 'general',\n 'description' => 'General configuration',\n 'author' => 'kironuniversity',\n 'icon' => 'icon-leaf'\n ];\n }", "abstract public function pluginDetails();", "function cpotheme_metadata_plugin()\n{\n $cpotheme_data = array();\n\n $cpotheme_data[] = array(\n 'name' => 'plugin_title',\n 'std' => '',\n 'label' => 'Título del Producto',\n 'type' => 'text',\n 'desc' => 'Indica la etiqueta de título (H1) del tema.'\n );\n\n $cpotheme_data[] = array(\n 'name' => 'plugin_demo_url',\n 'std' => '',\n 'label' => 'URL de la Demo',\n 'type' => 'text',\n 'desc' => 'Especifica la URL de la demo del tema.'\n );\n\n $cpotheme_data[] = array(\n 'name' => 'plugin_url',\n 'std' => '',\n 'label' => 'External URL',\n 'type' => 'text',\n 'desc' => 'Especifica la URL del tema si es un archivo externo.'\n );\n\n $cpotheme_data[] = array(\n 'name' => 'plugin_product',\n 'std' => '',\n 'label' => 'ID de Producto',\n 'type' => 'select',\n 'option' => cpotheme_metadata_productlist_optional(),\n 'desc' => 'Indica la ID del producto para enlazarlo.'\n );\n\n $cpotheme_data[] = array(\n 'name' => 'plugin_changelog',\n 'std' => '',\n 'label' => 'Changelog',\n 'type' => 'textarea',\n 'desc' => 'Muestra el registro de cambios de la descarga.'\n );\n\n return $cpotheme_data;\n}", "public function init()\n {\n // Poskladame config prvku\n $config = Array(\n 'buttons' => $this->config['buttons'],\n );\n\n // Pokud je povolen uplaod obrazku tak predame url na upload controller a dalsi parametry\n if ($this->config['images_upload']) {\n $get_params = Array(\n 'reltype' => $this->getImageRelType(),\n 'relid' => $this->model->pk(),\n );\n $config['images_upload'] = AppUrl::directupload_file_action('wysiwyg.images_upload', $get_params);\n }\n\n if (is_array($this->config['formatting_tags'])) {\n $config['formatting_tags'] = $this->config['formatting_tags'];\n }\n\n //inicializace pluginu na teto instanci form prvku\n $this->addInitJS(View::factory('js/jquery.AppFormItemWysiwyg-init.js')->set('config', $config));\n\n return parent::init();\n }", "public function admin_options() {\n\n\t\t\t?>\n\t\t\t<h3>ATOS</h3>\n\t\t\t<p><?php _e('Acceptez les paiements par carte bleue grâce à Atos.', 'woothemes'); ?></p>\n\t\t\t<p><?php _e('Plugin créé par David Fiaty', 'woothemes'); ?> - <a href=\"http://www.cmsbox.fr\">http://www.cmsbox.fr</a></p>\n\t\t\t<table class=\"form-table\">\n\t\t\t<?php\n\t\t\t\t// Generate the HTML For the settings form.\n\t\t\t\t$this->generate_settings_html();\n\t\t\t?>\n\t\t\t</table><!--/.form-table-->\n\t\t\t<?php\n\t\t}", "function opslert_plugin_settings(){\n return array( \n 'ops_alert_server' => array('friendly_name' => 'Ops Alert Server', \n 'default' => 'alerts.cheggnet.com',\n 'type' => 'string'),\n 'ops_alert_server_offset' => array('friendly_name' => 'Alert Offset',\n 'default' => 1000000, \n 'type' => 'integer')\n \n );\n}", "public function pluginDetails()\n {\n return [\n 'name' => 'Iklan',\n 'description' => 'Pengaturan Iklan',\n 'author' => 'PanatauSolusindo',\n 'icon' => 'icon-diamond'\n ];\n }", "public function register_settings()\n {\n }", "public function register_settings()\n {\n }", "public function getDataGridPluginConfig();", "public function inlcude_redux_config(){\n if (!isset($redux_demo) && file_exists(plugin_dir_path(__FILE__) . '/optionpanel/config.php'))\n {\n require_once ('optionpanel/config.php');\n }\n }", "abstract function getPluginSettingsPrefix();", "function my_plugin_menu() {\n\t\tadd_options_page( 'Opções do Plugin', 'Marvel SC', 'manage_options', 'my-unique-identifier', 'my_plugin_options' );\n\t}", "function SetAdminConfiguration() {\n\t\t\tadd_options_page(\"3B Meteo\", \"3B Meteo\", 8, basename(__FILE__), array(\"TreBiMeteo\",'DesignAdminPage'));\n\t\t}", "function sh_display_custom_settings_callback(){\n require_once( plugin_dir_path(__FILE__) . '/templates/display_custom_settings.php' );\n}", "function admin_init() {\r\n register_setting($this->optionsName, $this->optionsName);\r\n wp_register_style('custom-page-extensions-admin-css', $this->pluginURL . '/includes/custom-page-extensions-admin.css');\r\n wp_register_script('custom-page-extensions-js', $this->pluginURL . '/js/custom-page-extensions.js');\r\n }", "public function adminPluginOptionsPage()\n {\n echo $this->_loadView('admin-settings-page');\n }", "public function element_config()\n\t{\n\t\t$this->config['shortcode'] = 'pb_image';\n\t\t$this->config['name'] = JText::_('JSN_PAGEBUILDER_ELEMENT_IMAGE');\n\t\t$this->config['cat'] = JText::_('JSN_PAGEBUILDER_DEFAULT_ELEMENT_MEDIA');\n\t\t$this->config['icon'] = 'icon-image';\n\t\t$this->config['description'] = JText::_(\"JSN_PAGEBUILDER_ELEMENT_IMAGE_DES\");\n\t}", "function install_plugin_information()\n {\n }", "function hook_plugin_in_panel(){\n add_menu_page( 'Formularze zamówień', 'Formularze zamówień', 'manage_options', 'Formularze zamówień', 'load_plugin_backend' ); #settings for menu acces\n}", "function wp_plupload_default_settings()\n {\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'EaxOctober',\n 'description' => 'Стандартное расширение Quadrowin',\n 'author' => 'quadrowin',\n 'icon' => 'icon-leaf'\n ];\n }", "function element_config()\n {\n $this->config['shortcode'] = 'pb_market';\n $this->config['name'] = JText::_('JSN_PAGEBUILDER_ELEMENT_MARKET');\n $this->config['cat'] = JText::_('JSN_PAGEBUILDER_DEFAULT_ELEMENT_EXTRA');\n $this->config['icon'] = \"icon-market\";\n $this->config['has_subshortcode'] = __CLASS__ . 'Item';\n $this->config['description'] = JText::_(\"JSN_PAGEBUILDER_ELEMENT_MARKET_DES\");\n\n $this->config['exception'] = array(\n 'default_content' => JText::_('JSN_PAGEBUILDER_ELEMENT_MARKET')\n );\n }", "abstract public function getConfig();", "public function __construct() {\n\t\t\t// Initialize Settings\n\t\t\trequire_once(sprintf(\"%s/settings.php\", dirname(__FILE__))); //引入 当前目录替代%s返回的目录文件 ,dirname(__FILE__)表示当前文件的绝对路径\n\t\t\t$WP_Canvas_Best_Settings = new WP_Canvas_Best_Settings(); //生成设置实例。\n\n\t\t\t$plugin = plugin_basename(__FILE__); //插件当前文件名赋值,plugin_basename(__FILE__)表示插件当前文件的文件名称。\n\t\t\tadd_filter(\"plugin_action_links_$plugin\", array( $this, 'plugin_settings_link' )); //设置过滤钩子(名称,挂载的函数), array( $this, 'plugin_settings_link' )表示将函数引用到当前实例\n\t\t}", "function before_edit_configuration() { }", "function julia_kaya_customizer_settings() \r\n\t{\r\n\t\tadd_theme_page( esc_html__('Customizer Import','julia'), esc_html__('Customizer Import','julia'), 'edit_theme_options', 'import', array( $this,'julia_kaya_customize_import_option_page'));\r\n add_theme_page( esc_html__('Customizer Export','julia'), esc_html__('Customizer Export','julia'), 'edit_theme_options', 'export', array( $this,'julia_kaya_customize_export_option_page'));\r\n }", "public static function config() {\n require_once( 'includes/widget-config.php' );\n }", "private function add_ba_plugin_settings_link() {\n\t\tfunction ba_plugin_settings_link($links, $file) {\n\t\t\tif ( $file == plugin_basename( dirname(__FILE__).'/ba-dm-plugin.php' ) ) {\t\n\t\t\t\t# Einstelungs-Menü hinten\n\t\t\t\t$links[] = '<a href=\"'.admin_url('admin.php?page=ba_dm_plugin_menu').'\">'.__('Einstellungen', 'BA DM Plugin Menü').'</a>';\n\t\t\t\t\n\t\t\t\t# Einstelungs-Menü vorne\n\t\t\t\t#$link = '<a href=\"options-general.php?page=ba_dm_plugin_menu\">'.__('Einstellungen', 'BA DM Plugin Menü').'</a>';\n\t\t\t\t#array_unshift($links, $link);\t\n\t\t\t}\n\t\t\treturn $links;\n\t\t}\n\t\t\n\t\t# meldet ein Filter für ein Einstellungs-Link bei Plugins hinzu\n\t\tadd_filter( 'plugin_action_links', 'ba_plugin_settings_link', 10, 2);\n\t}", "function settings($customizer)\n {\n }", "public static function config();", "function wikiembed_options_init() {\n\tregister_setting( 'wikiembed_options', 'wikiembed_options', 'wikiembed_options_validate' ); // the settings for wiki embed options\n}", "function add_plugin($plugin)\n {\n }", "static function get_settings(){\n\t\t\t\treturn array(\t\n\t\t\t\t\t'icon' => GDLR_CORE_URL . '/framework/images/page-builder/nav-template.png', \n\t\t\t\t\t'title' => esc_html__('Templates', 'goodlayers-core')\n\t\t\t\t);\n\t\t\t}", "function plasso_kirki_configuration() {\n return array('url_path' => get_stylesheet_directory_uri() . '/assets/works/vendor/kirki/');\n}", "public function config()\n {\n }", "public function bootPlugin();", "function options_panel() {\r\n // Include options panel\r\n include($this->pluginPath . \"/includes/settings.php\");\r\n }", "function plugin_satisfactionsmiley_check_config() {\n return true;\n}", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "static public function slider_config() {\n ?>\n\n /**\n * J'ai simplement recopié le script du plugin pour pouvoir modifier les\n * caractéristiques du slider car aucun moyen de le configurer n'est \n * mis à dispo dans le backoffice...\n *\n * source https://github.com/sayful1/filterable-portfolio/blob/master/assets/src/frontend/slider.js\n */\n if (tns) {\n var sliders,\n i,\n slider,\n sliderOuter,\n controls,\n showDots,\n showArrows,\n autoplay,\n autoplayHoverPause,\n autoplayTimeout,\n speed,\n gutter,\n loop,\n lazyload,\n slideBy,\n mobile,\n tablet,\n desktop,\n wideScreen,\n fullHD,\n highScreen;\n\n sliders = document.querySelectorAll('.fp-tns-slider');\n for(i=0;i<sliders.length;i++){\n slider=sliders[i];\n\n sliderOuter = slider.parentNode;\n controls = sliderOuter.querySelector('.fp-tns-slider-controls');\n\n mobile = parseInt(slider.getAttribute('data-mobile'));\n tablet = parseInt(slider.getAttribute('data-tablet'));\n desktop = parseInt(slider.getAttribute('data-desktop'));\n wideScreen = parseInt(slider.getAttribute('data-wide-screen'));\n fullHD = parseInt(slider.getAttribute('data-full-hd'));\n highScreen = parseInt(slider.getAttribute('data-high-screen'));\n\n showDots = slider.getAttribute('data-dots') === 'true';\n showArrows = slider.getAttribute('data-arrows') === 'true';\n\n autoplay = slider.getAttribute('data-autoplay') === 'true';\n autoplayHoverPause = slider.getAttribute('data-autoplay-hover-pause') === 'true';\n // Default is 5000\n autoplayTimeout = 10000;\n // Default is 500\n speed = 1000;\n\n gutter = parseInt(slider.getAttribute('data-gutter'));\n loop = slider.getAttribute('data-loop') === 'true';\n lazyload = slider.getAttribute('data-lazyload') === 'true';\n\n slideBy = slider.getAttribute('data-slide-by');\n slideBy = (slideBy === 'page') ? 'page' : parseInt(slideBy);\n\n tns({\n container: slider,\n slideBy: slideBy,\n loop: loop,\n lazyload: lazyload,\n autoplay: autoplay,\n autoplayTimeout: autoplayTimeout,\n autoplayHoverPause: autoplayHoverPause,\n speed: speed,\n gutter: gutter,\n nav: showDots,\n controls: showArrows,\n controlsContainer: controls ? controls : false,\n edgePadding: 0,\n items: mobile,\n responsive: {\n 600: {items: tablet},\n 1000: {items: desktop},\n 1200: {items: wideScreen},\n 1500: {items: fullHD},\n 1921: {items: highScreen}\n }\n });\n }\n }\n\n\n <?php\n }", "abstract protected function getConfig();", "public function pluginDetails() {\n return [\n 'name' => 'janvince.smallextensions::lang.plugin.name',\n 'description' => 'janvince.smallextensions::lang.plugin.description',\n 'author' => 'Jan Vince',\n 'icon' => 'icon-universal-access'\n ];\n }", "function changyan_config_notice()\n {\n global $zbp;\n //TODO the link is not available\n $zbp->SetHint('tips', '<strong>请完成相关<a href=\"' . $zbp->host . 'zb_users/plugin/changyan/main.php' . '\">配置</a>,您就能享受畅言的服务了。</strong>');\n }", "public function set_plugin($plugin='') {\n $this->plugin = $plugin;\n }", "public function plugin_construction() {\t\r\n\t\r\n\t}", "public function pluginDetails()\n {\n return [\n 'name' => 'Тинькофф Банк',\n 'description' => 'Проведение платежей через Tinkoff EACQ.',\n 'author' => 'Sozonov Alexey',\n 'icon' => 'icon-shopping-cart',\n 'homepage' => 'https://sozonov-alexey.ru'\n ];\n }", "public function getPlugin();", "public function getPlugin();", "function tb_addTagBeepToWpAdmin() { \r\n //add in /settings manu\r\n add_options_page(\"tagBeep uptime\", \"tagBeep uptime\", 8, \"tagBeepUptimeMonitor\", \"tb_load_tagBeepAdmin\"); \r\n //add in the /plugins menu\r\n add_plugins_page(\"tagBeep uptime\", \"tagBeep uptime\", 8, \"tagBeepUptimeMonitorPlugin\", \"tb_load_tagBeepAdmin\"); \r\n}", "function admin_config(){\n \n if(!acf_current_user_can_admin())\n return;\n \n global $plugin_page;\n \n if(!$plugin_page)\n return;\n \n $page = acf_get_options_page($plugin_page);\n \n if(!acf_maybe_get($page, 'menu_slug'))\n return;\n \n // Get Dynamic Options Page\n $acfe_dop_options_page = get_posts(array(\n 'post_type' => $this->post_type,\n 'posts_per_page' => 1,\n 'name' => $page['menu_slug']\n ));\n \n if(empty($acfe_dop_options_page))\n return;\n \n $acfe_dop_options_page = $acfe_dop_options_page[0];\n \n ?>\n <script type=\"text/html\" id=\"tmpl-acfe-dop-title-config\">\n <a href=\"<?php echo admin_url('post.php?post=' . $acfe_dop_options_page->ID . '&action=edit'); ?>\" class=\"page-title-action acfe-dop-admin-config\"><span class=\"dashicons dashicons-admin-generic\"></span></a>\n </script>\n\n <script type=\"text/javascript\">\n (function($){\n\n // Add button\n $('.wrap h1').append($('#tmpl-acfe-dop-title-config').html());\n\n })(jQuery);\n </script>\n <?php\n \n }", "public function pluginDetails()\n {\n return [\n 'name' => 'Todo',\n 'description' => 'Just a simple todo widget',\n 'author' => 'Hartviglarsen',\n 'icon' => 'icon-leaf'\n ];\n }", "public function writewebconfig()\n {\n //<add fileExtension=\"supersake\" allowed=\"false\"/>\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'Klyp Page Builder',\n 'description' => 'Easily order component on pages.',\n 'author' => 'Klyp',\n 'icon' => 'icon-leaf'\n ];\n }", "function load_plugin() {\n global $fb_opt_name, $gp_opt_name, $popup_fb_page, $popup_delay, $fb_popup_box;\n \n if(is_admin()&& get_option('Activated_Plugin')=='Plugin-Slug') {\n delete_option('Activated_Plugin');\n add_option($fb_opt_name,'on');\n add_option($gp_opt_name,'on');\n add_option($popup_fb_page,'codesamplez');\n add_option($popup_delay,'2');\n add_option($fb_popup_box,'on');\n }\n}", "public function getConfig() {\r\n\r\n\t}", "function wpc_app_config_core(): void\n {\n if ( ! \\defined( 'ABSPATH' ) ) {\n exit;\n }\n\n Plugin::init();\n }", "public static function _setup_plugin() {\n\t\t\tadd_filter( 'mce_external_plugins', array( __CLASS__, 'mce_external_plugins' ) );\n\t\t\tadd_filter( 'mce_buttons_2', array( __CLASS__, 'mce_buttons_2' ) );\n\t\t\tadd_filter( 'content_save_pre', array( __CLASS__, 'content_save_pre' ), 20 );\n\t\t}", "function _init_plugin() {\n\t\tglobal $db, $apcms;\n\t\t\n\t\treturn true;\n\t}", "function khLess_settings_init()\n{\n register_setting('khLess', 'khLess_options');\n\n // register a new section in the \"khLess\" page\n add_settings_section(\n 'khLess_section_developers',\n __('', 'khLess'),\n 'khLess_section_developers_cb',\n 'khLess'\n );\n\n // register a new field in the \"khLess_section_developers\" section, inside the \"khLess\" page\n add_settings_field(\n 'khLess_field_pill', // as of WP 4.6 this value is used only internally\n // use $args' label_for to populate the id inside the callback\n __('Файл', 'Расписание'),\n 'khLess_field_pill_cb',\n 'khLess',\n 'khLess_section_developers',\n [\n 'label_for' => 'khLess_field_pill',\n 'class' => 'khLess_row',\n 'khLess_custom_data' => 'custom',\n ]\n );\n}", "function theme_options_init(){\n\tregister_setting( 'sample_options', 'site_description', 'theme_options_validate' );\n\tregister_setting( 'ga_options', 'ga_account', 'ga_validate' );\n\tadd_filter('site_description', 'stripslashes');\n}", "public function pluginDetails(): array\n {\n return [\n 'name' => 'definer.jivosite::lang.plugin.name',\n 'description' => 'definer.jivosite::lang.plugin.description',\n 'author' => 'Definer',\n 'icon' => 'icon-comments'\n ];\n }", "public function admin_options() { ?>\n <h3><?php _e( $this->pluginTitle(), 'midtrans-woocommerce' ); ?></h3>\n <p><?php _e($this->getSettingsDescription(), 'midtrans-woocommerce' ); ?></p>\n <table class=\"form-table\">\n <?php\n // Generate the HTML For the settings form.\n $this->generate_settings_html();\n ?>\n </table><!--/.form-table-->\n <?php\n }", "protected function getWidgetConfiguration() {}", "function autoriser_ieconfig_configurer_dist($faire, $type, $id, $qui, $opt) {\r\n\treturn autoriser('webmestre', $type, $id, $qui, $opt);\r\n}", "function activate()\n {\n $aData = array( 'SIZE_AVATAR' => 50,\n 'NUMERO_POST' => 5 );\n\n // Comprobamos si existe opciones para este Widget, si no existe las creamos por el contrario actualizamos\n if( ! get_option( 'ultimosPostPorAutor' ) )\n add_option( 'ultimosPostPorAutor' , $aData );\n else\n update_option( 'ultimosPostPorAutor' , $data);\n }", "public function configure()\n\t{\n\t\t$this->fileDir = 'form';\n\t\t$this->fileName = 'resourcebooking.js';\n\n\t\t$this->addExtension('crm.site.form.resourcebooking');\n\t\t//$this->addExtension('ui.vue.components.datepick');\n\t\t//$this->addExtension('calendar.resourcebooking');\n\n\t\t$this->embeddedModuleName = 'crm.form.resourcebooking';\n\t}", "function inkpro_create_options() {\r\n\treturn array();\r\n}", "function sh_custom_settings_options_callback(){\n echo 'Add your custom information';\n}", "public function composerSettings() {\n\n if ( current_user_can('manage_options') && $this->composer->isPlugin()) {\n //add_options_page(__(\"Swift Page Builder Settings\", \"js_composer\"), __(\"Swift Page Builder\", \"js_composer\"), 'install_plugins', \"wpb_vc_settings\", array($this, \"composerSettingsMenuHTML\"));\n }\n }", "function tsuiseki_tracking_admin_init() {\n register_setting('tsuiseki-tracking-settings', 'tsuiseki_tracking_key');\n register_setting('tsuiseki-tracking-settings', 'tsuiseki_tracking_css_class');\n register_setting('tsuiseki-tracking-settings', 'tsuiseki_tracking_excluded_uris');\n}" ]
[ "0.66924256", "0.66799957", "0.64847684", "0.6476168", "0.64138377", "0.63028073", "0.630192", "0.6287042", "0.6281437", "0.6254262", "0.6239765", "0.623923", "0.6230911", "0.62222046", "0.6203148", "0.61952436", "0.6190213", "0.6178388", "0.6139375", "0.6135726", "0.6133105", "0.61317235", "0.61216056", "0.61177444", "0.6117412", "0.6115559", "0.6107395", "0.6098254", "0.60943735", "0.6093053", "0.60709614", "0.606999", "0.60606694", "0.6058448", "0.6056245", "0.6053228", "0.6049507", "0.60462075", "0.6035626", "0.602533", "0.60148907", "0.59976465", "0.5972074", "0.59663886", "0.5965608", "0.59573686", "0.59534353", "0.59487796", "0.59483856", "0.59470534", "0.5942253", "0.59358305", "0.5932025", "0.59204435", "0.5919589", "0.59157324", "0.5914154", "0.59132004", "0.5912592", "0.5909711", "0.58973074", "0.58970916", "0.5894325", "0.5894325", "0.5894325", "0.5894325", "0.5894325", "0.5894325", "0.5894325", "0.5894325", "0.5892011", "0.5886142", "0.5884521", "0.58832395", "0.5864805", "0.58632845", "0.5855709", "0.5850116", "0.5850116", "0.5846845", "0.5844245", "0.5842777", "0.583681", "0.58315974", "0.5830492", "0.58127207", "0.58118325", "0.58093196", "0.580837", "0.5806231", "0.58013815", "0.57981604", "0.5795307", "0.5793502", "0.5788121", "0.578419", "0.57840294", "0.5783512", "0.57820714", "0.57799", "0.5779035" ]
0.0
-1
Returns the static model of the specified AR class.
public static function model($className=__CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function model()\r\n {\r\n return static::class;\r\n }", "public static function model() {\n return parent::model(get_called_class());\n }", "public static function model($class = __CLASS__)\n {\n return parent::model($class);\n }", "public static function model($class = __CLASS__)\n\t{\n\t\treturn parent::model(get_called_class());\n\t}", "static public function model($className = __CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return CActiveRecord::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }" ]
[ "0.74850124", "0.73803526", "0.7154113", "0.71401674", "0.70629025", "0.703232", "0.69285315", "0.69285315", "0.6925706", "0.6902751", "0.6894916", "0.6894916", "0.68900806", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424" ]
0.0
-1
Retrieves a list of models based on the current search/filter conditions.
public function search() { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria=new CDbCriteria; $criteria->compare('stock_id',$this->stock_id); $criteria->compare('visibility',$this->visibility); $criteria->compare('menu_name',$this->menu_name,true); $criteria->compare('end_date',$this->end_date); $criteria->compare('end_time',$this->end_time); $criteria->compare('short_text',$this->short_text,true); $criteria->compare('img',$this->img,true); $criteria->compare('position',$this->position); $criteria->compare('date',$this->date); $criteria->compare('in_main',$this->in_main); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModels();", "public function getModels();", "public function findAll($model);", "public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('warehouse_id');\n $client_id = ( !is_numeric(request()->get('client_id')) ) ? auth()->user()->current_client_id : request()->get('client_id');\n\n //instantiate model and run search\n $product_model = new Product();\n return $product_model->getListSearch(request()->get('search_term'), $warehouse_id, $client_id);\n }", "public function getModels()\n\t{\n\t\t$scope = $this->scopeName;\n\t\treturn CActiveRecord::model($this->baseModel)->$scope()->findAll();\n\t}", "protected function findModel()\n {\n $class = $this->model;\n $query = $class::query();\n\n foreach ($this->input as $key => $value) {\n $where = is_array($value) ? 'whereIn' : 'where';\n $query->$where($key, $value);\n }\n\n return $query->get();\n }", "public function modelScans()\n {\n if ($this->scanEverything) {\n return $this->getAllClasses();\n }\n\n return $this->scanModels;\n }", "public function listModels() {\n\n $config = $this->initConfig($version = AnalyzeModel::VERSION);\n\n $config->setQuery( [ 'version' => $version ] );\n\n $config->setMethod(HttpClientConfiguration::METHOD_GET);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n $config->setURL(self::BASE_URL.\"/models\");\n\n return $this->sendRequest($config);\n }", "public function getModelsForIndex()\n {\n $models = [];\n $all_models = $this->getAllModels();\n\n foreach ($all_models as $model) {\n //parse model\n $pieces = explode('.', $model);\n if (count($pieces) != 2) {\n throw new Exception('Parse error in AppModelList');\n }\n //check form match\n $app_model = $pieces[1];\n $link = $this->convertModelToLink($app_model);\n\n // add to actions\n $models[$app_model]['GET'] = [\n [\n 'action' => 'index',\n 'description' => 'List & filter all ' . $app_model . ' resources.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link\n ],\n [\n 'action' => 'show',\n 'description' => 'Show the ' . $app_model . ' that has the matching {id} from the route.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link . '/{id}'\n ]\n ];\n }\n return $models;\n }", "public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }", "public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }", "public function searchableBy()\n {\n return [];\n }", "public function all($model){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n $stmt = $this->pdo->prepare('select * from ' . $table);\n $stmt->execute();\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public static function find($model, $conditions = null, $orderby = null){\n\t\t$sql = \"SELECT * FROM \" . self::table_for($model);\n\t\tif ($conditions) $sql .= \" WHERE \" . self::make_conditions($conditions);\n\t\tif ($orderby)\t$sql .= \" ORDER BY \" . $orderby;\n\t\t\n\t\t$resultset = self::do_query($sql);\n\t\treturn self::get_results($resultset, $model);\n\t}", "function get_model_list($where=\"1\",$where_array,$sort_by=\"\"){\n\t\t$data= $this->select_query(\"make_model\",\"id,name,del_status\",$where,$where_array,$sort_by);\n\t\treturn $data;\n\t}", "public static function search()\n {\n return self::filterSearch([\n 'plot_ref' => 'string',\n 'plot_name' => 'string',\n 'plot_start_date' => 'string',\n 'user.name' => self::filterOption([\n 'select' => 'id',\n 'label' => trans_title('users', 'plural'),\n 'fields' => ['id', 'name'],\n //ComboBox user list base on the current client\n //See in App\\Models\\Users\\UsersScopes\n 'model' => app(User::class)->bySearch(),\n ]),\n 'client.client_name' => self::filterOption([\n 'conditional' => Credentials::hasRoles(['admin', 'admin-gv']),\n 'select' => 'client_id',\n 'label' => trans_title('clients', 'plural'),\n 'model' => Client::class,\n 'fields' => ['id', 'client_name']\n ])\n ]);\n }", "public function getList()\n {\n \treturn $this->model->where('is_base', '=', 0)->get();\n }", "public function getList()\n {\n $this->db->order_by(\"id\", 'desc');\n $this->db->where('status', 1);\n return $this->db->get($this->model);\n }", "public function findAll()\n {\n $fields = $options = [];\n //$options['debug'] = 1;\n $options['enablefieldsfe'] = 1;\n\n return $this->search($fields, $options);\n }", "public function findAll()\n {\n return $this->model->all();\n }", "public function get_multiple()\n\t{\n\t\t$options = array_merge(array(\n\t\t\t'offset' => 0,\n\t\t\t'limit' => 20,\n\t\t\t'sort_by' => 'name',\n\t\t\t'order' => 'ASC'\n\t\t), Input::all(), $this->options);\n\n\t\t// Preparing our query\n\t\t$results = $this->model->with($this->includes);\n\n\t\tif(count($this->join) > 0)\n\t\t{\n\t\t\tforeach ($this->join as $table => $settings) {\n\t\t\t\t$results = $results->join($table, $settings['join'][0], $settings['join'][1], $settings['join'][2]);\n\t\t\t\tif($settings['columns'])\n\t\t\t\t{\n\t\t\t\t\t$options['sort_by'] = (in_array($options['sort_by'], $settings['columns']) ? $table : $this->model->table()).'.'.$options['sort_by'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(stripos($options['sort_by'], '.') === 0)\n\t\t{\n\t\t\t$options['sort_by'] = $this->model->table().'.' . $options['sort_by'];\n\t\t}\n\t\t\n\t\t// Add where's to our query\n\t\tif(array_key_exists('search', $options))\n\t\t{\n\t\t\tforeach($options['search']['columns'] as $column)\n\t\t\t{\n\t\t\t\t$results = $results->or_where($column, '~*', $options['search']['string']);\n\t\t\t}\n\t\t}\n\n\t\t$total = (int) $results->count();\n\n\t\t// Add order_by, skip & take to our results query\n\t\t$results = $results->order_by($options['sort_by'], $options['order'])->skip($options['offset'])->take($options['limit'])->get();\n\n\t\t$response = array(\n\t\t\t'results' => to_array($results),\n\t\t\t'total' => $total,\n\t\t\t'pages' => ceil($total / $options['limit'])\n\t\t);\n\n\t\treturn Response::json($response);\n\t}", "public function getAll()\n {\n return DB::table('product_models')->get()->all();\n }", "public function filter($params) {\n $model = $this->model;\n $keyword = isset($params['keyword'])?$params['keyword']:'';\n $sort = isset($params['sort'])?$params['sort']:''; \n if ($sort == 'name') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('name'); \n }\n else if ($sort == 'newest') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('updated_at','desc'); \n }\n else {\n $query = $model->where('name','LIKE','%'.$keyword.'%'); \n }\n /** filter by class_id */ \n if (isset($params['byclass']) && isset($params['bysubject'])) {\n $query = $model->listClass($params['byclass'], $params['bysubject']);\n return $query; \n }\n else if (isset($params['byclass'])) { \n $query = $model->listClass($params['byclass']);\n return $query;\n }\n else if (isset($params['bysubject'])) {\n $query = $model->listClass(0,$params['bysubject']);\n return $query;\n }\n /** filter by course status */\n if (isset($params['incomming'])) {\n $query = $model->listCourse('incomming');\n return $query;\n }\n else if (isset($params['upcomming'])) {\n $query = $model->listCourse('upcomming');\n return $query;\n }\n $result = $query->paginate(10); \n return $result; \n }", "public function getAll($model, $filters = array())\n {\n $repo = $this->getRepository($model);\n\n return $repo->getAll($filters);\n }", "public function filters(Model $model): array\n {\n return [];\n }", "public function getResults()\n {\n if($this->search) {\n foreach ($this->filters as $field) {\n $field = array_filter(explode('.', $field));\n if(count($field) == 2) {\n $this->query->whereHas($field[0], function ($q) use ($field) {\n $q->where($field[1], 'ilike', \"%{$this->search}%\");\n });\n }\n if(count($field) == 1) {\n $this->query->orWhere($field[0], 'ilike', \"%{$this->search}%\");\n }\n }\n }\n\n if($this->where) {\n foreach ($this->where as $field => $value) {\n $this->query->where($field, $value);\n }\n }\n\n if ($this->whereBetween) {\n foreach ($this->whereBetween as $field => $value)\n $this->query->whereBetween($field, $value);\n }\n// dd($this->query->toSql());\n return $this->query->paginate($this->per_page);\n }", "protected function _searchInModel(Model $model, Builder $items){\n foreach($model->searchable as $param){\n if($param != 'id'){\n if(isset($this->request[$param]))\n $items = $items->where($param, $this->request[$param]);\n if(isset($this->request[$param.'_like']))\n $items = $items->where($param, 'like', '%'.$this->request[$param.'_like'].'%');\n }else{\n if(isset($this->request['id'])){\n $ids = explode(',', $this->request['id']);\n $items = $items->whereIn('id', $ids);\n }\n }\n }\n\n return $items;\n }", "public function getAll($model)\n {\n $sql = \"SELECT * FROM {$this->table}\";\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll(PDO::FETCH_CLASS,get_class($this->model));\n }", "private function getAllModels()\n {\n return (object)ModelRegistry::getAllObjects();\n }", "public function findAll()\n {\n return $this->driver->findAll($this->model);\n }", "public function getAllFilters();", "public function GetAll()\n {\n return $this->model->all();\n }", "public function fetch_all_models() {\n global $pdo;\n\n $query = $pdo->prepare(\"SELECT * FROM talents\");\n $query -> execute();\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public function findWhere($model, $conditions, $limit = 0){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n\n $sql = 'select * from ' . $table . ' where ';\n $values = [];\n $counter = 1;\n\n foreach ($conditions as $key => $value) {\n if($counter > 1)\n $sql .= ' AND ';\n\n $sql .= $key . '=?';\n $values[] = $value; \n $counter++;\n }\n\n if($limit > 0)\n $sql .= ' LIMIT ' . $limit;\n \n $stmt = $this->pdo->prepare($sql);\n $stmt->execute($values);\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public function search() {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('type', $this->type);\n\n return $criteria;\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t//$criteria->compare('object_id',$this->object_id);\n\t\t$criteria->compare('object_type_id',$this->object_type_id);\n\t\t$criteria->compare('data_type_id',$this->data_type_id);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('client_ip',$this->client_ip,true);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_origin',$this->url_origin,true);\n\t\t$criteria->compare('device',$this->device,true);\n\t\t$criteria->compare('country_name',$this->country_name,true);\n\t\t$criteria->compare('country_code',$this->country_code,true);\n\t\t$criteria->compare('regionName',$this->regionName,true);\n\t\t$criteria->compare('cityName',$this->cityName,true);\n\t\t$criteria->compare('browser',$this->browser,true);\n\t\t$criteria->compare('os',$this->os,true);\n\t\t\t// se agrego el filtro por el usuario actual\n\t\t$idUsuario=Yii::app()->user->getId();\n\t\t$model = Listings::model()->finbyAttributes(array('user_id'=>$idUsuario));\n\t\tif($model->id!=\"\"){\n\t\t\t$criteria->compare('object_id',$model->id);\t\n\t\t}else{\n\t\t\t$criteria->compare('object_id',\"Null\");\t\n\t\t}\n\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getModels()\n {\n return $this->_models;\n }", "public function getSearchFields();", "public function all()\n {\n return $this->model->get();\n }", "public function getAllModels()\n {\n try {\n return AppModelList::models();\n }\n catch (Throwable $t) {\n throw new Exception('Parse Error: AppModelList.php has been corrupted.');\n }\n }", "protected function _list_items_query()\n\t{\n\t\t$this->filters = (array) $this->filters;\n\t\t$where_or = array();\n\t\t$where_and = array();\n\t\tforeach($this->filters as $key => $val)\n\t\t{\n\t\t\tif (is_int($key))\n\t\t\t{\n\t\t\t\tif (isset($this->filters[$val])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$key = $val;\n\t\t\t\t$val = $this->filter_value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// used for separating table names and fields since periods get translated to underscores\n\t\t\t\t$key = str_replace(':', '.', $key);\n\t\t\t}\n\t\t\t\n\t\t\t$joiner = $this->filter_join;\n\t\t\t\n\t\t\tif (is_array($joiner))\n\t\t\t{\n\t\t\t\tif (isset($joiner[$key]))\n\t\t\t\t{\n\t\t\t\t\t$joiner = $joiner[$key];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$joiner = 'or';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($val)) \n\t\t\t{\n\t\t\t\t$joiner_arr = 'where_'.$joiner;\n\t\t\t\t\n\t\t\t\tif (strpos($key, '.') === FALSE AND strpos($key, '(') === FALSE) $key = $this->table_name.'.'.$key;\n\t\t\t\t\n\t\t\t\t//$method = ($joiner == 'or') ? 'or_where' : 'where';\n\t\t\t\t\n\t\t\t\t// do a direct match if the values are integers and have _id in them\n\t\t\t\tif (preg_match('#_id$#', $key) AND is_numeric($val))\n\t\t\t\t{\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\tarray_push($$joiner_arr, $key.'='.$val);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// from imknight https://github.com/daylightstudio/FUEL-CMS/pull/113#commits-pushed-57c156f\n\t\t\t\t//else if (preg_match('#_from#', $key) OR preg_match('#_to#', $key))\n\t\t\t\telse if (preg_match('#_from$#', $key) OR preg_match('#_fromequal$#', $key) OR preg_match('#_to$#', $key) OR preg_match('#_toequal$#', $key) OR preg_match('#_equal$#', $key))\n\t\t\t\t{\n\t\t\t\t\t//$key = strtr($key, array('_from' => ' >', '_fromequal' => ' >=', '_to' => ' <', '_toequal' => ' <='));\n\t\t\t\t\t$key_with_comparison_operator = preg_replace(array('#_from$#', '#_fromequal$#', '#_to$#', '#_toequal$#', '#_equal$#'), array(' >', ' >=', ' <', ' <=', ' ='), $key);\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\t//$where_or[] = $key.'='.$this->db->escape($val);\n\t\t\t\t\tarray_push($$joiner_arr, $key_with_comparison_operator.$this->db->escape($val));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$method = ($joiner == 'or') ? 'or_like' : 'like';\n\t\t\t\t\t//$this->db->$method('LOWER('.$key.')', strtolower($val), 'both');\n\t\t\t\t\tarray_push($$joiner_arr, 'LOWER('.$key.') LIKE \"%'.strtolower($val).'%\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// here we will group the AND and OR separately which should handle most cases me thinks... but if not, you can always overwrite\n\t\t$where = array();\n\t\tif (!empty($where_or))\n\t\t{\n\t\t\t$where[] = '('.implode(' OR ', $where_or).')';\n\t\t}\n\t\tif (!empty($where_and))\n\t\t{\n\t\t\t$where[] = '('.implode(' AND ', $where_and).')';\n\t\t}\n\t\tif (!empty($where))\n\t\t{\n\t\t\t$where_sql = implode(' AND ', $where);\n\t\t\t$this->db->where($where_sql);\n\t\t}\n\t\t\n\t\t\n\t\t// set the table here so that items total will work\n\t\t$this->db->from($this->table_name);\n\t}", "public function getAll()\n {\n return $this->fetchAll($this->searchQuery(0));\n }", "public function listAction() {\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$select = null;\n\t\t\n\t\tif ($this->_request->getParam('data')) {\n\t\t\t\n\t\t\t$data = unserialize($this->_request->getParam('data'));\n\t\t\t$aWhere = array();\n\t\t\t$searchText = array();\n\t\t\t\n\t\t\tforeach ($data['query'] as $key => $q) {\n\t\t\t\n\t\t\t\tif (isset($data['fields'][$key]) && !empty($data['fields'][$key])) {\n\t\t\t\t\n\t\t\t\t\t$func = addslashes($data['func'][$key]);\n\t\t\t\t\t$q =\taddslashes($q);\n\t\t\t\t\t$tmpWhere = array();\n\t\t\t\t\t$searchText[] = implode(' OU ', $data['fields'][$key]) . ' ' . $this->view->func[$func] . ' \"' . stripslashes($q) . '\"';\n\t\t\t\t\t\n\t\t\t\t\tforeach ($data['fields'][$key] as $field) {\n\t\t\t\t\t\n\t\t\t\t\t\t$field\t=\taddslashes($field);\n\t\t\t\t\t\tswitch ($func) {\n\t\t\t\t\t\t\tcase 'LIKE':\n\t\t\t\t\t\t\tcase 'NOT LIKE':\n\t\t\t\t\t\t\tcase '=':\n\t\t\t\t\t\t\tcase '!=':\n\t\t\t\t\t\t\tcase '>':\n\t\t\t\t\t\t\tcase '>=':\n\t\t\t\t\t\t\tcase '<':\n\t\t\t\t\t\t\tcase '<=':\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' ' . $func . ' \\'' . $q . '\\''; }\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"= ''\":\n\t\t\t\t\t\t\tcase \"!= ''\":\n\t\t\t\t\t\t\tcase 'IS NULL':\n\t\t\t\t\t\t\tcase 'IS NOT NULL':\n\t\t\t\t\t\t\t\t$tmpWhere[] = $field . ' ' . stripslashes($func);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' LIKE \\'%' . $q . '%\\''; }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$aWhere[] = '(' . implode(' OR ', $tmpWhere) . ')';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($aWhere)) { $select = $model->select()->where(implode(' AND ', $aWhere)); }\n\t\t\t$this->view->searchText = $searchText;\n\t\t}\n\t\t$this->view->model = $modelName;\n\t\t$this->view->allData = $model->fetchAll($select);\n\t\t$this->view->data = Zend_Paginator::factory($this->view->allData)\n\t\t\t\t\t\t\t->setCurrentPageNumber($this->_getParam('page', 1));\n\t}", "public function index(Request $request)\n {\n $this->validate($request, [\n 'type' => 'required',\n 'searched' => 'required',\n ]);\n\n try {\n if ($request->type == 'Categories') {\n return Category::search($request->searched)->take(20)->get();\n }\n\n if ($request->type == 'Submissions') {\n return $this->sugarFilter(Submission::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Comments') {\n return $this->withoutChildren(Comment::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Users') {\n return User::search($request->searched)->take(20)->get();\n }\n } catch (\\Exception $exception) {\n app('sentry')->captureException($exception);\n\n return [];\n }\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\n\t\t$criteria->compare('type_key',$this->type_key,true);\n\n\t\t$criteria->compare('type_name',$this->type_name,true);\n\n\t\t$criteria->compare('model',$this->model,true);\n\n\t\t$criteria->compare('status',$this->status,true);\n\t\t\n\t\t$criteria->compare('seo_title',$this->seo_title,true);\n\t\t\n\t\t$criteria->compare('seo_keywords',$this->seo_keywords,true);\n\t\t\n\t\t$criteria->compare('seo_description',$this->seo_description,true);\n\n\t\treturn new CActiveDataProvider('ModelType', array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getReturnModels(){\r\n return array_values($this->models);\r\n }", "public function findAll()\n {\n $models = $this->getDoctrineRepository()->findAll();\n $this->events()->trigger(__FUNCTION__ . '.post', $this, array(\n 'model' => $models,\n 'om' => $this->getObjectManager())\n );\n return $models;\n }", "public function models();", "public function search($conditions)\n\t{\n\t\t$limit = (isset($conditions['limit']) && $conditions['limit'] !== null ? $conditions['limit'] : 10);\n\t\t$result = array();\n\t\t$alphabets = [];\n\n\t\tDB::enableQueryLog();\n\n\t\t$mem = new Memcached();\n\t\t$mem->addServer(env('memcached_server'), env('memcached_port'));\n\n\t\t/* Get Default Logo Link on setting_object table */\n\t\t$logoMem = $mem->get('logo_course');\n\n\t\tif ($logoMem)\n\t\t{\n\t\t\t$default_logo = $logoMem;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$default_logo = $this->getDefaultLogo();\n\t\t\t$mem->set('logo_course', $default_logo);\n\t\t}\n\n\t\tif (isset($conditions['alphabet']) && $conditions['alphabet'] !== null && sizeof($conditions['alphabet']) > 0) {\n\t\t\tforeach ($conditions['alphabet'] as $item) {\n\t\t\t\t$alphabets[] = \"lower(entity.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t\t$alphabets[] = \"lower(curriculum.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t}\n\t\t}\n\n\t\t$extraGroup = (isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : '' );\n\t\t$extraGroup = str_replace(' ASC', '',$extraGroup);\n\t\t$extraGroup = str_replace(' DESC', '',$extraGroup);\n\n\t\t$searchData = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->limit($limit)\n\t\t\t->offset(isset($conditions['page']) && $conditions['page'] !== null ? ($conditions['page']-1) * $limit : 0)\n\t\t\t->get();\n\n\t\t$searchAll = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t//->groupBy('course.course_id','schedule.instructor_id','curriculum.curriculum_id','entity.logo', 'course.day_of_week','entity.name','curriculum.name','course.time_start', 'course.time_end','event_type.name')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->get();\n\n\t\t//echo(\"<br>Total : \" . sizeof($searchData) . \" records\");\n\t\tforeach ($searchData as $data) {\n\t\t\t/*echo('<br>' . $data->program_id . '|' . $data->program_name . '|'. $data->activity_id . '|' . $data->provider_name . '|' . $data->location_name);*/\n\t\t\t//echo('<br>' . $data->provider_id . '|' . $data->provider_name . '|' . $data->location_name);\n\n\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\n\n\t\t\t//echo('<br>' . $data->course_id . \"~\" . $data->program_name . '#'.$day->name. \"|\". date('h:i',strtotime($data->time_start)) . '-' .date('h:i',strtotime($data->time_end)));\n\t\t\t$item = ['course_id' => $data->course_id,\n\t\t\t\t'entity_logo' => ($data->entity_logo ? $data->entity_logo : $default_logo),\n\t\t\t\t'entity_name' => $data->entity_name,\n\t\t\t\t'curriculum_name' => $data->curriculum_name,\n\t\t\t\t'day_name' => $day->name,\n\t\t\t\t'time_start' => date('H:i',strtotime($data->time_start)),\n\t\t\t\t'time_end' => date('H:i',strtotime($data->time_end))];\n\n\t\t\t/*$schedules = DB::table('schedule')\n\t\t\t\t->select('schedule.schedule_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\tforeach ($schedules as $schedule) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t}*/\n\n\t\t\t$programs = DB::table('curriculum')\n\t\t\t\t->select('program.program_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\t$searchActivities = [];\n\t\t\tforeach ($programs as $program) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t\t$activities = DB::table('program')\n\t\t\t\t\t->select('activity.logo', 'program.provider_id', DB::raw('program.name program_name'))\n\t\t\t\t\t->join('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t\t\t->leftjoin('activity_classification', 'activity.activity_classification_id', 'activity_classification.activity_classification_id')\n\t\t\t\t\t->where('program.program_id', $program->program_id)\n\t\t\t\t\t->whereRaw(\n\t\t\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\t\t\t\t\t\t('program.status = 0')\n\t\t\t\t\t)\n\t\t\t\t\t//->groupBy('activity.logo')\n\t\t\t\t\t->get();\n\n\t\t\t\tforeach ($activities as $activity) {\n\t\t\t\t\t//echo('<img src=\"' . $activity->logo . '\" style=\"width:2%;\" alt=\"' . $activity->program_name . '\" title=\"' . $activity->program_name . '\">');\n\t\t\t\t\t$searchActivity = [\n\t\t\t\t\t\t'logo' => $activity->logo,\n\t\t\t\t\t\t'name' => $activity->program_name,\n\t\t\t\t\t];\n\t\t\t\t\tarray_push($searchActivities, $searchActivity);\n\t\t\t\t}\n\t\t\t}\n\t\t\tarray_push($result, array('item' => $item, 'activity' => $searchActivities));\n\t\t}\n\n\t\t$final = array('totalPage' => ceil(sizeof($searchAll)/$limit), 'total' => ( sizeof($searchAll) > 0 ? sizeof($searchAll) : 0), 'result' => $result, 'debug' => DB::getQueryLog()[0]['query']);\n\t\treturn $final;\n\t}", "public function searchAction() {\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$this->view->model = $this->_getParam('model');\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t\n\t\tif ($this->_request->isPost()) {\n\t\t\t$fields = array();\n\t\t\t$func \t= array();\n\t\t\t$query \t= array();\n\t\t\tforeach ($_POST['query'] as $key => $q) {\n\t\t\t\tif (isset($_POST['fields'][$key]) && !empty($_POST['fields'][$key])) {\n\t\t\t\t\t$fields[$key] = $_POST['fields'][$key];\n\t\t\t\t\t$func[$key] \t= $_POST['func'][$key];\n\t\t\t\t\t$query[$key] \t= $_POST['query'][$key];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data = array('fields' => $fields, 'func' => $func, 'query' => $query);\n\t\t\t$data = serialize($data);\n\t\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName, 'data' => $data));\n\t\t}\n\t}", "public function all()\n {\n return $this->model->get();\n }", "public function master_search() {\r\n $this->db->join(\r\n '__Vehicles', \r\n '__Vehicles.__ContactId = ' . $this->table_name. '.' . $this->contactId_fieldname ,\r\n 'left outer'\r\n ); \r\n return $this->get();\r\n }", "public function getList()\n {\n return $this->model->getList();\n }", "public function getItemsBy($params = false)\n {\n $query = $this->model->query();\n\n /*== RELATIONSHIPS ==*/\n if (in_array('*', $params->include)) {//If Request all relationships\n $query->with([]);\n } else {//Especific relationships\n $includeDefault = [];//Default relationships\n if (isset($params->include))//merge relations with default relationships\n $includeDefault = array_merge($includeDefault, $params->include);\n $query->with($includeDefault);//Add Relationships to query\n }\n\n /*== FILTERS ==*/\n if (isset($params->filter)) {\n $filter = $params->filter;//Short filter\n\n //Filter by date\n if (isset($filter->date)) {\n $date = $filter->date;//Short filter date\n $date->field = $date->field ?? 'created_at';\n if (isset($date->from))//From a date\n $query->whereDate($date->field, '>=', $date->from);\n if (isset($date->to))//to a date\n $query->whereDate($date->field, '<=', $date->to);\n }\n\n //Order by\n if (isset($filter->order)) {\n $orderByField = $filter->order->field ?? 'position';//Default field\n $orderWay = $filter->order->way ?? 'desc';//Default way\n $query->orderBy($orderByField, $orderWay);//Add order to query\n }\n\n // Filter By Menu\n if (isset($filter->menu)) {\n $query->where('menu_id', $filter->menu);\n }\n\n //add filter by search\n if (isset($filter->search)) {\n //find search in columns\n $query->where(function ($query) use ($filter) {\n $query->whereHas('translations', function ($query) use ($filter) {\n $query->where('locale', $filter->locale)\n ->where('title', 'like', '%' . $filter->search . '%');\n })->orWhere('id', 'like', '%' . $filter->search . '%')\n ->orWhere('updated_at', 'like', '%' . $filter->search . '%')\n ->orWhere('created_at', 'like', '%' . $filter->search . '%');\n });\n }\n\n }\n\n /*== FIELDS ==*/\n if (isset($params->fields) && count($params->fields))\n $query->select($params->fields);\n\n /*== REQUEST ==*/\n if (isset($params->page) && $params->page) {\n return $query->paginate($params->take);\n } else {\n $params->take ? $query->take($params->take) : false;//Take\n return $query->get();\n }\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function findBy(array $filters);", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('brand',$this->brand,true);\n\t\t$criteria->compare('status',$this->status,true);\n\t\t$criteria->compare('width',$this->width);\n\t\t$criteria->compare('height',$this->height);\n\t\t$criteria->compare('goods_thumb',$this->goods_thumb,true);\n\t\t$criteria->compare('goods_img',$this->goods_img,true);\n\t\t$criteria->compare('model_search',$this->model_search,true);\n\t\t$criteria->compare('brand_search',$this->brand_search,true);\n\t\t$criteria->compare('brand2',$this->brand2,true);\n\t\t$criteria->compare('brand2_search',$this->brand2_search,true);\n\t\t$criteria->compare('brand3',$this->brand3,true);\n\t\t$criteria->compare('brand3_search',$this->brand3_search,true);\n\t\t$criteria->compare('brand4',$this->brand4,true);\n\t\t$criteria->compare('brand4_search',$this->brand4_search,true);\n\t\t$criteria->compare('model2',$this->model2,true);\n\t\t$criteria->compare('model2_search',$this->model2_search,true);\n\t\t$criteria->compare('model3',$this->model3,true);\n\t\t$criteria->compare('model3_search',$this->model3_search,true);\n\t\t$criteria->compare('model4',$this->model4,true);\n\t\t$criteria->compare('model4_search',$this->model4_search,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getList($params = [])\n {\n $model = $this->prepareModel();\n return $model::all();\n }", "abstract protected function getSearchModelName(): string;", "public function getItemsCriteria() {}", "public function getItemsCriteria() {}", "public function getFilters();", "public static function getList(array $filters){\n return self::model()->findAllByAttributes($filters);\n }", "public function getSearch();", "public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('url', $this->url);\n $criteria->compare('type', $this->type);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 100),\n ));\n }", "public function actionList() {\n switch ($_GET['model']) {\n case 'Product':\n $models = Product::model()->findAll();\n break;\n case 'Vendor':\n $models = Vendor::model()->findAll();\n break;\n case 'FavoriteProduct':\n $models = FavoriteProduct::model()->findAll();\n break;\n case 'Order':\n $models = Order::model()->findAll();\n break;\n case 'Rating':\n $models = Rating::model()->findAll();\n break;\n case 'Review':\n $models = Review::model()->findAll();\n break;\n case 'UserAddress':\n $models = UserAddress::model()->findAll();\n break;\n case 'OrderDetail':\n $models = OrderDetail::model()->findAll();\n break;\n default:\n $this->_sendResponse(0, 'You have pass invalid modal name');\n Yii::app()->end();\n }\n // Did we get some results?\n if (empty($models)) {\n // No\n $this->_sendResponse(0, 'No Record found ');\n } else {\n // Prepare response\n $rows = array();\n $i = 0;\n foreach ($models as $model) {\n $rows[] = $model->attributes;\n if ($_GET['model'] == 'Order') {\n $rows[$i]['cart_items'] = Product::model()->getProducts($model->product_id);\n $rows[$i]['order_detail'] = OrderDetail::model()->findAll(array('condition' => 'order_id ='.$model->id));\n }\n $i = $i + 1;\n }\n // Send the response\n $this->_sendResponse(1, '', $rows);\n }\n }", "static public function filterData($model_name)\n {\n $query = \"{$model_name}Query\";\n $objects = $query::create()->find();\n \n if ($objects != null) {\n\n $array = array();\n foreach ($objects as $object) {\n $array[$object->getId()] = $object->__toString();\n }\n\n return $array;\n } else {\n return array();\n }\n }", "public static function getList(string $filter='')\n {\n $query = self::with(['product','insuredPerson','agency'])->whereNotNull('n_OwnerId_FK');\n\n $filterArray = json_decode(request('filter'));\n\n if (is_object($filterArray)) {\n foreach($filterArray as $key=>$value) {\n if (empty($value)) {\n continue;\n }\n if (is_array($value)) {\n $query->whereIn($key, $value);\n continue;\n }\n $query->where($key, 'like', \"%$value%\");\n }\n }\n return $query;\n }", "public function getCriteria();", "public static function getSearchable()\n {\n return [\n 'columns' => [],\n 'joins' => [\n \n ]\n ];\n }", "static function filter($model) {\n $cond = Session::get('filter', strtolower($model->source));\n $param = array(\n /* Relaciones */\n 'rel' => array(\n '=' => 'Igual',\n 'LIKE' => 'Parecido',\n '<>' => 'Diferente',\n '<' => 'Menor',\n '>' => 'Mayor'\n ),\n 'col' => array_diff($model->fields, $model->_at, $model->_in, $model->primary_key),\n 'model' => $model,\n 'cond' => $cond\n );\n ob_start();\n View::partial('backend/filter', false, $param);\n return ob_get_clean();\n }", "public function findByModelName($model_name);", "abstract public function getFieldsSearchable();", "function _get_by_related($model, $arguments = array())\r\n\t{\r\n\t\tif ( ! empty($model))\r\n\t\t{\r\n\t\t\t// Add model to start of arguments\r\n\t\t\t$arguments = array_merge(array($model), $arguments);\r\n\t\t}\r\n\r\n\t\t$this->_related('where', $arguments);\r\n\r\n\t\treturn $this->get();\r\n\t}", "public static function getModels()\n\t{\n\t\t$result = [];\n\t\t$path = __DIR__ . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR;\n\t\t$Iterator = new RecursiveDirectoryIterator($path);\n\t\t$objects = new RecursiveIteratorIterator($Iterator, RecursiveIteratorIterator::SELF_FIRST);\n\t\tforeach ($objects as $name => $object)\n\t\t{\n\t\t\tif (strtolower(substr($name, -4) != '.php'))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$name = strtolower(str_replace($path, '', substr($name, 0, strlen($name) - 4)));\n\t\t\t$name = str_replace(DIRECTORY_SEPARATOR, '\\\\', $name);\n\t\t\t$name = 'Model\\\\' . ucwords($name, '\\\\');\n\t\t\tif (class_exists($name))\n\t\t\t{\n\t\t\t\t$result[]= $name;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function autocomplete_search() {\n\tif (!empty($this->request->query['term'])) {\n\t $model = Inflector::camelize(Inflector::singularize($this->request->params['controller']));\n\t $my_models = $this->$model->find('all', array(\n\t\t 'conditions' => array($model . '.name LIKE' => $this->request->query['term'] . '%'),\n\t\t 'limit' => 10,\n\t\t 'contain' => false,\n\t\t\t ));\n\t $json_array = array();\n\t foreach ($my_models as $my_model) {\n\t\t$json_array[] = $my_model[$model];\n\t }\n\t $json_str = json_encode($json_array);\n\t $this->autoRender = false;\n\t return $json_str;\n\t}\n }", "public function getListQuery();", "public function search($model, $request)\n {\n $search = filter_var($request->get('search'), FILTER_SANITIZE_STRING);\n\n // Get optional filters\n // FILTER: GEOLOCATION\n if($request->input('location')) {\n $location = filter_var($request->get('location'), FILTER_SANITIZE_STRING);\n }\n if($request->input('geo_lat')) {\n $geo_lat = filter_var($request->get('geo_lat'), FILTER_SANITIZE_STRING);\n $geo_lng = filter_var($request->get('geo_lng'), FILTER_SANITIZE_STRING);\n }\n\n /**\n * Get current page number for location manual Pagination\n */\n $page = $request->get('page') ? $request->get('page') : 1;\n\n\n // Location first, since it's a special query\n if(isset($geo_lat) && isset($geo_lng)) {\n \n $location_data = Posts::location($geo_lat, $geo_lng, $search, 25, 100); \n\n // Hard and dirty search function through collection\n // since search with location method doesn't work still\n if($search !== '') {\n $location_data = $location_data->filter(function ($item) use ($search) {\n return stripos($item->name, $search) !== false;\n });\n }\n\n // Paginate results because location method can't\n $paginate = new Paginate;\n return $paginate->paginate($location_data, 15, $page, [\n 'path' => '/search/'\n ]);\n\n } \n // Section selection handler (brands/shops/prods/strains)\n elseif($search)\n {\n return $model->where('name', 'like', \"%$search%\");\n }\n\n }", "public function getWorkFlowModels()\n {\n return $this->postRequest('GetWorkFlowModels');\n }", "public function getList()\n {\n $filter = $this->getEvent()->getRouteMatch()->getParam('filter', null);\n return $this->getService()\n ->getList($filter);\n }", "private function _getAllModels(): array {\n\t\t$models = Array();\n\t\t$folder = Environment::$dirs->models;\n\t\t$files = array_diff(scandir($folder), array('.', '..'));\n\t\tforeach ($files as $fileName) {\n\t\t\tinclude_once($folder.DIRECTORY_SEPARATOR.$fileName);\n\t\t\t$className = basename($fileName, \".php\");\n\t\t\t$classNameNamespaced = \"\\\\Jeff\\\\Api\\\\Models\\\\\" . ucfirst($className);\n\t\t\t$model = new $classNameNamespaced($this->db, $this->account);\n\t\t\t$models[$model->modelNamePlural] = $model;\n\t\t}\n\t\treturn $models;\n\t}", "function getAll(){\n\n\t\t\t$this->db->order_by(\"status\", \"asc\");\n\t\t\t$query = $this->db->get_where($this->table);\n\t\t\treturn $query;\n\t\t}", "public function actionViewModelList($modelName)\n\t{\n\t\t$pageSize = BaseModel::PAGE_SIZE;\n\t\tif ($_POST[\"sortBy\"]) {\n\t\t\t$order = $_POST[\"sortBy\"];\n\t\t}\n\t\t//echo $order;\n\t\t/*if (!$modelName) {\n\t\t\t\n\t\t}*/\n\t\t$sess_data = Yii::app()->session->get($modelName.'search');\n\t\t$searchId = $_GET[\"search_id\"];\n\t\t$fromSearchId = TriggerValues::model() -> decodeSearchId($searchId);\n\t\t//print_r($fromSearchId);\n\t\t//echo \"<br/>\";\n\t\t//Если задан $_POST/GET с формы, то сливаем его с массивом из searchId с приоритетом у searchId\n\t\tif ($_POST[$modelName.'SearchForm'])\n\t\t{\n\t\t\t$fromPage = array_merge($_POST[$modelName.'SearchForm'], $fromSearchId);\n\t\t} else {\n\t\t\t//Если же он не задан, то все данные берем из searchId\n\t\t\t$fromPage = $fromSearchId;\n\t\t}\n\t\t//print_r($fromPage);\n\t\tif ((!$fromPage)&&(!$sess_data))\n\t\t{\n\t\t\t//Если никаких критереев не задано, то выдаем все модели.\n\t\t\t$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t} else {\n\t\t\tif ($_GET[\"clear\"]==1)\n\t\t\t{\n\t\t\t\t//Если критерии заданы, но мы хотим их сбросить, то снова выдаем все и обнуляем нужную сессию\n\t\t\t\tYii::app()->session->remove($modelName.'search');\n\t\t\t\t$page = 1;\n\t\t\t\t//was://$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromSearchId,$order);\n\t\t\t} else {\n\t\t\t\t//Если же заданы какие-то критерии, но не со страницы, то вместо них подаем данные из сессии\n\t\t\t\tif (!$fromPage)\n\t\t\t\t{\n\t\t\t\t\t$fromPage = $sess_data;\n\t\t\t\t\t//echo \"from session\";\n\t\t\t\t}\n\t\t\t\t//Адаптируем критерии под специализацию. Если для данной специализации нет какого-то критерия, а он где-то сохранен, то убираем его.\n\t\t\t\t$fromPage = Filters::model() -> FilterSearchCriteria($fromPage, $modelName);\n\t\t\t\t//Если критерии заданы и обнулять их не нужно, то запускаем поиск и сохраняем его критерии в сессию.\n\t\t\t\tYii::app()->session->add($modelName.'search',$fromPage);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromPage,$order);\n\t\t\t}\n\t\t}\n\t\t//делаем из массива объектов dataProvider\n $dataProvider = new CArrayDataProvider($searched['objects'],\n array( 'keyField' =>'id'\n ));\n\t\t$this -> layout = 'layoutNoForm';\n\t\t//Определяем страницу.\n\t\t$maxPage = ceil(count($searched['objects'])/$pageSize);\n\t\tif ($_GET[\"page\"]) {\n\t\t\t$_POST[\"page\"] = $_GET[\"page\"];\n\t\t}\n\t\t$page = $_POST[\"page\"] ? $_POST[\"page\"] : 1;\n\t\t$page = (($page >= 1)&&($page <= $maxPage)) ? $page : 1;\n\t\t$_POST[$modelName.'SearchForm'] = $fromPage;\n\t\t$this->render('show_list', array(\n\t\t\t'objects' => array_slice($searched['objects'],($page - 1) * $pageSize, $pageSize),\n\t\t\t'modelName' => $modelName,\n\t\t\t'filterForm' => $modelName::model() -> giveFilterForm($fromPage),\n\t\t\t'fromPage' => $fromPage,\n\t\t\t'description' => $searched['description'],\n\t\t\t'specialities' => Filters::model() -> giveSpecialities(),\n\t\t\t'page' => $page,\n\t\t\t'maxPage' => $maxPage,\n\t\t\t'total' => count($searched['objects'])\n\t\t));\n\t\t\n\t}", "public function search_through(Request $request)\n {\n $reports = Payment::query();\n\n if (!empty($request->query())) {\n foreach ($request->query() as $key => $value) {\n if ($key == 'date') {\n $reports->whereDate('created_at', '>=', $value);\n } else {\n $reports->where($key, $value);\n }\n }\n }\n\n return $reports->get();\n }", "public function models($query, array $options = [])\n {\n $hits = $this->run($query);\n list($models, $totalCount) = $this->search->config()->models($hits, $options);\n // Remember total number of results.\n $this->setCachedCount($query, $totalCount);\n\n return Collection::make($models);\n }", "public function index()\n {\n $this->repository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n return $this->repository->all();\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n \n $criteria->with=array('c','b');\n\t\t$criteria->compare('pid',$this->pid,true);\n\t\t$criteria->compare('t.cid',$this->cid,true);\n\t\t$criteria->compare('t.bid',$this->bid,true);\n\n $criteria->compare('c.classify_name',$this->classify,true);\n\t\t$criteria->compare('b.brand_name',$this->brand,true);\n \n $criteria->addCondition('model LIKE :i and model REGEXP :j');\n $criteria->params[':i'] = \"%\".$this->index_search.\"%\";\n $criteria->params[':j'] = \"^\".$this->index_search;\n\n \n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('package',$this->package,true);\n\t\t$criteria->compare('RoHS',$this->RoHS,true);\n\t\t$criteria->compare('datecode',$this->datecode,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('direction',$this->direction,true);\n $criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function queryset(){\n return $this->_get_queryset();\n }", "public function index(Request $request)\n {\n $keyword = $request->get('search');\n $perPage = $request->get('limit');\n $perPage = empty($perPage) ? 25 : $perPage;\n\n if (!empty($keyword)) {\n $filters = Filter::where('sl_gender', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_color', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_occasion', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_style', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_age', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_from', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_to', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_city_id', 'LIKE', \"%$keyword%\")\n ->orWhere('user_id', 'LIKE', \"%$keyword%\")\n ->paginate($perPage);\n } else {\n $filters = Filter::paginate($perPage);\n }\n\n return $filters;\n }", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getSearchCriterias()\n {\n return $this->_searchCriterias;\n }", "private function getSearchConditions()\n {\n $searchConditions = [];\n\n $userIds = $this->request->get('ids') ?? [];\n if ($userIds) {\n $searchConditions['id'] = $userIds;\n }\n\n $email = $this->request->get('email') ?? '';\n if ($email) {\n $searchConditions['email'] = $email;\n }\n\n return $searchConditions;\n }", "public function findAllAction();", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }", "function GetFilterList() {\n\t\tglobal $UserProfile;\n\n\t\t// Initialize\n\t\t$sFilterList = \"\";\n\t\t$sSavedFilterList = \"\";\n\n\t\t// Load server side filters\n\t\tif (EW_SEARCH_FILTER_OPTION == \"Server\" && isset($UserProfile))\n\t\t\t$sSavedFilterList = $UserProfile->GetSearchFilters(CurrentUserName(), \"fsolicitudlistsrch\");\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id->AdvancedSearch->ToJson(), \",\"); // Field id\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nombre_contacto->AdvancedSearch->ToJson(), \",\"); // Field nombre_contacto\n\t\t$sFilterList = ew_Concat($sFilterList, $this->name->AdvancedSearch->ToJson(), \",\"); // Field name\n\t\t$sFilterList = ew_Concat($sFilterList, $this->lastname->AdvancedSearch->ToJson(), \",\"); // Field lastname\n\t\t$sFilterList = ew_Concat($sFilterList, $this->_email->AdvancedSearch->ToJson(), \",\"); // Field email\n\t\t$sFilterList = ew_Concat($sFilterList, $this->address->AdvancedSearch->ToJson(), \",\"); // Field address\n\t\t$sFilterList = ew_Concat($sFilterList, $this->phone->AdvancedSearch->ToJson(), \",\"); // Field phone\n\t\t$sFilterList = ew_Concat($sFilterList, $this->cell->AdvancedSearch->ToJson(), \",\"); // Field cell\n\t\t$sFilterList = ew_Concat($sFilterList, $this->created_at->AdvancedSearch->ToJson(), \",\"); // Field created_at\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_sucursal->AdvancedSearch->ToJson(), \",\"); // Field id_sucursal\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoinmueble->AdvancedSearch->ToJson(), \",\"); // Field tipoinmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipovehiculo->AdvancedSearch->ToJson(), \",\"); // Field tipovehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomaquinaria->AdvancedSearch->ToJson(), \",\"); // Field tipomaquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomercaderia->AdvancedSearch->ToJson(), \",\"); // Field tipomercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->documento_mercaderia->AdvancedSearch->ToJson(), \",\"); // Field documento_mercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoespecial->AdvancedSearch->ToJson(), \",\"); // Field tipoespecial\n\t\t$sFilterList = ew_Concat($sFilterList, $this->email_contacto->AdvancedSearch->ToJson(), \",\"); // Field email_contacto\n\t\tif ($this->BasicSearch->Keyword <> \"\") {\n\t\t\t$sWrk = \"\\\"\" . EW_TABLE_BASIC_SEARCH . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Keyword) . \"\\\",\\\"\" . EW_TABLE_BASIC_SEARCH_TYPE . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Type) . \"\\\"\";\n\t\t\t$sFilterList = ew_Concat($sFilterList, $sWrk, \",\");\n\t\t}\n\t\t$sFilterList = preg_replace('/,$/', \"\", $sFilterList);\n\n\t\t// Return filter list in json\n\t\tif ($sFilterList <> \"\")\n\t\t\t$sFilterList = \"\\\"data\\\":{\" . $sFilterList . \"}\";\n\t\tif ($sSavedFilterList <> \"\") {\n\t\t\tif ($sFilterList <> \"\")\n\t\t\t\t$sFilterList .= \",\";\n\t\t\t$sFilterList .= \"\\\"filters\\\":\" . $sSavedFilterList;\n\t\t}\n\t\treturn ($sFilterList <> \"\") ? \"{\" . $sFilterList . \"}\" : \"null\";\n\t}", "public function search(Request $request)\n {\n if(!$request->has('query')) {\n return response()->json(['message' => 'Please type a keyword.']);\n }\n\n $userTenant = Auth::userTenant();\n $user = Auth::user();\n\n $searchableModelNameSpace = 'App\\\\Models\\\\';\n $result = [];\n // Loop through the searchable models.\n foreach (config('scout.searchableModels') as $model) {\n $modelClass = $searchableModelNameSpace.$model;\n $modelService = app($model.'Ser');\n\n if($model == 'Task') {\n $allowedModels = $modelService->searchForUserTenant($userTenant, $request->get('query'))->get();\n } else {\n $foundModels = $modelClass::search($request->get('query'))->get();\n if ($model === 'Comment') {\n $foundModels->where('groupId', '!=', null)->toArray();\n }\n $policy = app()->make('App\\Policies\\V2\\\\' . $model . 'Policy');\n $allowedModels = $foundModels->filter(function(BaseModel $foundModel) use($user, $policy) {\n return $policy->getAccess($user, $foundModel);\n });\n }\n\n $result[Str::lower($model) . 's'] = $allowedModels;\n }\n\n $responseData = ['message' => 'Keyword(s) matched!', 'results' => $result, 'pagination' => ['more' => false]];\n $responseHeader = Response::HTTP_OK;\n if (!count($result)) {\n $responseData = ['message' => 'No results found, please try with different keywords.'];\n $responseHeader = Response::HTTP_NOT_FOUND;\n }\n\n return response()->json($responseData, $responseHeader);\n }", "public function getAndFilter() {\n\t\treturn $this->db->getAndFilter();\n\t}" ]
[ "0.6745192", "0.6745192", "0.6607936", "0.6480248", "0.6380478", "0.6346251", "0.6309924", "0.6302481", "0.62549895", "0.62511677", "0.62511677", "0.6111791", "0.60769993", "0.60728127", "0.60465515", "0.60351735", "0.6033834", "0.601554", "0.5982608", "0.59806865", "0.5979308", "0.5970091", "0.59315383", "0.5928182", "0.59239197", "0.5891605", "0.588925", "0.5849558", "0.58478904", "0.58265656", "0.5818011", "0.5813345", "0.5808009", "0.5790819", "0.57766616", "0.57694167", "0.5765023", "0.57642305", "0.57522315", "0.5740738", "0.5738047", "0.5727545", "0.5724201", "0.5723084", "0.57225823", "0.5721401", "0.5718913", "0.5714439", "0.5712011", "0.5707315", "0.5694636", "0.5680138", "0.56711453", "0.5670484", "0.56703377", "0.56703377", "0.56703377", "0.5669673", "0.56673825", "0.56659126", "0.5656451", "0.5651109", "0.56498116", "0.564325", "0.5635642", "0.5633513", "0.56310356", "0.56235486", "0.56176996", "0.5612909", "0.560956", "0.5595046", "0.5579938", "0.557241", "0.5556209", "0.5550101", "0.55487776", "0.5547998", "0.5547349", "0.5535324", "0.5534813", "0.55342954", "0.55319065", "0.5525128", "0.55199116", "0.5518253", "0.55144674", "0.5509604", "0.55057275", "0.550087", "0.550019", "0.54966915", "0.54966915", "0.54966915", "0.54954666", "0.54937917", "0.5492664", "0.5492298", "0.5490264", "0.5489261", "0.54850507" ]
0.0
-1
Create a new controller instance.
public function __construct() { $this->middleware('auth', ['except' => ['welcome', 'index', 'botSkull', 'quemSomos']]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "public function AController() {\r\n\t}", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }" ]
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.6877748", "0.68702674", "0.68622285", "0.6839049", "0.6779292", "0.6703522", "0.66688496", "0.66600126", "0.6650373", "0.66436416", "0.6615505", "0.66144013", "0.6588728", "0.64483404", "0.64439476", "0.6429303", "0.6426485", "0.6303757", "0.6298291", "0.6293319", "0.62811387", "0.6258778", "0.62542456", "0.616827", "0.6162314", "0.61610043", "0.6139887", "0.613725", "0.61334985", "0.6132223", "0.6128982", "0.61092585", "0.6094611", "0.60889256", "0.6074893", "0.60660255", "0.6059098", "0.60565156", "0.6044235", "0.60288006", "0.6024102", "0.60225666", "0.6018304", "0.60134345", "0.60124683", "0.6010913", "0.6009284", "0.6001683", "0.5997471", "0.5997012", "0.59942573", "0.5985074", "0.5985074", "0.5985074", "0.5967613", "0.5952533", "0.5949068", "0.5942203", "0.5925731", "0.5914304", "0.5914013", "0.59119135", "0.5910308", "0.5910285", "0.59013796", "0.59003943", "0.5897524", "0.58964556", "0.58952993", "0.58918965", "0.5888943", "0.5875413", "0.5869938", "0.58627135", "0.58594996", "0.5853714", "0.5839484", "0.5832913", "0.582425", "0.58161044", "0.5815566" ]
0.0
-1
Show the application dashboard.
public function home(Request $request) { // activity() // ->withProperties(['ip' => $request->ip(), 'ua' => $request->header('User-Agent')]) // ->log('Café com pão'); $user = Auth::user(); // var_dump($user->id); return view('home'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }", "function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}", "public function showDashboard() { \n\t\n return View('admin.dashboard');\n\t\t\t\n }", "public function showDashboard()\n {\n return View::make('users.dashboard', [\n 'user' => Sentry::getUser(),\n ]);\n }", "public function dashboard()\n {\n return view('backend.dashboard.index');\n }", "public function index() {\n return view(\"admin.dashboard\");\n }", "public function dashboard()\n {\n return $this->renderContent(\n view('dashboard'),\n trans('sleeping_owl::lang.dashboard')\n );\n }", "public function dashboard(){\n return view('backend.admin.index');\n }", "public function showDashBoard()\n {\n \treturn view('Admins.AdminDashBoard');\n }", "public function dashboard()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('admin.dashboard', ['title' => 'Dashboard']);\n }", "public function dashboard() \r\n {\r\n return view('admin.index');\r\n }", "public function dashboard()\n\t{\n\t\t$page_title = 'organizer dashboard';\n\t\treturn View::make('organizer.dashboard',compact('page_title'));\n\t}", "public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }", "public function dashboard()\n {\n\n return view('admin.dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('adm.dashboard');\n }", "public function dashboard()\n {\n $users = \\App\\User::all()->count();\n $roles = \\Spatie\\Permission\\Models\\Role::all()->count();\n $permissions = \\Spatie\\Permission\\Models\\Permission::all()->count();\n $banner = \\App\\Banner::all();\n $categoria = \\App\\Categoria::all();\n $entidadOrganizativa = \\App\\Entidadorganizativa::all();\n $evento = \\App\\Evento::all();\n $fichero = \\App\\Fichero::all();\n $recurso = \\App\\Recurso::all();\n $redsocial = \\App\\Redsocial::all();\n $subcategoria = \\App\\Subcategoria::all();\n $tag = \\App\\Tag::all();\n\n $entities = \\Amranidev\\ScaffoldInterface\\Models\\Scaffoldinterface::all();\n\n return view('scaffold-interface.dashboard.dashboard',\n compact('users', 'roles', 'permissions', 'entities',\n 'banner', 'categoria', 'entidadOrganizativa',\n 'evento', 'fichero', 'recurso', 'redsocial', 'subcategoria', 'tag')\n );\n }", "public function show()\n {\n return view('dashboard');\n }", "public function index()\n\t{\n\t\treturn View::make('dashboard');\n\t}", "public function index() {\n return view('modules.home.dashboard');\n }", "public function show()\n {\n return view('dashboard.dashboard');\n \n }", "public function index()\n {\n return view('admin.dashboard.dashboard');\n\n }", "public function dashboard()\n { \n return view('jobposter.dashboard');\n }", "public function show()\n\t{\n\t\t//\n\t\t$apps = \\App\\application::all();\n\t\treturn view('applications.view', compact('apps'));\n\t}", "public function index()\n {\n return view('pages.admin.dashboard');\n }", "public function indexAction()\n {\n $dashboard = $this->getDashboard();\n\n return $this->render('ESNDashboardBundle::index.html.twig', array(\n 'title' => \"Dashboard\"\n ));\n }", "public function index()\n {\n //\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard.index');\n }", "public function dashboard()\n {\n return view('pages.backsite.dashboard');\n }", "public function index()\n {\n // return component view('dashboard.index');\n return view('layouts.admin_master');\n }", "public function index()\n {\n\n $no_of_apps = UploadApp::count();\n $no_of_analysis_done = UploadApp::where('isAnalyzed', '1')->count();\n $no_of_visible_apps = AnalysisResult::where('isVisible', '1')->count();\n\n return view('admin.dashboard', compact('no_of_apps', 'no_of_analysis_done', 'no_of_visible_apps'));\n }", "public function getDashboard() {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('smartcrud.auth.dashboard');\n }", "public function index()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n $this->global['pageTitle'] = 'Touba : Dashboard';\n \n $this->loadViews(\"dashboard\", $this->global, NULL , NULL);\n }", "public function dashboard() {\n $data = ['title' => 'Dashboard'];\n return view('pages.admin.dashboard', $data)->with([\n 'users' => $this->users,\n 'num_services' => Service::count(),\n 'num_products' => Product::count(),\n ]);\n }", "public function index()\n {\n return view('board.pages.dashboard-board');\n }", "public function index()\n {\n return view('admin::settings.development.dashboard');\n }", "public function index()\n {\n return view('dashboard.dashboard');\n }", "public function show()\n {\n return view('dashboard::show');\n }", "public function adminDash()\n {\n return Inertia::render(\n 'Admin/AdminDashboard', \n [\n 'data' => ['judul' => 'Halaman Admin']\n ]\n );\n }", "public function dashboard()\n {\n return view('Admin.dashboard');\n }", "public function show()\n {\n return view('admins\\auth\\dashboard');\n }", "public function index()\n {\n // Report =============\n\n return view('Admin.dashboard');\n }", "public function index()\n {\n return view('bitaac::account.dashboard');\n }", "public function index()\n { \n return view('admin-views.dashboard');\n }", "public function getDashboard()\n {\n return view('dashboard');\n }", "function showDashboard()\n { \n $logeado = $this->checkCredentials();\n if ($logeado==true)\n $this->view->ShowDashboard();\n else\n $this->view->showLogin();\n }", "public function index()\n { \n $params['crumbs'] = 'Home';\n $params['active'] = 'home';\n \n return view('admin.dashboard.index', $params);\n }", "public function index()\n\t{\n\t\treturn view::make('customer_panel.dashboard');\n\t}", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index() {\n // return view('home');\n return view('admin-layouts.dashboard.dashboard');\n }", "public function index()\r\n {\r\n return view('user.dashboard');\r\n }", "public function index() {\n return view('dashboard', []);\n }", "public function index()\n {\n //\n return view('dashboard.dashadmin', ['page' => 'mapel']);\n }", "public function index()\n {\n return view('back-end.dashboard.index');\n //\n }", "public function index()\n\t{\n\t\t\n\t\t$data = array(\n\t\t\t'title' => 'Administrator Apps With Laravel',\n\t\t);\n\n\t\treturn View::make('panel/index',$data);\n\t}", "public function index() {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('page.dashboard.index');\n }", "public function index()\n {\n\n return view('dashboard');\n }", "public function dashboardview() {\n \n $this->load->model('Getter');\n $data['dashboard_content'] = $this->Getter->get_dash_content();\n \n $this->load->view('dashboardView', $data);\n\n }", "public function index()\n {\n $this->authorize(DashboardPolicy::PERMISSION_STATS);\n\n $this->setTitle($title = trans('auth::dashboard.titles.statistics'));\n $this->addBreadcrumb($title);\n\n return $this->view('admin.dashboard');\n }", "public function action_index()\r\n\t{\t\t\t\t\r\n\t\t$this->template->title = \"Dashboard\";\r\n\t\t$this->template->content = View::forge('admin/dashboard');\r\n\t}", "public function index()\n {\n $info = SiteInfo::limit(1)->first();\n return view('backend.info.dashboard',compact('info'));\n }", "public function display()\n\t{\n\t\t// Set a default view if none exists.\n\t\tif (!JRequest::getCmd( 'view' ) ) {\n\t\t\tJRequest::setVar( 'view', 'dashboard' );\n\t\t}\n\n\t\tparent::display();\n\t}", "public function index()\n {\n $news = News::all();\n $posts = Post::all();\n $events = Event::all();\n $resources = Resources::all();\n $admin = Admin::orderBy('id', 'desc')->get();\n return view('Backend/dashboard', compact('admin', 'news', 'posts', 'events', 'resources'));\n }", "public function index()\n {\n\n return view('superAdmin.adminDashboard')->with('admin',Admininfo::all());\n\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n $this->template->set('title', 'Dashboard');\n $this->template->load('admin', 'contents' , 'admin/dashboard/index', array());\n }", "public function index()\n {\n return view('/dashboard');\n }", "public function index()\n {\n \treturn view('dashboard');\n }", "public function index()\n {\n return view('ketua.ketua-dashboard');\n }", "public function index(){\n return View::make('admin.authenticated.dashboardview');\n }", "public function admAmwDashboard()\n {\n return View::make('admission::amw.admission_test.dashboard');\n }", "public function index()\n {\n return view('adminpanel.home');\n }", "public function dashboard()\n\t{\n\t\t$this->validation_access();\n\t\t\n\t\t$this->load->view('user_dashboard/templates/header');\n\t\t$this->load->view('user_dashboard/index.php');\n\t\t$this->load->view('user_dashboard/templates/footer');\n\t}", "public function index()\n {\n return view('dashboard.home');\n }", "public function index()\n {\n $admins = $this->adminServ->all();\n $adminRoles = $this->adminTypeServ->all();\n return view('admin.administrators.dashboard', compact('admins', 'adminRoles'));\n }", "public function index()\n {\n if (ajaxCall::ajax()) {return response()->json($this -> dashboard);}\n //return response()->json($this -> dashboard);\n JavaScript::put($this -> dashboard);\n return view('app')-> with('header' , $this -> dashboard['header']);\n //return view('home');\n }", "public function index()\n {\n $userinfo=User::all();\n $gateinfo=GateEntry::all();\n $yarninfo=YarnStore::all();\n $greyinfo=GreyFabric::all();\n $finishinfo=FinishFabric::all();\n $dyesinfo=DyeChemical::all();\n return view('dashboard',compact('userinfo','gateinfo','yarninfo','greyinfo','finishinfo','dyesinfo'));\n }", "public function actionDashboard(){\n \t$dados_dashboard = Yii::app()->user->getState('dados_dashbord_final');\n \t$this->render ( 'dashboard', $dados_dashboard);\n }", "public function index()\n {\n $user = new User();\n $book = new Book();\n return view('admin.dashboard', compact('user', 'book'));\n }", "public function dashboard() {\n if (!Auth::check()) { // Check is user logged in\n // redirect to dashboard\n return Redirect::to('login');\n }\n\n $user = Auth::user();\n return view('site.dashboard', compact('user'));\n }", "public function dashboard()\n {\n $users = User::all();\n return view('/dashboard', compact('users'));\n }", "public function index()\n {\n $lineChart = $this->getLineChart();\n $barChart = $this->getBarChart();\n $pieChart = $this->getPieChart();\n\n return view('admin.dashboard.index', compact(['lineChart', 'barChart', 'pieChart']));\n }" ]
[ "0.77850926", "0.7760142", "0.7561336", "0.75147176", "0.74653697", "0.7464913", "0.73652893", "0.7351646", "0.7346477", "0.73420244", "0.7326711", "0.7316215", "0.73072463", "0.7287626", "0.72826403", "0.727347", "0.727347", "0.727347", "0.727347", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7241342", "0.7236133", "0.7235562", "0.7218318", "0.71989936", "0.7197427", "0.71913266", "0.71790016", "0.71684825", "0.71577966", "0.7146797", "0.7133428", "0.7132746", "0.71298903", "0.71249074", "0.71218014", "0.71170413", "0.7110151", "0.7109032", "0.7107029", "0.70974076", "0.708061", "0.7075653", "0.70751685", "0.7064041", "0.70550334", "0.7053102", "0.7051273", "0.70484304", "0.7043605", "0.70393986", "0.70197886", "0.70185125", "0.70139873", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.6992477", "0.6979631", "0.69741416", "0.69741327", "0.6968815", "0.6968294", "0.69677526", "0.69652885", "0.69586027", "0.6944985", "0.69432825", "0.69419175", "0.6941512", "0.6941439", "0.6938837", "0.6937524", "0.6937456", "0.6937456", "0.69276494", "0.6921651", "0.69074917", "0.69020325", "0.6882262", "0.6869339", "0.6867868", "0.68557185", "0.68479055", "0.684518", "0.68408877", "0.6838798", "0.6833479", "0.6832326", "0.68309164", "0.6826798", "0.6812457" ]
0.0
-1
Create the event listener.
public function __construct() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addRequestCreateListener($listener);", "public function onEvent();", "private function init_event_listeners() {\n\t\t// add_action('wp_ajax_example_action', [$this, 'example_function']);\n\t}", "public function listener(Listener $listener);", "protected function setupListeners()\n {\n //\n }", "function eventRegister($eventName, EventListener $listener);", "public function listen($event, $listener);", "private function createStreamCallback()\n {\n $read =& $this->readListeners;\n $write =& $this->writeListeners;\n $this->streamCallback = function ($stream, $flags) use(&$read, &$write) {\n $key = (int) $stream;\n if (\\EV_READ === (\\EV_READ & $flags) && isset($read[$key])) {\n \\call_user_func($read[$key], $stream);\n }\n if (\\EV_WRITE === (\\EV_WRITE & $flags) && isset($write[$key])) {\n \\call_user_func($write[$key], $stream);\n }\n };\n }", "public function addEventListener(string $eventClass, callable $listener, int $priority = 0): EnvironmentBuilderInterface;", "public function setupEventListeners()\r\n\t{\r\n\t\t$blueprints = craft()->courier_blueprints->getAllBlueprints();\r\n\t\t$availableEvents = $this->getAvailableEvents();\r\n\r\n\t\t// Setup event listeners for each blueprint\r\n\t\tforeach ($blueprints as $blueprint) {\r\n\t\t\tif (!$blueprint->eventTriggers) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tforeach ($blueprint->eventTriggers as $event) {\r\n\t\t\t\t// Is event currently enabled?\r\n\t\t\t\tif (!isset($availableEvents[$event])) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tcraft()->on($event, function(Event $event) use ($blueprint) {\r\n\t\t\t\t\tcraft()->courier_blueprints->checkEventConditions($event, $blueprint);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// On the event that an email is sent, create a successful delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailSent', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery'\r\n\t\t]);\r\n\r\n\t\t// On the event that an email fails to send, create a failed delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailFailed', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery',\r\n\t\t]);\r\n\t}", "protected function registerListeners()\n {\n }", "public function listen($listener);", "public function listenForEvents()\n {\n Event::listen(DummyEvent::class, DummyListener::class);\n\n event(new DummyEvent);\n }", "public function createEvent()\n {\n return new Event();\n }", "public function attachEvents();", "public function attachEvents();", "public function add_event_handler($event, $callback);", "function addListener(EventListener $listener): void;", "public static function initListeners() {\n\t\t\n\t\tif(GO::modules()->isInstalled('files') && class_exists('\\GO\\Files\\Controller\\FolderController')){\n\t\t\t$folderController = new \\GO\\Files\\Controller\\FolderController();\n\t\t\t$folderController->addListener('checkmodelfolder', \"GO\\Projects2\\Projects2Module\", \"createParentFolders\");\n\t\t}\n\t\t\n\t\t\\GO\\Base\\Model\\User::model()->addListener('delete', \"GO\\Projects2\\Projects2Module\", \"deleteUser\");\n\n\t}", "public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }", "private static function event()\n {\n $files = ['Event', 'EventListener'];\n $folder = static::$root.'Event'.'/';\n\n self::call($files, $folder);\n\n $files = ['ManyListenersArgumentsException'];\n $folder = static::$root.'Event/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "public function addEventListener($event, $callable){\r\n $this->events[$event] = $callable;\r\n }", "public function testEventCallBackCreate()\n {\n }", "public function listeners($event);", "public function addListener($event, $listener, $priority = 0);", "public function on($name, $listener, $data = null, $priority = null, $acceptedArgs = null);", "public function createWatcher();", "public function __construct()\n\t{\n\t\t$this->delegate = Delegate_1::fromMethod($this, 'onEvent');\n\t}", "public function init_listeners( $callable ) {\n\t}", "public static function events();", "public static function __events () {\n \n }", "public function onEventAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public function addApplicationBuilderListener( \n MyFusesApplicationBuilderListener $listener );", "public function addListener($eventName, $listener, $priority = 0);", "public function __construct(){\n\n\t\t\t$this->listen();\n\n\t\t}", "protected function registerListeners()\n {\n // Login event listener\n #Event::listen('auth.login', function($user) {\n //\n #});\n\n // Logout event subscriber\n #Event::subscribe('Mrcore\\Parser\\Listeners\\MyEventSubscription');\n }", "public function __construct()\n {\n// global $callback;\n // $this->eventsArr = $eventsArr;\n $this->callback = function () {\n\n // echo \"event: message\\n\"; // for onmessage listener\n echo \"event: ping\\n\";\n $curDate = date(DATE_ISO8601);\n echo 'data: {\"time\": \"' . $curDate . '\"}';\n echo \"\\n\\n\";\n\n while (($event = ServerSentEvents::popEvent()) != null) {\n $m = json_encode($event->contents);\n echo \"event: $event->event\\n\";\n echo \"data: $m\";\n echo \"\\n\\n\";\n }\n // echo \"event: message\\n\";\n // $curDate = date(DATE_ISO8601);\n // echo 'data: {\"message-time\": \"' . $curDate . '\"}';\n // echo \"\\n\\n\";\n // while(true){\n // if ($index != $this->eventsCounter){\n // ServerSentEvents::sendEvent($this->event, $this->eventBody);\n // $index = $this->eventsCounter;\n // }\n\n // sleep(1);\n // }\n };\n\n $this->setupResponse();\n }", "private function createMyEvents()\n {\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Frontend_Checkout',\n 'onPostDispatchCheckoutSecure'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_Checkout_PreRedirect',\n 'onPreRedirectToPayPal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch_Frontend_PaymentPaypal',\n 'onPreDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_Webhook',\n 'onPaymentPaypalWebhook'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_PlusRedirect',\n 'onPaymentPaypalPlusRedirect'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Frontend_Account',\n 'onPostDispatchAccount'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Javascript',\n 'onCollectJavascript'\n );\n $this->subscribeEvent(\n 'Shopware_Components_Document::assignValues::after',\n 'onBeforeRenderDocument'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Backend_Config',\n 'onPostDispatchConfig'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_Order',\n 'onPostDispatchOrder'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_PaymentPaypal',\n 'onPostDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Less',\n 'addLessFiles'\n );\n $this->subscribeEvent(\n 'Enlight_Bootstrap_InitResource_paypal_plus.rest_client',\n 'onInitRestClient'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Dispatcher_ControllerPath_Api_PaypalPaymentInstruction',\n 'onGetPaymentInstructionsApiController'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Front_StartDispatch',\n 'onEnlightControllerFrontStartDispatch'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch',\n 'onPreDispatchSecure'\n );\n }", "public static function creating(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATING, $listener, $priority);\n }", "public function listen();", "public function listen() {\n $this->source->listen($this->id);\n }", "public function addEventListener($event, $callback, $weight = null);", "public function testAddListener()\n {\n // Arrange\n $listenerCalled = false;\n $communicator = new Communicator();\n\n // Act\n $communicator->addListener(function () use (&$listenerCalled) {\n $listenerCalled = true;\n });\n\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertTrue($listenerCalled);\n }", "public function addListener($name, $listener, $priority = 0);", "public static function created(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATED, $listener, $priority);\n }", "public function on($event, $callback){ }", "public function appendListenerForEvent(string $eventType, callable $listener): callable;", "public function initEventLogger()\n {\n $dispatcher = static::getEventDispatcher();\n\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "protected function getCron_EventListenerService()\n {\n return $this->services['cron.event_listener'] = new \\phpbb\\cron\\event\\cron_runner_listener(${($_ = isset($this->services['cron.lock_db']) ? $this->services['cron.lock_db'] : $this->getCron_LockDbService()) && false ?: '_'}, ${($_ = isset($this->services['cron.manager']) ? $this->services['cron.manager'] : $this->getCron_ManagerService()) && false ?: '_'}, ${($_ = isset($this->services['request']) ? $this->services['request'] : ($this->services['request'] = new \\phpbb\\request\\request(NULL, true))) && false ?: '_'});\n }", "public function getListener(/* ... */)\n {\n return $this->_listener;\n }", "protected function _listener($name) {\n\t\treturn $this->_crud()->listener($name);\n\t}", "private function listeners()\n {\n foreach ($this['config']['listeners'] as $eventName => $classService) {\n $this['dispatcher']->addListener($classService::NAME, [new $classService($this), 'dispatch']);\n }\n }", "public function initializeListeners()\n {\n $this->eventsEnabled = false;\n $this->setPreloads();\n $this->setEvents();\n $this->eventsEnabled = true;\n }", "protected function listenForEvents()\n {\n $callback = function ($event) {\n foreach ($this->logWriters as $writer) {\n $writer->log($event);\n }\n };\n\n $this->events->listen(JobProcessing::class, $callback);\n $this->events->listen(JobProcessed::class, $callback);\n $this->events->listen(JobFailed::class, $callback);\n $this->events->listen(JobExceptionOccurred::class, $callback);\n }", "protected function registerListeners()\n {\n $this->container['listener.server'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\ServerListener($c['filesystem'], $c['generator.server']);\n });\n\n $this->container['listener.gateway'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\GatewayListener($c['filesystem'], $c['generator.gateway']);\n });\n }", "public function listeners($eventName);", "public static function create()\n {\n list(\n $message,\n $callbackService,\n $callbackMethod,\n $callbackParams\n ) = array_pad( func_get_args(), 4, null);\n\n static::addToEventQueue( array(\n 'type' => \"alert\",\n 'properties' => array(\n 'message' => $message\n ),\n 'service' => $callbackService,\n 'method' => $callbackMethod,\n 'params' => $callbackParams ?? []\n ));\n }", "public function requestCreateEvent()\n {\n $ch = self::curlIni('event_new', $this->eventParams);\n\n return $ch;\n }", "function __construct()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}", "public function __construct()\n {\n Hook::listen(__CLASS__);\n }", "function add_listener($hook, $function_name){\n\t\tglobal $listeners;\n\n\t\t$listeners[$hook][] = $function_name;\n\t}", "public function __construct()\n {\n $this->events = new EventDispatcher();\n }", "protected function initEventLogger(): void\n {\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $this->dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "public function listen($events, $listener = null): void;", "public function onCreate($callback)\n {\n $this->listeners[] = $callback;\n return $this;\n }", "public static function listen() {\n $projectId = \"sunday-1601040613995\";\n\n # Instantiates a client\n $pubsub = new PubSubClient([\n 'projectId' => $projectId\n ]);\n\n # The name for the new topic\n $topicName = 'gmail';\n\n # Creates the new topic\n $topic = $pubsub->createTopic($topicName);\n\n echo 'Topic ' . $topic->name() . ' created.';\n }", "protected function registerEventListeners()\n {\n Event::listen(Started::class, function (Started $event) {\n $this->progress = $this->output->createProgressBar($event->objects->count());\n });\n\n Event::listen(Imported::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(ImportFailed::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(DeletedMissing::class, function (DeletedMissing $event) {\n $event->deleted->isEmpty()\n ? $this->info(\"\\n No missing users found. None have been soft-deleted.\")\n : $this->info(\"\\n Successfully soft-deleted [{$event->deleted->count()}] users.\");\n });\n\n Event::listen(Completed::class, function (Completed $event) {\n if ($this->progress) {\n $this->progress->finish();\n }\n });\n }", "public function addBeforeCreateListener(IBeforeCreateListener $listener)\n {\n $this->_lifecyclers[BeanLifecycle::BeforeCreate][] = $listener;\n }", "protected function registerInputEvents() {\n\t\t$this->getEventLoop()->addEventListener('HANG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->offHook = (bool)$event['value'];\n\n\t\t\t// Trigger specific events for receiver up and down states\n\t\t\t$eventName = $this->isOffHook() ? 'RECEIVER_UP' : 'RECEIVER_DOWN';\n\t\t\t$this->fireEvents($eventName, $event);\n\t\t});\n\n\t\t$this->getEventLoop()->addEventListener('TRIG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->dialling = (bool)$event['value'];\n\t\t});\n\n\t\t// Proxy registration for all EventLoop events to pass them back up to our own listeners\n\t\t$this->getEventLoop()->addEventListener(true, function ($event, $type) {\n\t\t\t// Fire event to our own listeners\n\t\t\t$this->fireEvents($type, $event);\n\t\t});\n\t}", "public static function creating($callback)\n {\n self::listenEvent('creating', $callback);\n }", "public function attach(string $event, callable $listener, int $priority = 0): void;", "public function __construct()\n {\n $this->listnerCode = config('settings.listener_code.DeletingVoucherEventListener');\n }", "protected function registerEventListener()\n {\n $subscriber = $this->getConfig()->get('audit-trail.subscriber', AuditTrailEventSubscriber::class);\n $this->getDispatcher()->subscribe($subscriber);\n }", "function listenTo(string $eventName, callable $callback)\n {\n EventManager::register($eventName, $callback);\n }", "public function attach($identifier, $event, callable $listener, $priority = 1)\n {\n }", "public function testRegisiterListenerMethodAddsAListener()\n\t{\n\t\t$instance = new Dispatcher();\n\n\t\t$instance->register_listener('some_event', 'my_function');\n\n\t\t$this->assertSame(array('some_event' => array('my_function')), $instance->listeners);\n\t\t$this->assertAttributeSame(array('some_event' => array('my_function')), 'listeners', $instance);\n\t}", "protected function getPhpbb_Viglink_ListenerService()\n {\n return $this->services['phpbb.viglink.listener'] = new \\phpbb\\viglink\\event\\listener(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['template']) ? $this->services['template'] : $this->getTemplateService()) && false ?: '_'});\n }", "public static function create($className, array &$extraTabs, $selectedTabId)\r\n {\r\n $createClass = XenForo_Application::resolveDynamicClass($className, 'listener_th');\r\n if (!$createClass) {\r\n throw new XenForo_Exception(\"Invalid listener '$className' specified\");\r\n }\r\n \r\n return new $createClass($extraTabs, $selectedTabId);\r\n }", "function listen($listener)\n{\n return XPSPL::instance()->listen($listener);\n}", "function getEventListeners()\n {\n $listeners = array();\n \n $listener = new Listener($this);\n \n $listeners[] = array(\n 'event' => RoutesCompile::EVENT_NAME,\n 'listener' => array($listener, 'onRoutesCompile')\n );\n\n $listeners[] = array(\n 'event' => GetAuthenticationPlugins::EVENT_NAME,\n 'listener' => array($listener, 'onGetAuthenticationPlugins')\n );\n\n return $listeners;\n }", "protected static function loadListeners() {\n\t\t\n\t\t// default var\n\t\t$configDir = Config::getOption(\"configDir\");\n\t\t\n\t\t// make sure the listener data exists\n\t\tif (file_exists($configDir.\"/listeners.json\")) {\n\t\t\t\n\t\t\t// get listener list data\n\t\t\t$listenerList = json_decode(file_get_contents($configDir.\"/listeners.json\"), true);\n\t\t\t\n\t\t\t// get the listener info\n\t\t\tforeach ($listenerList[\"listeners\"] as $listenerName) {\n\t\t\t\t\n\t\t\t\tif ($listenerName[0] != \"_\") {\n\t\t\t\t\t$listener = new $listenerName();\n\t\t\t\t\t$listeners = $listener->getListeners();\n\t\t\t\t\tforeach ($listeners as $event => $eventProps) {\n\t\t\t\t\t\t$eventPriority = (isset($eventProps[\"priority\"])) ? $eventProps[\"priority\"] : 0;\n\t\t\t\t\t\tself::$instance->addListener($event, array($listener, $eventProps[\"callable\"]), $eventPriority);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "function __construct()\n\t{\n\t\t$this->events[\"BeforeShowList\"]=true;\n\n\t\t$this->events[\"BeforeProcessList\"]=true;\n\n\t\t$this->events[\"BeforeProcessPrint\"]=true;\n\n\t\t$this->events[\"BeforeShowPrint\"]=true;\n\n\t\t$this->events[\"BeforeQueryList\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeProcessEdit\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"BeforeProcessView\"]=true;\n\n\t\t$this->events[\"BeforeShowView\"]=true;\n\n\n\n\n\t\t$this->events[\"ProcessValuesView\"]=true;\n\n\t\t$this->events[\"ProcessValuesEdit\"]=true;\n\n\t\t$this->events[\"CustomAdd\"]=true;\n\n\t\t$this->events[\"CustomEdit\"]=true;\n\n\t\t$this->events[\"ProcessValuesAdd\"]=true;\n\n\t\t$this->events[\"BeforeQueryEdit\"]=true;\n\n\t\t$this->events[\"BeforeQueryView\"]=true;\n\n\n\t\t$this->events[\"BeforeProcessAdd\"]=true;\n\n\n//\tonscreen events\n\t\t$this->events[\"calmonthly_snippet2\"] = true;\n\t\t$this->events[\"calmonthly_snippet1\"] = true;\n\t\t$this->events[\"Monthly_Next_Prev\"] = true;\n\n\t}", "function defineHandlers() {\n EventsManager::listen('on_rawtext_to_richtext', 'on_rawtext_to_richtext');\n EventsManager::listen('on_daily', 'on_daily');\n EventsManager::listen('on_wireframe_updates', 'on_wireframe_updates');\n }", "public function createEvents()\n {\n //\n\n return 'something';\n }", "public static function createInstance()\n {\n return new GridPrintEventManager('ISerializable');\n }", "public function setUp()\n {\n if ($this->getOption('listener') === true) \n $this->addListener(new BlameableListener($this->_options));\n }", "public static function created($callback)\n {\n self::listenEvent('created', $callback);\n }", "public function addListener()\n {\n $dispatcher = $this->wrapper->getDispatcher();\n $listener = new TestListener();\n\n $dispatcher->addListener(PsKillEvents::PSKILL_PREPARE, [$listener, 'onPrepare']);\n $dispatcher->addListener(PsKillEvents::PSKILL_SUCCESS, [$listener, 'onSuccess']);\n $dispatcher->addListener(PsKillEvents::PSKILL_ERROR, [$listener, 'onError']);\n $dispatcher->addListener(PsKillEvents::PSKILL_BYPASS, [$listener, 'onBypass']);\n\n return $listener;\n }", "public static function addEventListener($event, $listenerClassName) {\n\t\tif (!is_a($listenerClassName, EventListenerInterface::class, TRUE)) {\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\tsprintf(\n\t\t\t\t\t'Invalid CMIS Service EventListener: %s must implement %s',\n\t\t\t\t\t$listenerClassName,\n\t\t\t\t\tEventListenerInterface::class\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tstatic::$eventListeners[get_called_class()][$event][] = $listenerClassName;\n\t}", "public function makeListener($listener, $wildcard = false): Closure;", "public function createSubscriber();", "public function listener() {\n\t\treturn $this->_runtime['listener'];\n\t}", "public function addEventListener($events, $eventListener)\n {\n $this->eventListeners[] = array('events' => $events, 'listener' => $eventListener);\n }", "function __construct()\r\n\t{\r\n\t\t$this->events[\"BeforeAdd\"]=true;\r\n\r\n\r\n\t}", "function __construct()\n\t{\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\n\t\t$this->events[\"BeforeShowAdd\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"IsRecordEditable\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"AfterDelete\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\n//\tonscreen events\n\n\t}", "public function startListening();", "public function addEntryAddedListener(callable $listener): SubscriptionInterface;", "function __construct()\n\t{\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}", "function GetEventListeners() {\n $my_file = '{%IEM_ADDONS_PATH%}/dynamiccontenttags/dynamiccontenttags.php';\n $listeners = array ();\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_SENDSTUDIOFUNCTIONS_GENERATEMENULINKS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'SetMenuItems'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_USERAPI_GETPERMISSIONTYPES',\n 'trigger_details' => array (\n 'Interspire_Addons',\n 'GetAddonPermissions',\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_DCT_HTMLEDITOR_TINYMCEPLUGIN',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'DctTinyMCEPluginHook'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_EDITOR_TAG_BUTTON',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'CreateInsertTagButton'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_GETALLTAGS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'getAllTags'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_REPLACETAGCONTENT',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'replaceTagContent'\n ),\n 'trigger_file' => $my_file\n );\n\n return $listeners;\n }", "function on_creation() {\n $this->init();\n }", "public function addEventListener(ListenerInterface $eventListener)\n {\n $this->eventListeners[] = $eventListener;\n }" ]
[ "0.65685207", "0.62875676", "0.6221792", "0.6197413", "0.61627764", "0.6129312", "0.6096226", "0.6056844", "0.6051069", "0.6041841", "0.596228", "0.596194", "0.5957539", "0.59439605", "0.58821785", "0.58821785", "0.5874665", "0.5864387", "0.5856076", "0.584338", "0.5824244", "0.5820997", "0.5791637", "0.57913053", "0.57893854", "0.57716024", "0.5764599", "0.5744472", "0.57417566", "0.57387024", "0.5721539", "0.57068586", "0.5699624", "0.56838834", "0.5675836", "0.56686187", "0.5661412", "0.56601405", "0.56584114", "0.5649107", "0.5638085", "0.56257224", "0.56172097", "0.56064796", "0.55919635", "0.5579062", "0.55775297", "0.5559927", "0.5546297", "0.5546121", "0.5545537", "0.5539715", "0.55295366", "0.55276597", "0.5527287", "0.551302", "0.5497285", "0.5495119", "0.54845315", "0.54834753", "0.54812366", "0.5478984", "0.5474917", "0.5471286", "0.54693574", "0.54684293", "0.5466594", "0.5465012", "0.5450231", "0.5450062", "0.5450001", "0.544321", "0.54308116", "0.54218924", "0.5389615", "0.53857446", "0.5378957", "0.5378836", "0.53771406", "0.5368413", "0.5360908", "0.5356685", "0.5349897", "0.53419805", "0.5340825", "0.53330225", "0.53323317", "0.5330117", "0.53270465", "0.5326564", "0.5307367", "0.52996707", "0.52980274", "0.52973336", "0.52886003", "0.528163", "0.5276869", "0.5269541", "0.5268173", "0.5265876", "0.52629435" ]
0.0
-1
Display a listing of the resource.
public function index() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { if (Auth::user()->cant('create', Coupon::class)) { return redirect()->route('admin.home')->with(['message'=>'You don\'t have permissions']); } $view = view('admin.coupon_create'); $view->with('title', 'New coupon'); return $view; }
{ "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) { if (Auth::user()->cant('create', Coupon::class)) { return redirect()->route('admin.home')->with(['message'=>'You don\'t have permissions']); } $rules = [ 'code' => 'required|unique:coupons', 'value' => 'required|numeric|min:0.01', 'expire' => 'date_format:"d.m.Y"|nullable', 'min_order_price' => 'numeric|nullable|min:0.01', 'max_usages' => 'integer|nullable|min:0', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return redirect()->route('coupons.create')->withErrors($validator)->withInput(); } $coupon = new Coupon(); $coupon->code = $request->get('code'); $coupon->value = $request->get('value'); $coupon->type = $request->get('type'); $coupon->expire = $request->get('expire'); $coupon->min_order_price = $request->get('min_order_price'); $coupon->max_usages = $request->get('max_usages'); $coupon->save(); return redirect()->route('coupons.edit', ['id'=>$coupon->id]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\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(Coupon $coupon) { // }
{ "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, Coupon $coupon) { if (Auth::user()->cant('view', $coupon)) { return redirect()->route('admin.home')->with(['message'=>'You don\'t have permissions']); } $view = view('admin.coupon_edit'); $view->with('title', $coupon->code); $er = $request->session()->get('errors'); if (!empty($er)) { $coupon->code = $request->old('code'); $coupon->value = $request->old('value'); $coupon->type = $request->old('type'); $coupon->expire = $request->old('expire'); $coupon->min_order_price = $request->old('min_order_price'); $coupon->max_usages = $request->old('max_usages'); } $view->with('coupon', $coupon); return $view; }
{ "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, Coupon $coupon) { if (Auth::user()->cant('update', $coupon)) { return redirect()->route('admin.home')->with(['message'=>'You don\'t have permissions']); } $rules = [ 'code' => 'required|unique:coupons,code,'.$coupon->id, 'value' => 'required|numeric|min:0.01', 'expire' => 'date_format:"d.m.Y"|nullable', 'min_order_price' => 'numeric|nullable|min:0.01', 'max_usages' => 'integer|nullable|min:0', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return redirect()->route('coupons.edit', ['id'=>$coupon->id])->withErrors($validator)->withInput(); } $coupon->code = $request->get('code'); $coupon->value = $request->get('value'); $coupon->type = $request->get('type'); $coupon->expire = $request->get('expire'); $coupon->min_order_price = $request->get('min_order_price'); $coupon->max_usages = $request->get('max_usages'); $coupon->save(); return redirect()->route('coupons.edit', ['id'=>$coupon->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(Coupon $coupon) { if (Auth::user()->cant('delete', $coupon)) { return redirect()->route('admin.home')->with(['message'=>'You don\'t have permissions']); } Coupon::destroy($coupon->id); return redirect(url()->previous()); }
{ "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
Display a listing of the resource.
public function index() { $listAdministrativeRegions = AdministrativeRegion::paginate(5); return view('admin.administrative-regions.index', \compact('listAdministrativeRegions')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { return view('admin.administrative-regions.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(StoreAdministrativeRegion $request) { AdministrativeRegion::create($request->all()); return redirect()->route('admin.administrative-regions.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show(AdministrativeRegion $administrativeRegion) { return view('admin.administrative-regions.show', compact('administrativeRegion')); }
{ "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(AdministrativeRegion $administrativeRegion) { return view('admin.administrative-regions.edit', compact('administrativeRegion')); }
{ "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(UpdateAdministrativeRegion $request, AdministrativeRegion $administrativeRegion) { $administrativeRegion->fill($request->all()); $administrativeRegion->save(); return redirect()->route('admin.administrative-regions.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(AdministrativeRegion $administrativeRegion) { $administrativeRegion->delete(); return redirect()->route('admin.administrative-regions.index'); }
{ "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
Set the key for the page number parameter.
public function withPageParam(string $key): self { if (empty($key)) { throw new \InvalidArgumentException('Page parameter cannot be an empty string.'); } $this->pageParam = $key; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPageKey($key);", "public function setPageNum($num) {\n\t\t$this->pageNum = (int) $num;\t\n\t}", "public function setPageNumber($pageNumber);", "public function setPageNumber(int $pageNumber): void\n {\n $this->pageNumber = $pageNumber;\n }", "public function get_pagination_arg($key)\n {\n }", "function SetKey( $i ) { $this->_key = $i; $this->SetValue('_key', $i ); }", "public function set_page($page);", "function MyMod_Paging_NPages_Set()\n {\n if ($this->NumberOfItems>$this->NItemsPerPage)\n {\n $this->MyMod_Paging_N=intval($this->NumberOfItems/$this->NItemsPerPage);\n $res=$this->NumberOfItems % $this->NItemsPerPage;\n if ($res>0) { $this->MyMod_Paging_N++; }\n }\n elseif ($this->NumberOfItems>0)\n {\n $this->MyMod_Paging_N=1;\n }\n else\n {\n $this->MyMod_Paging_N=0;\n }\n }", "public function setPage(int $page)\n {\n $this->page = $page;\n }", "public function withPerPageParam(string $key): self\n {\n if (empty($key)) {\n throw new \\InvalidArgumentException('Per-page parameter cannot be an empty string.');\n }\n\n $this->perPageParam = $key;\n\n return $this;\n }", "public function setPageNumber($page) {\n $this->page_ = (0 < $page ? $page : 1);\n $this->results_ = null;\n }", "protected function GetCacheKey()\n\t{\n\t\treturn $this->params['page'];\n\t}", "private function setNumberOfPages(): void\n {\n $this->number_of_pages = (int)ceil($this->number_of_records / $this->per_page);\n }", "function setParameter($key, $value) {\n $this->parameters[$key] = $value;\n }", "public function setPage(int $page): void\n {\n $this->page = $page;\n }", "public function setPageLimit($number = null);", "private function setPage(){\n\t if(!empty($_GET['page'])){\n\t if($_GET['page']>0){\n\t if($_GET['page'] > $this->pagenum){\n\t return $this->pagenum;\n\t }else{\n\t return $_GET['page'];\n\t }\n\t }else{\n\t return 1;\n\t }\n\t }else{\n\t return 1;\n\t }\n\t }", "public function set_param($key, $value)\n {\n }", "function MyMod_Paging_Page_No_Set()\n {\n //$this->MyMod_Paging_No=$this->PresetPage;\n if (empty($this->MyMod_Paging_No))\n {\n $this->MyMod_Paging_No=$this->GetPOST($this->ModuleName.\"_Page\");\n if (empty($this->MyMod_Paging_No))\n {\n $this->MyMod_Paging_No=$this->GetGETOrPOST(\"Page\");\n }\n }\n\n if (\n empty($this->MyMod_Paging_No)\n ||\n $this->MyMod_Paging_No>$this->MyMod_Paging_N\n )\n {\n $this->MyMod_Paging_No=1;\n }\n }", "function MyMod_Paging_NItemsPerPage_Set()\n {\n $val=$this->CGI_VarValue($this->ModuleName.\"_NItemsPerPage\");;\n if (!empty($val) && preg_match('/^\\d+$/',$val))\n {\n $this->NItemsPerPage=$val;\n }\n }", "public function set_page($page) {\n $this->list_page = (int) $page;\n }", "public function setParameter( $key, $value ) {\n\t\t$this->fields[ $this->parameterPrefix . trim( $key ) ] = $value;\n\t}", "public function setParam($key, $value);", "public function page($num){\r\n $this->page = $num;\r\n return $this;\r\n }", "public function getPageKey();", "public function setPageNumber($pageNum, $rowsPerPage){\n $query = \"SELECT COUNT(*) AS numrows FROM \".NEWS_TABLE;\n $result = mysql_query($query) or die('Error, query failed');\n $row = mysql_fetch_array($result, MYSQL_ASSOC);\n $numrows = $row['numrows'];\n \n \n //utk bikin link page number\n $maxPage = ceil($numrows/$rowsPerPage);\n \n $self = $_SERVER['PHP_SELF'];\n $nav = '';\n for($page = 1; $page <= $maxPage; $page++){\n if($page == $pageNum){\n $nav .= \"<span class=\\\"page-num\\\">$page</span>\";\n }else{\n $nav .= \"<span class=\\\"page-num-linked\\\"><a href=\\\"$self?page=$page\\\">$page</a></span> \";\n }\n }\n return $nav;\n }", "function setPageSize($value)\n {\n $this->_props['PageSize'] = $value;\n }", "abstract protected function setParameter($key, $value);", "public function setParamToView($key, $value);", "protected function setPage_id($value)\n\t{\n\t\t$this->page_id = $value;\n\t}", "public function setPage($page)\n {\n $this->page = intval($page);\n \n if ($this->page == 0) {\n $this->page = 1;\n }\n }", "function setPageID( $pageID ) \n {\n $this->setValueByFieldName( 'page_id', $pageID );\n }", "private function set_page($intPage = 1)\n {\n if (!isset($this->arrPayload['count'])) {\n throw new DocumentSearchMissingCount('\\DocumentSearch::setPerPage() is required before \\DocumentSearch::setPage()');\n }\n\n // get the page\n if (isset($this->arrSearch['page'])) {\n $intPage = $this->arrSearch['page'];\n }\n\n // set the starting point\n $this->arrPayload['start'] = $this->arrPayload['count'] * ($intPage - 1);\n\n return $this;\n }", "public function setKey( $key )\r\n {\r\n $this->key = $key;\r\n }", "public function setPrimaryKey($key)\n {\n $this->setPothnbr($key);\n }", "public function setPageID(){/*ACTUALLY NOT DEFINED*/}", "public function setCurrentKey($key)\n {\n $this->steps[$key];\n }", "public function setPageNumber(int $pageNumber): void {\n\t\tif ($pageNumber < 1) {\n\t\t\tthrow new PaginationLinkException(\"Invalid page number: $pageNumber\",\n\t\t\t\tPaginationLinkException::INVALID_PAGE_NUMBER);\n\t\t}\n\n\t\t$this->pageNumber = $pageNumber;\n\t}", "public function setPageID(){\n\t\t\n\t\t$id = 'page';\n\t\t$s = '-';\n\t\t$pound = (!self::USE_SPLASH)?'#':'';\n\t\t$prefix = $pound.$id.$s;\n\t\t$this->headerContainerId = $prefix.'header'.$s.'container';\n\t\t$this->headerId = $prefix.'header';\n\t\t$this->subtitleId = $prefix.'subtitle';\n\t\t$this->brandId = $prefix.'brand';\n\t\t\n\t}", "public function setPageNumber($pageNumber)\n {\n $this->pageNumber = $pageNumber;\n return $this;\n }", "public function SetNumPages()\n\t\t{\n\t\t\t$this->_pricenumpages = ceil($this->GetNumProducts() / GetConfig('CategoryProductsPerPage'));\n\t\t}", "public function setCurrentPage($number)\n\t{\n\t\t$this->_currentPage = (int) $number;\n\t\treturn $this;\n\t}", "function setKey($value) {\r\n $this->key = $value;\r\n }", "public function setKeyName($key);", "function setParam($inKey, $inParamValue) {\n\t\treturn $this->_setItem($inKey, $inParamValue);\n\t}", "public function setKey(?string $key): void\n {\n $this->key = $key;\n }", "public function next($id,$key=''){\n $this->page = $id;\n \n $this->page += 1;\n \n return $this->page;\n }", "public function setPage($page){\n $this->page=$page;\n }", "protected function set_page($page){\n self::$page_name = $page;\n }", "public function setParam($key, $val) {\n $this->params[$key] = $val;\n }", "public function setPage($number)\n\t{\n\t\tif ( ! isset($this->_pages[$number])) {\n\t\t\tthrow new Scil_Services_Form_Wizard_Exception(__METHOD__.' The page index : '.$number.' does not exists');\n\t\t}\n\n\t\t$this->_currentPage = $number;\n\t\treturn $this;\n\t}", "private function setPage($page)\n {\n $this->page = (int)$page;\n $this->offset = ($page - 1) * $this->limit;\n }", "public function getPageNumber() {}", "public function getPageNumber() {}", "public function setKey($key)\n {\n $this->key = $key;\n }", "public function setKey($key)\n {\n $this->key = $key;\n }", "public function setKey($key)\n {\n $this->key = $key;\n }", "public static function getParameterKeyPageSize()\n {\n return config('consts.ParameterPageSize');\n }", "function setNum($num)\n {\n $this->num = $num;\n }", "public function setParam($key, $value)\r\n {\r\n $this->_frontController->setParam($key, $value);\r\n }", "public function setKey($key)\n\t{\n\t\t$this->key = $key;\n\t}", "public function setKey($key)\n\t{\n\t\t$this->key = $key;\n\t}", "public function setKey($key)\n\t{\n\t\t$this->key = $key;\n\t}", "public function setKey($key)\n {\n $this->_key = $key;\n }", "public function set_query_arg($key, $value)\n {\n }", "public function _set($number) {\n\t\t$this->number = $number;\n\t\t$this->id = $this->id_base . '-' . $number;\n\t}", "public function getNextPageNumber(): int;", "public function setParamToView($key, $value){\n\t\tView::setViewParam($key, $value);\n\t}", "public function setKey(?string $key): void\n {\n }", "public function setPageNumberAdmin($pageNum, $rowsPerPage){\n $query = \"SELECT COUNT(*) AS numrows FROM \".NEWS_TABLE;\n $result = mysql_query($query) or die('Error, query failed');\n $row = mysql_fetch_array($result, MYSQL_ASSOC);\n $numrows = $row['numrows'];\n \n \n //utk bikin link page number\n $maxPage = ceil($numrows/$rowsPerPage);\n \n $self = $_SERVER['PHP_SELF'];\n $nav = '';\n for($page = 1; $page <= $maxPage; $page++){\n if($page == $pageNum){\n $nav .= \"<span class=\\\"page-num-black\\\">$page</span>\";\n }else{\n $nav .= \"<span class=\\\"page-num-linked-black\\\"><a href=\\\"$self?tab=news&&page=$page\\\">$page</a></span> \";\n }\n }\n return $nav;\n }", "public function setPage($value, $validatePage = false)\n {\n if ($value === null) {\n $this->zeroBasedCurrentPageNum = null;\n } else {\n $value = (int) $value;\n if ($validatePage && $this->validatePage) {\n $pageCount = $this->getPageCount();\n if ($value >= $pageCount) {\n $value = $pageCount - 1;\n }\n }\n if ($value < 0) {\n $value = 0;\n }\n $this->zeroBasedCurrentPageNum = $value;\n }\n }", "public function setKey($key);", "function set_lessonpageid($pageid) {\n $this->lessonpageid = $pageid;\n }", "public function __get($key)\n {\n if ($key == 'pageNumber') {\n return $this->pageNumber;\n }\n\n return $this->getInfo(strtolower($key));\n }", "public function setPageItems($intValue) {\r\n\t\t$this->__pageItems = $intValue;\r\n\r\n\t\t$this->setCurrentPage();\r\n\t\t$this->seek($this->pageStart() - 1);\r\n\t}", "function setPrimaryKey($pkey_name){\n\n\t\t$this->pkey = $pkey_name;\n\n\t}", "public function setKey(string $key) : void {\n\t\t$this->key = $key;\n\t}", "function setFormKey($key);", "public function setKey(string $key);", "private function setIndexPageTitle($pageKey)\n {\n $titles = [\n 'comments1' => \"Anax-MVC kommentarsida 1\",\n 'comments2' => \"Anax-MVC kommentarsida 2\"\n ];\n $this->theme->setTitle($titles[$pageKey]);\n $this->views->add('comment/index', [\n 'pageTitle' => $this->theme->getVariable(\"title\")\n ], 'main');\n }", "public function setPage($page){\n $this->page = $page;\n }", "public function getPageNumber();", "public function getPageNumber();", "public function preview($id,$key='') {\n $this->page = $id;\n \n $this->page -= 1;\n \n return $this->page;\n }", "public function setKey(\\SetaPDF_Core_Type_Name $key) {}", "public static function setKey($key){\n\t\tself::$_key = $key;\n\t}", "public function setPrimaryKey($key)\n {\n $this->setOpPrimeId($key);\n }", "public function setPage($page)\n\t{\n\t\tif((int) $page == 0)\n\t\t{\n\t\t\t$page = 1;\n\t\t}\n\t\t$this->page = $page;\n\t\t// (re-)calculate start rec\n\t\t//$this->calculateStart();\n\t}", "function setRecordsPerPage($count) {\n $this->records_per_page = $count;\n}", "public function setPage($value)\n\t{\n\t\t$this->searchFilters[$this->ref_page] = $value;\n\t}", "public function pageNumber() {\n\t\treturn Arr::get($this->params, 'page', 1);\n\t}", "function setKeyoption($key_in) : void\n {\n $this->keyoption = $key_in;\n }", "public function set_posts_per_page(int $number) {\n\t\t$this->posts_per_page = $number;\n\t}", "public function key() : int\n {\n return $this->currentRecordPos - ($this->pageSize * ($this->currentPagePos-1));\n }", "public function key()\n {\n return $this->pager->key();\n }", "public function setPrimaryKey($key)\n {\n $this->setBiblioId($key);\n }", "public function setParam(string $key, string $value): self\n {\n $this->params[$key] = $value;\n\n return $this;\n }", "public function setNumber($number)\n {\n $this->_number = $number;\n }", "public function setNumber($number) {\n $this->_number = $number;\n }", "function setKey($key)\r\n {\r\n $this->key = $key;\r\n $this->changed = true;\r\n }" ]
[ "0.78210336", "0.68856734", "0.6654975", "0.63794965", "0.6336197", "0.627285", "0.60803854", "0.60276425", "0.600012", "0.5999961", "0.5940436", "0.593753", "0.58907956", "0.58324176", "0.5829354", "0.5825448", "0.58207023", "0.5815609", "0.5793507", "0.5774191", "0.57635015", "0.5745171", "0.57372344", "0.5728474", "0.5728203", "0.57171893", "0.57093376", "0.5681129", "0.5677676", "0.5660314", "0.56201917", "0.5604885", "0.558911", "0.55680156", "0.5554109", "0.55525833", "0.55455077", "0.5519846", "0.54954827", "0.5490443", "0.5490186", "0.54876447", "0.54690707", "0.5463574", "0.54381835", "0.54316294", "0.5419192", "0.54163414", "0.5404499", "0.5402261", "0.5399024", "0.5394962", "0.53853005", "0.53853005", "0.53790593", "0.53790593", "0.53790593", "0.5371336", "0.5359897", "0.5358507", "0.53549945", "0.53549945", "0.53549945", "0.534552", "0.53433424", "0.53330576", "0.5327901", "0.5323797", "0.53179276", "0.531321", "0.53093374", "0.5296685", "0.5294937", "0.52947044", "0.52821505", "0.5279344", "0.5275327", "0.52731854", "0.5263742", "0.5262845", "0.5262252", "0.52577883", "0.52577883", "0.5252796", "0.5251476", "0.5243729", "0.52360773", "0.5232644", "0.5231792", "0.52268845", "0.5225808", "0.5221699", "0.5215668", "0.5213741", "0.5206344", "0.51955956", "0.5195433", "0.5191389", "0.51894087", "0.51851976" ]
0.6386192
3
Set the key for the perpage parameter.
public function withPerPageParam(string $key): self { if (empty($key)) { throw new \InvalidArgumentException('Per-page parameter cannot be an empty string.'); } $this->perPageParam = $key; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPageKey($key);", "public function setPerPage($perPage);", "public function get_pagination_arg($key)\n {\n }", "public function withPageParam(string $key): self\n {\n if (empty($key)) {\n throw new \\InvalidArgumentException('Page parameter cannot be an empty string.');\n }\n\n $this->pageParam = $key;\n\n return $this;\n }", "function MyMod_Paging_NItemsPerPage_Set()\n {\n $val=$this->CGI_VarValue($this->ModuleName.\"_NItemsPerPage\");;\n if (!empty($val) && preg_match('/^\\d+$/',$val))\n {\n $this->NItemsPerPage=$val;\n }\n }", "function MyMod_Paging_NPages_Set()\n {\n if ($this->NumberOfItems>$this->NItemsPerPage)\n {\n $this->MyMod_Paging_N=intval($this->NumberOfItems/$this->NItemsPerPage);\n $res=$this->NumberOfItems % $this->NItemsPerPage;\n if ($res>0) { $this->MyMod_Paging_N++; }\n }\n elseif ($this->NumberOfItems>0)\n {\n $this->MyMod_Paging_N=1;\n }\n else\n {\n $this->MyMod_Paging_N=0;\n }\n }", "public static function getParameterKeyPageSize()\n {\n return config('consts.ParameterPageSize');\n }", "function SetKey( $i ) { $this->_key = $i; $this->SetValue('_key', $i ); }", "function setPageSize($value)\n {\n $this->_props['PageSize'] = $value;\n }", "public function handleSetItemsPerPage($perPage){\n $this->perPage = $perPage;\n }", "public function setPerPage($value){\n setcookie($this->main->module_mode.'_list_per_page_limit', $value, time() + 3600 * 24 * 365, '/admin/');\n $this->per_page = $value;\n }", "public function setPageNum($num) {\n\t\t$this->pageNum = (int) $num;\t\n\t}", "public function getPageKey();", "function setRecordsPerPage($count) {\n $this->records_per_page = $count;\n}", "protected function GetCacheKey()\n\t{\n\t\treturn $this->params['page'];\n\t}", "public function set_page($page);", "private function setPage(){\n\t if(!empty($_GET['page'])){\n\t if($_GET['page']>0){\n\t if($_GET['page'] > $this->pagenum){\n\t return $this->pagenum;\n\t }else{\n\t return $_GET['page'];\n\t }\n\t }else{\n\t return 1;\n\t }\n\t }else{\n\t return 1;\n\t }\n\t }", "function setParameter($key, $value) {\n $this->parameters[$key] = $value;\n }", "private function setNumberOfPages(): void\n {\n $this->number_of_pages = (int)ceil($this->number_of_records / $this->per_page);\n }", "abstract protected function setParameter($key, $value);", "public function set_param($key, $value)\n {\n }", "public function setParam($key, $value);", "public function setJsonpKey($name)\n\t{\n\t\t$this->jsonpKey = $name;\n\t}", "public function setPerPage(Request $request)\n {\n $value = $request->query($this->PER_PAGE_INDICATOR);\n\n if (!is_null($value)) {\n if (!is_numeric($value)) {\n return $value;\n }\n\n $this->perPage = $value === '0' ? null : intval($value);\n }\n }", "public function setPageNumber($pageNumber);", "public function SetNumPages()\n\t\t{\n\t\t\t$this->_pricenumpages = ceil($this->GetNumProducts() / GetConfig('CategoryProductsPerPage'));\n\t\t}", "function _sf_set_per_page_cookie() {\n\t\tif(!isset($_COOKIE['per_page'])){\n\t\t\t\n\t\t\t// GETS FIRST OPTION\n\t\t\t$opts = _sf_get_per_page_options();\n\t\t\t\n\t\t\t// SETS COOKIE\n\t\t\tsetcookie('per_page', $opts[0], 0, '/');\n\t\t\t\n\t\t}\n\t\t\t\n\t\t//// IF OUR PER PAGE IS SET WE SET THE COOKIE AS WELL\n\t\tif(isset($_GET['per_page'])) {\n\t\t\t\n\t\t\t$options = _sf_get_per_page_options();\n\t\t\t\n\t\t\t///// MAKES SURE ITS A VALID OPTION\n\t\t\tif(in_array($_GET['per_page'], $options)) {\n\t\t\t\t\n\t\t\t\t//// SAVES IT\n\t\t\t\tsetcookie('per_page', $_GET['per_page'], 0, '/');\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function setItemsPerPage( $newValue )\n {\n $this->_properties['ItemsPerPage'] = $newValue;\n }", "public function setPerPage(int $perPage) : self\n {\n $this->perPage = $perPage;\n return $this;\n }", "function MyMod_Paging_Page_No_Set()\n {\n //$this->MyMod_Paging_No=$this->PresetPage;\n if (empty($this->MyMod_Paging_No))\n {\n $this->MyMod_Paging_No=$this->GetPOST($this->ModuleName.\"_Page\");\n if (empty($this->MyMod_Paging_No))\n {\n $this->MyMod_Paging_No=$this->GetGETOrPOST(\"Page\");\n }\n }\n\n if (\n empty($this->MyMod_Paging_No)\n ||\n $this->MyMod_Paging_No>$this->MyMod_Paging_N\n )\n {\n $this->MyMod_Paging_No=1;\n }\n }", "public function setParameter( $key, $value ) {\n\t\t$this->fields[ $this->parameterPrefix . trim( $key ) ] = $value;\n\t}", "public function setKey( $key )\r\n {\r\n $this->key = $key;\r\n }", "function setKeyoption($key_in) : void\n {\n $this->keyoption = $key_in;\n }", "function setKey($value) {\r\n $this->key = $value;\r\n }", "public function setParam($key, $val) {\n $this->params[$key] = $val;\n }", "public function setPage(int $page)\n {\n $this->page = $page;\n }", "public function setPerPage(int $perPage)\n {\n $this->perPage = $perPage;\n\n return $this;\n }", "public function setPerPage(int $perPage)\n {\n $this->perPage = $perPage;\n\n return $this;\n }", "public function set_page($page) {\n $this->list_page = (int) $page;\n }", "public function setParamToView($key, $value);", "public function set_posts_per_page(int $number) {\n\t\t$this->posts_per_page = $number;\n\t}", "public function render_per_page_options()\n {\n }", "public static function getParameterKeyPage()\n {\n return config('consts.ParameterPage');\n }", "function set_lines_per_page ($lines_per_page)\r\n {\r\n $_SESSION[\"lines_per_page\"] = $lines_per_page;\r\n }", "private function set_page($intPage = 1)\n {\n if (!isset($this->arrPayload['count'])) {\n throw new DocumentSearchMissingCount('\\DocumentSearch::setPerPage() is required before \\DocumentSearch::setPage()');\n }\n\n // get the page\n if (isset($this->arrSearch['page'])) {\n $intPage = $this->arrSearch['page'];\n }\n\n // set the starting point\n $this->arrPayload['start'] = $this->arrPayload['count'] * ($intPage - 1);\n\n return $this;\n }", "public function per_page($number) {\n $number = (int) $number;\n if($number < 1)\n $number = 1;\n if($number > 500)\n $number = 500;\n $this->param[\"per_page\"] = $number;\n return $this;\n }", "function setParam($inKey, $inParamValue) {\n\t\treturn $this->_setItem($inKey, $inParamValue);\n\t}", "public function setKey(\\SetaPDF_Core_Type_Name $key) {}", "public function setKey($key)\n\t{\n\t\t$this->key = $key;\n\t}", "public function setKey($key)\n\t{\n\t\t$this->key = $key;\n\t}", "public function setKey($key)\n\t{\n\t\t$this->key = $key;\n\t}", "public function setKeyName($key);", "public function setKey($key)\n {\n $this->key = $key;\n }", "public function setKey($key)\n {\n $this->key = $key;\n }", "public function setKey($key)\n {\n $this->key = $key;\n }", "public function setPageSize(int $per_page)\n {\n $this->per_page = $per_page;\n\n return $this;\n }", "public function setPage($page){\n $this->page=$page;\n }", "function set_key($key)\n\t{\n\t\tif(empty($key) || !isset($GLOBALS['ACCESS_KEYS'][$key])) return;\n\t\tif(ACCESS_MODEL === \"roles\") {\n\t\t\tforeach($GLOBALS['ACCESS_KEYS'][$key] as $k) {\n\t\t\t\tif(substr($k, 0, 1) == '@') {\n\t\t\t\t\t// This key references another role - pull in all keys from that role\n\t\t\t\t\t$this->set_key(substr($k, 1));\n\t\t\t\t} else {\n\t\t\t\t\t$this->access_keys[] = $k;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if(ACCESS_MODEL === \"discrete\") {\n\t\t\t$this->access_keys[] = $key;\n\t\t}\n\n\t\t$_SESSION['_ACCESS']['keys'] = $this->access_keys;\n\t}", "public function setKey($key)\n {\n $this->_key = $key;\n }", "public function SetKey($key = ''){\n \tself::$userKey = $key;\n }", "private function setQueryWithoutPageKey(): void\n {\n $this->query_without_page_key = array_filter(\n $this->request->query(),\n function ($key) {\n return $key !== $this->key;\n },\n ARRAY_FILTER_USE_KEY\n );\n }", "public static function setKey($key){\n\t\tself::$_key = $key;\n\t}", "private function preparePagingParameter($page) {\n switch ($this->_mode) {\n case self::MODE_OFFSET :\n return ($page - 1) * $this->_itemsPerPage;\n default :\n return $page;\n }\n }", "public function itemsperpageAction()\r\n {\r\n $itemCountPerPageSession = new Zend_Session_Namespace('itemCountPerPage');\r\n $itemCountPerPageSession->itemCountPerPage['citype'] = $this->_getParam('rowCount');\r\n $this->_redirect('citype/index');\r\n exit;\r\n }", "public function setPerPage($perPage)\n {\n $this->perPage = $perPage;\n\n return $this;\n }", "function setPageID( $pageID ) \n {\n $this->setValueByFieldName( 'page_id', $pageID );\n }", "function setEntryKey($entryKey) {\n\t\t$this->setData('entryKey', $entryKey);\n\t}", "public function setPageNumber($page) {\n $this->page_ = (0 < $page ? $page : 1);\n $this->results_ = null;\n }", "function itemsPerPage($newValue=NULL) {\n\t\tif ( isset($newValue) ) {\n\t\t\tif ( $newValue == \"all\" ) $this->items_per_page = $this->TotalItems();\n\t\t\telse $this->items_per_page = IntVal($newValue);\n\t\t}\n\t\tif ( $this->items_per_page == 0 ) $this->items_per_page = 5;\n\t\treturn $this->items_per_page;\n\t}", "public function setCurrentKey($key)\n {\n $this->steps[$key];\n }", "function set_lessonpageid($pageid) {\n $this->lessonpageid = $pageid;\n }", "public function setPage(int $page): void\n {\n $this->page = $page;\n }", "public function setListPerPage($array){\n $this->listPerPage = [];\n if (is_array($array)){\n foreach ($array as $item){\n $this->listPerPage[$item] = $item;\n }\n $this->listPerPage[9999]=\"All\";\n \n }\n }", "public function setKey(?string $key): void\n {\n $this->key = $key;\n }", "public function setRowsPerPage($r)\n\t{\n\t\tif((int) $r == 0)\n\t\t{\n\t\t\t$r = 20;\n\t\t}\n\t\t$this->max = $r;\n\t\t// (re-)calculate start rec\n\t\t//$this->calculateStart();\n\t}", "private function setTotalPages()\n {\n $this->totalPages = ceil($this->totalData / $this->limit);\n }", "public function setPage($value)\n\t{\n\t\t$this->searchFilters[$this->ref_page] = $value;\n\t}", "private function setRowsPerPage($rows_per_page)\r\n\t{\r\n\t\tif(isset($rows_per_page) and is_numeric($rows_per_page))\r\n\t\t{\r\n\t\t\t$this->rows_per_page = (int) $rows_per_page;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// default number of rows to show per page\r\n\t\t\t$this->rows_per_page = 10;\r\n\t\t}\r\n\r\n\t\tif($this->rows_per_page < 1)\r\n\t\t{\r\n\t\t\t$this->rows_per_page = 10;\r\n\t\t}\r\n\t}", "public function perPage($per_page)\n {\n $this->limit = $per_page;\n $this->offset = ($this->page - 1) * $per_page;\n return $this;\n }", "public function setPageSizeForIndex($pageSize);", "private function setPage($page)\n {\n $this->page = (int)$page;\n $this->offset = ($page - 1) * $this->limit;\n }", "public function setKey($key);", "protected function set_page($page){\n self::$page_name = $page;\n }", "public function setPage($page)\n {\n $this->page = intval($page);\n \n if ($this->page == 0) {\n $this->page = 1;\n }\n }", "function awcp_setSearchResultsPerPage( $query ) {\n\tglobal $wp_the_query;\n\tif ( ( ! is_admin() ) && ( $query === $wp_the_query ) && ( $query->is_search() ) ) {\n\n\t\t//get options\n\t\t$options = advancedwordpressconfigurationpluginOptions::getInstance();\n\n\t\t//get current option name\n\t\t$shortName = $options->getShortName(__FILE__);\n\n\t\t$query->set( 'wpfme_search_results_per_page', $options->options_frontend[\"advanced_wordpress_configuration_plugin_\".$shortName] );\n\t}\n\treturn $query;\n}", "public function setPageLimit($number = null);", "public function setPageToken(?string $pageToken) : self\n {\n $this->initialized['pageToken'] = true;\n $this->pageToken = $pageToken;\n return $this;\n }", "public function setPageToken(?string $pageToken) : self\n {\n $this->initialized['pageToken'] = true;\n $this->pageToken = $pageToken;\n return $this;\n }", "function Pagination() \n { \n $this->current_page = 1; \n $this->mid_range = 7; \n $this->items_per_page = (!empty($_GET['ipp'])) ? $_GET['ipp']:$this->default_ipp; \n }", "public function setPage($page){\n $this->page = $page;\n }", "public function setElementsPerPage($count);", "public function setPageSize($value)\n {\n $allowedPageSize = [\n 'A0',\n 'A1',\n 'A2',\n 'A3',\n 'A4',\n 'A5',\n 'A6',\n 'A7',\n 'A8',\n 'A9',\n 'B0',\n 'B1',\n 'B2',\n 'B3',\n 'B4',\n 'B5',\n 'B6',\n 'B7',\n 'B8',\n 'B9',\n 'B10',\n 'C5E',\n 'Comm10E',\n 'DLE',\n 'Executive',\n 'Folio',\n 'Ledger',\n 'Legal',\n 'Letter',\n 'Tabloid'\n ];\n if (!in_array($value, $allowedPageSize)) {\n throw new PdfKiwiException(sprintf(\n \"The page size must be one of: [%s].\",\n implode(', ', $allowedPageSize)\n ));\n }\n\n $this->fields['options']['page_size'] = $value;\n }", "public function setKey(?string $key): void\n {\n }", "public function next($id,$key=''){\n $this->page = $id;\n \n $this->page += 1;\n \n return $this->page;\n }", "function SetPageSize($intPageSize=0)\n\t{\n\t\t$this->_intPageSize = $intPageSize;\n\t}", "public function setKey(string $key) : void {\n\t\t$this->key = $key;\n\t}", "public function set_query_arg($key, $value)\n {\n }", "public function setDataRangeByPerPage($per_page, $curr_page = 0) {\n\t\t\t$this->setDataRange($per_page, $curr_page * $per_page);\n\t\t}", "public function perPage($perPage)\n {\n $this->perPage = $perPage;\n return $this;\n }", "public function key()\n {\n return $this->pager->key();\n }" ]
[ "0.73899084", "0.6549948", "0.62477964", "0.6237446", "0.6220721", "0.6081021", "0.6050613", "0.5877966", "0.58756673", "0.5864102", "0.5797858", "0.57243615", "0.56976736", "0.568367", "0.566052", "0.5654659", "0.5631701", "0.562285", "0.561116", "0.55858237", "0.5580219", "0.5566429", "0.5499785", "0.5499162", "0.54916906", "0.54585207", "0.5450432", "0.5446413", "0.543255", "0.5429962", "0.5425938", "0.54178756", "0.54002327", "0.53963727", "0.53818244", "0.53769433", "0.5369982", "0.5369982", "0.5368832", "0.5366664", "0.5342674", "0.5328272", "0.53232366", "0.531712", "0.53099906", "0.5308397", "0.5302348", "0.53000546", "0.52914673", "0.52914673", "0.52914673", "0.52891004", "0.52777624", "0.52777624", "0.52777624", "0.52471054", "0.524601", "0.52355486", "0.5228762", "0.5228189", "0.5227906", "0.52176654", "0.5212434", "0.519349", "0.51909065", "0.51887566", "0.518581", "0.5184667", "0.5176827", "0.5175148", "0.5167704", "0.5166145", "0.5164739", "0.51616514", "0.5161132", "0.51573956", "0.5155124", "0.5154055", "0.5141934", "0.51373196", "0.51361185", "0.5135006", "0.51267505", "0.51217186", "0.5108914", "0.51048815", "0.50995606", "0.50995606", "0.509208", "0.5091418", "0.5081727", "0.50791836", "0.5074411", "0.50736773", "0.5069537", "0.5068788", "0.5060958", "0.5058674", "0.5057247", "0.50439346" ]
0.68039346
1
Key/value list of vatRate/vatPriceTotal
public function getVatPriceTotal(): array { return $this->vatPriceTotal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getFormattedVats(): array\n {\n $vats = $this->cart->getVats();\n\n foreach ($vats as $key => $vat) {\n $vats[$key]['total'] = TemplateModifiers::formatNumber($vat['total'], 2);\n }\n\n return $vats;\n }", "public function getTotalsWithVatFromPrices($prices);", "public function total()\n {\n if ($this->_isCartArray($this->cart()) === TRUE)\n {\n $price = 0;\n $vat = 0;\n foreach ($this->cart() as $key)\n {\n $item_price = ($key['price'] * $key['qty']);\n $item_vat = (($item_price/100)*$key['vat']);\n // $price =+ ($price + ($key['price'] * $key['qty']));\n $price += $item_price;\n $vat += $item_vat;\n }\n\n // $params = $this->_config['vat'];\n // $vat = $this->_formatNumber((($price / 100) * $params));\n\n return array(\n 'sub-total' => $this->_formatNumber($price),\n 'vat' \t\t=> $this->_formatNumber($vat),\n 'total' \t=> $this->_formatNumber($price + $vat)\n );\n }\n }", "public function pricesProvider()\n {\n return [\n 'sufficient data' => [\n 'period' => 14,\n 'precision' => 2,\n 'prices' => [\n 4834.91,// current\n 4724.89,// previous\n 4555.14,\n 4587.48,\n 4386.69,\n 4310.01,\n 4337.44,\n 4280.68,\n 4316.01,\n 4114.01,\n 4040.0,\n 4016.0,\n 4086.29,\n 4139.98,\n 4108.37,\n 4285.08,\n ],\n 'expected RSI' => [\n 81.19,// current\n 67.86,// previous\n 62.72,\n ],\n ],\n 'insufficient data' => [\n 'period' => 14,\n 'precision' => 2,\n 'prices' => [\n 4834.91,// current\n 4724.89,// previous\n ],\n 'expected RSI' => [],\n ],\n ];\n }", "public function getTotalVatFromPriceObject(Price $price);", "public function getTotalsForDisplay()\n {\n $vouchers = $this->getVouchers();\n if (empty($vouchers)) {\n return array();\n }\n\n $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;\n\n $total = array();\n foreach ($vouchers as $voucher) {\n $salePriceInclVat = $voucher['emag_sale_price'] + $voucher['emag_sale_price_vat'];\n\n $total[] = array(\n 'label' => $voucher['emag_voucher_name'] . ':',\n 'amount' => $this->getOrder()->formatPriceTxt($salePriceInclVat),\n 'font_size' => $fontSize,\n );\n }\n\n return $total;\n }", "public function get_vehicle_total()\n\t{\n\t\t$vehi_id = Input::get('vehi_id');\n\t\t$vehi_data = DB::table('tbl_sales')->where('vehicle_id',$vehi_id)->first();\n\t\t$total_price1 = $vehi_data->total_price;\n\t\t$tbl_rto_taxes=DB::table('tbl_rto_taxes')->where('vehicle_id','=',$vehi_id)->first();\n\t\tif(!empty($tbl_rto_taxes))\n\t\t{\n\t\t\t$registration_tax= $tbl_rto_taxes->registration_tax;\n\t\t\t$number_plate_charge= $tbl_rto_taxes->number_plate_charge;\n\t\t\t$muncipal_road_tax= $tbl_rto_taxes->muncipal_road_tax;\n\t\t\t$total_rto=$registration_tax + $number_plate_charge + $muncipal_road_tax;\n\t\t\t$total_price= $total_price1 + $total_rto;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$total_price= $total_price1;\n\t\t}\n\t\t$sale_id = $vehi_data->id;\n\t\treturn array($sale_id, $total_price);\n\t}", "function get_price_rate($price)\n { \n $rtn = array();\n foreach ( $price as $key=>$item)\n { // cost\n if($item['rate_type']==2 && $item['customer_level_id']==0)\n $rtn['cost']=$item['zone']; \n //contract\n if($item['rate_type']==1 && $item['customer_level_id']==0)\n $rtn['contract']=$item['zone']; \n //customer L0\n if($item['rate_type']==3 && $item['customer_level_id']==1)\n $rtn['1']=$item['zone']; \n //customer L1\n if($item['rate_type']==3 && $item['customer_level_id']==2)\n $rtn['2']=$item['zone']; \n //customer L2\n if($item['rate_type']==3 && $item['customer_level_id']==3)\n $rtn['3']=$item['zone']; \n //customer L3\n if($item['rate_type']==3 && $item['customer_level_id']==4)\n $rtn['4']=$item['zone']; \n //customer L4\n if($item['rate_type']==3 && $item['customer_level_id']==5)\n $rtn['5']=$item['zone']; \n\n\n\n } \n return $rtn;\n }", "public function getTotalPriceWithVatFromPriceObject(Price $price);", "private function getTierPriceStructure()\n {\n return [\n 'children' => [\n 'record' => [\n 'children' => [\n 'website_id' => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'options' => $this->getWebsites(),\n 'value' => $this->getDefaultWebsite(),\n 'visible' => true,\n 'disabled' => false,\n ],\n ],\n ],\n ],\n 'price_value' => [\n 'children' => [\n 'price' => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'addbefore' => $this->getStore()->getBaseCurrency()\n ->getCurrencySymbol(),\n ]\n ]\n ],\n ],\n 'value_type' => [\n 'arguments' => [\n 'data' => [\n 'options' => $this->productPriceOptions->toOptionArray(),\n ]\n ],\n ],\n ],\n ],\n ],\n ],\n ],\n ];\n }", "public function getVatTotal()\n {\n return $this->getUnitTotal()->multiplyWith($this->getVatRate());\n }", "static function getVATrates(&$country)\n\t{\n\t\t$setEUmemberstates = UIDvalidationAustria::setEUmemberstates();\n\t\t$vatRates = array();\n\t\t$vatRates['country']\t= $country;\n\t\t$vatRates['standard']\t= 0;\n\t\t$vatRates['reduced']\t= 0;\n\t\tif (array_key_exists($country, $GLOBALS[\"UIDvalidationATglobalvars\"][\"arr_eu_memberstates\"])) \n\t\t{ \t// Country is member of EU\n\t\t\t$vatRates['standard']\t= $GLOBALS[\"UIDvalidationATglobalvars\"][\"arr_eu_memberstates\"][$country][1];\n\t\t\t$vatRates['reduced']\t= $GLOBALS[\"UIDvalidationATglobalvars\"][\"arr_eu_memberstates\"][$country][2];\n\t\t\tif (isset ($GLOBALS[\"UIDvalidationATglobalvars\"][\"arr_eu_memberstates\"][$country][3]) )\n\t\t\t{\n\t\t\t\t$vatRates['reduced_2']\t= $GLOBALS[\"UIDvalidationATglobalvars\"][\"arr_eu_memberstates\"][$country][3];\n\t\t\t}\n\t\t\tif (isset ($GLOBALS[\"UIDvalidationATglobalvars\"][\"arr_eu_memberstates\"][$country][4]) )\n\t\t\t{\n\t\t\t\t$vatRates['reduced_3']\t= $GLOBALS[\"UIDvalidationATglobalvars\"][\"arr_eu_memberstates\"][$country][4];\n\t\t\t}\n\t\t}\n\t\treturn $vatRates;\n\t}", "function get_indicator_price($price,$vat){\r\n $full_price = $price + ($price * $vat);\r\n return $full_price;\r\n}", "public function getListPrice()\n\t{\n\t\treturn $this->getKeyValue('list_price'); \n\n\t}", "function verusPrice( $currency ) {\n global $phpextconfig;\n $currency = strtoupper($currency);\n\n if ( $currency == 'VRSC' | $currency == 'VERUS' ) {\n $results = json_decode( curlRequest( $phpextconfig['fiat_api'] . 'rawpricedata.php', curl_init(), null ), true );\n return $results['data']['avg_btc'];\n }\n else {\n return curlRequest( $phpextconfig['fiat_api'] . '?currency=' . $currency, curl_init(), null );\n } \n}", "public function get_visible_price_data() : array {\n\t\treturn [\n\t\t\t'price_data' => [\n\t\t\t\t'min_price' => $this->get_min_price(),\n\t\t\t\t'max_price' => $this->get_max_price(),\n\t\t\t\t'min_discount_price' => $this->get_disc_min_price(),\n\t\t\t\t'max_discount_price' => $this->get_disc_max_price(),\n\t\t\t\t'currency_code' => $this->get_currency_code(),\n\t\t\t\t'discount_percent' => $this->get_discount_percentage(),\n\t\t\t],\n\t\t];\n\t}", "function calculatePriceForRabatt(){\r\n// @ToDo remove static Values \r\n\r\n\t $basketIns = array_merge($this->basket->get_articles_by_article_type_uid_asuidlist(1)); //,$this->basket->get_articles_by_article_type_uid_asuidlist($this->pObj->conf['couponNormalType']),$this->basket->get_articles_by_article_type_uid_asuidlist($this->pObj->conf['couponRelatedType'])); // 4 and 5\r\n\t $value = array('net'=>0,'gross'=>0);\r\n\t \r\n\t foreach ($basketIns as $itemObjId) {\r\n\t\t$temp = $this->basket->basket_items[$itemObjId];\r\n\t\t$temp->recalculate_item_sums();\r\n\t\t\r\n\t\t$value['net'] += $temp->get_item_sum_net();\r\n\t\t$value['gross'] += $temp->get_item_sum_gross();\r\n\t }\r\n\r\n\t if($value['net']< 0){\r\n\t\t$value['net'] = 0;\r\n\t }\r\n\r\n\t if($value['gross'] < 0){\r\n\t\t$value['gross'] = 0;\r\n\t }\r\n\t return $value;\r\n\t}", "public function getVatility()\n {\n return $this->get(self::_VATILITY);\n }", "private function extractVatRate(array $data)\n {\n if (isset($data['vat_rate'])) {\n $vat_rate = $data['vat_rate'];\n } elseif (isset($data['vat'])) {\n $vat_rate = $data['vat'];\n }\n\n return $vat_rate ?? null;\n }", "protected function convertPriceList() {\n\t\t$retArray =array();\n\t\t\n\t\tforeach ($this->DetailPriceList as $name => $nameValue) {\n\t\t\t$description = '';\n\t\t\t$unit = '';\n\t\t\t$price = 0;\n\t\t\t$avgPrice = 0;\n\t\t\tif (is_array($nameValue)) {\n\t\t\t\tforeach ($nameValue as $desc => $prices) {\n\t\t\t\t\tif (is_array($prices)) {\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$price = $nameValue;\n\t\t\t\t$avgPrice = $price;\n\t\t\t}\n\t\t\t$retArray[] = array($name,$description, $unit,$price, $avgPrice );\n\t\t}\n\t}", "public function getPicklistValues()\n\t{\n\t\t$taxes = Vtiger_Inventory_Model::getGlobalTaxes();\n\t\tforeach ($taxes as $key => $tax) {\n\t\t\t$taxes[$key] = $tax['name'] . ' - ' . App\\Fields\\Double::formatToDisplay($tax['value']) . '%';\n\t\t}\n\t\treturn $taxes;\n\t}", "public function getPricing() : array\n {\n $data = $this->fetchJson();\n $result = [];\n\n foreach ($data['fuel']['types'] as $fuelType) {\n if (!in_array($fuelType['name'], $this->types)) {\n continue;\n }\n\n $result[] = [\n 'name' => $fuelType['name'],\n 'price' => $fuelType['price'] * 100\n ] ;\n }\n\n return $result;\n }", "private function getItemVatRate(array $line)\n {\n //====================================================================//\n // Line not Taxable\n if (isset($line['taxable']) && !$line['taxable']) {\n return 0;\n }\n //====================================================================//\n // No Taxes Lines\n if (empty($line['tax_lines'])) {\n return 0;\n }\n //====================================================================//\n // Sum Applied VAT Rates\n $vatRate = 0;\n foreach ($line['tax_lines'] as $tax) {\n $vatRate += (100 * $tax['rate']);\n }\n\n return $vatRate;\n }", "public function getVatCoefficient($vatPercent);", "public function getSubtotalInvoiced();", "public function getPrices()\n {\n }", "public function toOptionArray()\n {\n return [\n ['value' => 20, 'label' => __('VAT20')],\n ['value' => 10, 'label' => __('VAT10')],\n ['value' => 0, 'label' => __('VAT0')],\n ['value' => 110, 'label' => __('VAT110')],\n ['value' => 120, 'label' => __('VAT120')],\n ['value' => null, 'label' => __('VAT Free')],\n ];\n }", "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 getCustomerTaxvat();", "function fn_get_yandex_checkpoint_price($price = 0.00, $currency = 'RUB')\n{\n return array(\n 'amount' => (float) fn_format_rate_value((float) $price, 'F', 2, '.', '', ''),\n 'currency' => $currency\n );\n}", "function priceArray(){\n $priceObject = [\n 'STA' => [\n 'SeatType' => \"Standard Adult\",\n 'DiscountPrice' => \"14.00\",\n 'FullPrice' => \"19.80\"\n ],\n 'STP' => [\n 'SeatType' => \"Standard Concession\",\n 'DiscountPrice' => \"12.50\",\n 'FullPrice' => \"17.50\"\n ],\n 'STC' => [\n 'SeatType' => \"Standard Child\",\n 'DiscountPrice' => \"11.00\",\n 'FullPrice' => \"15.30\"\n ],\n 'FCA' => [\n 'SeatType' => \"First Class Adult\",\n 'DiscountPrice' => \"24.00\",\n 'FullPrice' => \"30.00\"\n ],\n 'FCP' => [\n 'SeatType' => \"First Class Concession\",\n 'DiscountPrice' => \"22.50\",\n 'FullPrice' => \"27.00\"\n ],\n 'FCC' => [\n 'SeatType' => \"First Class Child\",\n 'DiscountPrice' => \"21.00\",\n 'FullPrice' => \"24.00\"\n ]\n ];\n return $priceObject;\n}", "function totals()\n\t{\n\t\treturn $this->_tour_voucher_contents['totals'];\n\t}", "public function getCosts (VirtueMartCart $cart, $method, $cart_prices) {\r\n\r\n\t\t$cartTotalAmountOrig=!empty($cart_prices['withTax'])? $cart_prices['withTax']:$cart_prices['salesPrice'];\r\n\t\t\r\n\t\t$this->_vivinstalments = vRequest::getInt('vivinstalments', 0);\r\n\t\t$this->addprice = '';\r\n\t\t$this->addpricecurrency = '';\r\n\t\t\r\n\t\tif(isset($this->_vivinstalments) && $this->_vivinstalments > 1){\r\n\t\t$this->_setHellaspayIntoSession();\r\n\t\t}\r\n\t\t\r\n\t\t$this->_getHellaspayIntoSession();\r\n\t\tif(isset($this->_vivinstalments) && $this->_vivinstalments > 1){\r\n\t\t\r\n\t\t$instalmentcharge = $this->_getInstalmentCharge($this->_currentMethod);\r\n\t\t$this->_currentMethod->hellaspay_instalments_charge = '';\r\n\t\t\r\n\t\tif(isset($instalmentcharge) && $instalmentcharge!=''){\r\n\t\t\r\n\t\t$split_charge_hellaspay = explode(',', $instalmentcharge);\r\n\t\t$c = count ($split_charge_hellaspay);\r\n\t\tfor($i=0; $i<$c; $i++)\r\n\t\t{\r\n\t\tlist($instal_amount, $instal_percentage) = explode(\":\", $split_charge_hellaspay[$i]);\r\n\t\t\r\n\t\tif($this->_vivinstalments == $instal_amount){\r\n\t\t$this->addprice = $cartTotalAmountOrig * $instal_percentage * 0.01;\r\n\t\t$this->addpricecurrency = (string)$cart->pricesCurrency;\r\n\t\t} \r\n\t\t}//end for\r\n\t\t\r\n\t\t}//end if charge is set\r\n\t\t}//end if instalments are selected\r\n\t\t\r\n\t\t$instalmentoptions = $this->_getInstalmentOptions($this->_currentMethod);\r\n\t\t$split_instal_hellaspay = explode(',', $instalmentoptions);\r\n\t\t$c = count ($split_instal_hellaspay);\r\n\t\t$term_array = array();\r\n\t\t\r\n\t\tif($c > 1){\r\n\t\tfor($i=0; $i<$c; $i++)\r\n\t\t{\r\n\t\tlist($instal_amount, $instal_term) = explode(\":\", $split_instal_hellaspay[$i]);\r\n\t\tif($cartTotalAmountOrig > $instal_amount){\r\n\t\t$term_array[]=$instal_term;\r\n\t\t}\r\n\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(!in_array($this->_vivinstalments ,$term_array)){\r\n\t\t$this->addprice = '';\r\n\t\t$this->addpricecurrency = '';\r\n\t\t$this->_clearHellaspaySession();\r\n\t\t}\r\n\t\t\r\n\t\t$this->_currentMethod->cost_per_transaction += $this->addprice;\r\n\t\t\r\n\t\tif(!empty($cart_prices['withTax'])){\r\n\t\t$cart_prices['withTax'] = $cart_prices['withTax'] + $this->_currentMethod->cost_per_transaction;\r\n\t\t} else {\r\n\t\t$cart_prices['salesPrice'] = $cart_prices['salesPrice'] + $this->_currentMethod->cost_per_transaction;\r\n\t\t}\r\n\t\t\r\n\t\tif (preg_match ('/%$/', $this->_currentMethod->cost_percent_total)) {\r\n\t\t\t$this->_currentMethod->cost_percent_total = substr ($this->_currentMethod->cost_percent_total, 0, -1);\r\n\t\t} else {\r\n\t\t\t$this->_currentMethod->cost_percent_total = $this->_currentMethod->cost_percent_total;\r\n\t\t}\r\n\t\t$cartPrice = !empty($cart_prices['withTax'])? $cart_prices['withTax']:$cart_prices['salesPrice'];\r\n\t\t\r\n\t\treturn ($this->_currentMethod->cost_per_transaction + ($cartPrice * $method->cost_percent_total * 0.01));\r\n\t}", "function ewtComputation($total_purchased,$discount,$is_vat,$ewt){\n $total_amount = 0;\n $non_vat_value = $total_purchased;\n $ewt = ewtTypes($ewt);\n $vat = 0;\n if($is_vat == true){\n // for vat\n $vat = ( $total_purchased - $discount ) / 1.12;\n $non_vat_value = $vat;\n $vat = ( $total_purchased - $discount ) - $non_vat_value;\n $vat = round($vat,6);\n }else{\n $non_vat_value = $non_vat_value - $discount;\n }\n\n $total_amount = ( $non_vat_value ) + $vat ; // total amount less vat value\n $total_amount = round($total_amount,6);\n\n $ewt_amount = $non_vat_value * $ewt;\n if($ewt > 0) {\n $ewt_amount = $non_vat_value * $ewt;\n $ewt_amount = round($ewt_amount,6);\n }\n $non_vat_value = round($non_vat_value,6);\n\n $grand_total = $total_amount - $ewt_amount;\n $grand_total = round($grand_total,6);\n return array(\n 'total_purchased'=> $non_vat_value,\n 'total_amount'=> $total_amount,\n 'vat'=> $vat,\n 'ewt_base'=> $ewt,\n 'ewt_amount'=> $ewt_amount,\n 'grand_total'=> $grand_total,\n );\n}", "function calculateAll(){\n try{\n $sum = 0;\n foreach($this->content as $inventary){\n foreach($inventary as $key=>$item){\n $sum1 = 0;\n foreach($item as $value)\n $sum1=$sum1+$value->weight*$value->price;\n echo \"value of \".$key.\" = \".$sum1.\"\\n\";\n }\n $sum = $sum + $sum1;\n }\n \n echo \"value of all inventary=\".$sum.\"\\n\";\n } catch (Exception $e) {\n echo $e;\n }\n }", "public function provideTotal()\n {\n return [\n [[1, 2, 5, 8], 16],\n [[-1, 2, 5, 8], 14],\n [[1, 2, 8], 11]\n ];\n }", "public function getOptions_values_price() {\n\t\treturn $this->options_values_price;\n\t}", "function getAllRates($interval) {\n\n\t\tforeach ( $this->lConf['productDetails'] as $uid => $val ) {\n\t\t\t// get all prices for given UID and given dates\n\t\t\t$this->lConf['productDetails'][$uid]['prices'] = tx_abbooking_div::getPrices($uid, $interval);\n\t\t}\n\n\t\treturn 0;\n\t}", "function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('DBO_Prices',$k,$v); }", "public function toOptionArray()\n {\n return [\n ['value' => 18, 'label' => __('VAT18')],\n ['value' => 10, 'label' => __('VAT10')],\n ['value' => 0, 'label' => __('VAT0')],\n ['value' => 110, 'label' => __('VAT110')],\n ['value' => 118, 'label' => __('VAT118')],\n ['value' => null, 'label' => __('VAT Free')],\n ];\n }", "public function getPriceAll()\n { \n $collection = $this->PostCollectionFactory->create();\n /*$a = $collection->getPrice();*/\n foreach ($collection as $key => $value) {\n $value->getPrice();\n }\n return $value->getPrice();\n }", "public function getItemsPrice()\n {\n return [10,20,54];\n }", "public function toArray($request)\n {\n\n $totalProposedAmt = 0;\n\n foreach ($this->vdvks as $vdvk) {\n $totalProposedAmt += $vdvk->getTotalProposedCost();\n }\n\n return [\n 'mo_id' => $this->id,\n 'MO' => $this->name,\n 'proposed_amount' => $totalProposedAmt,\n 'vdvks' => $this->vdvks()->count()\n ];\n }", "public function getRates()\n {\n # Convert the rates to a key / value array:\n return json_decode( json_encode($this->rates), true );\n }", "function total_price($totals){\n $sum = 0;\n $sub = 0;\n foreach($totals as $total ){\n $sum += $total['total_saleing_price'];\n $sub += $total['total_buying_price'];\n $profit = $sum - $sub;\n }\n return array($sum,$profit);\n}", "private function getPrices () {\n\t\tlibxml_use_internal_errors(true);\n\t\n\t\t$dom = new DOMDocument();\n\n\t\t@$dom->loadHTML( $this->result );\n\t\t$xpath = new DOMXPath( $dom );\n\t\t\n\t\t$this->prices[] = array(\n\t\t\t'station.from' => $this->getPostField('from.searchTerm'),\n\t\t\t'station.to' => $this->getPostField('to.searchTerm'),\n\t\t\t'station.prices' => $xpath->query($this->config['lookupString'])\n\t\t);\n\t}", "function vatAmount($value = 0, $vat_percent = 20)\n{\n return ($vat_percent / 100) * $value;\n}", "function get_vacation_time($va_time_plan){\r\n foreach ($va_time_plan as $key => $value) {\r\n $vdate = get_days($value['startdate'], $value['enddate']);\r\n foreach ($vdate as $key => $value1) {\r\n $vd[$value1] = get_times($value['starttime'], $value['endtime']);\r\n }\r\n }\r\n return $vd;\r\n }", "function total( $params ) {\n\t\textract( $params );\n\n\t\t// Should zcarriage be in the items or not? If $zcarriage='NO' exclude the zcarriage from the total cost\n\t\t$zcarriage = !empty( $zcarriage ) && $zcarriage == 'NO' ? \" AND sku<>'zcarriage'\" : '';\n\n\t\t// The pu already contains vat\n\t\t$res = $this->db->query( \"SELECT SUM(ci.qty*ci.pu) price FROM cart_items ci INNER JOIN cart c ON c.id=ci.cart_id WHERE cart_id='\".$cart_id.\"' AND user='\".$user_no.\"' AND qty>0\".$zcarriage )->row_array();\n\t\treturn $res[ 'price' ];\n\t}", "function get_price_object() {\r\n\t\t$price_obj = array (\r\n\t\t\t\t\"Currency\" => false,\r\n\t\t\t\t\"TotalDisplayFare\" => 0,\r\n\t\t\t\t\"PriceBreakup\" => array (\r\n\t\t\t\t\t\t'BasicFare' => 0,\r\n\t\t\t\t\t\t'Tax' => 0,\r\n\t\t\t\t\t\t'AgentCommission' => 0,\r\n\t\t\t\t\t\t'AgentTdsOnCommision' => 0\r\n\t\t\t\t) \r\n\t\t);\r\n\t\treturn $price_obj;\r\n\t}", "public function ctrSumaTotalVentas(){\n\n\t\t$tabla = \"ventas\";\n\n\t\t$respuesta = ModeloVentas::mdlSumaTotalVentas($tabla);\n\n\t\treturn $respuesta;\n\n\t}", "public function getTotalsWithoutVatFromPrices($prices);", "public function getTotalInvoiced();", "public function dataProvider()\n {\n return [\n [\n new Money(10, 'EUR'),\n 'EUR',\n new Money(10, 'EUR'),\n ],\n [\n new Money(15, 'EUR'),\n 'SEK',\n new Money(15, 'EUR'),\n ],\n [\n new Money(1497, 'USD'),\n 'EUR',\n new Money(1000, 'EUR'),\n ],\n ];\n }", "public function calculateTotals()\n {\n $in = $this->_calculateTotalsIn();\n $out = $this->_calculateTotalsOut();\n $rating = $this->_calculateTotalsByRating();\n \n $result = array_merge($in, $out, $rating);\n $output = array();\n \n if (count($result)) {\n foreach ($result as $row) {\n $id = in_array($row['type'], array('MANUFACTURER', 'STOCK_STATUS', 'RATING')) ? '0' : $row['id'];\n $gid = strtolower(substr($row['type'], 0, 1)) . $id;\n if (!isset($output[$gid])) {\n $output[$gid] = array();\n }\n $output[$gid][$row['val']] = $row['c'];\n }\n }\n \n return $output;\n }", "function findVATEligibility($basket_content) {\n\t\n\t\tif (!is_array($basket_content)) return false;\n\t\t\n\t\tforeach ($basket_content['items'] as $item) {\n\t\t\tif ($item['vat'] > 0) {\n\t\t\t\t$vat_rate = (string) $item['product']['vat'];\n\t\t\t\treturn $vat_rate;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn 0;\n\t}", "public function convertToProductRowPrices(float $price, float $basePrice, float $vatRate, bool $vatIncluded): array\n\t{\n\t\t$result = [];\n\t\t$vatCalculator = new VatCalculator($vatRate);\n\n\t\tif ($vatIncluded)\n\t\t{\n\t\t\t$result['PRICE_BRUTTO'] = $basePrice;\n\t\t\t$result['PRICE_NETTO'] = $vatCalculator->allocate($basePrice);\n\t\t\t$result['PRICE_EXCLUSIVE'] = $vatCalculator->allocate($price);\n\t\t\t$result['PRICE'] = $price;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result['PRICE_BRUTTO'] = $vatCalculator->accrue($basePrice);\n\t\t\t$result['PRICE_NETTO'] = $basePrice;\n\t\t\t$result['PRICE_EXCLUSIVE'] = $price;\n\t\t\t$result['PRICE'] = $vatCalculator->accrue($price);\n\t\t}\n\n\t\t$result['DISCOUNT_RATE'] = Discount::calculateDiscountRate($result['PRICE_NETTO'], $result['PRICE_EXCLUSIVE']);\n\t\t$result['DISCOUNT_SUM'] = Discount::calculateDiscountSum($result['PRICE_EXCLUSIVE'], $result['DISCOUNT_RATE']);\n\t\t$result['DISCOUNT_SUM'] = PriceMaths::roundPrecision($result['DISCOUNT_SUM']);\n\n\t\treturn $result;\n\t}", "public static function getTotals()\n {\n $subTotal = self::getSubTotal();\n $taxes = StoreTax::getTaxes();\n $addedTaxTotal = 0;\n $includedTaxTotal = 0;\n $taxCalc = Config::get('vividstore.calculation');\n\n if ($taxes) {\n foreach ($taxes as $tax) {\n if ($taxCalc != 'extract') {\n $addedTaxTotal += $tax['taxamount'];\n } else {\n $includedTaxTotal += $tax['taxamount'];\n }\n }\n }\n\n $shippingTotal = self::getShippingTotal();\n \n $total = ($subTotal + $addedTaxTotal + $shippingTotal);\n \n return array('subTotal'=>$subTotal,'taxes'=>$taxes, 'taxTotal'=>$addedTaxTotal + $includedTaxTotal, 'shippingTotal'=>$shippingTotal, 'total'=>$total);\n }", "public function getTotal()\n\t{\n\t\treturn $this->getKeyValue('total'); \n\n\t}", "private function _getExtraAmountValues(){\n return Tools::convertPrice($this->_getCartRulesValues() + $this->_getWrappingValues());\n }", "static public function ctrSumaTotalVentas(){\n\n\t\t$tabla = \"ventas\";\n\n\t\t$respuesta = ModeloVentas::mdlSumaTotalVentas($tabla);\n\n\t\treturn $respuesta;\n\n\t}", "public static function VAT_BUYER(): VatRate\n {\n return self::fromCode('VAT_BUYER');\n }", "function verifVadsAmount($data) {\n $amountTotal = $data / 100;\n return $amountTotal;\n }", "function getVat($productId, $showPercent = '')\r\n\t{\r\n\t\t$sql = $GLOBALS['db']->Query(\"SELECT Preis,UstZone FROM \" . PREFIX . \"_modul_shop_artikel WHERE Id = '$productId'\");\r\n\t\t$row = $sql->fetchrow();\r\n\t\t$sql->close();\r\n\r\n\t\t$sql2 = $GLOBALS['db']->Query(\"SELECT Wert FROM \" . PREFIX . \"_modul_shop_ust WHERE Id = '$row->UstZone'\");\r\n\t\t$row2 = $sql2->fetchrow();\r\n\t\t$sql2->close();\r\n\r\n\t\t$mu = explode('.', $row2->Wert);\r\n\t\t$multiplier = (strlen($mu[0])==1) ? '1.0' . $mu[0] . $mu[1] : '1.' . $mu[0] . $mu[1];\r\n\r\n\t\t$vat = ($showPercent==1) ? $row2->Wert : $multiplier;\r\n\t\treturn $vat;//echo \"$row->Preis / 100 * $row2->Wert --> $vat € (Multi:$multiplier)<br>\";\r\n\t}", "function AddProduct() {\n\t$customer_id=$_GET['customer_id'];\n\n\t$invoice_id=$_GET['invoice_id'];\n\n\t$invoice_item_id = $_POST['invoice_item_id'];\n\n\t$service_type = $_POST['service_type'];\n\n\t$service_range = $_POST['service_range'];\n\n\t$price = $_POST['price'];\n\n\t$value = ($_POST['price'] * $_POST['service_range'])-(($_POST['price'] * $_POST['service_range'])*($_POST['vat']/(100+$_POST['vat'])));\n\t$vat_percent = $_POST['vat'];\n\n\t$vat= ($_POST['price'] * $_POST['service_range'])*($_POST['vat']/(100+$_POST['vat']));\n\n\t$vat_value =(($_POST['price'] * $_POST['service_range'])-(($_POST['price'] * $_POST['service_range'])*($_POST['vat']/(100+$_POST['vat']))))+\n\t(($_POST['price'] * $_POST['service_range'])*($_POST['vat']/(100+$_POST['vat'])));\n\tif ($_POST['rebate']>0) {\n\t\t$rabat = (($_POST['price'] * $_POST['service_range']/100)*$_POST['rebate']);\n\t}else{\n\t\t$rebate = $_POST['rebate'];}\n\n\t\tif ($_POST['rebate']>0) {\n\t\t\t$total_value = ((($_POST['price'] * $_POST['service_range'])-(($_POST['price'] * $_POST['service_range'])*($_POST['vat']\n\t\t\t\t/(100+$_POST['vat']))))+(($_POST['price'] * $_POST['service_range'])*($_POST['vat']/(100+$_POST['vat']))))\n\t\t\t-(($_POST['price']*$_POST['service_range'])/100*$_POST['rebate']);\n\t\t}else{\n\t\t\t$total_value = (($_POST['price'] * $_POST['service_range'])-(($_POST['price'] * $_POST['service_range'])\n\t\t\t\t*($_POST['vat']/(100+$_POST['vat'])))+(($_POST['price'] * $_POST['service_range'])*($_POST['vat']/(100+$_POST['vat']))));}\n\n\t\t\t$query = \"INSERT INTO invoice_item (invoice_item_id,invoice_id,customer_id, service_range, service_type, price, value,\n\t\t\t vat ,vat_percent,vat_value,rebate,total_value)\n\t\t\tVALUES (NULL,'$invoice_id','$customer_id','$service_range','$service_type','$price','$value',\n\t\t\t\t'$vat','$vat_percent','$vat_value','$rebate','$total_value')\";\n\t\t\t$result = mysql_query($query);\n\n\t\t\tif(!$result) \n\t\t\t{\n\t\t\t\tdie(mysql_error());\n\t\t\t}\n\n\t\t}", "public function calculate_price_with_vat($price_without_vat, $vat_rate = FALSE)\n {\n if ($this->loaded()) {\n $coeff = $this->coefficient_with_vat;\n }\n else {\n $coeff = round($vat_rate->value / 100, 2);\n }\n \n $vat = $price_without_vat * $coeff;\n return round($price_without_vat + $vat, 2);\n }", "public function getCurrencies();", "function getTotalsForDisplay()\n {\n $amount = $this->getSource()->formatPriceTxt($this->getAmount());\n\n if ($this->getAmountPrefix()) {\n $amount = $this->getAmountPrefix() . $amount;\n }\n\n $title = __($this->getTitle());\n if ($this->getTitleSourceField()) {\n $label = $title . ' (' . $this->getTitleDescription() . '):';\n } else {\n $label = $title . ':';\n }\n\n $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;\n $total = ['amount' => $amount, 'label' => $label, 'font_size' => $fontSize];\n return [$total];\n }", "public function getPrices(Collection $currencies)\n {\n $currencies = $currencies\n ->pluck('id', 'currency_code')\n ->map(function($id){\n return [\n 'id' => $id,\n 'currency_id' => null\n ];\n })->toArray();\n\n // add currencyIds\n foreach($this->currencyIds() as $currencyCode => $currencyID){\n if($currencies[$currencyCode]) {\n $currencies[$currencyCode]['currency_id'] = $currencyID;\n }\n }\n\n\n // exchangeRate\n $exchangeRate = $this->getExchangeRate();\n\n\n // make api call\n $version = '';\n $url = $this->apiBase . $version . '/public/ticker/ALL';\n $res = null;\n\n try{\n $res = Http::request(Http::GET, $url);\n }\n catch (\\Exception $e){\n // Error handling\n echo($e->getMessage());\n exit();\n }\n\n\n // data from API\n $data = [];\n $dataOriginal = json_decode($res->content, true);\n $data = $dataOriginal['data'];\n\n\n // Finalize data. [id, currency_id, price]\n $currencies = array_map(function($currency) use($data, $exchangeRate){\n $dataAvailable = true;\n if(is_array($currency['currency_id'])){\n foreach($currency['currency_id'] as $i){\n if(!isset($data[$i])){\n $dataAvailable = false;\n }\n }\n } else {\n $dataAvailable = isset($data[$currency['currency_id']]);\n }\n\n\n if($dataAvailable){\n if(is_array($currency['currency_id'])){ // 2 step\n $level1 = doubleval($data[$currency['currency_id'][0]]['closing_price']) / $exchangeRate;\n $level2 = doubleval($data[$currency['currency_id'][1]]['closing_price']) / $exchangeRate;\n $currency['price'] = $level1 * $level2;\n }\n else { // 1 step: string\n $currency['price'] = doubleval($data[$currency['currency_id']]['closing_price']) / $exchangeRate;\n }\n\n }\n else {\n $currency['price'] = null;\n }\n\n return $currency;\n\n }, $currencies);\n\n\n return $currencies;\n\n\n }", "public function getPriceHistory() { return array($this->getPrice()); }", "public function getAttributes_qty_prices() {\n\t\treturn $this->attributes_qty_prices;\n\t}", "public function getTaxRates($basket)\r\n {\r\n $result = array();\r\n\r\n if (!empty($basket['sShippingcostsTax'])) {\r\n $basket['sShippingcostsTax'] = number_format(floatval($basket['sShippingcostsTax']),2);\r\n\r\n $result[$basket['sShippingcostsTax']] = $basket['sShippingcostsWithTax']-$basket['sShippingcostsNet'];\r\n if (empty($result[$basket['sShippingcostsTax']])) unset($result[$basket['sShippingcostsTax']]);\r\n } elseif ($basket['sShippingcostsWithTax']) {\r\n $result[number_format(floatval(Shopware()->Config()->get('sTAXSHIPPING')),2)] = $basket['sShippingcostsWithTax']-$basket['sShippingcostsNet'];\r\n if (empty($result[number_format(floatval(Shopware()->Config()->get('sTAXSHIPPING')),2)])) unset($result[number_format(floatval(Shopware()->Config()->get('sTAXSHIPPING')),2)]);\r\n }\r\n\r\n\r\n if (empty($basket['content'])) {\r\n ksort($result, SORT_NUMERIC);\r\n return $result;\r\n }\r\n\r\n foreach ($basket['content'] as $item) {\r\n\r\n if (!empty($item[\"tax_rate\"])) {\r\n\r\n } elseif (!empty($item['taxPercent'])) {\r\n $item['tax_rate'] = $item[\"taxPercent\"];\r\n } elseif ($item['modus'] == 2) {\r\n // Ticket 4842 - dynamic tax-rates\r\n $resultVoucherTaxMode = Shopware()->Db()->fetchOne(\r\n \"SELECT taxconfig FROM s_emarketing_vouchers WHERE ordercode=?\r\n \", array($item[\"ordernumber\"]));\r\n // Old behaviour\r\n if (empty($resultVoucherTaxMode) || $resultVoucherTaxMode == \"default\") {\r\n $tax = Shopware()->Config()->get('sVOUCHERTAX');\r\n } elseif ($resultVoucherTaxMode == \"auto\") {\r\n // Automatically determinate tax\r\n $tax = $this->basket->getMaxTax();\r\n } elseif ($resultVoucherTaxMode == \"none\") {\r\n // No tax\r\n $tax = \"0\";\r\n } elseif (intval($resultVoucherTaxMode)) {\r\n // Fix defined tax\r\n $tax = Shopware()->Db()->fetchOne(\"\r\n SELECT tax FROM s_core_tax WHERE id = ?\r\n \", array($resultVoucherTaxMode));\r\n }\r\n $item['tax_rate'] = $tax;\r\n } else {\r\n // Ticket 4842 - dynamic tax-rates\r\n $taxAutoMode = Shopware()->Config()->get('sTAXAUTOMODE');\r\n if (!empty($taxAutoMode)) {\r\n $tax = $this->basket->getMaxTax();\r\n } else {\r\n $tax = Shopware()->Config()->get('sDISCOUNTTAX');\r\n }\r\n $item['tax_rate'] = $tax;\r\n }\r\n\r\n if (empty($item['tax_rate']) || empty($item[\"tax\"])) continue; // Ignore 0 % tax\r\n\r\n $taxKey = number_format(floatval($item['tax_rate']), 2);\r\n\r\n $result[$taxKey] += str_replace(',', '.', $item['tax']);\r\n }\r\n\r\n ksort($result, SORT_NUMERIC);\r\n\r\n return $result;\r\n }", "public function getTotalPrice();", "public function getTotalPrice();", "public function _get_plates_costs() {\n $this->db->select('orangeplate_price, blueplate_price, repaid_cost, inv_addcost, beigeplate_price');\n $this->db->from('ts_configs');\n $res=$this->db->get()->row_array();\n return $res;\n }", "function listTestPrice() {\n\t\t$query = $this->db->query('SELECT a.*,b.* FROM '.$this->test_price_table.' AS a, '.$this->test_table.' AS b WHERE a.test_id=b.test_id AND a.status!=0');\n\t\treturn $query->result();\n\t}", "function getRates($currencies){\n $response=array();\n $json = file_get_contents('https://blockchain.info/ticker');\n $result = json_decode($json, true);\n foreach ($currencies as $currency) {\n $response[$currency]=$result[$currency]['last'];\n }\n return $response;\n}", "public function getTaxRates(){\n $taxRates = [];\n foreach ($this->data as $taxRate) {\n $newTaxRate = [];\n $newTaxRate['accounting_id'] = IndexSanityCheckHelper::indexSanityCheck('TaxType', $taxRate);\n $newTaxRate['code'] = IndexSanityCheckHelper::indexSanityCheck('TaxType', $taxRate);\n $newTaxRate['name'] = IndexSanityCheckHelper::indexSanityCheck('Name', $taxRate);\n $newTaxRate['tax_type_id'] = IndexSanityCheckHelper::indexSanityCheck('TaxType', $taxRate);\n $newTaxRate['rate'] = IndexSanityCheckHelper::indexSanityCheck('EffectiveRate', $taxRate);\n $newTaxRate['is_asset'] = IndexSanityCheckHelper::indexSanityCheck('CanApplyToAssets', $taxRate);\n $newTaxRate['is_equity'] = IndexSanityCheckHelper::indexSanityCheck('CanApplyToEquity', $taxRate);\n $newTaxRate['is_expense'] = IndexSanityCheckHelper::indexSanityCheck('CanApplyToExpenses', $taxRate);\n $newTaxRate['is_liability'] = IndexSanityCheckHelper::indexSanityCheck('CanApplyToLiabilities', $taxRate);\n $newTaxRate['is_revenue'] = IndexSanityCheckHelper::indexSanityCheck('CanApplyToRevenue', $taxRate);\n array_push($taxRates, $newTaxRate);\n }\n\n return $taxRates;\n }", "function vatIncluded($value = 0, $vat_percent = 20)\n{\n return $value * (1 + $vat_percent / 100);\n}", "public function map($price): array\n\t{\n\t\treturn [\n\t\t\t$price->location->name,\n\t\t\t$price->item->name,\n\t\t\t$price->user->name,\n\t\t\t$price->value,\n\t\t\t$price->created_at\n\t\t];\n\t}", "public function total()\n {\n // $this->line_items\n $total_price = 0;\n foreach ($this->line_items as $key => $value) {\n $total_price = $total_price + $value->product->price_amount;\n }\n // dd();\n return $total_price;\n }", "public function getCurrentPriceData() {\n $priceData = new \\stdClass();\n $priceData->ask = $this->rates[$this->rateIndex]['open_mid'];\n $priceData->bid = $this->rates[$this->rateIndex]['open_mid'];\n $priceData->high = $this->rates[$this->rateIndex]['high_mid'];\n $priceData->open = $this->rates[$this->rateIndex]['open_mid'];\n $priceData->low = $this->rates[$this->rateIndex]['low_mid'];\n $priceData->id = $this->rates[$this->rateIndex]['id'];\n $priceData->dateTime = $this->rates[$this->rateIndex]['rate_date_time'];\n $priceData->rateUnixTime = $this->rates[$this->rateIndex]['rate_unix_time'];\n $priceData->instrument = $this->exchange->exchange;\n\n Config::set('bt_rate_time', $this->rates[$this->rateIndex]['rate_unix_time']);\n\n $this->currentPriceData = $priceData;\n }", "public static function getRates() : array\n {\n return self::$rates;\n }", "public function toArray()\n {\n return array(\n /*'v3' => Mage::helper('apruvepayment')->__('V3'),*/\n 'v4' => Mage::helper('apruvepayment')->__('V4'),\n );\n }", "public function extraPortfolioItemInfo()\n\t{\n\t\t$extraInfo = array();\n\t\t\n\t\t$extraInfo['total_text'] \t= $this->lang->words['total_funds'];\n\t\t$extraInfo['cost'] \t\t= $this->caches['ibEco_banks'][ $cartItem['p_type_id'] ]['b_loans_app_fee'];\n\t\t$extraInfo['total'] \t\t= $this->caches['ibEco_banks'][ $cartItem['p_type_id'] ]['outstanding_loan_amt'];\n\t\t$extraInfo['total_bought']\t= $this->currencySymbolForSums().$this->registry->getClass('class_localization')->formatNumber( $extraInfo['total'], $this->decimalPlacesForSums());\n\t\t\n\t\treturn $extraInfo;\n\t}", "public function getValues();", "public function getBaseSubtotalInvoiced();", "public function getAllStat()\n {\n // Cache method calls\n static $stat = null;\n\n if (is_null($stat)) {\n $stat = array(\n 'totalQuantity' => array_sum($this->collection->getAllOptions(self::BASKET_STATIC_OPTION_QTY)),\n 'totalPrice' => array_sum($this->collection->getAllOptions(self::BASKET_STATIC_OPTION_SUBTOTAL_PRICE))\n );\r\n }\n\n return $stat;\n }", "public function __subTotal($items) {\n\n $price = 0.0;\n\n foreach ($items as $item) {\n\n// if ($item['currency_id'] == 2)\n// $currency = 1;\n//\n// if ($item['currency_id'] == 1)\n// $currency = 4.17;\n//\n// if ($item['currency_id'] == 3)\n// $currency = 4.50;\n\n //$price += $this->__lineItemTotal($item['qty'], $item['price'], $item['taxRate'], $item['currency_id']);\n //$price += $item['qty'] * $item['price'] * $currency;\n $price += $item['qty'] * $item['price'] * $item['rate'];\n }\n\n return $price;\n }", "public function getBaseTotalInvoiced();", "public function getTaxedPrice();", "public function getPrice ($key) {\n $query = \"SELECT avg_price\n FROM ea_product\n WHERE id = '$key' \";\n //print(\"$query\");\n foreach($this->dbo->query($query) as $row) {\n $avg_price = stripslashes($row[0]);\n }\n \n return $avg_price;\n }", "protected function calculatePrices()\n {\n }", "public function valuesProvider(): array\n {\n return [\n // Byte\n '48 B' => [ '48 B', 48 ],\n '1byte' => [ '1byte', 1 ],\n '603 bytes' => [ '603 bytes', 603 ],\n\n // kilobyte / kibibyte\n '2.6k' => [ '2.6k', 2600 ],\n '1.48 kb' => [ '1.48 kb', 1480 ],\n '48kilobyte' => [ '48kilobyte', 48_000 ],\n '62 Kilobytes' => [ '62 Kilobytes', 62_000 ],\n\n '3.72ki' => [ '3.72ki', 3809 ],\n '4 kib' => [ '4 kib', 4096 ],\n '55 KIBIBYTE' => [ '55 KIBIBYTE', 56_320 ],\n '12kibibytes' => [ '12kibibytes', 12_288 ],\n\n // megabyte / mebibyte\n '1 m' => [ '1 m', 1_000_000 ],\n '2 mb' => [ '2 mb', 2_000_000 ],\n '3 megabyte' => [ '3 megabyte', 3_000_000 ],\n '9megabytes' => [ '9megabytes', 9_000_000 ],\n\n '1 mi' => [ '1 mi', 1_048_576 ],\n '2 mib' => [ '2 mib', 2_097_152 ],\n '3 mebibyte' => [ '3 mebibyte', 3_145_728 ],\n '8mebibytes' => [ '8mebibytes', 8_388_608 ],\n\n // gigabyte / gibibyte\n '1.1 g' => [ '1.1 g', 1_100_000_000 ],\n '2 gb' => [ '2 gb', 2_000_000_000 ],\n '5.3 gigabyte' => [ '5.3 gigabyte', 5_300_000_000 ],\n '3gigabytes' => [ '3gigabytes', 3_000_000_000 ],\n\n '1.1 gi' => [ '1.1 gi', 1_181_116_006 ],\n '2 gib' => [ '2 gib', 2_147_483_648 ],\n '5.3 gibibyte' => [ '5.3 gibibyte', 5_690_831_667 ],\n '3gibibytes' => [ '3gibibytes', 3_221_225_472 ],\n\n // terabyte / tebibyte\n '2 t' => [ '2 t', 2_000_000_000_000 ],\n '1.13 tb' => [ '1.13 tb', 1_130_000_000_000 ],\n '8 terabyte' => [ '8 terabyte', 8_000_000_000_000 ],\n '5terabytes' => [ '5terabytes', 5_000_000_000_000 ],\n\n '2 ti' => [ '2 ti', 2_199_023_255_552 ],\n '1.13 tib' => [ '1.13 tib', 1_242_448_139_387 ],\n '8 tebibyte' => [ '8 tebibyte', 8_796_093_022_208 ],\n '5tebibytes' => [ '5tebibytes', 5_497_558_138_880 ],\n\n // petabyte / pebibyte\n '1.5 p' => [ '1.5 p', 1_500_000_000_000_000 ],\n '2.35 pb' => [ '2.35 pb', 2_350_000_000_000_000 ],\n '1 petabyte' => [ '1 petabyte', 1_000_000_000_000_000 ],\n '3petabytes' => [ '3petabytes', 3_000_000_000_000_000 ],\n\n '1.5 pi' => [ '1.5 pi', 1_688_849_860_263_936 ],\n '2.35 pib' => [ '2.35 pib', 2_645_864_781_080_166 ],\n '1 pebibyte' => [ '1 pebibyte', 1_125_899_906_842_624 ],\n '3pebibytes' => [ '3pebibytes', 3_377_699_720_527_872 ],\n\n // Exabyte / Exbibyte\n '2.33 e' => [ '2.33 e', 2_330_000_000_000_000_000 ],\n '1.0 eb' => [ '1.0 eb', 1_000_000_000_000_000_000 ],\n '4.3 exabyte' => [ '4.3 exabyte', 4_300_000_000_000_000_000 ],\n '1.8exabytes' => [ '1.8exabytes', 1_800_000_000_000_000_000 ],\n\n '2.33 ei' => [ '2.33 ei', 2_686_307_105_733_953_536 ],\n '1.0 EiB' => [ '1.0 EiB', 1_152_921_504_606_846_976 ],\n '4.3 EXBIBYTE' => [ '4.3 EXBIBYTE', 4_957_562_469_809_441_792 ],\n '1.8exbibytes' => [ '1.8exbibytes', 2_075_258_708_292_324_608 ],\n ];\n }", "function getListFee($price) {\n $fee = round($price * 0.1);\n return $fee;\n }", "public function showAllBalance(){\n $user=Auth::user();\n $userProfit=Buy::where('rev_id',$user->id)->where('finish',1)->sum('buy_price');\n $userPay=Buy::where('user_id',$user->id)->where('finish','!=',2)->sum('buy_price');\n $userCharge=Pay::where('user_id',$user->id)->sum('price');\n $profitDone= Profit::where(\"user_id\",$user->id)->sum(\"profit_price\");\n\n $getWaitProfit=Profit::where(\"user_id\",$user->id)->where(\"status\",0)->sum(\"profit_price\");\n $getDoneProfit=Profit::where(\"user_id\",$user->id)->where(\"status\",1)->sum(\"profit_price\");\n\n $p= $userProfit - $profitDone;\n\n $array= [\n 'user' => $user,\n 'userProfit' => $p,\n 'userPay' => $userPay,\n 'userCharge' => $userCharge,\n 'waitProfit' => $getWaitProfit,\n \"DoneProfit\" => $getDoneProfit\n ];\n return $array;\n\n }", "public function get_var_values($vtype_id)\n {\n $query=$this->db->select('*')->from('var_value')->where(array('var_type_id'=>$vtype_id))->order_by('var_value');\n $res=$query->get();\n return $res->result_array();\n }", "public function getVatAmount()\r\n {\r\n $amount = $this->getAmount();\r\n $vat = $this->getVatPercentage();\r\n $vatAmount = ($amount / 100) * $vat;\r\n\r\n return $this->vatAmount;\r\n }", "private function value_fundraising($data){\n $dataArray = array();\n if(isset($data->fundraising)){\n $dataArray['round_opened_at'] = $this->value_fundraising_round_opened_at($data->fundraising);\n $dataArray['raising_amount'] = $this->value_fundraising_raising_amount($data->fundraising);\n $dataArray['pre_money_valuation'] = $this->value_fundraising_pre_money_valuation($data->fundraising);\n $dataArray['equity_basis'] = $this->value_fundraising_equity_basis($data->fundraising);\n $dataArray['updated_at'] = $this->value_fundraising_updated_at($data->fundraising);\n $dataArray['raised_amount'] = $this->value_fundraising_raised_amount($data->fundraising);\n }\n return $dataArray;\n }", "public function getTaxes()\n {\n $t = TransModPPM::getInstance();\n return [\n ['id' => 'N', 'name' => $t->ld('Without VAT')],\n ['id' => 'Y', 'name' => $t->ld('With VAT')],\n ];\n }" ]
[ "0.64281356", "0.61658955", "0.61197674", "0.59062016", "0.5806182", "0.5791746", "0.5759514", "0.56852436", "0.55438447", "0.55372775", "0.5531466", "0.5474502", "0.54507136", "0.5446054", "0.53707105", "0.53259575", "0.5318655", "0.5294964", "0.5284472", "0.5279797", "0.52741086", "0.5263678", "0.5251638", "0.52299404", "0.5212059", "0.5166846", "0.51550794", "0.5152646", "0.5149328", "0.5146865", "0.51364535", "0.5127825", "0.51264024", "0.5124826", "0.5123648", "0.5114298", "0.51126325", "0.51045394", "0.50955904", "0.5072242", "0.50647956", "0.50609016", "0.50568867", "0.5045624", "0.5029957", "0.5024474", "0.50226665", "0.50163686", "0.501127", "0.50078756", "0.5006698", "0.49845314", "0.49705207", "0.49685735", "0.49462348", "0.49247602", "0.49234", "0.49082312", "0.49062675", "0.4905092", "0.49024534", "0.48933235", "0.48914564", "0.48866934", "0.48740345", "0.48673597", "0.4863779", "0.48625803", "0.48586094", "0.48571616", "0.48568514", "0.48507518", "0.48447534", "0.48447534", "0.4844745", "0.48337784", "0.48318937", "0.4827343", "0.48238194", "0.48152655", "0.48135915", "0.48027608", "0.4797347", "0.47881123", "0.4786955", "0.4784772", "0.47831646", "0.47757927", "0.47707787", "0.47667247", "0.47626078", "0.47603405", "0.4752738", "0.47488004", "0.4739635", "0.4739365", "0.47364002", "0.47338644", "0.47281998", "0.47252962" ]
0.68363667
0
Display a listing of the resource.
public function index(Request $request) { $filter = $request->only([ 'name', 'code' ]); return view('department.index', [ 'table' => Department::table(), 'departments' => Department::list($filter), 'filter' => $filter, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { return view('department.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(StoreDepartment $request) { $data = $request->validated(); current_user()->createDepartment($data); return response()->json([ 'message' => 'Tạo khoa mới thành công.', 'redirect_to' => route('departments.index'), ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $department = Department::findOrFail($id); return view('department.edit', [ 'department' => $department ]); }
{ "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(UpdateDepartment $request, $id) { $data = $request->validated(); current_user()->updateDepartment($id, $data); return response()->json([ 'message' => 'Sửa khoa thành công.', 'redirect_to' => 'RELOAD', ]); }
{ "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(Request $request, $id) { Department::findOrFail($id); current_user()->destroyDepartment($id); return response()->json([ 'message' => 'Đã xóa khoa.', 'redirect_to' => $request->redirect_to ?? 'RELOAD' ]); }
{ "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
Remove the resource list from storage.
public function destroyList(Request $request) { Department::findOrFail($request->ids); current_user()->destroyListDepartment($request->ids); return response()->json([ 'message' => 'Đã xóa các khoa.', 'redirect_to' => 'RELOAD' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy()\n {\n $this->items = array();\n }", "public function destroy() {\n unset($this->items);\n $this->items = false;\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 remove() {}", "public function remove() {}", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function deleteAllResources() {\n\t\t$this->resources = array();\n\t}", "public function __destruct()\n {\n unlink($this->tmpListFile);\n }", "public function clear() {\r\n\r\n \t\r\n \t\tunset ( $this->__sesionStorage->role );\r\n \t\t\r\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function clear(): void\n {\n $app = App::get();\n $list = $app->data->getList()\n ->filterBy('key', '.temp/cache/', 'startWith');\n foreach ($list as $item) {\n $app->data->delete($item->key);\n };\n }", "public function clearItems()\n\t{\n\t\t$this->storage->clear();\n\t}", "public function destroy(): void\n {\n foreach ($this->getAll() as $k => $v) {\n if (strlen(strval($k)) > 0) {\n $this->remove($k);\n }\n }\n return;\n }", "private function actionListDelete() {\n $put_vars = $this->actionListPutConvert();\n $this->loadModel($put_vars['id'])->delete();\n }", "public function RemoveArtworkList(): void{\n\n if(!Session::isLogin())\n exit;\n\n if(!ArtworkVerifier::removeList($_POST))\n exit;\n\n if(isset(UserList::where('user_list.user_id', Session::getUser()['id'])->where('user_list.artwork_id', $_POST['artwork_id'])->getOne()->id))\n UserList::where('user_id', Session::getUser()['id'])\n ->where('artwork_id', $_POST['artwork_id'])\n ->delete();\n }", "public function remove() {\n\t\t$this->setRemoved(TRUE);\n\t}", "public function clear() {\n @rmpath($this->storage);\n }", "public function destroy(UserList $userlist)\n { \n $this->authorize('modify', $userlist);\n if($userlist->image) {\n File::delete(public_path().$userlist->image);\n }\n $userlist->delete();\n return redirect('/userlists');\n }", "public function unsetResourceContainedResourceReferenceList($index)\n {\n unset($this->resourceContainedResourceReferenceList[$index]);\n }", "public function destroy()\n {\n $this->registry = array();\n\n $this->adaptor->deleteIndex($this->section);\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 remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public function removeFromListAction() { \n \n //get id of recipe which should be removed from list\n $recipeID = (int) $this->params()->fromRoute('recipeID');\n\n //get default list of user\n if ($_SESSION['user'] != \"\") {\n $userID = $_SESSION['user'];\n\n $list = $this->getListsTable()->getListsByUser($userID); //1 list \n\n $listID = 0;\n if ($list == null) {\n //should not happen\n throw new \\Exception(\"ERROR: Remove recipe $recipeID from list $listID - no list available\"); \n } else { \n $listID = (int) $list->listID; \n $this->getListDetailTable()->removeRecipeFromList($listID, $recipeID); \n }\n \n //refresh current favorite list\n return $this->redirect()->toRoute('list', array('action' => 'viewList'));\n }//check if user is logged-in\n }", "public function remove() {\n }", "public function clear()\n {\n $this->dataStorage = [];\n }", "public function clean() {\n $this->requires = array();\n $this->getResource()->clear();\n }", "protected function removeFromList($data)\n {\n $repo = \\XLite\\Core\\Database::getRepo('\\XLite\\Model\\ViewList');\n $repo->deleteInBatch($repo->findBy($data), false);\n }", "public function clear()\n {\n $this->items = [];\n $this->saveItems();\n }", "public function cleanModuleList()\n {\n /**\n * @var \\Magento\\TestFramework\\ObjectManager $objectManager\n */\n $objectManager = \\Magento\\TestFramework\\Helper\\Bootstrap::getObjectManager();\n $objectManager->removeSharedInstance(ModuleList::class);\n $objectManager->removeSharedInstance(ModuleListInterface::class);\n }", "public function destroy(UserList $list)\n {\n\n try {\n\n TitleList::where('user_list_id','=', $list->id)->delete();\n UserList::where('id', '=', $list->id)->delete();\n \n } catch (Excepition $e) {\n\n return redirect(url()->previous())->with('error', $e);\n }\n \n return redirect(url()->previous());\n }", "function deletableResources(){\n\n return $this->resourcesByPermission('delete');\n }", "function remove() {\n\n\t\t$this->readychk();\n\n\t\t// Remove slide from its queue.\n\t\t$queue = $this->get_queue();\n\t\t$queue->remove_slide($this);\n\t\t$queue->write();\n\n\t\t// Remove slide data files.\n\t\tif (!empty($this->dir_path)) {\n\t\t\trmdir_recursive($this->dir_path);\n\t\t}\n\t}", "public function destroy()\n {\n try {\n $medSupID = array();\n foreach (Input::all() as $key) {\n $medSupID = $key;\n }\n\n UsedMedSupply::whereIn('medSupplyUsedID', $medSupID)->update(['isDeleted' => 1]);\n\n\n } catch (Exception $e) {\n\n }\n }", "public function clearAll() {\n $list = scandir(self::ROOT_PATH . \"/public/{$this->storagePath}\");\n foreach ($list as $file) {\n if ($file == '.' || $file == '..') {\n continue;\n }\n $filePath = self::ROOT_PATH . \"/public/{$this->storagePath}/$file\";\n unlink($filePath);\n }\n $this->_tableGw->delete();\n }", "abstract public function remove();", "abstract public function remove();", "abstract public function remove();", "public function destroy(ImgList $imgList)\n {\n //\n }", "public function action_item_remove(Request $request, Response $response)\n\t{\n\t\t$values = $request->query();\n\n\t\t$restock = ORM::factory('Store_Restock', $values['restock_id']);\n\n\t\tif(!$restock->loaded())\n\t\t{\n\t\t\tRD::set(RD::ERROR, 'No restock record found.');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$restock->delete();\n\t\t\tRD::set(RD::SUCCESS, 'Item successfully removed from the store\\'s stock');\n\t\t}\n\t}", "public function destroy(List_Extra_Siswa $list_Extra_Siswa)\n {\n //\n }", "public function clear(): void\n {\n $this->items = collect();\n\n $this->save();\n }", "public static function remove() : void\n {\n static::clear();\n \n }", "public function remove()\n\t{\n\t\t$this->logout();\n\t}", "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 }", "protected function _postDelete()\n {\n $this->clearResources();\n }", "function destructor()\n\t{\n\t\tunset($Resources,$FileName,$FileType,$FileSize,$NumRes,$FileVersion,$Description,$DataOffset);\n\t}", "public function deleteTemp()\n {\n $list=collect(Storage::disk(config('lopsoft.temp_disk'))->listContents(config('lopsoft.temp_dir'), true))\n\t ->each(function($file) {\n\t\t if ($file['type'] == 'file' && $file['timestamp'] < now()->subDays(config('lopsoft.garbagecollection_days'))->getTimestamp()) {\n\t\t\t Storage::disk(config('lopsoft.temp_disk'))->delete($file['path']);\n\t\t }\n });\n }", "public function postRemoveFromWatchlist()\n {\n \n $w_id = Input::get('id');\n $watchlist = new Watchlist();\n return Response::json( $watchlist->removeWatchlist( Auth::user()->id, $w_id, FALSE) ); \n \n }", "public function cleanup() {\r\n\t\t$this->resource->cleanup();\r\n\t}", "public function removeList(array $list): void\n {\n foreach ($list as $id) {\n $this->remove($id);\n }\n }", "protected function purge()\n {\n $this->view->dropResources();\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "public function instance_deleted() {\n $this->purge_all_definitions();\n @rmdir($this->filestorepath);\n }", "public function destroy($id)\n {\n\n\n $data = SoftwareMedia::find($id);\n $isDeleted =$data->delete();\n $value = $data->screenshots;\n if(strpos($value, \"+\") !== false){\n $data->screenshots = (explode(\"+\",$value));\n foreach($data->screenshots as $one){\n //$one= substr($one,42);\n $one = str_replace('http://localhost:8000/storage/screenshots/','',$one);\n unlink(storage_path('app/public/screenshots/'.$one));\n }\n }else{\n $value = str_replace('http://localhost:8000/storage/screenshots/','',$value);\n unlink(storage_path('app/public/screenshots/'.$value));\n }\n\n if($data->ebooks != null){\n $value = $data->ebooks;\n if(strpos($value, \"+\") !== false){\n $data->ebooks = (explode(\"+\",$value));\n foreach($data->ebooks as $ebook){\n $ebook = str_replace('http://localhost:8000/storage/ebooks/','',$ebook);\n unlink(storage_path('app/public/ebooks/'.$ebook));\n }\n }else{\n $value = str_replace('http://localhost:8000/storage/ebooks/','',$value);\n unlink(storage_path('app/public/ebooks/'.$value));\n }\n }\n if($data->whitepapers != null){\n $value = $data->whitepapers;\n if(strpos($value, \"+\") !== false){\n $data->whitepapers = (explode(\"+\",$value));\n foreach($data->whitepapers as $whitepaper){\n $whitepaper = str_replace('http://localhost:8000/storage/whitepapers/','',$whitepaper);\n unlink(storage_path('app/public/whitepapers/'.$whitepaper));\n }\n }else{\n $value = str_replace('http://localhost:8000/storage/whitepapers/','',$value);\n unlink(storage_path('app/public/whitepapers/'.$value));\n }\n }\n if($data->pdf != null){\n $value = $data->pdf;\n if(strpos($value, \"+\") !== false){\n $data->pdf = (explode(\"+\",$value));\n foreach($data->pdf as $one){\n $one = str_replace('http://localhost:8000/storage/pdf/','',$one);\n unlink(storage_path('app/public/pdf/'.$one));\n }\n }else{\n $value = str_replace('http://localhost:8000/storage/pdf/','',$value);\n unlink(storage_path('app/public/pdf/'.$value));\n }\n }\n if($data->guides != null){\n $value = $data->guides;\n if(strpos($value, \"+\") !== false){\n $data->guides = (explode(\"+\",$value));\n foreach($data->guides as $guide){\n $guide = str_replace('http://localhost:8000/storage/guides/','',$guide);\n unlink(storage_path('app/public/guides/'.$guide));\n }\n }else{\n $value = str_replace('http://localhost:8000/storage/guides/','',$value);\n unlink(storage_path('app/public/guides/'.$value));\n }\n }\n if($isDeleted == true){\n return response()->json(['message'=>'Deleted successfully','isdeleted'=>$isDeleted],200 );\n }else{\n return response()->json(['message'=>'Cannot delete something went wrong']);\n }\n }", "public function destroy($list_id)\n {\n $list = Listt::find($list_id);\n $list->delete();\n return redirect(route('adminpanel.index'));\n }", "public function onRemove();", "public function remove()\n \t{\n \t\tforeach( $this->pages as $page ) {\n\n \t\t\t$page->update( ['menu_id' => null] );\n\n \t\t}\n\n \t\treturn $this->delete();\n \t}", "public function removeCache() {\r\n $files = $this->caches;\r\n while (count($files) > 0) {\r\n @unlink(array_shift($files));\r\n }\r\n\r\n }", "public function destroy()\n {\n return $this->remove();\n }", "public function removeTemporary();", "public function remove()\n {\n database()->run('DELETE FROM ' . $this->table . ' WHERE ' . $this->primaryKey . ' = ?', [ $this->{$this->primaryKey} ]);\n $this->__destruct();\n }", "public function clear() {\n $this->list = [];\n\n return $this;\n }", "public function reclaim();", "function supp_list($list){\n $lid = get_id($list);\n //supp\n if ($lid!=-1){\n //supprimer element de la liste\n\t$SQL = \"DELETE FROM element_list WHERE list='$lid'\";\n \tglobal $db;\n \t$res = $db->prepare($SQL);\n \t$res->execute();\n //supprimer list\n \t$SQL = \"DELETE FROM list_list WHERE list='$list'\";\n \tglobal $db;\n \t$res = $db->prepare($SQL);\n \t$res->execute(); }\n}", "public function cleanAll()\n {\n $this->filesystem->remove(self::getFilesList());\n }", "public function delete(Inventory_list $inventory_list_id){\n // per non fare il find dell'id devo chiamare la variabile col nome indicato nella route\n \n //$inventory_list = Inventory_list::find($id);\n \n $thumbNail = $inventory_list_id->inv_thumb;\n $disk = config('filesystems.default');\n $resu = $inventory_list_id->delete();\n \n //storage\n if($resu){\n if($thumbNail && Storage::disk($disk)->has($thumbNail)){\n Storage::disk($disk)->delete($thumbNail);\n }\n }\n\n \treturn '' . $resu;\n //return redirect()->back();\n\t}", "public function clearPermissionsCollection(): void\n {\n $this->permissions = null;\n }", "public function destroy(): void\n {\n $this->items = collect();\n $this->coupons = collect();\n $this->giftcards = collect();\n\n $this->session?->remove('shop.cart');\n }", "public function destroy($id)\n {\n $action=Action::find($id);\n $existingInPivot=Action::with('getResources')->where('id',$action->id)->get();\n foreach ($existingInPivot as $e) {\n $existingResources=[];\n foreach ($e->getResources as $existingResource) {\n $existingResources[]=$existingResource->id;\n }\n }\n\n try {\n DB::transaction(function () use ($action,$existingResources) {\n $action->delete();\n for ($i=0; $i <count($existingResources) ; $i++) { \n $action->getResources()->detach($existingResources[$i]);\n }\n });\n } catch (Exception $exc) {\n session()->flash('message.type', 'danger');\n session()->flash('message.content', 'Erreur lors de la suppression');\n// echo $exc->getTraceAsString();\n }\n session()->flash('message.type', 'success');\n session()->flash('message.content', 'Action supprimer avec succès!');\n return redirect()->route('actions.index');\n}", "public function removeAction() {\n $result = array('status' => 'failed');\n if ($this->getRequest()->isPost() && $this->getRequest()->getPost('remove') == 'true') {\n $dirName = Mage::getBaseDir('code').'/local/Balticode/Postoffice';\n if (is_dir($dirName) && file_exists($dirName.'/etc/config.xml')) {\n $directory = new Varien_Io_File();\n $deleteResult = $directory->rmdir($dirName, true);\n if ($deleteResult) {\n $result['status'] = 'success';\n }\n }\n \n }\n $this->getResponse()->setRawHeader('Content-type: application/json');\n $this->getResponse()->setBody(json_encode($result));\n return;\n }", "public function dropListCache()\n {\n $this->statusLists = null;\n return $this;\n }", "function evel_list_destroy($scope, $tag) {\n global $evel_client;\n $params = func_get_args();\n $result = $evel_client->call('EvEl.list_destroy', $params);\n return $result;\n}", "private function remove()\n {\n $this->checkPersister();\n\n $this->persister->beginTransaction();\n foreach ($this as $entity) {\n if (!empty($entity)) {\n $this->persister->remove($entity);\n }\n }\n\n $this->persister->commitTransaction();\n }", "public function remove() {\n if ( ! $this->can_remove() ) {\n return;\n }\n $location = add_query_arg( 'tab', 'export', admin_url( 'options-general.php?page=wpsupercache' ) );\n if ( $this->backupFileExists() )\n $file = @unlink( self::$cache_config_file_backup );\n if ( ! $file ) {\n wp_safe_redirect( add_query_arg( 'message', 4, $location ) );\n exit;\n }\n delete_option( '_wp_super_cache_backup_options' );\n wp_safe_redirect( add_query_arg( 'message', 6, $location ) );\n exit;\n }", "public function drop () {\n\t\tif ($this->oStore->isSetUp()) {\n\t\t\t$this->oStore->drop();\n\t\t}\n\t}", "public function destroy(ServiceList $serviceList) {\n //\n }", "public function deleteCollection(Request $request){\n Collection::find($request->id)->books()->detach();\n\n // Removing the collection\n Collection::find($request->id)->delete();\n }", "protected function afterRemoving()\n {\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeUpload()\n {\n $this->picture = null;\n }", "public function destroyList($id)\n\t{\n\t\tDB::table('list_items')->where('list_id', $id)->delete();\n\t\tDB::table('lists')->where('id', $id)->delete();\n\t\t\n\t\treturn redirect(url('/yourLists'));\n\t}", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function remove()\n {\n }", "function Clear() {\n\t\t\t$s3objects = $this->ListAlls3objects();\n\t\t\t/* delete each one */\n\t\t\tforeach($s3objects AS $s3object) {\n\t\t\t\t$s3object->Delete();\n\t\t\t\tunset($s3object);\n\t\t\t}\n\t\t}", "public function unload()\n {\n\n $this->synchronized = true;\n $this->id = null;\n $this->newId = null;\n $this->data = [];\n $this->savedData = [];\n $this->orm = null;\n\n $this->multiRef = [];\n $this->i18n = null;\n\n }", "public function removeStudentFromList(){\n\n\t\t$viewDataController = new ViewDataController();\n\t\t$data = $viewDataController->buildData();\n\n\t\t$input = Request::all();\t\n\n\t\tif (!isset($input['user_id']) || empty($input['user_id'])) {\n\t\t\treturn 'failed';\n\t\t}\n\n\t\t$cache = Cache::get(env('ENVIRONMENT').'_'.$data['user_id'].'_studentList');\n\n\t\t$cnt = 0;\n\t\tforeach ($cache as $key) {\n\t\t\tif ($key['user_id'] == $input['user_id']) {\n\t\t\t\tunset($cache[$cnt]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$cnt++;\n\t\t}\n\n\t\tCache::put(env('ENVIRONMENT').'_'.$data['user_id'].'_studentList', $cache, 60);\n\n\t\treturn 'success';\n\t}", "public function flush(): void\n {\n $this->list = [];\n }", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n try {\n $connection = $this->resourceConfig->getConnection();\n $connection->delete(\n $this->resourceConfig->getMainTable(),\n [\n $connection->quoteInto('path = ?', Data::XML_META_TAG),\n ]\n );\n $this->cleanCache();\n $response = ['status' => 'OK'];\n } catch (\\Exception $e) {\n $this->logError($e);\n $response['status'] = 'FAILED';\n $response['message'] = $e->getMessage() . '. For more info please check magento squarefeed log file.';\n\n }\n return [$response];\n }", "static function remove() {\n }", "public function remove() {\n\n // Updates DB (data & metadata)\n $this->attributes->removeAll($this->get(\"id\"));\n $this->db->delete(XCMS_Tables::TABLE_USERS, array(\n \"id\" => $this->get(\"id\")\n ));\n\n }", "public function removeRegisteredFiles() {}", "function remove()\t{\r\n\t\ttep_db_query(\"delete from IXcore.\" . TABLE_CONFIGURATION . \" where configuration_key in ('\" . implode(\"', '\", $this->keys()) . \"')\");\r\n\t}", "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 }", "protected function cleanup()\n {\n foreach ($this->temp_files as $file) {\n $this->filesystem->remove($file);\n }\n $this->temp_files = [];\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy(TvList $tvList)\n {\n //\n }" ]
[ "0.6390973", "0.6346092", "0.6188612", "0.6170873", "0.6170873", "0.6170873", "0.6170873", "0.6146227", "0.61462194", "0.60913384", "0.6053139", "0.6026833", "0.59767526", "0.5941312", "0.5903771", "0.58983904", "0.58888906", "0.5884768", "0.58525175", "0.5850606", "0.5843922", "0.5782636", "0.57757676", "0.5720538", "0.5710703", "0.56866133", "0.5683893", "0.5678664", "0.566741", "0.5647042", "0.56122327", "0.5555179", "0.55538213", "0.5547713", "0.5540564", "0.55357075", "0.5526606", "0.5524238", "0.5519446", "0.5519446", "0.5519446", "0.5517828", "0.55142576", "0.5499169", "0.54862076", "0.54691744", "0.546052", "0.54490674", "0.54478407", "0.5436648", "0.5434941", "0.54331017", "0.54326177", "0.54188144", "0.54074895", "0.5404232", "0.5403511", "0.5403351", "0.5384784", "0.53829956", "0.53779143", "0.5375783", "0.5373888", "0.5363912", "0.5353884", "0.535109", "0.5348635", "0.5347736", "0.5346923", "0.5342437", "0.5334328", "0.53161234", "0.5312615", "0.5310666", "0.5303103", "0.52996254", "0.5295665", "0.5292048", "0.5288625", "0.5278882", "0.52751493", "0.52703", "0.5269788", "0.5268161", "0.5266396", "0.526157", "0.5258459", "0.52570206", "0.5249838", "0.52470386", "0.52454436", "0.52422184", "0.5235054", "0.52294016", "0.5226176", "0.5226026", "0.52253777", "0.5224295", "0.5220467", "0.521641", "0.52148944" ]
0.0
-1
/ Plugin Name: Post asssignment Description: Displays posts. Plugin URI: Author: Rama Chaudhry Author URI: / As stated in the wordpress codex, the following code ; the first register post type function will display labels, which are written below. Next, the second part of the argument will ensure that it shows on the front part of the website for the user this code below will allow for the enqueue of a stylesheet for the plugin.
function plugin_enqueue_scripts (){ wp_enqueue_style ('postplugin', plugins_url ('plugin/css/pluginstyle.css')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function thirdtheme_custom_post_type()\n {\n $args = array(\n 'labels' => array('name' =>__(' my custom post'),\n 'singular name' =>__('my custom post')),\n 'public' => true,\n 'show_in_menu' => true,\n 'has_archive' => true,\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail'));\n register_post_type('custompost',$args);\n \n }", "function register_post_types(){\n }", "function register_post_types(){\n }", "public function register_post_type(){\r\n //Capitilize the words and make it plural\r\n $name = ucwords( str_replace( '_', ' ', $this->post_type_name ) );\r\n $plural = $name . 's';\r\n $menupos = $this->post_type_pos;\r\n\r\n // We set the default labels based on the post type name and plural. We overwrite them with the given labels.\r\n $labels = array_merge(\r\n\r\n // Default\r\n array(\r\n 'name' => _x( $plural, 'post type general name' ),\r\n 'singular_name' => _x( $name, 'post type singular name' ),\r\n 'add_new' => _x( 'Add New', strtolower( $name ) ),\r\n 'add_new_item' => __( 'Add New ' . $name ),\r\n 'edit_item' => __( 'Edit ' . $name ),\r\n 'new_item' => __( 'New ' . $name ),\r\n 'all_items' => __( 'All ' . $plural ),\r\n 'view_item' => __( 'View ' . $name ),\r\n 'search_items' => __( 'Search ' . $plural ),\r\n 'not_found' => __( 'No ' . strtolower( $plural ) . ' found'),\r\n 'not_found_in_trash' => __( 'No ' . strtolower( $plural ) . ' found in Trash'),\r\n 'parent_item_colon' => '',\r\n 'menu_name' => $plural\r\n ),\r\n\r\n // Given labels\r\n $this->post_type_labels\r\n\r\n );\r\n\r\n // Same principle as the labels. We set some defaults and overwrite them with the given arguments.\r\n $args = array_merge(\r\n\r\n // Default\r\n array(\r\n 'capability_type' => 'post',\r\n 'hierarchical' => false,\r\n 'label' => $plural,\r\n 'labels' => $labels,\r\n 'menu_position' => $menupos,\r\n 'public' => true,\r\n 'publicly_queryable' => true,\r\n 'query_var' => true,\r\n 'rewrite' => array('slug' => $plural),\r\n 'show_in_nav_menus' => true,\r\n 'show_ui' => true,\r\n 'supports' => array( 'title', 'editor'),\r\n '_builtin' => false,\r\n ),\r\n\r\n // Given args\r\n $this->post_type_args\r\n\r\n );\r\n\r\n // Register the post type\r\n register_post_type( $this->post_type_name, $args );\r\n }", "function create_posttype() {\n \n register_post_type( 'headlines',\n // CPT Options\n array(\n 'labels' => array(\n 'name' => __( 'Headlines' ),\n 'singular_name' => __( 'Headline' )\n\t\t\t),\n\t\t\t'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields'),\n 'public' => true,\n\t\t\t'has_archive' => true,\n 'menu_icon' => 'dashicons-text-page',\n 'rewrite' => array('slug' => 'headlines'),\n 'show_in_rest' => true,\n )\n );\n}", "function register_post_types()\n {\n }", "public function register()\n {\n $args = apply_filters( $this->name.'_post_type_config', $this->config );\n $args['labels'] = apply_filters( $this->name.'_post_type_labels', $this->labels);\n\n register_post_type( $this->name, $args );\n }", "function plugin_cpt_register() {\n\n\t\t\t$labels = array(\n\t\t\t\t'name' => _x( 'Plugins', 'plugins', 'wp3sixty-extra' ),\n\t\t\t\t'singular_name' => _x( 'Plugin', 'plugin', 'wp3sixty-extra' ),\n\t\t\t\t'menu_name' => __( 'Plugin', 'wp3sixty-extra' ),\n\t\t\t\t'name_admin_bar' => __( 'Plugin', 'wp3sixty-extra' ),\n\t\t\t\t'archives' => __( 'Plugin Archives', 'wp3sixty-extra' ),\n\t\t\t\t'parent_item_colon' => __( 'Parent Plugin:', 'wp3sixty-extra' ),\n\t\t\t\t'all_items' => __( 'All Plugins', 'wp3sixty-extra' ),\n\t\t\t\t'add_new_item' => __( 'Add New Plugin', 'wp3sixty-extra' ),\n\t\t\t\t'add_new' => __( 'Add New', 'wp3sixty-extra' ),\n\t\t\t\t'new_item' => __( 'New Plugin', 'wp3sixty-extra' ),\n\t\t\t\t'edit_item' => __( 'Edit Plugin', 'wp3sixty-extra' ),\n\t\t\t\t'update_item' => __( 'Update Plugin', 'wp3sixty-extra' ),\n\t\t\t\t'view_item' => __( 'View Plugin', 'wp3sixty-extra' ),\n\t\t\t\t'search_items' => __( 'Search Plugin', 'wp3sixty-extra' ),\n\t\t\t\t'not_found' => __( 'Not found', 'wp3sixty-extra' ),\n\t\t\t\t'not_found_in_trash' => __( 'Not found in Trash', 'wp3sixty-extra' ),\n\t\t\t\t'featured_image' => __( 'Featured Image', 'wp3sixty-extra' ),\n\t\t\t\t'set_featured_image' => __( 'Set featured image', 'wp3sixty-extra' ),\n\t\t\t\t'remove_featured_image' => __( 'Remove featured image', 'wp3sixty-extra' ),\n\t\t\t\t'use_featured_image' => __( 'Use as featured image', 'wp3sixty-extra' ),\n\t\t\t\t'insert_into_item' => __( 'Insert into plugin', 'wp3sixty-extra' ),\n\t\t\t\t'uploaded_to_this_item' => __( 'Uploaded to this plugin', 'wp3sixty-extra' ),\n\t\t\t\t'items_list' => __( 'Items plugin', 'wp3sixty-extra' ),\n\t\t\t\t'items_list_navigation' => __( 'Plugin list navigation', 'wp3sixty-extra' ),\n\t\t\t\t'filter_items_list' => __( 'Filter plugins list', 'wp3sixty-extra' ),\n\t\t\t);\n\t\t\t$args = array(\n\t\t\t\t'label' => __( 'plugin', 'wp3sixty-extra' ),\n\t\t\t\t'description' => __( 'plugin cpt', 'wp3sixty-extra' ),\n\t\t\t\t'labels' => $labels,\n\t\t\t\t'supports' => array(\n\t\t\t\t\t'title',\n\t\t\t\t\t'editor',\n\t\t\t\t\t'excerpt',\n\t\t\t\t\t'author',\n\t\t\t\t\t'thumbnail',\n\t\t\t\t\t'comments',\n\t\t\t\t\t'revisions',\n\t\t\t\t\t'custom-fields',\n\t\t\t\t\t'post-formats',\n\t\t\t\t),\n\t\t\t\t'taxonomies' => array( 'category', 'post_tag' ),\n\t\t\t\t'hierarchical' => false,\n\t\t\t\t'public' => true,\n\t\t\t\t'show_ui' => true,\n\t\t\t\t'show_in_menu' => true,\n\t\t\t\t'menu_position' => 5,\n\t\t\t\t'menu_icon' => 'dashicons-hammer',\n\t\t\t\t'show_in_admin_bar' => true,\n\t\t\t\t'show_in_nav_menus' => true,\n\t\t\t\t'can_export' => true,\n\t\t\t\t'has_archive' => true,\n\t\t\t\t'exclude_from_search' => false,\n\t\t\t\t'publicly_queryable' => true,\n\t\t\t\t'capability_type' => 'page',\n\t\t\t);\n\t\t\tregister_post_type( 'plugin', $args );\n\n\t\t}", "function register_post_types() {\n\t}", "function register_post_types() {\n\t}", "function rawlins_register_post_types() {\n\t$rawlins_magic_post_type_maker_array = array(\n\t\t/*array(\n\t\t\t'cpt_single' => 'Resource',\n\t\t\t'cpt_plural' => 'Resources',\n\t\t\t'slug' => 'resource',\n\t\t\t'cpt_icon' => 'dashicons-index-card',\n\t\t\t'exclude_from_search' => false,\n\t\t),*/\n\n\t);\n\n\tforeach( $rawlins_magic_post_type_maker_array as $post_type ){\n\t\t$cpt_single = $post_type['cpt_single'];\n\t\t$cpt_plural = $post_type['cpt_plural'];\n\t\t$slug = $post_type['slug'];\n\t\t$cpt_icon = $post_type['cpt_icon'];\n\t\t$exclude_from_search = $post_type['exclude_from_search'];\n\n\t\t// Admin Labels\n\t \t$labels = rawlins_generate_label_array($cpt_plural, $cpt_single);\n\n\t \t// Arguments\n\t\t$args = rawlins_generate_post_type_args($labels, $cpt_plural, $cpt_icon, $exclude_from_search);\n\n\t\t// Just do it\n\t\tregister_post_type( $slug, $args );\n\t}\n\n}", "function bs_configure_custom_post_types($args)\n{\n function bs_custom_post_types()\n {\n global $bs_config;\n\n foreach ($bs_config[\"custom-post-types\"] as $key => $type) {\n $type = bs_defaults($type, [\n \"public\" => true,\n ]);\n\n if (isset($type[\"name\"])) {\n $type[\"labels\"][\"name\"] = $type[\"name\"];\n }\n\n if (isset($type[\"slug\"])) {\n $type[\"rewrite\"][\"slug\"] = $type[\"slug\"];\n }\n\n if (isset($type[\"admin_only\"]) && $type[\"admin_only\"]) {\n $type[\"public\"] = false;\n $type[\"show_ui\"] = true;\n }\n\n register_post_type($key, bs_array_omit($type, [\"slug\", \"name\", \"admin_only\"]));\n }\n }\n add_action(\"init\", \"bs_custom_post_types\");\n}", "public static function register_post_type()\n {\n\n \t register_post_type( 'books',\n\t\t array(\n\t\t 'labels' => array(\n\t\t 'name' => __( 'Books' ),\n\t\t 'singular_name' => __( 'Books' )\n\t\t ),\n\t\t 'public' => true,\n\t\t 'has_archive' => false,\n\t\t )\n\t\t );\n\n }", "private function register_post_type() {\n\t\t\t// register the post type\n\t\t\t$args = array('label' => __('Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t'description' => '',\n\t\t\t\t\t\t\t\t\t\t'public' => false,\n\t\t\t\t\t\t\t\t\t\t'show_ui' => true,\n\t\t\t\t\t\t\t\t\t\t'show_in_menu' => true,\n\t\t\t\t\t\t\t\t\t\t'capability_type' => 'post',\n\t\t\t\t\t\t\t\t\t\t'map_meta_cap' => true,\n\t\t\t\t\t\t\t\t\t\t'hierarchical' => false,\n\t\t\t\t\t\t\t\t\t\t'rewrite' => array('slug' => $this->post_type, 'with_front' => false),\n\t\t\t\t\t\t\t\t\t\t'query_var' => true,\n\t\t\t\t\t\t\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t\t\t\t\t\t\t'menu_position' => 100,\n\t\t\t\t\t\t\t\t\t\t'menu_icon' => 'dashicons-admin-generic',\n\t\t\t\t\t\t\t\t\t\t'supports' => array('title','custom-fields','revisions'),\n\t\t\t\t\t\t\t\t\t\t'labels' => array('name' => __('Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'singular_name' => __('Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'menu_name' =>\t__('Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'add_new' => __('Add Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'add_new_item' => __('Add New Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit' => __('Edit', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit_item' => __('Edit Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'new_item' => __('New Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'view' => __('View Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'view_item' => __('View Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'search_items' => __('Search Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'not_found' => __('No Options Pages Found', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'not_found_in_trash' => __('No Options Pages Found in Trash', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'parent' => __('Parent Options Page', $this->text_domain)));\n\t\t\tregister_post_type($this->post_type, $args);\n\t\t}", "function pluginprefix_setup_post_type()\n{\n register_post_type('post-nasa-gallery', [\n 'label' => 'Nasa Images Posts',\n 'public' => true\n ]);\n}", "function add_config_post_type() {\n\t\t\n\t\t$labels = array(\n 'name' => _x( 'Công trình', 'Post Type General Name'),\n 'singular_name' => _x( 'Công trình', 'Post Type Singular Name'),\n 'menu_name' => __( 'Công trình'),\n 'name_admin_bar' => __( 'Công trình'),\n 'archives' => __( 'Item Archives'),\n 'attributes' => __( 'Item Attributes'),\n 'parent_item_colon' => __( 'Parent Item:'),\n 'all_items' => __( 'Tất cả công trình'),\n 'add_new_item' => __( 'Add công trình'),\n 'add_new' => __( 'Thêm công trình'),\n 'new_item' => __( 'Thêm mới'),\n 'edit_item' => __( 'Chỉnh sửa'),\n 'update_item' => __( 'Cập nhật'),\n 'view_item' => __( 'View Item'),\n 'view_items' => __( 'View Items'),\n 'search_items' => __( 'Search Item'),\n 'not_found' => __( 'Not found'),\n 'not_found_in_trash' => __( 'Not found in Trash'),\n 'featured_image' => __( 'Featured Image'),\n 'set_featured_image' => __( 'Set featured image'),\n 'remove_featured_image' => __( 'Remove featured image'),\n 'use_featured_image' => __( 'Use as featured image'),\n 'insert_into_item' => __( 'Insert into item'),\n 'uploaded_to_this_item' => __( 'Uploaded to this item'),\n 'items_list' => __( 'Bản ghi'),\n 'items_list_navigation' => __( 'Items list navigation'),\n 'filter_items_list' => __( 'Filter items list'),\n );\n $args = array(\n 'label' => __( 'Công trình'),\n 'description' => __( 'Công trình'),\n 'labels' => $labels,\n 'supports' => array( 'title','editor','revisions','thumbnail','author'),\n 'taxonomies' => array('category'),\n 'hierarchical' => true,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'post',\n // 'rewrite' => array( 'slug' => 'danhsach' ),\n 'query_var' => true,\n 'menu_icon' => 'dashicons-admin-home'\n );\n register_post_type( 'estate', $args );\n \n }", "public function register_post_type() {\n\t\tadd_action( 'init', array( $this, 'post_registration_callback' ), 0, 0 );\n\t}", "public function register_post_types() {\n $args = array(\n 'description' => '',\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_in_nav_menus' => false,\n 'show_in_admin_bar' => true,\n 'exclude_from_search' => false,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 12,\n 'menu_icon' => 'dashicons-portfolio',\n 'can_export' => true,\n 'delete_with_user' => false,\n 'hierarchical' => false,\n // 'has_archive' => option::get( 'portfolio_root' ),\n 'query_var' => 'portfolio_item',\n 'show_in_rest' => true,\n\n /* The rewrite handles the URL structure. */\n 'rewrite' => array(\n 'slug' => trim( option::get( 'portfolio_root' ) ),\n 'with_front' => false,\n 'pages' => true,\n 'feeds' => true,\n 'ep_mask' => EP_PERMALINK,\n ),\n\n /* What features the post type supports. */\n 'supports' => array(\n 'title',\n 'editor',\n 'excerpt',\n 'author',\n 'thumbnail',\n 'custom-fields',\n 'comments'\n ),\n\n /* Labels used when displaying the posts. */\n 'labels' => array(\n 'name' => __( 'Portfolio Items', 'wpzoom' ),\n 'singular_name' => __( 'Portfolio Item', 'wpzoom' ),\n 'menu_name' => __( 'Portfolio', 'wpzoom' ),\n 'name_admin_bar' => __( 'Portfolio Item', 'wpzoom' ),\n 'add_new' => __( 'Add New', 'wpzoom' ),\n 'add_new_item' => __( 'Add New Portfolio Item', 'wpzoom' ),\n 'edit_item' => __( 'Edit Portfolio Item', 'wpzoom' ),\n 'new_item' => __( 'New Portfolio Item', 'wpzoom' ),\n 'view_item' => __( 'View Portfolio Item', 'wpzoom' ),\n 'search_items' => __( 'Search Portfolio', 'wpzoom' ),\n 'not_found' => __( 'No portfolio items found', 'wpzoom' ),\n 'not_found_in_trash' => __( 'No portfolio items found in trash', 'wpzoom' ),\n 'all_items' => __( 'Portfolio Items', 'wpzoom' ),\n\n // Custom labels b/c WordPress doesn't have anything to handle this.\n 'archive_title' => __( 'Portfolio', 'wpzoom' ),\n )\n );\n\n /* Register the portfolio post type */\n register_post_type( 'portfolio_item', $args );\n }", "function create_post_type() {\r\n register_post_type( 'nyheter',\r\n array(\r\n 'labels' => array(\r\n 'name' => __( 'Nyheter' ),\r\n 'singular_name' => __( 'Nyheter' )\r\n ),\r\n 'public' => true,\r\n 'has_archive' => true,\r\n 'supports' => array('title', 'editor', 'thumbnail')\r\n )\r\n );\r\n}", "static function register_post_type() {\n\n $args = array(\n 'labels' => array(\n\t\t'name' => __( 'Forms', 'pwp' ),\n\t\t'singular_name' => __( 'Form', 'pwp' ),\n\t\t'add_new' => __( 'Add New', 'pwp' ),\n\t\t'add_new_item' => __( 'Add New Form', 'pwp' ),\n\t\t'edit_item' => __( 'Edit Form', 'pwp' ),\n\t\t'new_item' => __( 'New Form', 'pwp' ),\n\t\t'all_items' => __( 'All Forms', 'pwp' ),\n\t\t'view_item' => __( 'View Form', 'pwp' ),\n\t\t'search_items' => __( 'Search Forms', 'pwp' ),\n\t\t'not_found' => __( 'No forms found', 'pwp' ),\n\t\t'not_found_in_trash' => __( 'No forms found in Trash', 'pwp' ),\n\t\t'parent_item_colon' => __( ':', 'pwp' ),\n\t\t'menu_name' => __( 'Forms', 'pwp' )\n\t ),\n 'public' => false,\n 'show_ui' => true,\n 'query_var' => false,\n 'supports' => array( 'title', 'custom-fields', 'editor' )\n );\n\tregister_post_type( 'form', $args );\n }", "function portfolio_post_type(){\n $args=array(\n 'labels'=>array(\n 'name'=>'Portfolios',\n 'singular_name'=>'Portfolio'\n ),\n 'public'=>true,\n 'has_archive'=>true,\n 'menu_icon'=>'dashicons-admin-site-alt3',\n 'supports'=>array('title','editor','thumbnail','custom-fields'),\n\n );\n register_post_type('portfolio',$args);\n}", "public function setup_posttype() {\n register_post_type( 'brg_post_templates',\n array(\n 'labels' => array(\n 'name' => 'Templates',\n 'singular_name' => 'Template'\n ),\n 'description' => 'Template for a post type single view',\n 'public' => false,\n 'show_ui' => true\n )\n );\n }", "function registerPostTypes()\n{\n register_post_type('destination', [\n 'public' => true,\n 'label' => 'Destinations',\n 'supports' => ['title', 'editor', 'thumbnail']\n ]);\n register_post_type('review', [\n 'public' => true,\n 'label' => 'Reviews',\n 'supports' => ['title', 'editor']\n ]);\n}", "function cptui_register_my_cpts_how_it_works() {\n\n\t$labels = array(\n\t\t\"name\" => __( \"How It Works\", \"esoftkulo\" ),\n\t\t\"singular_name\" => __( \"How it Work\", \"esoftkulo\" ),\n\t);\n\n\t$args = array(\n\t\t\"label\" => __( \"How It Works\", \"esoftkulo\" ),\n\t\t\"labels\" => $labels,\n\t\t\"description\" => \"\",\n\t\t\"public\" => true,\n\t\t\"publicly_queryable\" => true,\n\t\t\"show_ui\" => true,\n\t\t\"delete_with_user\" => false,\n\t\t\"show_in_rest\" => true,\n\t\t\"rest_base\" => \"\",\n\t\t\"rest_controller_class\" => \"WP_REST_Posts_Controller\",\n\t\t\"has_archive\" => false,\n\t\t\"show_in_menu\" => true,\n\t\t\"show_in_nav_menus\" => true,\n\t\t\"exclude_from_search\" => false,\n\t\t\"capability_type\" => \"post\",\n\t\t\"map_meta_cap\" => true,\n\t\t\"hierarchical\" => false,\n\t\t\"rewrite\" => array( \"slug\" => \"how_it_works\", \"with_front\" => true ),\n\t\t\"query_var\" => true,\n\t\t\"supports\" => array( \"title\", \"editor\", \"thumbnail\" ),\n\t);\n\n\tregister_post_type( \"how_it_works\", $args );\n}", "function BH_register_posttypes() {\r\n\r\n\tBH_register_posttype_event();\r\n\tBH_register_posttype_gallery();\r\n\r\n}", "function carbon_register_post_type($settings){\n\n $labels = array(\n 'name' => _x($settings['plural'],'post type plural name','carbon'),\n 'singular_name' => _x($settings['singular'],'post type singular name','carbon'),\n 'add_new' => _x('Add New',$settings['singular'],'carbon'),\n 'add_new_item' => __('Add New ' .$settings['singular']),\n 'edit_item' => __('Edit ' .$settings['singular']),\n 'new_item' => __('New ' .$settings['singular']),\n 'all_items' => __('All ' .$settings['plural']),\n 'view_item' => __('View ' .$settings['singular']),\n 'search_items' => __('Search ' .$settings['plural']),\n 'not_found' => __('No ' .$settings['plural'].' found'),\n 'not_found_in_trash' => __('No ' .$settings['plural'].' found in Trash'),\n 'parent_item_colon' => ':',\n 'menu_name' => $settings['plural'],\n );\n\n $args = array(\n 'labels' => $labels,\n 'can_export' => (isset($settings['can_export']) ? $settings['can_export'] : true), // defaults true\n 'capability_type' => (isset($settings['capability_type']) ? $settings['behavior'] : 'post'), // default post\n // 'capabilities' // default capability_type\n 'exclude_from_search' => (isset($settings['exclude_from_search']) ? $settings['exclude_from_search'] : false), // default opposite of public\n 'hierarchical' => (isset($settings['hierarchical']) ? $settings['hierarchical'] : false), // default false\n 'has_archive' => (isset($settings['has_archive']) ? $settings['has_archive'] : false), // default false\n // 'permalink_epmask' // default EP_PERMALINK\n 'public' => (isset($settings['public']) ? $settings['public'] : true), // default false\n 'publicly_queryable' => (isset($settings['publicly_queryable']) ? $settings['publicly_queryable'] : true), // default public\n 'query_var' => (isset($settings['query_var']) ? $settings['query_var'] : true), // default true type\n 'show_ui' => (isset($settings['show_ui']) ? $settings['show_ui'] : true), // default public\n 'show_in_menu' => (isset($settings['show_in_menu']) ? $settings['show_in_menu'] : true), // default public\n 'show_in_admin_bar' => (isset($settings['show_in_admin_bar']) ? $settings['show_in_admin_bar'] : true), // default show_in_menu\n 'menu_position' => (isset($settings['menu_position']) ? $settings['menu_position'] : null), // default null\n 'menu_icon' => (isset($settings['menu_icon']) ? $settings['menu_icon'] : 'dashicons-admin-post'),\n 'supports' => (isset($settings['supports']) ? $settings['supports'] : array('title', 'editor', 'excerpt', 'thumbnail', 'revisions', 'page-attributes')), // default title editor\n 'taxonomies' => (isset($settings['taxonomies']) ? $settings['taxonomies'] : array()), // default none\n // 'register_meta_box_cb' // default none\n 'rewrite' => (isset($settings['rewrite']) ? $settings['rewrite'] : array( // default true name\n 'slug' => (isset($settings['slug']) ? $settings['slug'] : $settings['type']), // default type\n 'with_front' => (isset($settings['with_front']) ? $settings['with_front'] : false), // default true\n 'feeds' => (isset($settings['feeds']) ? $settings['feeds'] : false), // default has_archive\n 'pages' => (isset($settings['pages']) ? $settings['pages'] : true), // defaults true\n // 'ep_mask' // default permalink_epmask EP_PERMALINK\n )),\n );\n register_post_type($settings['type'], $args);\n }", "function tt_register_cpt($single, $plural = '') {\n if (empty($plural)) {\n $plural = $single.'s';\n }\n register_post_type(\n strtolower($single),\n array(\n 'label' => $plural,\n 'labels' => array(\n 'add_new_item' => \"Add New $single\",\n 'edit_item' => \"Edit $single\",\n 'new_item' => \"New $single\",\n 'view_item' => \"View $single\",\n 'search_items' => \"Search $plural\",\n 'not_found' => \"No $plural found\",\n 'not_found_in_trash' => \"No $plural found in Trash\",\n ),\n 'public' => true,\n 'has_archive' => true,\n 'supports' => array(\n 'title',\n 'editor',\n 'thumbnail',\n 'custom-fields',\n 'excerpt',\n ),\n 'taxonomies' => array('category'),\n )\n );\n}", "function wpbm_register_post_type(){\n include('inc/admin/register/wpbm-register-post.php');\n register_post_type( 'WP Blog Manager', $args );\n }", "function register_fablabs_post_type () {\n\t$labels = array(\n 'name' => _x( 'Fab Labs', 'post type general name', 'additive_tcp' ),\n 'singular_name' => _x( 'Fab Lab', 'post type singular name', 'additive_tcp' ),\n 'menu_name' => _x( 'Fab Labs', 'admin menu', 'additive_tcp' ),\n 'name_admin_bar' => _x( 'Fab Lab', 'add new on admin bar', 'additive_tcp' ),\n 'add_new' => _x( 'Add New', 'fablab', 'additive_tcp' ),\n 'add_new_item' => __( 'Add New Fab Lab', 'additive_tcp' ),\n 'new_item' => __( 'New Fab Lab', 'additive_tcp' ),\n 'edit_item' => __( 'Edit Fab Lab', 'additive_tcp' ),\n 'view_item' => __( 'View Fab Lab', 'additive_tcp' ),\n 'all_items' => __( 'All Fab Labs', 'additive_tcp' ),\n 'search_items' => __( 'Search Fab Labs', 'additive_tcp' ),\n 'parent_item_colon' => __( 'Parent Fab Lab:', 'additive_tcp' ),\n 'not_found' => __( 'No fab labs found.', 'additive_tcp' ),\n 'not_found_in_trash' => __( 'No fab labs found in Trash.', 'additive_tcp' )\n );\n\tregister_post_type('additive_fab_lab', array(\n\t\t'labels' => $labels,\n\t\t'description' => 'Fab Labs which will appear on the Fab Labs page.',\n\t\t'public' => true,\n\t\t'hierarchical' => false,\n\t\t'capability_type' => 'post',\n\t\t'supports' => array('title', 'editor', 'custom-fields', 'thumbnail')\n\t));\n}", "function custom_post_type() {\n\n// Set UI labels for Custom Post Type\n\t$labels = array(\n\t\t'name' => _x( 'Новости', 'Новости сайта', 'p1atform' ),\n\t\t'singular_name' => _x( 'Новость', 'Post Type Singular Name', 'p1atform' ),\n\t\t'menu_name' => __( 'Новости', 'p1atform' ),\n\t\t'parent_item_colon' => __( 'Parent Новость', 'p1atform' ),\n\t\t'all_items' => __( 'Все новости', 'p1atform' ),\n\t\t'view_item' => __( 'Просмотреть новость', 'p1atform' ),\n\t\t'add_new_item' => __( 'Добавить новость', 'p1atform' ),\n\t\t'add_new' => __( 'Добавить новость', 'p1atform' ),\n\t\t'edit_item' => __( 'Редактировать новость', 'p1atform' ),\n\t\t'update_item' => __( 'Обновить новость', 'p1atform' ),\n\t\t'search_items' => __( 'Поиск новости', 'p1atform' ),\n\t);\n\n\t$args = array(\n\t\t'label' => __( 'Отзывы', 'p1atform' ),\n\t\t'description' => __( 'Отзывы', 'p1atform' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array(\n\t\t\t'title',\n\t\t\t'editor',\n\t\t\t'excerpt',\n\t\t\t'author',\n\t\t\t'thumbnail',\n\t\t\t'comments',\n\t\t\t'revisions',\n\t\t\t'custom-fields'\n\t\t),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-format-aside',\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n\t);\n\n\tregister_post_type( 'news', $args );\n\n\t$labels = array(\n\t\t'name' => _x( 'Клиенты', 'Новости сайта', 'p1atform' ),\n\t\t'singular_name' => _x( 'Клиент', 'Post Type Singular Name', 'p1atform' ),\n\t\t'menu_name' => __( 'Клиенты', 'p1atform' ),\n\t\t'parent_item_colon' => __( 'Парент Клиент', 'p1atform' ),\n\t\t'all_items' => __( 'Все клиенты', 'p1atform' ),\n\t\t'view_item' => __( 'Просмотреть клиента', 'p1atform' ),\n\t\t'add_new_item' => __( 'Добавить клиента', 'p1atform' ),\n\t\t'add_new' => __( 'Добавить клиента', 'p1atform' ),\n\t\t'edit_item' => __( 'Редактировать клиента', 'p1atform' ),\n\t\t'update_item' => __( 'Обновить клиента', 'p1atform' ),\n\t\t'search_items' => __( 'Поиск клиента', 'p1atform' ),\n\t);\n\n\t$args = array(\n\t\t'labels' => $labels,\n\t\t'supports' => array(\n\t\t\t'title',\n\t\t\t'editor',\n\t\t\t'excerpt',\n\t\t\t'author',\n\t\t\t'thumbnail',\n\t\t\t'comments',\n\t\t\t'revisions',\n\t\t\t'custom-fields',\n\t\t),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 6,\n\t\t'menu_icon' => 'dashicons-admin-users',\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n\t);\n\n\tregister_post_type( 'clients', $args );\n\n\tregister_post_type( 'reviews', array(\n\t\t'labels' => array(\n\t\t\t'name' => 'Отзывы', // Основное название типа записи\n\t\t\t'singular_name' => 'Отзыв', // отдельное название записи типа Book\n\t\t\t'add_new' => 'Добавить Отзыв',\n\t\t\t'add_new_item' => 'Добавить Отзыв',\n\t\t\t'edit_item' => 'Редактировать Отзыв',\n\t\t\t'new_item' => 'Новая Отзыв',\n\t\t\t'view_item' => 'Посмотреть Отзыв',\n\t\t\t'search_items' => 'Найти Отзыв',\n\t\t\t'not_found' => 'Книг не найдено',\n\t\t\t'not_found_in_trash' => 'В корзине книг не найдено',\n\t\t\t'parent_item_colon' => '',\n\t\t\t'menu_name' => 'Отзывы'\n\n\t\t),\n\t\t'public' => true,\n\t\t'publicly_queryable' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => true,\n\t\t'capability_type' => 'post',\n\t\t'has_archive' => true,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-format-chat',\n\t\t'hierarchical' => false,\n\t\t'menu_position' => null,\n\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )\n\t) );\n\n}", "public function register_post_types() {\n\n\t}", "function carbon_register_post_types(){\n\n // carbon_register_post_type(array(\n // 'singular' => 'Type', // required\n // 'plural' => 'Types', // required\n // 'type' => 'type', // required\n // 'slug' => 'types/type',\n // 'menu_icon' => 'dashicons-admin-post',\n // 'has_archive' => true,\n // 'exclude_from_search' => true,\n // ));\n }", "function add_custom_post_type() {\n\tregister_post_type( 'learning_resource',\n array(\n 'labels' => array(\n 'name' => __( 'Learning Resources' ),\n 'singular_name' => __( 'Learning Resource' )\n ),\n 'public' => true,\n 'has_archive' => true,\n )\n );\n}", "function gndt_register_cpt_publishing() {\n register_post_type('gndt_research',\n array(\n 'labels' => array(\n 'name' => __('Research', 'textdomain'),\n 'singular_name' => __('Research', 'textdomain'),\n ),\n 'public' => true,\n 'has_archive' => true,\n\t\t \t\t'show_in_rest' => true,\n 'supports' => ['editor'], /* allow gutenberg editor for this post type */\n 'capability_type' => 'gndt_researchposttype',\n\t\t\t \t'capabilities' => array(\n\t\t\t\t\t 'publish_posts' => 'gndt_publish_researchposttypes',\n\t\t\t\t\t 'edit_posts' => 'gndt_edit_researchposttypes',\n\t\t\t\t\t 'edit_others_posts' => 'gndt_edit_others_researchposttypes',\n\t\t\t\t\t 'read_private_posts' => 'gndt_read_private_researchposttypes',\n\t\t\t\t\t 'edit_post' => 'gndt_edit_researchposttype',\n\t\t\t\t\t 'delete_post' => 'gndt_delete_researchposttype',\n\t\t\t\t\t 'read_post' => 'gndt_read_researchposttype',\n\t\t\t\t ),\n )\n );\n\n\tadd_post_type_support( 'gndt_research', 'author' ); //add author support to custom post type \n}", "function register_post_types(){\n\t\t\trequire('lib/custom-types.php');\n\t\t}", "public static function register_post_types() {}", "function custom_post_type() {\n\t$labels = array(\n\t\t'name' => __( 'Post', 'themeSlug' ),\n\t\t'singular_name' => __( 'Post', 'themeSlug' ),\n\t\t'menu_name' => __( 'Post', 'themeSlug' ),\n\t\t'all_items' => __( 'All Post', 'themeSlug' ),\n\t\t'add_new' => __( 'Add New', 'themeSlug' ),\n\t\t'add_new_item' => __( 'Add New Post', 'themeSlug' ),\n\t\t'edit_item' => __( 'Edit Post', 'themeSlug' ),\n\t\t'new_item' => __( 'New Item', 'themeSlug' ),\n\t\t'view_item' => __( 'View Post', 'themeSlug' ),\n\t\t'search_items' => __( 'Search Post', 'themeSlug' ),\n\t\t'not_found' => __( 'No Post Found', 'themeSlug' ),\n\t\t'not_found_in_trash' => __( 'No Post in trash', 'themeSlug' ),\n\t\t'parent_item_colon' => __( 'Parent Post', 'themeSlug' ),\n\t\t'archives' => __( 'Post Archives', 'themeSlug' ),\n\t\t'insert_into_item' => __( 'Insert into Post', 'themeSlug' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this Post', 'themeSlug' ),\n\t\t'filter_items_list' => __( 'Filter Post List', 'themeSlug' ),\n\t\t'items_list_navigation' => __( 'Post list navigation', 'themeSlug' ),\n\t\t'items_list' => __( 'Post List', 'themeSlug' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'Post', 'text_domain' ),\n\t\t'description' => __( 'Post', 'text_domain' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'editor' ),\n\t\t'hierarchical' => false,\n\t\t'public' => false,\n\t\t'publicly_queryable' => false,\n\t\t'show_ui' => true,\n\t\t'show_in_rest' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 6,\n\t\t'menu_icon' => 'dashicons-format-status',\n\t\t'exclude_from_search' => false,\n\t\t'capability_type' => 'post',\n\t\t'rewrite' => array(\n\t\t\t'slug' => 'cpt',\n\t\t\t'with_front' => true,\n\t\t),\n\t);\n\n\tregister_post_type( 'cpt', $args );\n}", "public function register_post_type()\n {\n $labels = [\n 'name' => _x('Chiro Quizzes', 'post type general name', $this->token),\n 'singular_name' => _x('Chiro Quiz', 'post type singular name', $this->token),\n 'add_new' => _x('Add New', $this->token, $this->token),\n 'add_new_item' => sprintf(__('Add New %s', $this->token), __('Chiro Quiz', $this->token)),\n 'edit_item' => sprintf(__('Edit %s', $this->token), __('Chiro Quiz', $this->token)),\n 'new_item' => sprintf(__('New %s', $this->token), __('Chiro Quiz', $this->token)),\n 'all_items' => sprintf(__('All %s', $this->token), __('Chiro Quizzes', $this->token)),\n 'view_item' => sprintf(__('View %s', $this->token), __('Chiro Quiz', $this->token)),\n 'search_items' => sprintf(__('Search %a', $this->token), __('Chiro Quizzes', $this->token)),\n 'not_found' => sprintf(__('No %s Found', $this->token), __('Chiro Quizzes', $this->token)),\n 'not_found_in_trash' => sprintf(__('No %s Found In Trash', $this->token), __('Chiro Quizzes', $this->token)),\n 'parent_item_colon' => '',\n 'menu_name' => __('Chiro Quizzes', $this->token)\n ];\n\n $slug = __('chiro-quiz', 'pf_chiro_quiz');\n $custom_slug = get_option('pf_chiro_quiz_slug');\n if ($custom_slug && strlen($custom_slug) > 0 && $custom_slug != '') {\n $slug = $custom_slug;\n }\n\n $args = [\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'exclude_from_search' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'query_var' => true,\n 'rewrite' => ['slug' => $slug],\n 'capability_type' => 'post',\n 'has_archive' => false,\n 'hierarchical' => false,\n 'supports' => ['title'],\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-admin-quiz'\n ];\n\n register_post_type($this->token, $args);\n }", "function bf_register_custom_post_type() {\r\n /* Añado las etiquetas que aparecerán en el escritorio de WordPress */\r\n\t$labels = array(\r\n\t\t'name' => _x( 'Ponentes', 'post type general name', 'text-domain' ),\r\n\t\t'singular_name' => _x( 'Ponente', 'post type singular name', 'text-domain' ),\r\n\t\t'menu_name' => _x( 'Ponentes', 'admin menu', 'text-domain' ),\r\n\t\t'add_new' => _x( 'Añadir nuevo', 'ponente', 'text-domain' ),\r\n\t\t'add_new_item' => __( 'Añadir nuevo ponente', 'text-domain' ),\r\n\t\t'new_item' => __( 'Nuevo Ponente', 'text-domain' ),\r\n\t\t'edit_item' => __( 'Editar Ponente', 'text-domain' ),\r\n\t\t'view_item' => __( 'Ver ponente', 'text-domain' ),\r\n\t\t'all_items' => __( 'Todos los ponentes', 'text-domain' ),\r\n\t\t'search_items' => __( 'Buscar ponentes', 'text-domain' ),\r\n\t\t'not_found' => __( 'No hay ponentes.', 'text-domain' ),\r\n\t\t'not_found_in_trash' => __( 'No hay ponentes en la papelera.', 'text-domain' )\r\n\t);\r\n\r\n /* Configuro el comportamiento y funcionalidades del nuevo custom post type */\r\n\t$args = array(\r\n\t\t'labels' => $labels,\r\n\t\t'description' => __( 'Descripción.', 'text-domain' ),\r\n\t\t'public' => true,\r\n\t\t'publicly_queryable' => true,\r\n\t\t'show_ui' => true,\r\n\t\t'show_in_menu' => true,\r\n\t\t'show_in_nav_menus' => true,\r\n\t\t'query_var' => true,\r\n\t\t'rewrite' => array( 'slug' => 'ponente' ),\r\n\t\t'capability_type' => 'post',\r\n\t\t'hierarchical' => false,\r\n\t\t'menu_position' => null,\r\n 'menu_icon' => 'dashicons-businessman',\r\n\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\r\n\t\t'show_in_rest'\t \t => true,\r\n\t\t'public' \t\t\t => true,\r\n\t\t'has_archive' \t\t => true,\r\n\t\t'taxonomies' => array('category','categoria-conferencias')\r\n\t);\r\n\r\n\tregister_post_type('ponentes', $args );\r\n}", "function custom_post_type() {\n $labels = array(\n 'name' => _x( 'Ort', 'Post Type General Name', 'twentythirteen' ),\n 'singular_name' => _x( 'Ort', 'Post Type Singular Name', 'twentythirteen' ),\n 'menu_name' => __( 'Orter', 'twentythirteen' ),\n 'all_items' => __( 'Alla Orter', 'twentythirteen' ),\n 'view_item' => __( 'View Ort', 'twentythirteen' ),\n 'add_new_item' => __( 'Skapa ny Ort', 'twentythirteen' ),\n 'add_new' => __( 'Skapa ny Ort', 'twentythirteen' ),\n 'edit_item' => __( 'Redigera Ort', 'twentythirteen' ),\n 'update_item' => __( 'Upddatera Ort', 'twentythirteen' ),\n 'search_items' => __( 'Sök Ort', 'twentythirteen' ),\n 'not_found' => __( 'Not Found', 'twentythirteen' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'twentythirteen' ),\n );\n \n $args = array(\n 'label' => __( 'cities', 'twentythirteen' ),\n 'description' => __( 'City Post Page', 'twentythirteen' ),\n 'labels' => $labels,\n 'supports' => array('title','thumbnail',),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n \n register_post_type( 'cities', $args );\n\n }", "function classTools_post_type() {\n\n $labels = array(\n 'name' => _x( 'Ferramentas', 'Post Type General Name', 'text_domain' ),\n 'singular_name' => _x( 'ferramenta', 'Post Type Singular Name', 'text_domain' ),\n 'menu_name' => __( 'Ferramenta', 'text_domain' ),\n 'name_admin_bar' => __( 'Post Type', 'text_domain' ),\n 'archives' => __( 'Item Archives', 'text_domain' ),\n 'attributes' => __( 'Item Attributes', 'text_domain' ),\n 'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n 'all_items' => __( 'todas as ferramentas', 'text_domain' ),\n 'add_new_item' => __( 'Add novaferramenta', 'text_domain' ),\n 'add_new' => __( 'nova ferramenta', 'text_domain' ),\n 'new_item' => __( 'nova ferramenta', 'text_domain' ),\n 'edit_item' => __( 'Edit Item', 'text_domain' ),\n 'update_item' => __( 'Update Item', 'text_domain' ),\n 'view_item' => __( 'View Item', 'text_domain' ),\n 'view_items' => __( 'View Items', 'text_domain' ),\n 'search_items' => __( 'Search Item', 'text_domain' ),\n 'not_found' => __( 'não encontrado', 'text_domain' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n 'featured_image' => __( 'Featured Image', 'text_domain' ),\n 'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n 'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n 'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n 'insert_into_item' => __( 'Insert into item', 'text_domain' ),\n 'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),\n 'items_list' => __( 'Items list', 'text_domain' ),\n 'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),\n 'filter_items_list' => __( 'Filter items list', 'text_domain' ),\n );\n $args = array(\n 'label' => __( 'ferramentas', 'text_domain' ),\n 'description' => __( 'ferramentas', 'text_domain' ),\n 'labels' => $labels,\n 'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields'),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n register_post_type( 'classTools_post_type', $args );\n\n}", "function tower_custom_post_types() {\n foreach (TOWER_CUSTOM_POSTS as $key => $custom_type) {\n register_post_type($key, $custom_type['config']);\n }\n}", "function register_post_types(){\n\t\trequire('lib/custom-types.php');\n\t}", "public function register_post_type() {\n\t $args = array(\n\t\t\t'public' => true,\n\t\t\t'label' => 'Questions'\n\t\t);\n\t register_post_type( 'questions', $args );\n\t}", "public function registerPostTypes()\n {\n $projectLabels = array(\n 'name' => __( 'Projects'),\n 'singular_name' => __( 'Project'),\n 'menu_name' => __( 'Projects'),\n 'parent_item_colon' => __( 'Parent Project'),\n 'all_items' => __( 'All Projects'),\n 'view_item' => __( 'View Project'),\n 'add_new_item' => __( 'Add New Project'),\n 'add_new' => __( 'Add New'),\n 'edit_item' => __( 'Edit Project'),\n 'update_item' => __( 'Update Project'),\n 'search_items' => __( 'Search Project'),\n 'not_found' => __( 'Not Found'),\n 'not_found_in_trash' => __( 'Not found in Trash'),\n );\n $componentLabels = array(\n 'name' => __( 'Components'),\n 'singular_name' => __( 'Component'),\n 'menu_name' => __( 'Components'),\n 'parent_item_colon' => __( 'Parent Component'),\n 'all_items' => __( 'All Components'),\n 'view_item' => __( 'View Component'),\n 'add_new_item' => __( 'Add New Component'),\n 'add_new' => __( 'Add New'),\n 'edit_item' => __( 'Edit Component'),\n 'update_item' => __( 'Update Component'),\n 'search_items' => __( 'Search Component'),\n 'not_found' => __( 'Not Found'),\n 'not_found_in_trash' => __( 'Not found in Trash'),\n );\n $componentTypeTaxLabels = array(\n 'name' => __('Component types'),\n 'singular_name' => __('Component type'),\n 'search_items' => __( 'Search Component types' ),\n 'popular_items' => __( 'Popular Component types' ),\n 'all_items' => __( 'All Component types' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Component type' ),\n 'update_item' => __( 'Update Component type' ),\n 'add_new_item' => __( 'Add New Component type' ),\n 'new_item_name' => __( 'New Component type Name' ),\n 'separate_items_with_commas' => __( 'Separate component types with commas' ),\n 'add_or_remove_items' => __( 'Add or remove component types' ),\n 'choose_from_most_used' => __( 'Choose from the most used ones' ),\n 'menu_name' => __( 'Component types' ),\n ); \n \n // Set other options for custom post types\n $projectArgs = array(\n 'label' => __( 'projects'),\n 'description' => __( 'Stuff that you have done or used'),\n 'labels' => $projectLabels,\n 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields'),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 6,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n \n $componentArgs = array(\n 'label' => __( 'components'),\n 'description' => __( 'Things used in projects'),\n 'labels' => $componentLabels,\n 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields'),\n 'taxonomies' => array('components'),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 7,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n \n $componentTypeTaxArgs = array(\n 'hierarchical' => false,\n 'labels' => $componentTypeTaxLabels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'type' ),\n );\n \n // Registering your Custom Post Type\n register_taxonomy('component_type', 'component', $componentTypeTaxArgs);\n register_post_type('component', $componentArgs);\n register_post_type( 'project', $projectArgs );\n }", "function custom_post_types(){\n\t\n // CPT Portfolio\n $labels = array(\n 'name' => __('Formation'),\n 'all_items' => 'LA FORMATION ', // affiché dans le sous menu\n 'singular_name' => 'Formation',\n 'add_new_item' => 'add new formation ',\n 'edit_item' => 'Modify the diploma',\n 'menu_name' => 'Formation'\n );\n\n\t$args = array(\n 'labels' => $labels,\n 'public' => true,\n 'show_in_rest' => true,\n 'has_archive' => true,\n 'supports' => array( 'title', 'editor','thumbnail', 'excerpt' ),\n 'menu_position' => 2, \n 'menu_icon' => 'dashicons-welcome-learn-more',\n\t);\n\n\tregister_post_type( 'formation', $args );\n}", "function labdevs_rtcookie_post_type_init()\n{\n $labels = array(\n 'name' => _x('labdevsrtcookies', 'post type general name', 'your-plugin-textdomain'),\n 'singular_name' => _x('labdevsrtcookie', 'post type singular name', 'your-plugin-textdomain'),\n 'menu_name' => _x('labdevsrtcookies', 'admin menu', 'your-plugin-textdomain'),\n 'name_admin_bar' => _x('labdevsrtcookie', 'add new on admin bar', 'your-plugin-textdomain'),\n 'add_new' => _x('Add New', 'labdevsrtcookie', 'your-plugin-textdomain'),\n 'add_new_item' => __('Add New labdevsrtcookie', 'your-plugin-textdomain'),\n 'new_item' => __('New labdevsrtcookie', 'your-plugin-textdomain'),\n 'edit_item' => __('Edit labdevsrtcookie', 'your-plugin-textdomain'),\n 'view_item' => __('View labdevsrtcookie', 'your-plugin-textdomain'),\n 'all_items' => __('All labdevsrtcookies', 'your-plugin-textdomain'),\n 'search_items' => __('Search labdevsrtcookies', 'your-plugin-textdomain'),\n 'parent_item_colon' => __('Parent labdevsrtcookies:', 'your-plugin-textdomain'),\n 'not_found' => __('No labdevsrtcookies found.', 'your-plugin-textdomain'),\n 'not_found_in_trash' => __('No labdevsrtcookies found in Trash.', 'your-plugin-textdomain'),\n );\n\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'query_var' => true,\n 'rewrite' => array('slug' => 'labdevsrtcookie'),\n 'capability_type' => 'post',\n 'has_archive' => true,\n 'hierarchical' => false,\n 'menu_position' => null,\n 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments')\n );\n\n register_post_type('labdevsrtcookie', $args);\n}", "function cadastrando_post_type_clientes() {\n\n $nomeSingular = 'Cliente';\n $nomePlural = 'Clientes';\n $descricao = 'Clientes da minha empresa';\n\n $labels = array(\n 'name' => $nomePlural,\n 'name_singular' => $nomeSingular,\n 'add_new_item' => 'Adicionar novo ' . $nomeSingular,\n 'edit_item' => 'Editar ' . $nomeSingular\n );\n\n $supports = array(\n 'title',\n 'editor',\n 'thumbnail'\n );\n\n $args = array(\n 'labels' => $labels,\n 'description' => $descricao,\n 'public' => true,\n 'menu_icon' => 'dashicons-id-alt',\n 'supports' => $supports\n );\n\n register_post_type( 'cliente', $args);\n}", "function nsbr_post_type() {\r\n\r\n $labels = array(\r\n\t\t'name' => _x( 'NSBR', 'Post Type General Name', 'text_domain' ),\r\n\t\t'singular_name' => _x( 'Boat', 'Post Type Singular Name', 'text_domain' ),\r\n\t\t'menu_name' => __( 'NSBR', 'text_domain' ),\r\n\t\t'parent_item_colon' => __( 'Parent Boat:', 'text_domain' ),\r\n\t\t'all_items' => __( 'All Small Boat Registrations', 'text_domain' ),\r\n\t\t'view_item' => __( 'View Boat Registration', 'text_domain' ),\r\n\t\t'add_new_item' => __( 'Add Small Boat Registration', 'text_domain' ),\r\n\t\t'add_new' => __( 'Add Small Boat Registration', 'text_domain' ),\r\n\t\t'edit_item' => __( 'Edit Boat Registration', 'text_domain' ),\r\n\t\t'update_item' => __( 'Update Boat Registration', 'text_domain' ),\r\n\t\t'search_items' => __( 'Search NSBR', 'text_domain' ),\r\n\t\t'not_found' => __( 'Boat Not found in Register', 'text_domain' ),\r\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\r\n\t);\r\n\t$capabilities = array(\r\n\t\t'edit_post' => 'edit_nsbr',\r\n\t\t'read_post' => 'read_nsbr',\r\n\t\t'delete_post' => 'delete_nsbr',\r\n\t\t'edit_posts' => 'edit_nsbr',\r\n\t\t'edit_others_posts' => 'edit_others_nsbr',\r\n\t\t'publish_posts' => 'publish_nsbr',\r\n\t\t'read_private_posts' => 'read_private_nsbr',\r\n\t);\r\n\t$args = array(\r\n\t\t'label' => __( 'nsbr', 'text_domain' ),\r\n\t\t'description' => __( 'National Small Boat Register', 'text_domain' ),\r\n\t\t'labels' => $labels,\r\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions',),\r\n\t\t'hierarchical' => false,\r\n\t\t'public' => true,\r\n\t\t'show_ui' => true,\r\n\t\t'show_in_menu' => true,\r\n\t\t'show_in_nav_menus' => true,\r\n\t\t'show_in_admin_bar' => true,\r\n\t\t'menu_position' => 5,\r\n\t\t'can_export' => true,\r\n\t\t'has_archive' => true,\r\n\t\t'exclude_from_search' => false,\r\n\t\t'publicly_queryable' => true,\r\n\t 'capabilities' => $capabilities,\r\n\t);\r\n\tregister_post_type( 'nsbr', $args );\r\n\t\r\n\tadd_role('nsbr_manager', 'NSBR Manager', array(\r\n 'edit_nsbr' => true,\r\n 'edit_others_nsbr' => true,\r\n 'read_nsbr' => true,\r\n 'publish_nsbr' => true,\r\n 'read_private_nsbr' => true,\r\n 'delete_nsbr' => true,\r\n 'read'=> true\r\n ));\r\n \r\n\t add_nsbr_capabilities_to_role( 'curator' );\r\n add_nsbr_capabilities_to_role( 'administrator' );\r\n add_nsbr_capabilities_to_role( 'nmmc_admin' );\r\n}", "function my_custom_post_registry() {\n\t$registry_labels = array(\n\t\t'name' => 'Registrations',\n\t\t'singular_name' => 'Cozmeena Shawl Registration',\n\t\t'add_new' => 'Add New',\n\t\t'all_items' => 'All Registrations',\n\t\t'add_new_item' => 'Add New Registration',\n\t\t'edit_item' => 'Edit Registration',\n\t\t'new_item' => 'New Registration',\n\t\t'view_item' => 'View Registration',\n\t\t'search_items' => 'Search Registrations',\n\t\t'not_found' => 'No Registrations found',\n\t\t'not_found_in_trash' => 'No Registrations found in trash',\n\t\t'parent_item_colon' => '',\n\t\t'menu_name' => 'Cozmeena Shawl Registrations'\n\t);\n\t$registry_args = array(\n\t\t'labels' => $registry_labels,\n\t\t'description' => \"The International Cozmeena Registry is the official record of Cozmeena Shawls\",\n\t\t'public' => true,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => '',\n\t\t'supports' => array('title','author', 'editor','thumbnail'),\n\t\t'capability_type' => 'coz_registry', // need to assign capabilities via plugin\n\t\t'map_meta_cap' => true,\n\t\t'has_archive' => true,\n\t); \n\tregister_post_type('coz_registry',$registry_args);\n}", "public function customPostType()\n {\n\n if (empty($this->custom_post_types)) {\n return;\n }\n\n foreach ($this->custom_post_types as $post_type) {\n register_post_type(\n $post_type['post_type'],\n [\n 'labels' => [\n 'name' => __($post_type['name'], 'vrcoder'),\n 'singular_name' => __($post_type['singular_name'], 'vrcoder'),\n 'menu_name' => __($post_type['name'], 'vrcoder'),\n 'name_admin_bar' => __($post_type['singular_name'], 'vrcoder'),\n 'archives' => __($post_type['singular_name'] . ' Archives', 'vrcoder'),\n 'attributes' => __($post_type['singular_name'] . ' Attributes', 'vrcoder'), \n 'parent_item_colon' => __('Parent ' . $post_type['singular_name'], 'vrcoder'),\n 'all_items' => __('All ' . $post_type['name'], 'vrcoder'),\n 'add_new_item' => __('Add new ' . $post_type['singular_name'], 'vrcoder'),\n 'add_new' => __('Add new', 'vrcoder'),\n 'new_item' => __('New ' . $post_type['singular_name'], 'vrcoder'),\n 'edit_item' => __('Edit ' . $post_type['singular_name'], 'vrcoder'),\n 'update_item' => __('Update' . $post_type['singular_name'], 'vrcoder'),\n 'view_item' => __('View' . $post_type['singular_name'], 'vrcoder'),\n 'view_items' => __('View' . $post_type['name'], 'vrcoder'),\n 'search_items' => __('Search' . $post_type['name'], 'vrcoder'),\n 'not_found' => __('No' . $post_type['singular_name'] . ' Found', 'vrcoder'),\n 'not_found_in_trash' => __('No' . $post_type['singular_name'] . ' Found in Trash', 'vrcoder'),\n 'featured_image' => __('Featured Image', 'vrcoder'),\n 'set_featured_image' => __('Set Featured Image', 'vrcoder'),\n 'remove_featured_image' => __('Remove Featured Image', 'vrcoder'),\n 'use_featured_image' => __('Use Featured Image', 'vrcoder'),\n 'insert_into_item' => __('Insert into' . $post_type['singular_name'], 'vrcoder'),\n 'uploaded_to_this_item' => __('Upload to this' . $post_type['singular_name'], 'vrcoder'),\n 'items_list' => __($post_type['name'] . ' List', 'vrcoder'),\n 'items_list_navigation' => __($post_type['name'] . ' List Navigation', 'vrcoder'),\n 'filter_items_list' => __('Filter' . $post_type['name'] . ' List', 'vrcoder'),\n ],\n 'label' => __($post_type['singular_name'], 'vrcoder'),\n 'description' => __($post_type['name'] . ' Custom Post Type', 'vrcoder'),\n 'supports' => $post_type['supports'],\n 'show_in_rest' => $post_type['show_in_rest'],\n 'taxonomies' => $post_type['taxonomies'],\n 'hierarchical' => $post_type['hierarchical'],\n 'public' => $post_type['public'],\n 'show_ui' => $post_type['show_ui'],\n 'show_in_menu' => $post_type['show_in_menu'],\n 'menu_position' => $post_type['menu_position'],\n 'show_in_admin_bar' => $post_type['show_in_admin_bar'],\n 'show_in_nav_menus' => $post_type['show_in_nav_menus'],\n 'can_export' => $post_type['can_export'],\n 'has_archive' => $post_type['has_archive'],\n 'exclude_from_search' => $post_type['exclude_from_search'],\n 'publicly_queryable' => $post_type['publicly_queryable'],\n 'capability_type' => $post_type['capability_type'],\n 'menu_icon' => $post_type['menu_icon']\n ]\n );\n }\n\n }", "public function register_post_types() {\n require_once('includes/post-types.php');\n }", "function thirdtheme_about_page()\n {\n $args = array(\n 'labels' => array('name' =>__('our service'),\n 'add_new' =>__('add services detail')),\n \n 'public' => true,\n 'menu_icon' =>'dashicons-buddicons-pm',\n 'show_in_menu' => true,\n 'has_archive' => true,\n 'supports' => array( 'title', 'editor')); \n register_post_type('our_service',$args);\n }", "function thirdtheme_resort_overview()\n {\n add_theme_support('post-thumbnails');\n add_image_size('medium',278,281);\n $args = array(\n 'labels' => array('name' =>__('resort detail'),\n 'add_new' =>__('add new detail')),\n \n 'public' => true,\n 'menu_icon' => 'dashicons-format-aside',\n 'show_in_menu' => true,\n 'has_archive' => true,\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail','custom-fields','excerpt')); \n register_post_type('resortdetail',$args);\n }", "public function register_post_type(){\n\t\tif(!class_exists('CPT')) return;\n\t\n\t\t$this->post_type = new CPT(\n\t\t\tarray(\n\t\t\t 'post_type_name' => 'slide',\n\t\t\t 'singular' => 'Slide',\n\t\t\t 'plural' => 'Slides',\n\t\t\t 'slug' => 'slide'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'has_archive' \t\t\t=> \ttrue,\n\t\t\t\t'menu_position' \t\t=> \t8,\n\t\t\t\t'menu_icon' \t\t\t=> \t'dashicons-layout',\n\t\t\t\t'supports' \t\t\t\t=> \tarray('title', 'excerpt', 'content','thumbnail', 'post-formats', 'custom-fields')\n\t\t\t)\n\t\t);\n\t\t\n\t\t$labels = array('menu_name'=>'Types');\n\t\t$this->post_type->register_taxonomy('type',array(\n\t\t\t'hierarchical' => true,\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'show_tagcloud' => true,\n\t\t),$labels);\n\t}", "function resources_custom_post() {\n\n\t$labels = array(\n\t\t'name' => _x( 'Resources', 'Post Type General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'Resource', 'Post Type Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'Resources Post', 'text_domain' ),\n\t\t'name_admin_bar' => __( 'Resources Post', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n\t\t'all_items' => __( 'All Items', 'text_domain' ),\n\t\t'add_new_item' => __( 'Add New Item', 'text_domain' ),\n\t\t'add_new' => __( 'Add New', 'text_domain' ),\n\t\t'new_item' => __( 'New Item', 'text_domain' ),\n\t\t'edit_item' => __( 'Edit Item', 'text_domain' ),\n\t\t'update_item' => __( 'Update Item', 'text_domain' ),\n\t\t'view_item' => __( 'View Item', 'text_domain' ),\n\t\t'search_items' => __( 'Search Item', 'text_domain' ),\n\t\t'not_found' => __( 'Not found', 'text_domain' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'Resource', 'text_domain' ),\n\t\t'description' => __( 'resources_custom_post', 'text_domain' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', ),\n\t\t'taxonomies' => array( 'category', 'post_tag' ),\n\t\t'hierarchical' => true,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\t\t\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n\t);\n\tregister_post_type('resources_post', $args);\n\n}", "function wpcp_custom_post_type()\n{\n register_post_type('wpcp_server',\n array(\n 'labels' => array(\n 'name' => __('Servers', 'textdomain'),\n 'singular_name' => __('Server', 'textdomain'),\n ),\n 'public' => true,\n 'has_archive' => false,\n 'delete_with_user' => false,\n \"supports\" => array(\"customer\", \"author\"),\n 'menu_icon' => 'dashicons-cloud'\n )\n );\n}", "function adafunc_setup(){\r\n load_plugin_textdomain('wp-ada', true, dirname( plugin_basename( __FILE__ ) ) . '/lang' );\r\n\r\n //Enables Pet and Lost Types\r\n $PETPostType = new PETPostType();\r\n\r\n\t\t//Register the post type\r\n\t\tadd_action('init', array($PETPostType,'register'),3 );\r\n\r\n //Register pet type taxonomies\r\n add_action('init', 'create_type_taxonomies', 5 );\r\n add_action('init', 'create_color_taxonomies', 6 );\r\n add_action('init', 'create_status_taxonomy', 7 );\r\n add_action('init', 'create_state_taxonomy', 8 );\r\n\r\n //Metabox script\r\n add_action ('init', 'meta_box_script', 10);\r\n\r\n //Contextual Help\r\n add_action('admin_head', 'plugin_header');\r\n add_action('contextual_help', 'add_help_text', 10, 3 );\r\n\r\n //Widgets\r\n add_action('widgets_init', create_function('', 'return register_widget(\"ADA_Widget_Tagcloud\");'));\r\n add_action('widgets_init', create_function('', 'return register_widget(\"ADA_Widget_Searchform\");'));\r\n add_action('widgets_init', create_function('', 'return register_widget(\"ADAWidget\");'));\r\n add_shortcode( 'ada', 'ada_shortcode' );\r\n }", "public function register_custom_post_type() {\n $labels = array (\n 'name' => __('Custom', self::$plugin_obj->class_name ),\n 'singular_name' => __('item', self::$plugin_obj->class_name ),\n 'add_new' => __('new item', self::$plugin_obj->class_name ),\n 'add_new_item' => __('new item', self::$plugin_obj->class_name ),\n 'new_item' => __('new item', self::$plugin_obj->class_name ),\n 'edit' => __('edit item', self::$plugin_obj->class_name ),\n 'edit_item' => __('edit item', self::$plugin_obj->class_name ),\n 'view' => __('view item', self::$plugin_obj->class_name ),\n 'view_item' => __('view item', self::$plugin_obj->class_name ),\n 'search_items' => __('search item', self::$plugin_obj->class_name ),\n 'not_found' => __('no item found', self::$plugin_obj->class_name ),\n 'not_found_in_trash' => __('no item in trash', self::$plugin_obj->class_name ),\n 'parent' => __('parent item', self::$plugin_obj->class_name )\n );\n\n $args = array(\n 'labels' => $labels,\n 'public' => TRUE,\n 'publicly_queryable' => TRUE,\n 'show_ui' => TRUE,\n 'show_in_menu' => TRUE,\n 'query_var' => TRUE,\n 'capability_type' => 'page',\n 'has_archive' => TRUE,\n 'hierarchical' => TRUE,\n 'exclude_from_search' => FALSE,\n 'menu_position' => 100 ,\n 'supports' => array('title','editor','excerpt','custom-fields','revisions','thumbnail','page-attributes'),\n 'taxonomies' => array('category','post_tag')\n );\n\n register_post_type('custom', $args);\n }", "function news_custom_post() {\n $args = array(\n 'public' => true,\n 'label' => 'News',\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\n 'show_ui' => true,\n 'publicly_queryable' => true,\n 'taxonomies' => array('category', 'post_tag'),\n 'rewrite' => array( 'slug' => 'news' )\n\t\n );\n register_post_type('news', $args);\n}", "function Custom_Post_type()\n{\n $labels = array( \n 'name' => 'Flipbox',\n 'singular_name' => 'Flipbox', \n 'menu_name' => 'Flipbox',\n 'all_items' => 'All Flipbox', \n 'view_item' => 'View wow Flipbox',\n 'add_new_item' => false,\n 'add_new' => 'Add New Flipbox',\n 'edit_item' => 'Edit Flipbox',\n 'update_item' => 'Update Flipbox',\n 'search_items' => 'Search Flipbox',\n 'not_found' => 'Not found', \n 'not_found_in_trash' => 'Not Found in trash'\n ); \n\n $args = array(\n 'label' => 'Flipbox', 'twentynineteen',\n 'description' => 'Flipbox', 'twentynineteen',\n 'labels' => $labels,\n 'hierarchial' => false, \n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 15,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search'=> false,\n 'publicly_queryable' => true, \n 'capability_type' => 'post', \n 'supports' => ( array( 'title' ) ), \n );\n \n register_post_type('Flipbox', $args);\n}", "public function registered_post_type( $post_type, $args ) {\n\n\t\tglobal $wp_post_types, $wp_rewrite, $wp;\n\n\t\tif( $args->_builtin or !$args->publicly_queryable or !$args->show_ui ){\n\t\t\treturn false;\n\t\t}\n\t\t$permalink = get_option( $post_type.'_structure' );\n\n\t\tif( !$permalink ) {\n\t\t\t$permalink = $this->default_structure;\n\t\t}\n\n\t\t$permalink = '%'.$post_type.'_slug%'.$permalink;\n\t\t$permalink = str_replace( '%postname%', '%'.$post_type.'%', $permalink );\n\n\t\tadd_rewrite_tag( '%'.$post_type.'_slug%', '('.$args->rewrite['slug'].')','post_type='.$post_type.'&slug=' );\n\n\t\t$taxonomies = get_taxonomies( array(\"show_ui\" => true, \"_builtin\" => false), 'objects' );\n\t\tforeach ( $taxonomies as $taxonomy => $objects ):\n\t\t\t$wp_rewrite->add_rewrite_tag( \"%tax-$taxonomy%\", '(.+?)', \"$taxonomy=\" );\n\t\tendforeach;\n\n\t\t$permalink = trim($permalink, \"/\" );\n\t\tadd_permastruct( $post_type, $permalink, $args->rewrite );\n\n\t}", "public function register_post(): void\n {\n $args = $this->register_post_type_args();\n register_post_type($this->post_type, $args);\n }", "public function registerCustomPostTypes() {\n\n\n }", "function press_post_type() {\n\n// Set UI labels for Custom Post Type\n\t$labels = array(\n\t\t'name' => _x( 'Press', 'Post Type General Name'),\n\t\t'singular_name' => _x( 'Press', 'Post Type Singular Name'),\n\t\t'menu_name' => __( 'Press'),\n\t\t'all_items' => __( 'All Press'),\n\t\t'view_item' => __( 'View Press'),\n\t\t'add_new_item' => __( 'Add New Press'),\n\t\t'add_new' => __( 'Add New'),\n\t\t'edit_item' => __( 'Edit Press'),\n\t\t'update_item' => __( 'Update Press')\n\n\t\t\n\t);\n\t\n// Set other options for Custom Post Type\n\t\n\t$args = array(\n\t\t'label' => __( 'press'),\n\t\t'labels' => $labels,\n\t\t// Features this CPT supports in Post Editor\n\t\t'supports' => array( 'title', 'editor', 'thumbnail'),\n \n\t\t/* A hierarchical CPT is like Pages and can have\n\t\t* Parent and child items. A non-hierarchical CPT\n\t\t* is like Posts.\n\t\t*/\t\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => false,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 5,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => true,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n 'rewrite' => array(\"slug\" => \"press\"),\n 'register_meta_box_cb' => 'add_press_metaboxes' // function hooking up metaboxes\n\t);\n\t\n\t// Registering your Custom Post Type\n\tregister_post_type( 'press', $args );\n\n}", "function create_posttype() {\n register_post_type( 'sliders',\n // CPT Options\n array(\n 'labels' => array(\n 'name' => __( 'sliders' ),\n 'singular_name' => __( 'sliders' )\n ),\n 'public' => true,\n 'has_archive' => false,\n 'rewrite' => array('slug' => 'sliders'),\n )\n );\n }", "function setup_post_types() {\n\t\t//Default support for WP Pages\n\t\tadd_post_type_support('page','sliders');\n\t\t\n\t\t/**\n\t\t * @cpt Sliders\n\t\t */\n\t\t$labels = array(\n\t\t\t'name' => __('Sliders','tw-sliders'),\n\t\t\t'singular_name' => __('Slider','tw-sliders'),\n\t\t\t'add_new' => __('Add slider','tw-sliders'),\n\t\t\t'add_new_item' => __('Add new slider','tw-sliders')\n\t\t);\n\t\t\n\t\t$args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'public' => false,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => 'themes.php',\n\t\t\t'supports' => array('title','sliders')\n\t\t); \n\t\t\n\t\tregister_post_type('tw-sliders',$args);\n\t}", "function resource_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'Resources', 'Post Type General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'Resource', 'Post Type Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'Resource', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Parent Resource:', 'text_domain' ),\n\t\t'all_items' => __( 'All Resources', 'text_domain' ),\n\t\t'view_item' => __( 'View Resource', 'text_domain' ),\n\t\t'add_new_item' => __( 'Add New Resource', 'text_domain' ),\n\t\t'add_new' => __( 'Add New', 'text_domain' ),\n\t\t'edit_item' => __( 'Edit Resource', 'text_domain' ),\n\t\t'update_item' => __( 'Update Resource', 'text_domain' ),\n\t\t'search_items' => __( 'Search Resource', 'text_domain' ),\n\t\t'not_found' => __( 'Not found', 'text_domain' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'resource', 'text_domain' ),\n\t\t'description' => __( 'Base resources for fuel use', 'text_domain' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'custom-fields', 'page-attributes', ),\n\t\t'taxonomies' => array( 'usage' ),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 5,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'page',\n\t\t'show_in_rest' => true,\n\t\t'rest_base' => 'resources',\n\t);\n\tregister_post_type( 'resource', $args );\n\n}", "function theme_custom_post_type() {\n\tregister_post_type( 'custom_type',\n\n\t\t// Array with all the options for the custom post type\n\t\tarray( 'labels' => array(\n\t\t\t'name'\t\t\t\t\t=> __( 'Custom Types' ), // Name of the custom post type group\n\t\t\t'singular_name'\t\t\t=> __( 'Custom Post' ), // Name of the custom post type singular\n\t\t\t'all_items'\t\t\t\t=> __( 'All Custom Posts' ),\n\t\t\t'add_new' \t\t\t\t=> __( 'Add New' ),\n\t\t\t'add_new_item' \t\t\t=> __( 'Add New Custom Type' ),\n\t\t\t'edit'\t\t\t\t\t=> __( 'Edit' ),\n\t\t\t'edit_item'\t\t\t\t=> __( 'Edit Post Types' ),\n\t\t\t'new_item'\t\t\t\t=> __( 'New Post Type' ),\n\t\t\t'view_item'\t\t\t\t=> __( 'View Post Type' ),\n\t\t\t'search_items'\t\t\t=> __( 'Search Post Type' ),\n\t\t\t'not_found'\t\t\t\t=> __( 'Nothing found in the Database.' ),\n\t\t\t'not_found_in_trash'\t=> __( 'Nothing found in Trash' ),\n\t\t\t'parent_item_colon' \t=> ''\n\t\t\t),\n\n\t\t\t'description' \t\t\t=> __( 'This is the example custom post type' ), // Custom post type description\n\t\t\t'public' \t\t\t\t=> true,\n\t\t\t'publicly_queryable' \t=> true,\n\t\t\t'exclude_from_search' \t=> false,\n\t\t\t'show_ui' \t\t\t\t=> true,\n\t\t\t'query_var' \t\t\t=> true,\n\t\t\t'menu_position' \t\t=> 5, // The order the custom post type appears on the admin menu\n\t\t\t// 'menu_icon' \t\t\t=> get_stylesheet_directory_uri() . '/assets/images/custom-post-icon.png',\n\t\t\t'rewrite'\t\t\t\t=> array( 'slug' => 'custom_type', 'with_front' => false ), // You may specify its url slug\n\t\t\t'has_archive' \t\t\t=> 'custom_type', // You mary rename the slug here\n\t\t\t'capability_type' \t\t=> 'post',\n\t\t\t'hierarchical' \t\t\t=> false,\n\n\t\t\t// Enable post editor support\n\t\t\t'supports' => array(\n\t\t\t\t'title',\n\t\t\t\t'editor',\n\t\t\t\t'author',\n\t\t\t\t'thumbnail',\n\t\t\t\t'excerpt',\n\t\t\t\t'trackbacks',\n\t\t\t\t'custom-fields',\n\t\t\t\t'comments',\n\t\t\t\t'revisions',\n\t\t\t\t'sticky'\n\t\t\t)\n\t\t)\n\t);\n\n\t// This adds your post categories to your custom post type\n\tregister_taxonomy_for_object_type( 'category', 'custom_type' );\n\n\t// This adds your post tags to your custom post type\n\tregister_taxonomy_for_object_type( 'post_tag', 'custom_type' );\n\n}", "function create_post_type() {\n\n // register external_post as a Custom Post Type\n register_post_type( 'external_post', \n array( \n 'labels' => array( \n 'name' => __('External Posts'), \n 'singular_name' => __('External Post') \n ),\n 'public' => true,\n 'menu_position' => 5,\n 'supports' => array('title', 'excerpt'),\n 'rewrite' => array('slug' => 'external','with_front' => false) \n ) \n ); \n\n // connect external_post to category taxonomy\n register_taxonomy_for_object_type('category', 'external_post');\n register_taxonomy_for_object_type('post_tag', 'external_post');\n\n\n // register wp_tool as a Custom Post Type\n register_post_type('wp_tool',\n array( \n 'labels' => array( \n 'name' => __('WordPress Tools'), \n 'singular_name' => __('WordPress Tool') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'author', 'editor', 'excerpt', 'thumbnail', 'post-formats', 'revisions', 'meta_info'),\n 'rewrite' => array('slug' => 'tool','with_front' => false) \n ) \n );\n\n // connect wp_tool to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'wp_tool');\n register_taxonomy_for_object_type('category', 'wp_tool');\n\n\n // reregister default post so we can set a custom slug\n register_post_type('post', array(\n 'labels' => array(\n 'name_admin_bar' => _x('Post', 'add new on admin bar' ),\n ),\n 'public' => true,\n '_builtin' => false, \n '_edit_link' => 'post.php?post=%d', \n 'capability_type' => 'post',\n 'map_meta_cap' => true,\n 'show_in_menu' => false,\n 'hierarchical' => false,\n 'rewrite' => array('slug' => 'article'),\n 'query_var' => false,\n 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats', 'column_info'),\n )); \n\n // register external_tool as a Custom Post Type\n register_post_type('external_tool',\n array(\n 'labels' => array( \n 'name' => __('External Tools'), \n 'singular_name' => __('External Tool') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'author', 'excerpt', 'thumbnail', 'revisions', 'meta_info'),\n 'rewrite' => array('slug' => 'special','with_front' => false) \n ) \n ); \n\n // connect external_tool to category taxonomy\n register_taxonomy_for_object_type('category', 'external_tool');\n register_taxonomy_for_object_type('meta_info', 'external_tool');\n\n\n // register city_journal as a Custom Post Type\n register_post_type('city_journal',\n array(\n 'labels' => array( \n 'name' => __('CityJournal Entry'),\n 'singular_name' => __('CityJournal Entry')\n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'editor', 'author', 'excerpt', 'thumbnail', 'revisions', 'meta_info', 'comments'),\n 'rewrite' => array('slug' => 'cityjournal','with_front' => false) \n ) \n ); \n\n // connect city_journal to category taxonomy\n register_taxonomy_for_object_type('category', 'city_journal');\n register_taxonomy_for_object_type('meta_info', 'city_journal'); \n\n\n // register people_project as a Custom Post Type\n register_post_type('people_project',\n array(\n 'labels' => array( \n 'name' => __('People & Projects'),\n 'singular_name' => __('People & Project')\n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'excerpt', 'thumbnail', 'meta_info'),\n ) \n ); \n\n // connect people_project to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'people_project'); \n\n\n register_post_type('discussion',\n array( \n 'labels' => array( \n 'name' => __('Discussions'), \n 'singular_name' => __('Discussion') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'post-formats', 'revisions', 'meta_info', 'comments'),\n 'rewrite' => array('slug' => 'discussion','with_front' => false) \n ) \n );\n\n // connect discussion to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'discussion');\n register_taxonomy_for_object_type('category', 'discussion');\n\n}", "function create_resource() {\n register_post_type( 'resources',\n array(\n 'labels' => array(\n 'name' => 'Downloadable Resources',\n 'singular_name' => 'Downloadable Resource',\n 'add_new' => 'Add New',\n 'add_new_item' => 'Add New Resource',\n 'edit' => 'Edit',\n 'edit_item' => 'Edit Resource',\n 'new_item' => 'New Resource',\n 'view' => 'View',\n 'view_item' => 'View Resource',\n 'search_items' => 'Search Downloadable Resources',\n 'not_found' => 'No Downloadable Resources found',\n 'not_found_in_trash' => 'No Downloadable Resources found in Trash',\n 'parent' => 'Parent Resource'\n ),\n \n 'public' => true,\n 'menu_position' => 15,\n 'supports' => array( 'title', 'editor', 'thumbnail' ),\n 'taxonomies' => array( 'resource_categories', 'resource_tags' ),\n 'menu_icon' => plugins_url( 'images/generic.png', __FILE__ ),\n 'has_archive' => true\n )\n );\n}", "function create_posttype() \n {\n register_post_type( 'mist_employee',\n array(\n 'labels' => array(\n 'name' => __( 'Employees' ),\n 'singular_name' => __( 'Employee' )\n ),\n \n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array('slug' => 'employees'),\n 'supports' => array('title','editor','thumbnail','excerpt'),\n 'menu_icon' => 'dashicons-businessman'\n )\n );\n register_post_type( 'mist_message',\n array(\n 'labels' => array(\n 'name' => __( 'Person Messages' ),\n 'singular_name' => __( 'Message' ),\n ),\n \n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array('slug' => 'message'),\n 'supports' => array('title','editor','thumbnail','excerpt'),\n 'menu_icon' => 'dashicons-testimonial'\n )\n );\n add_post_type_support('mist_message', 'excerpt');\n \n }", "public function register_post_type() {\n\t\t$labels = array(\n\t\t\t'name' => _x( 'Movies', 'Post type general name', 'plugintest' ),\n\t\t\t'singular_name' => _x( 'Movie', 'Post type singular name', 'plugintest' ),\n\t\t\t'menu_name' => _x( 'Movies', 'Admin Menu text', 'plugintest' ),\n\t\t\t'name_admin_bar' => _x( 'Movie', 'Admin Menu Toolbar text', 'plugintest' ),\n\t\t\t'add_new' => __( 'Add New', 'plugintest' ),\n\t\t\t'add_new_item' => __( 'Add New Movie', 'plugintest' ),\n\t\t\t'new_item' => __( 'Aaaaaa', 'plugintest' ),\n\t\t\t'view_item' => __( 'View Movie', 'plugintest' ),\n\t\t\t'edit_item' => __( 'Edit Movie', 'plugintest' ),\n\t\t\t'all_items' => __( 'All Movies', 'plugintest' ),\n\t\t\t'search_items' => __( 'Search Movies', 'plugintest' ),\n\t\t\t'parent_item_colon' => __( 'Parent Movies', 'plugintest' ),\n\t\t\t'not_found' => __( 'No Movies found.', 'plugintest' ),\n\t\t\t'not_found_in_trash' => __( 'No Movies found in Trash.', 'plugintest' ),\n\t\t\t'featured_image' => _x( 'Movie Cover Image', 'Overrides the “Featured Image” phrase for this post type. Added in 4.3', 'plugintest' ),\n\t\t\t'set_featured_image' => _x( 'Set cover image', 'Overrides the “Set featured image” phrase for this post type. Added in 4.3', 'plugintest' ),\n\t\t\t'remove_featured_image' => _x( 'Remove cover image', 'Overrides the “Remove featured image” phrase for this post type. Added in 4.3', 'plugintest' ),\n\t\t\t'use_featured_image' => _x( 'Use as cover image', 'Overrides the “Use as featured image” phrase for this post type. Added in 4.3', 'plugintest' ),\n\t\t\t'item_published' => __( 'New Movie Published.', 'plugintest' ),\n\t\t\t'item_updated' => __( 'Movie post updated.', 'plugintest' ),\n\t\t);\n\n\t\t$args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'query_var' => true,\n\t\t\t'rewrite' => array( 'slug' => 'movie' ),\n\t\t\t'capability_type' => 'post',\n\t\t\t'hierarchical' => false,\n\t\t\t'has_archive' => true,\n\t\t\t'menu_position' => null,\n\t\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\n\t\t\t'taxonomies' => array( 'category', 'post_tag' ), // Using wordpess category and tags.\n\t\t);\n\n\t\tregister_post_type( 'movie', $args );\n\t\tflush_rewrite_rules();\n\n\t\t$category_labels = array(\n\t\t\t'name' => esc_html__( 'Movies Categories', 'plugintest' ),\n\t\t\t'singular_name' => esc_html__( 'Movie Category', 'plugintest' ),\n\t\t\t'all_items' => esc_html__( 'Movies Categories', 'plugintest' ),\n\t\t\t'parent_item' => null,\n\t\t\t'parent_item_colon' => null,\n\t\t\t'edit_item' => esc_html__( 'Edit Category', 'plugintest' ),\n\t\t\t'update_item' => esc_html__( 'Update Category', 'plugintest' ),\n\t\t\t'add_new_item' => esc_html__( 'Add New Movie Category', 'plugintest' ),\n\t\t\t'new_item_name' => esc_html__( 'New Movie Name', 'plugintest' ),\n\t\t\t'menu_name' => esc_html__( 'Genre', 'plugintest' ),\n\t\t\t'search_items' => esc_html__( 'Search Categories', 'plugintest' ),\n\t\t);\n\n\t\t$category_args = array(\n\t\t\t'hierarchical' => false,\n\t\t\t'public' => true,\n\t\t\t'labels' => $category_labels,\n\t\t\t'show_ui' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'rewrite' => array( 'slug' => 'genre' ),\n\t\t);\n\n\t\tregister_taxonomy( 'genre', array( self::$post_type ), $category_args );\n\t}", "function my_custom_init() {\n\t$labels = array(\n\t'name' => _x( 'Marcas', 'post type general name' ),\n 'singular_name' => _x( 'Marca', 'post type singular name' ),\n 'add_new' => _x( 'Añadir nuevo', 'marca' ),\n 'add_new_item' => __( 'Añadir nueva Marca' ),\n 'edit_item' => __( 'Editar Marca' ),\n 'new_item' => __( 'Nueva Marca' ),\n 'view_item' => __( 'Ver Marca' ),\n 'search_items' => __( 'Buscar Marca' ),\n 'not_found' => __( 'No se han encontrado Marcas' ),\n 'not_found_in_trash' => __( 'No se han encontrado Marcas en la papelera' ),\n 'parent_item_colon' => ''\n );\n\n // Creamos un array para $args\n $args = array( 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n 'query_var' => true,\n 'rewrite' => true,\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'menu_position' => null,\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )\n );\n\n register_post_type( 'Marca', $args );\n}", "function register() {\n // Para el back-end\n add_action('admin_enqueue_scripts', array($this, 'put_in_queue'));\n // Para el front-end\n add_action('wp_enqueue_scripts', array($this, 'put_in_queue'));\n // Generar nuestro custom post type\n add_action('init', array($this, 'custom_post_type'));\n\n // Añadir una metabox a nuestro custom post type backend\n add_action('add_meta_boxes', array($this, 'reviews_meta_box'));\n // Guardar los cambios que hagamos en los custom post type backend\n add_action('save_post', array($this, 'save_review'));\n\n // Crear un enlace para los settings del plugin en el admin area\n add_action('admin_menu', array($this, 'add_admin_pages'));\n }", "public static function register_post_type() {\n\t\tregister_post_type( 'drsa_ad', self::arguments() );\n\t}", "public function register_location_content_type(){\n\t\t //Labels for post type\n\t\t $labels = array(\n 'name' => 'Add Portfolio',\n 'singular_name' => 'Portfolio',\n 'menu_name' => 'Add Portfolio',\n 'name_admin_bar' => 'Add Portfolio',\n 'add_new' => 'Add New', \n 'add_new_item' => 'Add New Portfolio Item',\n 'new_item' => 'New Portfolio Item', \n 'edit_item' => 'Edit Portfolio Item',\n 'view_item' => 'View Portfolio Item',\n 'all_items' => 'All Portfolio Items',\n 'search_items' => 'Search Portfolio Items',\n 'parent_item_colon' => 'Parent Portfolio Item: ', \n 'not_found' => 'No Portfolio Items found.', \n 'not_found_in_trash' => 'No Portfolio Items found in Trash.',\n );\n //arguments for post type\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable'=> true,\n 'show_ui' => true,\n 'show_in_nav' => true,\n 'query_var' => true,\n 'hierarchical' => false,\n 'supports' => array('title','thumbnail','editor'),\n 'has_archive' => true,\n 'menu_position' => 20,\n 'show_in_admin_bar' => true,\n 'menu_icon' => 'dashicons-location-alt',\n 'rewrite'\t\t\t=> array('slug' => 'locations', 'with_front' => 'true')\n );\n //register post type\n register_post_type('wp_locations', $args);\n\t}", "function init(){\n //Register post types. \n register_post_type( 'games',\n array(\n 'labels' => array(\n 'name' => __('Games'),\n 'singular_name' => __('Game')\n ),\n 'public' => true,\n 'has archive' => true,\n 'menu_icon' => 'dashicons-desktop',\n 'menu_position' => 3\n )\n );\n }", "protected function addPostType()\n {\n WordPress::registerType('lbwp-nl', 'Newsletter', 'Newsletter', array(\n 'show_in_menu' => 'newsletter',\n 'publicly_queryable' => false,\n 'exclude_from_search' => true,\n 'supports' => array('title')\n ), 'n');\n }", "function add_my_custom_posttype_waarden(){\n //LABELS DIFINIËREN\n $labels = array(\n 'add_new' => 'Voeg nieuwe waarde toe',\n 'add_new_item' => 'Voeg nieuwe waarde toe',\n 'name' => 'waarden',\n 'singular_name' => 'waarden',\n );\n //ARGUMENTEN DIFINIËREN\n $args = array(\n 'labels' => $labels, // de array labels van hier boven linken aan het argument labels\n 'Description' => 'waarden van Ben & Jerry',\n 'public' => true,\n 'menu_position' => 6,\n 'menu_icon' => 'dashicons-layout', //Een icoon kiezen\n 'supports' => array('title', 'editor', 'thumbnail'), \n 'has_archive' => true, //Maak een archief aan (opsomming van alle elementen), anders gaan we archive-waarden.php nooit kunnen aanspreken.\n 'show_in_nav_menus' => TRUE,\n \n );\n register_post_type( 'waarden', $args ); \n }", "function project_post_type(){\n $projects = array(\n 'labels' => array(\n 'name' => 'Projects',\n 'singular_name' => 'Project',\n ),\n 'public' => true,\n 'has_archive' => true,\n 'supports' => array('title', 'editor', 'thumbnail', 'excerpt', 'custom-fields'),\n );\n\n register_post_type('projects', $projects);\n}", "function create_posttype() {\n $labels = array(\n 'name' => _x( 'NPosts', 'Post Type General Name'),\n 'singular_name' => _x( 'NPost', 'Post Type Singular Name'),\n 'menu_name' => __( 'NPosts'),\n 'parent_item_colon' => __( 'Parent NPost'),\n 'all_items' => __( 'All NPosts'),\n 'view_item' => __( 'View NPost'),\n 'add_new_item' => __( 'Add New NPost'),\n 'add_new' => __( 'Add New'),\n 'edit_item' => __( 'Edit NPost'),\n 'update_item' => __( 'Update NPost'),\n 'search_items' => __( 'Search NPost'),\n 'not_found' => __( 'Not Found'),\n 'not_found_in_trash' => __( 'Not found in Trash'),\n );\n \n// Set other options for Custom Post Type\n \n $args = array(\n 'label' => __( 'nposts'),\n 'description' => __( 'NPost news and reviews'),\n 'labels' => $labels,\n // Features this CPT supports in Post Editor\n 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ),\n // You can associate this CPT with a taxonomy or custom taxonomy. \n // 'taxonomies' => array( 'genres' ),\n /* A hierarchical CPT is like Pages and can have\n * Parent and child items. A non-hierarchical CPT\n * is like Posts.\n */ \n 'hierarchical' => true,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'post',\n );\n \n // Registering your Custom Post Type\n register_post_type( 'npost', $args );\n \n}", "function thirdtheme_custom_slider()\n {\n add_theme_support('post-thumbnails');\n $args = array(\n 'labels' => array('name' =>__(' custom slider'),\n 'add_new' =>__('add new slider')),\n \n 'public' => true,\n 'menu_icon' => 'dashicons-format-image',\n 'show_in_menu' => true,\n 'has_archive' => true,\n 'supports' => array( 'title', 'thumbnail' )); \n register_post_type('slider',$args);\n }", "function training_section(){\r\n\t$singular='Training Show';\r\n\t$plural='Training Shows';\r\n\r\n\t$labels=array(\r\n 'name'=>$plural,\r\n 'singular_name'=>$singular,\r\n 'add_name'=>'Add New',\r\n 'add_new_item'=>'Add New' . $singular,\r\n 'edit'=>'Edit',\r\n 'edit_item' =>'Edit' . $singular,\r\n 'new_item' =>'New' . $singular,\r\n 'view'=>'View' . $singular,\r\n 'view_item'=>'View' . $singular,\r\n 'search_item'=>'Search' . $plural,\r\n 'parent'=>'Parent' . $singular,\r\n 'not_found'=>'No' . $plural .'found',\r\n 'not_found_in_trash'=>'No' . $plural .'in Trash'\r\n\t\t);\r\n\t$args =array(\r\n 'labels' =>$labels,\r\n 'public' =>true,\r\n 'menu_position'=>10,\r\n 'has_archive'=>true,\r\n 'capability_type'=>'post',\r\n 'map_meta_cap'=>true,\r\n 'supports'=>array(\r\n 'title',\r\n 'editor',\r\n 'custom-fields',\r\n 'thumbnail'\r\n \t)\r\n\t\t);\r\n\tregister_post_type('training_show',$args);\r\n}", "public function register_qmgt_custom_post() {\r\n\t\trequire_once( QMGT_ROOT . '/qmgt-custom-post-type.php');\r\n\t}", "function register_post_types() {\r\n $schedule_post_def = array(\r\n 'label' => __( 'Schedules', 'bpsp' ),\r\n 'singular_label' => __( 'Schedule', 'bpsp' ),\r\n 'description' => __( 'BuddyPress ScholarPress Courseware Schedules', 'bpsp' ),\r\n 'public' => BPSP_DEBUG,\r\n 'publicly_queryable' => false,\r\n 'exclude_from_search' => true,\r\n 'show_ui' => BPSP_DEBUG,\r\n 'capability_type' => 'schedule',\r\n 'hierarchical' => false,\r\n 'rewrite' => false,\r\n 'query_var' => false,\r\n 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'custom-fields' ),\r\n 'taxonomies' => array( 'group_id', 'course_id' )\r\n );\r\n if( !register_post_type( 'schedule', $schedule_post_def ) )\r\n wp_die( __( 'BuddyPress Courseware error while registering schedule post type.', 'bpsp' ) );\r\n }", "function vscu_register_post_type_args_callback( $args, $posttype ) {\n\n\tif ( 'wpcf7_contact_form' === $posttype ) {\n\t\t$args['show_in_rest'] = true;\n\t\t$args['rest_base'] = 'wpcf7_contact_forms';\n\t\t$args['rest_controller_class'] = 'WP_REST_Posts_Controller';\n\t}\n\n\treturn $args;\n}", "function ydd_post_type() {\r\n\r\n $labels = array(\r\n 'name' => _x( 'YDD', 'Post Type General Name', 'text_domain' ),\r\n\t\t'singular_name' => _x( 'Yacht Design', 'Post Type Singular Name', 'text_domain' ),\r\n\t\t'menu_name' => __( 'Yacht Design', 'text_domain' ),\r\n\t\t'parent_item_colon' => __( 'Parent Design:', 'text_domain' ),\r\n\t\t'all_items' => __( 'All Yacht Designs', 'text_domain' ),\r\n\t\t'view_item' => __( 'View Yacht Design', 'text_domain' ),\r\n\t\t'add_new_item' => __( 'Add Yacht Design', 'text_domain' ),\r\n\t\t'add_new' => __( 'Add Yacht Design', 'text_domain' ),\r\n\t\t'edit_item' => __( 'Edit Yacht Design', 'text_domain' ),\r\n\t\t'update_item' => __( 'Update Yacht Design', 'text_domain' ),\r\n\t\t'search_items' => __( 'Search YDD', 'text_domain' ),\r\n\t\t'not_found' => __( 'Yacht Design Not found in Register', 'text_domain' ),\r\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\r\n\t);\r\n\t$capabilities = array(\r\n\t\t'edit_post' => 'edit_ydd',\r\n\t\t'read_post' => 'read_ydd',\r\n\t\t'delete_post' => 'delete_ydd',\r\n\t\t'edit_posts' => 'edit_ydd',\r\n\t\t'edit_others_posts' => 'edit_others_ydd',\r\n\t\t'publish_posts' => 'publish_ydd',\r\n\t\t'read_private_posts' => 'read_private_ydd',\r\n\t);\r\n\t$args = array(\r\n\t\t'label' => __( 'ydd', 'text_domain' ),\r\n\t\t'description' => __( 'Yacht Design Database', 'text_domain' ),\r\n\t\t'labels' => $labels,\r\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions',),\r\n\t\t'hierarchical' => false,\r\n\t\t'public' => true,\r\n\t\t'show_ui' => true,\r\n\t\t'show_in_menu' => true,\r\n\t\t'show_in_nav_menus' => true,\r\n\t\t'show_in_admin_bar' => true,\r\n\t\t'menu_position' => 5,\r\n\t\t'can_export' => true,\r\n\t\t'has_archive' => true,\r\n\t\t'exclude_from_search' => false,\r\n\t\t'publicly_queryable' => true,\r\n\t 'capabilities' => $capabilities,\r\n\t);\r\n\tregister_post_type( 'ydd', $args );\r\n \r\n add_ydd_capabilities_to_role( 'curator' );\r\n add_ydd_capabilities_to_role( 'administrator' );\r\n add_ydd_capabilities_to_role( 'nmmc_admin' );\r\n}", "function rng_create_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'Post Types Plural', 'Post Type General Name', 'translate_name' ),\n\t\t'singular_name' => _x( 'Post Type Singular', 'Post Type Singular Name', 'translate_name' ),\n\t\t'menu_name' => __( 'Post Types', 'translate_name' ),\n\t\t'name_admin_bar' => __( 'Post Type', 'translate_name' ),\n\t\t'archives' => __( 'Item Archives', 'translate_name' ),\n\t\t'attributes' => __( 'Item Attributes', 'translate_name' ),\n\t\t'parent_item_colon' => __( 'Parent Item:', 'translate_name' ),\n\t\t'all_items' => __( 'All Items', 'translate_name' ),\n\t\t'add_new_item' => __( 'Add New Item', 'translate_name' ),\n\t\t'add_new' => __( 'Add New', 'translate_name' ),\n\t\t'new_item' => __( 'New Item', 'translate_name' ),\n\t\t'edit_item' => __( 'Edit Item', 'translate_name' ),\n\t\t'update_item' => __( 'Update Item', 'translate_name' ),\n\t\t'view_item' => __( 'View Item', 'translate_name' ),\n\t\t'view_items' => __( 'View Items', 'translate_name' ),\n\t\t'search_items' => __( 'Search Item', 'translate_name' ),\n\t\t'not_found' => __( 'Not found', 'translate_name' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'translate_name' ),\n\t\t'featured_image' => __( 'Featured Image', 'translate_name' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'translate_name' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'translate_name' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'translate_name' ),\n\t\t'insert_into_item' => __( 'Insert into item', 'translate_name' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this item', 'translate_name' ),\n\t\t'items_list' => __( 'Items list', 'translate_name' ),\n\t\t'items_list_navigation' => __( 'Items list navigation', 'translate_name' ),\n\t\t'filter_items_list' => __( 'Filter items list', 'translate_name' ),\n\t);\n\t$args = array(\n 'public' => true,\n\t\t'label' => __( 'Post Type Singular', 'translate_name' ),\n\t\t'description' => __( 'Post Type Description', 'translate_name' ),\n 'labels' => $labels,\n 'exclude_from_search' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_menu'\t\t\t=> true,\n\t\t'show_in_admin_bar'\t\t=> true,\n\t\t'menu_position'\t\t\t=> 5,\n\t\t// 'menu_icon' \t\t\t=> get_bloginfo('template_directory') . '/images/portfolio-icon.png',\n\t\t'menu_icon'\t\t\t\t=> 'dashicon-groups',\n\t\t'has_archive'\t\t\t=> true,\n\t\t'capability_type'\t\t=> array('book','books'),\n\t\t'capabilities' \t\t\t=> array(\n\t\t\t'edit_post' => 'edit_book', \n\t\t\t'read_post' => 'read_book', \n\t\t\t'delete_post' => 'delete_book', \n\t\t\t'edit_posts' => 'edit_books', \n\t\t\t'edit_others_posts' => 'edit_others_books', \n\t\t\t'publish_posts' => 'publish_books', \n\t\t\t'read_private_posts' => 'read_private_books', \n\t\t\t'create_posts' => 'edit_books', \n\t\t),\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes', 'post-formats' ),\n\t\t'taxonomies' => array( 'category', 'post_tag' ),\n\t\t'hierarchical' => true,\n\t);\n\tregister_post_type( 'book', $args );\n\n}", "function custom_widgets_register() {\n register_post_type('custom_widgets', array(\n 'labels' => array(\n 'name' => __('Custom Widgets'),\n 'singular_name' => __('Custom Widget'),\n ),\n 'public' => false,\n 'show_ui' => true,\n 'has_archive' => false,\n 'exclude_from_search' => true,\n ));\n}", "function create_posttype() {\n\n register_post_type( 'portfolio',\n // CPT Options\n array(\n 'labels' => array(\n 'name' => __( 'Portfolio' ),\n 'singular_name' => __( 'Portfolio' ),\n 'menu_name' => __( 'Portfolio' )\n ),\n 'public' => true,\n 'has_archive' => true,\n 'menu_icon' => 'dashicons-format-image',\n 'rewrite' => array('slug' => 'portfolio'),\n 'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'revisions' )\n )\n );\n}", "function register_quickmenu_post_type() {\n // Set various pieces of text, $labels is used inside the $args array\n $labels = array(\n 'name' => _x( 'Menus rápido', 'post type general name' ),\n 'singular_name' => _x( 'Menu rápido', 'post type singular name' ),\n 'menu_name' => _x( 'Menus rápidos', 'Admin Menu text', 'textdomain' ),\n\n \n );\n // Set various pieces of information about the post type\n $args = array(\n 'labels' => $labels,\n 'description' => 'My custom post type',\n 'public' => true,\n 'menu_icon' => 'dashicons-editor-insertmore',\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail','custom-fields', 'page-attributes'),\n );\n // Register the movie post type with all the information contained in the $arguments array\n register_post_type( 'QuickMenus', $args );\n}", "function create_post_type() {\r\n\r\n\tregister_post_type( 'Editorials',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t'name' => __( 'Editorials' ),\r\n\t\t\t\t'singular_name' => __( 'Editorial' )\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'editorials'),\r\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),\r\n \t'show_ui' => true,\r\n\t\t)\r\n\t);\r\n\tregister_post_type( 'Local news',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t\r\n\t\t\t\t'name' => __( 'Local news' ),\r\n\t\t\t\t'singular_name' => __( 'Local new' )\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'local news'),\r\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),\r\n \t'show_ui' => true,\r\n\t\t)\r\n\t);\r\n}", "function add_clients() {\n $args = array(\n 'labels' => array(\n 'name' => 'Clients',\n 'singular_name' => 'Client'\n ),\n 'public' => true,\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'has_archive' => true\n );\n register_post_type('clients', $args);\n}", "public static function registerWPPostType()\n {\n register_post_type\n (\n 'fs_feed_entry',\n array\n (\n 'label' => 'Feed Entries',\n 'labels' => array\n (\n 'name' => 'Feed Entries',\n 'singular_name' => 'Feed Entry',\n 'add_new' => 'Add New',\n 'add_new_item' => 'Add New Feed Entry',\n 'edit_item' => 'Edit Feed Entry',\n 'new_item' => 'New Feed Entry',\n 'view_item' => 'View Feed Entry',\n 'search_items' => 'Search Feed Entries',\n 'not_found' => 'No Feed Entries Found',\n 'not_found_in_trash' => 'No Feed Entries Found In Trash',\n 'parent_item_colon' => 'Parent Feed Entries:',\n 'edit' => 'Edit',\n 'view' => 'View Feed Entry'\n ),\n 'public' => false,\n 'show_ui' => true\n )\n );\n }", "function post_type_minibanners() {\n\n register_post_type(\n 'minibanners',\n array('label' => __('Mini Banners'),\n 'singular_label' => __('Mini Banner'),\n 'public' => true,\n 'rewrite' => array('slug' => 'mini-banners'), // modify the page slug / permalink\n 'show_ui' => true,\n 'capability_type' => 'post',\n 'hierarchical' => false, //it means we cannot have parent and sub pages\n 'query_var' => false,\n 'exclude_from_search' => true,\n 'supports' => array(\n 'title', // entry title\n 'thumbnail', // featured image\n 'editor', //standard wysywig editor\n 'page-attributes'),\n 'labels' => array(\n 'name' => __( 'Mini Banners' ),\n 'singular_name' => __( 'Mini Banner' ),\n 'add_new' => __( 'Add New' ),\n 'add_new_item' => __( 'Add New Mini Banner' ),\n 'edit' => __( 'Edit' ),\n 'edit_item' => __( 'Edit Mini Banner' ),\n 'new_item' => __( 'New Mini Banner' ),\n 'view' => __( 'View Mini Banners' ),\n 'view_item' => __( 'View Mini Banner' ),\n 'search_items' => __( 'Search Mini Banners' ),\n 'not_found' => __( 'No Mini Banners Found' ),\n 'not_found_in_trash' => __( 'No Mini Banners Found in Trash' ),\n 'parent' => __( 'Parent Mini Banner' )\n )\n )\n\n );\n\n register_taxonomy_for_object_type('post_tag', 'minibanners'); // Change to match custom content name\n}", "function products_type() {\n\n $labels = array(\n 'name' => 'Productos',\n 'singular_name' => 'Producto',\n 'menu_name' => 'Productos',\n );\n\n $args = array(\n 'label' => 'Productos',\n 'description' => 'Productos de Platzi',\n 'labels' => $labels,\n 'supports' => array('title', 'editor', 'thumbnail', 'revisions'),\n 'public' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-cart',\n 'can_export' => true,\n 'publicly' => true,\n 'rewrite' => true,\n 'show_in_rest' => true,\n );\n\n register_post_type('producto', $args);\n}", "function compendium_register_type($slug, $name, $pname, $dicon) {\n $pt_slug = $slug;\n $tax_slug = $slug . '-category';\n\n register_post_type($pt_slug, array(\n 'labels' => array(\n 'name' => $pname,\n 'singular_name' => $name,\n 'add_new' => 'Add New',\n 'add_new_item' => 'Add New '.$name,\n 'edit_item' => 'Edit '.$name,\n 'new_item' => 'New '.$name,\n 'view_item' => 'View '.$name,\n 'search_items' => 'Search '.$pname,\n 'not_found' => 'No '.$pname.' found',\n 'not_found_in_trash' => 'No '.$pname.' found in trash',\n ),\n 'public' => true,\n 'menu_position' => 35,\n 'supports' => array('title','editor','thumbnail','excerpt'),\n 'menu_icon' => $dicon,\n 'rewrite' => array(\n 'slug' => 'resource-center/' . $pt_slug,\n 'with_front' => true\n ),\n ));\n\n register_taxonomy($tax_slug, $pt_slug, array(\n 'labels' => array(\n 'name' => 'Categories',\n 'singular_name' => 'Category',\n ),\n 'hierarchical' => true,\n ));\n}", "public function register_post_type()\n\t{\n\n\t\tregister_post_type( 'partner', array(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => _x( 'Partners', 'post type general name', 'custom-post-type-partners' ),\n\t\t\t\t'singular_name' => _x( 'Partner', 'post type singular name', 'custom-post-type-partners' ),\n\t\t\t\t'add_new' => _x( 'Add New', 'Partner', 'custom-post-type-partners' ),\n\t\t\t\t'add_new_item' => __( 'Add New Partner', 'custom-post-type-partners' ),\n\t\t\t\t'edit_item' => __( 'Edit Partner', 'custom-post-type-partners' ),\n\t\t\t\t'new_item' => __( 'New Partner', 'custom-post-type-partners' ),\n\t\t\t\t'all_items' => __( 'All Partners', 'custom-post-type-partners' ),\n\t\t\t\t'view_item' => __( 'View Partner', 'custom-post-type-partners' ),\n\t\t\t\t'search_items' => __( 'Search Partners', 'custom-post-type-partners' ),\n\t\t\t\t'not_found' => __( 'No Partners found', 'custom-post-type-partners' ),\n\t\t\t\t'not_found_in_trash' => __( 'No Partners found in Trash', 'custom-post-type-partners' ),\n\t\t\t\t'parent_item_colon' => '',\n\t\t\t\t'menu_name' => __( 'Partners', 'custom-post-type-partners' )\n\t\t\t),\n\t\t\t'public' => TRUE,\n\t\t\t'publicly_queryable' => TRUE,\n\t\t\t'show_ui' => TRUE,\n\t\t\t'show_in_menu' => TRUE,\n\t\t\t'query_var' => TRUE,\n\t\t\t'rewrite' => TRUE,\n\t\t\t'capability_type' => 'post',\n\t\t\t'has_archive' => FALSE,\n\t\t\t'hierarchical' => FALSE,\n\t\t\t'menu_position' => NULL,\n\t\t\t'menu_icon' => 'dashicons-admin-links',\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes' )\n\t\t) );\n\n\t}", "public function create_post_type() {\n\n register_post_type( self::POST_TYPE,\n array(\n\n 'labels' => array(\n 'name' => __( 'Fundraisers' ),\n 'singular_name' => __( 'Fundraiser' )\n ),\n 'description' => 'Fundraisers that allow users to purchase items through the WooCommerce Stores',\n 'menu_icon' => 'dashicons-chart-line',\n 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt',\n 'revisions' ),\n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array(\n 'slug' => __( 'fundraisers' ),\n 'with_front' => false\n )\n )\n );\n }", "function tyreconnect_testimonials_post_type() {\n $args = [\n 'name' => 'testimonials',\n 'label' => 'testimonials',\n 'singular_name' => 'Testimonials',\n 'show_in_rest' => true,\n 'menu_icon' => 'dashicons-chart-pie',\n 'show_in_menu ' => true,\n 'public' => true,\n 'hierarchical' => false,\n 'menu_position' => 50,\n 'supports' => array('title', 'editor', 'thumbnail'),\n 'show_ui' => true\n\n ];\n register_post_type('testimonials', $args );\n}" ]
[ "0.73344046", "0.701116", "0.69997287", "0.69871527", "0.6980512", "0.68633753", "0.6851531", "0.68435717", "0.68285596", "0.68285596", "0.68080693", "0.68026465", "0.6798774", "0.6787967", "0.6778411", "0.67749137", "0.6774757", "0.6764531", "0.6760168", "0.67575055", "0.6753561", "0.6752188", "0.6745879", "0.6745403", "0.67364913", "0.6729912", "0.6728391", "0.67100066", "0.66859424", "0.667071", "0.6663192", "0.6659053", "0.6658508", "0.6651887", "0.6651091", "0.66505724", "0.66455203", "0.6644503", "0.66105175", "0.6605324", "0.6604209", "0.6603718", "0.65987486", "0.65949655", "0.6593182", "0.6589061", "0.65815884", "0.65790933", "0.6571782", "0.6563069", "0.656234", "0.6558578", "0.65577686", "0.65566146", "0.65541005", "0.6554006", "0.6553297", "0.6547273", "0.65465856", "0.6535233", "0.65318644", "0.65151536", "0.65109986", "0.6502732", "0.65022236", "0.65005475", "0.64943135", "0.6494076", "0.6482746", "0.6482484", "0.647934", "0.64735204", "0.6465944", "0.6450763", "0.6446049", "0.6435014", "0.6434218", "0.64338017", "0.64270896", "0.64252084", "0.6417576", "0.6416305", "0.64154893", "0.6412714", "0.64089113", "0.6408471", "0.64072645", "0.6398725", "0.63960695", "0.6393067", "0.639306", "0.6388305", "0.638482", "0.6383531", "0.63798535", "0.6374835", "0.63721627", "0.63701", "0.63696486", "0.63641655", "0.6360486" ]
0.0
-1
/ This following code below will register the post type for the lable goals.
function custom_post_type () { // These labels below will create the necessary variables and items required for the goals post type. $labels = array ( 'name' => 'goals', 'singular_name' => 'goals', 'add_new' => 'Weekly goals', 'all_items' => 'All Items', 'edit_item' => 'Edit Item', 'new_item' => 'New Item', 'search_iterm' => 'Search goals', 'not_found' => 'No Item Found', 'not_found_in_trash' => 'No Item Found in Trash', 'parent_item_colon' => 'Parent Item' ); /*this following array will allow the plugin post type to display on wordpress, along with added a custom menu icon to the goals menu option, as seen on the wordpress backend. 'menu_icon' => 'dashicons-thumbs-up' is the line of code responsible for the changing of icons, using dash icons. */ $args = array( 'labels' => $labels, 'public' => true, 'has_archive' => true, 'menu_icon' => 'dashicons-thumbs-up', 'publicly_queryable' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'hierarchical' => true, /*the supports function below will allow for there to be an array of a title,editor and feature a thumbnail for the posts created in the goals section of wordpress.*/ 'supports' => array( 'title', 'editor', 'thumbnail' ), /*Taxonomies have been created below to allow for categories to be displayed in the */ 'taxonomies' => array ('category', 'post_tag'), 'exclude_from_search' => false, ); register_post_type('goals', $args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wpbm_register_post_type(){\n include('inc/admin/register/wpbm-register-post.php');\n register_post_type( 'WP Blog Manager', $args );\n }", "public function register_post(): void\n {\n $args = $this->register_post_type_args();\n register_post_type($this->post_type, $args);\n }", "public function register_post_type() {\n\t\tadd_action( 'init', array( $this, 'post_registration_callback' ), 0, 0 );\n\t}", "public function register_post_type() {\n\t $args = array(\n\t\t\t'public' => true,\n\t\t\t'label' => 'Questions'\n\t\t);\n\t register_post_type( 'questions', $args );\n\t}", "public static function register_post_type() {\n\t\tregister_post_type( 'drsa_ad', self::arguments() );\n\t}", "public function registerCustomPostTypes() {\n\n\n }", "public function createPostTypes()\n {\n }", "public static function register_post_types() {}", "public function create_post_types() {\n }", "public function register_post_types() {\n\n\t}", "function register_post_types(){\n }", "function register_post_types(){\n }", "protected function addPostType()\n {\n WordPress::registerType('lbwp-nl', 'Newsletter', 'Newsletter', array(\n 'show_in_menu' => 'newsletter',\n 'publicly_queryable' => false,\n 'exclude_from_search' => true,\n 'supports' => array('title')\n ), 'n');\n }", "public function register_post_type(){\r\n //Capitilize the words and make it plural\r\n $name = ucwords( str_replace( '_', ' ', $this->post_type_name ) );\r\n $plural = $name . 's';\r\n $menupos = $this->post_type_pos;\r\n\r\n // We set the default labels based on the post type name and plural. We overwrite them with the given labels.\r\n $labels = array_merge(\r\n\r\n // Default\r\n array(\r\n 'name' => _x( $plural, 'post type general name' ),\r\n 'singular_name' => _x( $name, 'post type singular name' ),\r\n 'add_new' => _x( 'Add New', strtolower( $name ) ),\r\n 'add_new_item' => __( 'Add New ' . $name ),\r\n 'edit_item' => __( 'Edit ' . $name ),\r\n 'new_item' => __( 'New ' . $name ),\r\n 'all_items' => __( 'All ' . $plural ),\r\n 'view_item' => __( 'View ' . $name ),\r\n 'search_items' => __( 'Search ' . $plural ),\r\n 'not_found' => __( 'No ' . strtolower( $plural ) . ' found'),\r\n 'not_found_in_trash' => __( 'No ' . strtolower( $plural ) . ' found in Trash'),\r\n 'parent_item_colon' => '',\r\n 'menu_name' => $plural\r\n ),\r\n\r\n // Given labels\r\n $this->post_type_labels\r\n\r\n );\r\n\r\n // Same principle as the labels. We set some defaults and overwrite them with the given arguments.\r\n $args = array_merge(\r\n\r\n // Default\r\n array(\r\n 'capability_type' => 'post',\r\n 'hierarchical' => false,\r\n 'label' => $plural,\r\n 'labels' => $labels,\r\n 'menu_position' => $menupos,\r\n 'public' => true,\r\n 'publicly_queryable' => true,\r\n 'query_var' => true,\r\n 'rewrite' => array('slug' => $plural),\r\n 'show_in_nav_menus' => true,\r\n 'show_ui' => true,\r\n 'supports' => array( 'title', 'editor'),\r\n '_builtin' => false,\r\n ),\r\n\r\n // Given args\r\n $this->post_type_args\r\n\r\n );\r\n\r\n // Register the post type\r\n register_post_type( $this->post_type_name, $args );\r\n }", "function register_post_types()\n {\n }", "public function register_qmgt_custom_post() {\r\n\t\trequire_once( QMGT_ROOT . '/qmgt-custom-post-type.php');\r\n\t}", "function register_post_types() {\n\t}", "function register_post_types() {\n\t}", "public function registerCustomPostType()\n {\n if (!post_type_exists($this->slug)) {\n register_post_type($this->slug, $this->arguments);\n }\n }", "function bf_register_custom_post_type() {\r\n /* Añado las etiquetas que aparecerán en el escritorio de WordPress */\r\n\t$labels = array(\r\n\t\t'name' => _x( 'Ponentes', 'post type general name', 'text-domain' ),\r\n\t\t'singular_name' => _x( 'Ponente', 'post type singular name', 'text-domain' ),\r\n\t\t'menu_name' => _x( 'Ponentes', 'admin menu', 'text-domain' ),\r\n\t\t'add_new' => _x( 'Añadir nuevo', 'ponente', 'text-domain' ),\r\n\t\t'add_new_item' => __( 'Añadir nuevo ponente', 'text-domain' ),\r\n\t\t'new_item' => __( 'Nuevo Ponente', 'text-domain' ),\r\n\t\t'edit_item' => __( 'Editar Ponente', 'text-domain' ),\r\n\t\t'view_item' => __( 'Ver ponente', 'text-domain' ),\r\n\t\t'all_items' => __( 'Todos los ponentes', 'text-domain' ),\r\n\t\t'search_items' => __( 'Buscar ponentes', 'text-domain' ),\r\n\t\t'not_found' => __( 'No hay ponentes.', 'text-domain' ),\r\n\t\t'not_found_in_trash' => __( 'No hay ponentes en la papelera.', 'text-domain' )\r\n\t);\r\n\r\n /* Configuro el comportamiento y funcionalidades del nuevo custom post type */\r\n\t$args = array(\r\n\t\t'labels' => $labels,\r\n\t\t'description' => __( 'Descripción.', 'text-domain' ),\r\n\t\t'public' => true,\r\n\t\t'publicly_queryable' => true,\r\n\t\t'show_ui' => true,\r\n\t\t'show_in_menu' => true,\r\n\t\t'show_in_nav_menus' => true,\r\n\t\t'query_var' => true,\r\n\t\t'rewrite' => array( 'slug' => 'ponente' ),\r\n\t\t'capability_type' => 'post',\r\n\t\t'hierarchical' => false,\r\n\t\t'menu_position' => null,\r\n 'menu_icon' => 'dashicons-businessman',\r\n\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\r\n\t\t'show_in_rest'\t \t => true,\r\n\t\t'public' \t\t\t => true,\r\n\t\t'has_archive' \t\t => true,\r\n\t\t'taxonomies' => array('category','categoria-conferencias')\r\n\t);\r\n\r\n\tregister_post_type('ponentes', $args );\r\n}", "public function add_custom_post_types() {\n //\n }", "public function register_post_type()\n {\n $labels = [\n 'name' => _x('Chiro Quizzes', 'post type general name', $this->token),\n 'singular_name' => _x('Chiro Quiz', 'post type singular name', $this->token),\n 'add_new' => _x('Add New', $this->token, $this->token),\n 'add_new_item' => sprintf(__('Add New %s', $this->token), __('Chiro Quiz', $this->token)),\n 'edit_item' => sprintf(__('Edit %s', $this->token), __('Chiro Quiz', $this->token)),\n 'new_item' => sprintf(__('New %s', $this->token), __('Chiro Quiz', $this->token)),\n 'all_items' => sprintf(__('All %s', $this->token), __('Chiro Quizzes', $this->token)),\n 'view_item' => sprintf(__('View %s', $this->token), __('Chiro Quiz', $this->token)),\n 'search_items' => sprintf(__('Search %a', $this->token), __('Chiro Quizzes', $this->token)),\n 'not_found' => sprintf(__('No %s Found', $this->token), __('Chiro Quizzes', $this->token)),\n 'not_found_in_trash' => sprintf(__('No %s Found In Trash', $this->token), __('Chiro Quizzes', $this->token)),\n 'parent_item_colon' => '',\n 'menu_name' => __('Chiro Quizzes', $this->token)\n ];\n\n $slug = __('chiro-quiz', 'pf_chiro_quiz');\n $custom_slug = get_option('pf_chiro_quiz_slug');\n if ($custom_slug && strlen($custom_slug) > 0 && $custom_slug != '') {\n $slug = $custom_slug;\n }\n\n $args = [\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'exclude_from_search' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'query_var' => true,\n 'rewrite' => ['slug' => $slug],\n 'capability_type' => 'post',\n 'has_archive' => false,\n 'hierarchical' => false,\n 'supports' => ['title'],\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-admin-quiz'\n ];\n\n register_post_type($this->token, $args);\n }", "function carbon_register_post_types(){\n\n // carbon_register_post_type(array(\n // 'singular' => 'Type', // required\n // 'plural' => 'Types', // required\n // 'type' => 'type', // required\n // 'slug' => 'types/type',\n // 'menu_icon' => 'dashicons-admin-post',\n // 'has_archive' => true,\n // 'exclude_from_search' => true,\n // ));\n }", "public static function post_type(){}", "public function register()\n {\n $args = apply_filters( $this->name.'_post_type_config', $this->config );\n $args['labels'] = apply_filters( $this->name.'_post_type_labels', $this->labels);\n\n register_post_type( $this->name, $args );\n }", "public function flo_reg_custom_post_type(){\n\t\t// call the methods that are registering the post types\n\t\t$this->flo_reg_forms_post_type();\n\t\t$this->flo_reg_entrie_post_type();\n\n\t\t$this->flo_register_form_entries_taxonomy();\n\t}", "public function register_custom_post() {\n foreach ( $this->posts as $key => $value ) {\n register_post_type( $key, $value );\n }\n }", "function add_custom_post_type() {\n\tregister_post_type( 'learning_resource',\n array(\n 'labels' => array(\n 'name' => __( 'Learning Resources' ),\n 'singular_name' => __( 'Learning Resource' )\n ),\n 'public' => true,\n 'has_archive' => true,\n )\n );\n}", "public function register_post_type(){\n\t\tif(!class_exists('CPT')) return;\n\t\n\t\t$this->post_type = new CPT(\n\t\t\tarray(\n\t\t\t 'post_type_name' => 'slide',\n\t\t\t 'singular' => 'Slide',\n\t\t\t 'plural' => 'Slides',\n\t\t\t 'slug' => 'slide'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'has_archive' \t\t\t=> \ttrue,\n\t\t\t\t'menu_position' \t\t=> \t8,\n\t\t\t\t'menu_icon' \t\t\t=> \t'dashicons-layout',\n\t\t\t\t'supports' \t\t\t\t=> \tarray('title', 'excerpt', 'content','thumbnail', 'post-formats', 'custom-fields')\n\t\t\t)\n\t\t);\n\t\t\n\t\t$labels = array('menu_name'=>'Types');\n\t\t$this->post_type->register_taxonomy('type',array(\n\t\t\t'hierarchical' => true,\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'show_tagcloud' => true,\n\t\t),$labels);\n\t}", "public static function register_post_type() {\n\t\t$labels = array(\n\t\t\t'name' => _x( 'Collections', 'post type general name', 'wp-recipe-maker-premium' ),\n\t\t\t'singular_name' => _x( 'Collection', 'post type singular name', 'wp-recipe-maker-premium' ),\n\t\t);\n\n\t\t$args = apply_filters( 'wprm_recipe_collections_post_type_arguments', array(\n\t\t\t'labels' \t=> $labels,\n\t\t\t'public' \t=> false,\n\t\t\t'rewrite' \t=> false,\n\t\t\t'capability_type' \t=> 'post',\n\t\t\t'query_var' \t=> false,\n\t\t\t'has_archive' \t=> false,\n\t\t\t'supports' \t\t\t\t=> array( 'title', 'author' ),\n\t\t\t'show_in_rest'\t\t\t=> true,\n\t\t\t'rest_base'\t\t\t\t=> WPRMPRC_POST_TYPE,\n\t\t\t'rest_controller_class' => 'WP_REST_Posts_Controller',\n\t\t));\n\n\t\tregister_post_type( WPRMPRC_POST_TYPE, $args );\n\t}", "public static function register_type() {\n\t\tregister_graphql_object_type(\n\t\t\t'PostTypeLabelDetails',\n\t\t\t[\n\t\t\t\t'description' => __( 'Details for labels of the PostType', 'wp-graphql' ),\n\t\t\t\t'fields' => [\n\t\t\t\t\t'name' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'General name for the post type, usually plural.', 'wp-graphql' ),\n\t\t\t\t\t],\n\t\t\t\t\t'singularName' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Name for one object of this post type.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->singular_name ) ? $labels->singular_name : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'addNew' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Default is ‘Add New’ for both hierarchical and non-hierarchical types.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->add_new ) ? $labels->add_new : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'addNewItem' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for adding a new singular item.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->add_new_item ) ? $labels->add_new_item : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'editItem' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for editing a singular item.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->edit_item ) ? $labels->edit_item : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'newItem' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for the new item page title.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->new_item ) ? $labels->new_item : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'viewItem' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for viewing a singular item.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->view_item ) ? $labels->view_item : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'viewItems' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for viewing post type archives.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->view_items ) ? $labels->view_items : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'searchItems' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for searching plural items.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->search_items ) ? $labels->search_items : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'notFound' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label used when no items are found.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->not_found ) ? $labels->not_found : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'notFoundInTrash' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label used when no items are in the trash.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->not_found_in_trash ) ? $labels->not_found_in_trash : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'parentItemColon' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label used to prefix parents of hierarchical items.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->parent_item_colon ) ? $labels->parent_item_colon : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'allItems' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label to signify all items in a submenu link.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->all_items ) ? $labels->all_items : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'archives' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for archives in nav menus', 'wp-graphql' ),\n\t\t\t\t\t],\n\t\t\t\t\t'attributes' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for the attributes meta box.', 'wp-graphql' ),\n\t\t\t\t\t],\n\t\t\t\t\t'insertIntoItem' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for the media frame button.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->insert_into_item ) ? $labels->insert_into_item : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'uploadedToThisItem' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for the media frame filter.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->uploaded_to_this_item ) ? $labels->uploaded_to_this_item : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'featuredImage' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for the Featured Image meta box title.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->featured_image ) ? $labels->featured_image : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'setFeaturedImage' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for setting the featured image.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->set_featured_image ) ? $labels->set_featured_image : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'removeFeaturedImage' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for removing the featured image.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->remove_featured_image ) ? $labels->remove_featured_image : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'useFeaturedImage' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label in the media frame for using a featured image.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->use_featured_item ) ? $labels->use_featured_item : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'menuName' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for the menu name.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->menu_name ) ? $labels->menu_name : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'filterItemsList' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for the table views hidden heading.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->filter_items_list ) ? $labels->filter_items_list : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'itemsListNavigation' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for the table pagination hidden heading.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->items_list_navigation ) ? $labels->items_list_navigation : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t'itemsList' => [\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'description' => __( 'Label for the table hidden heading.', 'wp-graphql' ),\n\t\t\t\t\t\t'resolve' => function( $labels ) {\n\t\t\t\t\t\t\treturn ! empty( $labels->items_list ) ? $labels->items_list : null;\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t}", "function nsbr_post_type() {\r\n\r\n $labels = array(\r\n\t\t'name' => _x( 'NSBR', 'Post Type General Name', 'text_domain' ),\r\n\t\t'singular_name' => _x( 'Boat', 'Post Type Singular Name', 'text_domain' ),\r\n\t\t'menu_name' => __( 'NSBR', 'text_domain' ),\r\n\t\t'parent_item_colon' => __( 'Parent Boat:', 'text_domain' ),\r\n\t\t'all_items' => __( 'All Small Boat Registrations', 'text_domain' ),\r\n\t\t'view_item' => __( 'View Boat Registration', 'text_domain' ),\r\n\t\t'add_new_item' => __( 'Add Small Boat Registration', 'text_domain' ),\r\n\t\t'add_new' => __( 'Add Small Boat Registration', 'text_domain' ),\r\n\t\t'edit_item' => __( 'Edit Boat Registration', 'text_domain' ),\r\n\t\t'update_item' => __( 'Update Boat Registration', 'text_domain' ),\r\n\t\t'search_items' => __( 'Search NSBR', 'text_domain' ),\r\n\t\t'not_found' => __( 'Boat Not found in Register', 'text_domain' ),\r\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\r\n\t);\r\n\t$capabilities = array(\r\n\t\t'edit_post' => 'edit_nsbr',\r\n\t\t'read_post' => 'read_nsbr',\r\n\t\t'delete_post' => 'delete_nsbr',\r\n\t\t'edit_posts' => 'edit_nsbr',\r\n\t\t'edit_others_posts' => 'edit_others_nsbr',\r\n\t\t'publish_posts' => 'publish_nsbr',\r\n\t\t'read_private_posts' => 'read_private_nsbr',\r\n\t);\r\n\t$args = array(\r\n\t\t'label' => __( 'nsbr', 'text_domain' ),\r\n\t\t'description' => __( 'National Small Boat Register', 'text_domain' ),\r\n\t\t'labels' => $labels,\r\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions',),\r\n\t\t'hierarchical' => false,\r\n\t\t'public' => true,\r\n\t\t'show_ui' => true,\r\n\t\t'show_in_menu' => true,\r\n\t\t'show_in_nav_menus' => true,\r\n\t\t'show_in_admin_bar' => true,\r\n\t\t'menu_position' => 5,\r\n\t\t'can_export' => true,\r\n\t\t'has_archive' => true,\r\n\t\t'exclude_from_search' => false,\r\n\t\t'publicly_queryable' => true,\r\n\t 'capabilities' => $capabilities,\r\n\t);\r\n\tregister_post_type( 'nsbr', $args );\r\n\t\r\n\tadd_role('nsbr_manager', 'NSBR Manager', array(\r\n 'edit_nsbr' => true,\r\n 'edit_others_nsbr' => true,\r\n 'read_nsbr' => true,\r\n 'publish_nsbr' => true,\r\n 'read_private_nsbr' => true,\r\n 'delete_nsbr' => true,\r\n 'read'=> true\r\n ));\r\n \r\n\t add_nsbr_capabilities_to_role( 'curator' );\r\n add_nsbr_capabilities_to_role( 'administrator' );\r\n add_nsbr_capabilities_to_role( 'nmmc_admin' );\r\n}", "function rng_create_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'Post Types Plural', 'Post Type General Name', 'translate_name' ),\n\t\t'singular_name' => _x( 'Post Type Singular', 'Post Type Singular Name', 'translate_name' ),\n\t\t'menu_name' => __( 'Post Types', 'translate_name' ),\n\t\t'name_admin_bar' => __( 'Post Type', 'translate_name' ),\n\t\t'archives' => __( 'Item Archives', 'translate_name' ),\n\t\t'attributes' => __( 'Item Attributes', 'translate_name' ),\n\t\t'parent_item_colon' => __( 'Parent Item:', 'translate_name' ),\n\t\t'all_items' => __( 'All Items', 'translate_name' ),\n\t\t'add_new_item' => __( 'Add New Item', 'translate_name' ),\n\t\t'add_new' => __( 'Add New', 'translate_name' ),\n\t\t'new_item' => __( 'New Item', 'translate_name' ),\n\t\t'edit_item' => __( 'Edit Item', 'translate_name' ),\n\t\t'update_item' => __( 'Update Item', 'translate_name' ),\n\t\t'view_item' => __( 'View Item', 'translate_name' ),\n\t\t'view_items' => __( 'View Items', 'translate_name' ),\n\t\t'search_items' => __( 'Search Item', 'translate_name' ),\n\t\t'not_found' => __( 'Not found', 'translate_name' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'translate_name' ),\n\t\t'featured_image' => __( 'Featured Image', 'translate_name' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'translate_name' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'translate_name' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'translate_name' ),\n\t\t'insert_into_item' => __( 'Insert into item', 'translate_name' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this item', 'translate_name' ),\n\t\t'items_list' => __( 'Items list', 'translate_name' ),\n\t\t'items_list_navigation' => __( 'Items list navigation', 'translate_name' ),\n\t\t'filter_items_list' => __( 'Filter items list', 'translate_name' ),\n\t);\n\t$args = array(\n 'public' => true,\n\t\t'label' => __( 'Post Type Singular', 'translate_name' ),\n\t\t'description' => __( 'Post Type Description', 'translate_name' ),\n 'labels' => $labels,\n 'exclude_from_search' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_menu'\t\t\t=> true,\n\t\t'show_in_admin_bar'\t\t=> true,\n\t\t'menu_position'\t\t\t=> 5,\n\t\t// 'menu_icon' \t\t\t=> get_bloginfo('template_directory') . '/images/portfolio-icon.png',\n\t\t'menu_icon'\t\t\t\t=> 'dashicon-groups',\n\t\t'has_archive'\t\t\t=> true,\n\t\t'capability_type'\t\t=> array('book','books'),\n\t\t'capabilities' \t\t\t=> array(\n\t\t\t'edit_post' => 'edit_book', \n\t\t\t'read_post' => 'read_book', \n\t\t\t'delete_post' => 'delete_book', \n\t\t\t'edit_posts' => 'edit_books', \n\t\t\t'edit_others_posts' => 'edit_others_books', \n\t\t\t'publish_posts' => 'publish_books', \n\t\t\t'read_private_posts' => 'read_private_books', \n\t\t\t'create_posts' => 'edit_books', \n\t\t),\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes', 'post-formats' ),\n\t\t'taxonomies' => array( 'category', 'post_tag' ),\n\t\t'hierarchical' => true,\n\t);\n\tregister_post_type( 'book', $args );\n\n}", "function register_post_types(){\n\t\t\trequire('lib/custom-types.php');\n\t\t}", "function ydd_post_type() {\r\n\r\n $labels = array(\r\n 'name' => _x( 'YDD', 'Post Type General Name', 'text_domain' ),\r\n\t\t'singular_name' => _x( 'Yacht Design', 'Post Type Singular Name', 'text_domain' ),\r\n\t\t'menu_name' => __( 'Yacht Design', 'text_domain' ),\r\n\t\t'parent_item_colon' => __( 'Parent Design:', 'text_domain' ),\r\n\t\t'all_items' => __( 'All Yacht Designs', 'text_domain' ),\r\n\t\t'view_item' => __( 'View Yacht Design', 'text_domain' ),\r\n\t\t'add_new_item' => __( 'Add Yacht Design', 'text_domain' ),\r\n\t\t'add_new' => __( 'Add Yacht Design', 'text_domain' ),\r\n\t\t'edit_item' => __( 'Edit Yacht Design', 'text_domain' ),\r\n\t\t'update_item' => __( 'Update Yacht Design', 'text_domain' ),\r\n\t\t'search_items' => __( 'Search YDD', 'text_domain' ),\r\n\t\t'not_found' => __( 'Yacht Design Not found in Register', 'text_domain' ),\r\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\r\n\t);\r\n\t$capabilities = array(\r\n\t\t'edit_post' => 'edit_ydd',\r\n\t\t'read_post' => 'read_ydd',\r\n\t\t'delete_post' => 'delete_ydd',\r\n\t\t'edit_posts' => 'edit_ydd',\r\n\t\t'edit_others_posts' => 'edit_others_ydd',\r\n\t\t'publish_posts' => 'publish_ydd',\r\n\t\t'read_private_posts' => 'read_private_ydd',\r\n\t);\r\n\t$args = array(\r\n\t\t'label' => __( 'ydd', 'text_domain' ),\r\n\t\t'description' => __( 'Yacht Design Database', 'text_domain' ),\r\n\t\t'labels' => $labels,\r\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions',),\r\n\t\t'hierarchical' => false,\r\n\t\t'public' => true,\r\n\t\t'show_ui' => true,\r\n\t\t'show_in_menu' => true,\r\n\t\t'show_in_nav_menus' => true,\r\n\t\t'show_in_admin_bar' => true,\r\n\t\t'menu_position' => 5,\r\n\t\t'can_export' => true,\r\n\t\t'has_archive' => true,\r\n\t\t'exclude_from_search' => false,\r\n\t\t'publicly_queryable' => true,\r\n\t 'capabilities' => $capabilities,\r\n\t);\r\n\tregister_post_type( 'ydd', $args );\r\n \r\n add_ydd_capabilities_to_role( 'curator' );\r\n add_ydd_capabilities_to_role( 'administrator' );\r\n add_ydd_capabilities_to_role( 'nmmc_admin' );\r\n}", "function bs_configure_custom_post_types($args)\n{\n function bs_custom_post_types()\n {\n global $bs_config;\n\n foreach ($bs_config[\"custom-post-types\"] as $key => $type) {\n $type = bs_defaults($type, [\n \"public\" => true,\n ]);\n\n if (isset($type[\"name\"])) {\n $type[\"labels\"][\"name\"] = $type[\"name\"];\n }\n\n if (isset($type[\"slug\"])) {\n $type[\"rewrite\"][\"slug\"] = $type[\"slug\"];\n }\n\n if (isset($type[\"admin_only\"]) && $type[\"admin_only\"]) {\n $type[\"public\"] = false;\n $type[\"show_ui\"] = true;\n }\n\n register_post_type($key, bs_array_omit($type, [\"slug\", \"name\", \"admin_only\"]));\n }\n }\n add_action(\"init\", \"bs_custom_post_types\");\n}", "public function add_post_type( $name ) {\n\t\t$this->post_types[] = $name;\n\t}", "function register_post_types(){\n\t\trequire('lib/custom-types.php');\n\t}", "function wpmudev_create_post_type() {\n\t$labels = array(\n \t\t'name' => 'Actividades',\n \t'singular_name' => 'Actividad',\n \t'add_new' => 'Añade Nueva Actividad',\n \t'add_new_item' => 'Añade una nueva Actividad',\n \t'edit_item' => 'Edita la Actividad',\n \t'new_item' => 'Nueva Actividad',\n \t'all_items' => 'Todas las Actividades',\n \t'view_item' => 'Ver Actividad',\n \t'search_items' => 'Buscar Actividades',\n \t'not_found' => 'No se han encontrado Actividades',\n \t'not_found_in_trash' => 'No se han encontrado Actividades en la Papelera', \n \t'parent_item_colon' => '',\n \t'menu_name' => 'Actividades',\n );\n \n $args = array(\n\t\t'labels' => $labels,\n\t\t'has_archive' => true,\n \t\t'public' => true,\n\t\t'supports' => array( 'title', 'custom-fields', 'thumbnail', 'comments', 'page-attributes', 'author' ),\n\t\t'exclude_from_search' => false,\n\t\t'capability_type' => 'post',\n\t\t//'map_meta_caps' => true,\n\t\t'rewrite' => array( 'slug' => 'actividades' ),\n\t);\n\t\n\tregister_post_type( 'actividad', $args );\n}", "function pluginprefix_setup_post_type()\n{\n register_post_type('post-nasa-gallery', [\n 'label' => 'Nasa Images Posts',\n 'public' => true\n ]);\n}", "function registerPostTypes()\n{\n register_post_type('destination', [\n 'public' => true,\n 'label' => 'Destinations',\n 'supports' => ['title', 'editor', 'thumbnail']\n ]);\n register_post_type('review', [\n 'public' => true,\n 'label' => 'Reviews',\n 'supports' => ['title', 'editor']\n ]);\n}", "function zmpm_register_post_type() {\n\t\n\t$labels = array(\n\t\t'name' => 'Permissions',\n\t\t'singular_name' => 'Permission',\n\t\t'menu_name' => 'Permissions',\n\t\t'name_admin_bar' => 'Permission',\n\t\t'archives' => 'Permission Archives',\n\t\t'attributes' => 'Permission Attributes',\n\t\t'parent_item_colon' => 'Parent Permission:',\n\t\t'all_items' => 'Permissions',\n\t\t'add_new_item' => 'Add New Permission',\n\t\t'add_new' => 'Add New',\n\t\t'new_item' => 'New Permission',\n\t\t'edit_item' => 'Edit Permission',\n\t\t'update_item' => 'Update Permission',\n\t\t'view_item' => 'View Permission',\n\t\t'view_items' => 'View Permissions',\n\t\t'search_items' => 'Search Permission',\n\t\t'not_found' => 'Not found',\n\t\t'not_found_in_trash' => 'Not Found in Trash',\n\t\t'featured_image' => 'Featured Image',\n\t\t'set_featured_image' => 'Set featured image',\n\t\t'remove_featured_image' => 'Remove featured image',\n\t\t'use_featured_image' => 'Use as featured image',\n\t\t'insert_into_item' => 'Insert into permission',\n\t\t'uploaded_to_this_item' => 'Uploaded to this permission',\n\t\t'items_list' => 'Permissions list',\n\t\t'items_list_navigation' => 'Permissions list navigation',\n\t\t'filter_items_list' => 'Filter permissions list',\n\t);\n\t$args = array(\n\t\t'label' => 'Permission',\n\t\t'description' => 'ZingMap permissions',\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title' ),\n\t\t'hierarchical' => false,\n\t\t'public' => false,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => 'users.php',\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-lock',\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => false,\n\t\t'can_export' => true,\n\t\t'has_archive' => false,\n\t\t'exclude_from_search' => true,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'page',\n\t);\n\tregister_post_type( 'zmpm_permission', $args );\n\t\n}", "function tower_custom_post_types() {\n foreach (TOWER_CUSTOM_POSTS as $key => $custom_type) {\n register_post_type($key, $custom_type['config']);\n }\n}", "function register_fablabs_post_type () {\n\t$labels = array(\n 'name' => _x( 'Fab Labs', 'post type general name', 'additive_tcp' ),\n 'singular_name' => _x( 'Fab Lab', 'post type singular name', 'additive_tcp' ),\n 'menu_name' => _x( 'Fab Labs', 'admin menu', 'additive_tcp' ),\n 'name_admin_bar' => _x( 'Fab Lab', 'add new on admin bar', 'additive_tcp' ),\n 'add_new' => _x( 'Add New', 'fablab', 'additive_tcp' ),\n 'add_new_item' => __( 'Add New Fab Lab', 'additive_tcp' ),\n 'new_item' => __( 'New Fab Lab', 'additive_tcp' ),\n 'edit_item' => __( 'Edit Fab Lab', 'additive_tcp' ),\n 'view_item' => __( 'View Fab Lab', 'additive_tcp' ),\n 'all_items' => __( 'All Fab Labs', 'additive_tcp' ),\n 'search_items' => __( 'Search Fab Labs', 'additive_tcp' ),\n 'parent_item_colon' => __( 'Parent Fab Lab:', 'additive_tcp' ),\n 'not_found' => __( 'No fab labs found.', 'additive_tcp' ),\n 'not_found_in_trash' => __( 'No fab labs found in Trash.', 'additive_tcp' )\n );\n\tregister_post_type('additive_fab_lab', array(\n\t\t'labels' => $labels,\n\t\t'description' => 'Fab Labs which will appear on the Fab Labs page.',\n\t\t'public' => true,\n\t\t'hierarchical' => false,\n\t\t'capability_type' => 'post',\n\t\t'supports' => array('title', 'editor', 'custom-fields', 'thumbnail')\n\t));\n}", "function bg_register_post_type_team() {\r\n\t\t$labels = array(\r\n\t\t\t'name' => __('Team','blueglass'),\r\n\t\t\t'singular_name' => __('Team','blueglass'),\r\n\t\t\t'add_new' => __('Add memeber','blueglass'),\r\n\t\t\t'add_new_item' => __('Add new memeber','blueglass'),\r\n\t\t\t'new_item' => __('New memeber','blueglass'),\r\n\t\t\t'edit_item' => __('Update memeber','blueglass'),\r\n\t\t\t'view_item' => __('View memeber','blueglass'),\r\n\t\t\t'all_items' => __('All memebers','blueglass'),\r\n\t\t);\r\n\t\tregister_post_type( 'team',\r\n\t\t\tarray( \r\n\t\t\t\t'labels' => $labels,\r\n\t\t\t\t'menu_position' => 21,\r\n\t\t\t\t'_builtin' => false,\r\n\t\t\t\t'exclude_from_search' => true, // Exclude from Search Results\r\n\t\t\t\t'capability_type' => 'post',\r\n\t\t\t\t'public' => true, \r\n\t\t\t\t'show_ui' => true,\r\n\t\t\t\t'show_in_nav_menus' => false,\r\n\t\t\t\t'rewrite' => array(\r\n\t\t\t\t\t'slug' => 'team',\r\n\t\t\t\t\t'with_front' => FALSE,\r\n\t\t\t\t),\r\n\t\t\t\t'query_var' => \"team\", // This goes to the WP_Query schema\r\n\t\t\t\t'menu_icon' => 'dashicons-groups',\r\n\t\t\t\t'supports' => array(\r\n\t\t\t\t\t'title',\r\n\t\t\t\t\t'editor' => false,\r\n\t\t\t\t),\r\n\t\t\t)\r\n\t\t);\r\n\t\t/*\r\n\t\tregister_taxonomy('case_studies_category', 'case_studies', array(\r\n\t\t\t\t'hierarchical' => true, \r\n\t\t\t\t'label' => __('Categories','blueglass'), \r\n\t\t\t\t'singular_name' => __('Category','blueglass'), \r\n\t\t\t\t\"rewrite\" => true, \"query_var\" => true\r\n\t\t\t\t));\r\n\t\t*/\r\n\t}", "private function register_post_type() {\n\t\t\t// register the post type\n\t\t\t$args = array('label' => __('Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t'description' => '',\n\t\t\t\t\t\t\t\t\t\t'public' => false,\n\t\t\t\t\t\t\t\t\t\t'show_ui' => true,\n\t\t\t\t\t\t\t\t\t\t'show_in_menu' => true,\n\t\t\t\t\t\t\t\t\t\t'capability_type' => 'post',\n\t\t\t\t\t\t\t\t\t\t'map_meta_cap' => true,\n\t\t\t\t\t\t\t\t\t\t'hierarchical' => false,\n\t\t\t\t\t\t\t\t\t\t'rewrite' => array('slug' => $this->post_type, 'with_front' => false),\n\t\t\t\t\t\t\t\t\t\t'query_var' => true,\n\t\t\t\t\t\t\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t\t\t\t\t\t\t'menu_position' => 100,\n\t\t\t\t\t\t\t\t\t\t'menu_icon' => 'dashicons-admin-generic',\n\t\t\t\t\t\t\t\t\t\t'supports' => array('title','custom-fields','revisions'),\n\t\t\t\t\t\t\t\t\t\t'labels' => array('name' => __('Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'singular_name' => __('Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'menu_name' =>\t__('Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'add_new' => __('Add Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'add_new_item' => __('Add New Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit' => __('Edit', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit_item' => __('Edit Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'new_item' => __('New Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'view' => __('View Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'view_item' => __('View Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'search_items' => __('Search Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'not_found' => __('No Options Pages Found', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'not_found_in_trash' => __('No Options Pages Found in Trash', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'parent' => __('Parent Options Page', $this->text_domain)));\n\t\t\tregister_post_type($this->post_type, $args);\n\t\t}", "function create_post_type() {\n\t\tregister_post_type(\n\t\t 'project',\n\t\t array(\n\t\t 'label' => 'Projects',\n\t\t 'labels' => array(\n\t\t 'name' => 'Projects',\n\t\t 'singular_name' => 'Project',\n\t\t 'all_items' => 'All projects',\n\t\t 'add_new_item' => 'Add a project',\n\t\t 'edit_item' => 'Edit project',\n\t\t 'new_item' => 'New project',\n\t\t 'view_item' => 'See project',\n\t\t 'search_items' => 'Search project',\n\t\t 'not_found' => 'No project found',\n\t\t 'not_found_in_trash'=> 'No project in the trash'\n\t\t ),\n\t\t 'public' => true,\n\t\t // 'capability_type' => 'post',\n\t\t 'supports' => array(\n\t\t 'title',\n\t\t 'editor',\n\t\t 'thumbnail'\n\t\t ),\n\t\t 'has_archive' => true,\n\t\t\t'menu_icon' => 'dashicons-welcome-add-page'\n\t\t )\n\t\t);\n\t}", "function create_post_type() {\r\n\r\n\tregister_post_type( 'Editorials',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t'name' => __( 'Editorials' ),\r\n\t\t\t\t'singular_name' => __( 'Editorial' )\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'editorials'),\r\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),\r\n \t'show_ui' => true,\r\n\t\t)\r\n\t);\r\n\tregister_post_type( 'Local news',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t\r\n\t\t\t\t'name' => __( 'Local news' ),\r\n\t\t\t\t'singular_name' => __( 'Local new' )\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'local news'),\r\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),\r\n \t'show_ui' => true,\r\n\t\t)\r\n\t);\r\n}", "public function post_type() {\n\t\t$labels = array(\n\t\t\t'name' => __( 'Departamentos'),\n\t\t\t'singular_name' => __( 'Departamento' ),\n\t\t\t'add_new' => __('Añadir nuevo'),\n\t\t\t'add_new_item' => __('Añadir nuevo Departamento'),\n\t\t\t'edit_item' => __('Editar Departamento'),\n\t\t\t'new_item' => __('Nuevo Departamento'),\n\t\t\t'view_item' => __('Ver Departamento'),\n\t\t\t'search_items' => __('Buscar'),\n\t\t\t'not_found' => __('No se encontraron Departamentos'),\n\t\t\t'not_found_in_trash' => __('No se encontraron Departamentos en la Papelera'), \n\t\t\t'parent_item_colon' => ''\n\t\t );\n\t\t \n\t\t $args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true, \n\t\t\t'query_var' => true,\n\t 'has_archive' => true,\n\t\t\t'capability_type' => 'post',\n\t\t\t'hierarchical' => true,\n\t\t 'show_ui' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t 'show_in_menu' => 'bn_config',\n\t\t\t'menu_position' => 57,\n\t\t\t'menu_icon' => 'dashicons-clipboard',\n\t\t\t'rewrite' => array('slug' => __( $this->post_type )),\n\t\t\t'supports' => array('title', 'excerpt', 'page-attributes') //,'editor'\n\t\t );\n\t\t \n\t\t register_post_type(__( $this->post_type ), $args);\n\t}", "function wpcpolls_custom_post_type() {\n $labels = array(\n 'name' => _x( 'Polls', 'Post Type General Name', 'wordpress-custom-polls' ),\n 'singular_name' => _x( 'Poll', 'Post Type Singular Name', 'wordpress-custom-polls' ),\n 'menu_name' => __( 'Polls', 'wordpress-custom-polls' ),\n 'name_admin_bar' => __( 'Polls', 'wordpress-custom-polls' ),\n 'archives' => __( 'Poll Archives', 'wordpress-custom-polls' ),\n 'attributes' => __( 'Poll Attributes', 'wordpress-custom-polls' ),\n 'parent_item_colon' => __( 'Parent Poll:', 'wordpress-custom-polls' ),\n 'all_items' => __( 'All Polls', 'wordpress-custom-polls' ),\n 'add_new_item' => __( 'Add New Poll', 'wordpress-custom-polls' ),\n 'add_new' => __( 'Add New', 'wordpress-custom-polls' ),\n 'new_item' => __( 'New Poll', 'wordpress-custom-polls' ),\n 'edit_item' => __( 'Edit Poll', 'wordpress-custom-polls' ),\n 'update_item' => __( 'Update Poll', 'wordpress-custom-polls' ),\n 'view_item' => __( 'View Poll', 'wordpress-custom-polls' ),\n 'view_items' => __( 'View Polls', 'wordpress-custom-polls' ),\n 'search_items' => __( 'Search Poll', 'wordpress-custom-polls' ),\n 'not_found' => __( 'Not found', 'wordpress-custom-polls' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'wordpress-custom-polls' ),\n 'featured_image' => __( 'Featured Image', 'wordpress-custom-polls' ),\n 'set_featured_image' => __( 'Set featured image', 'wordpress-custom-polls' ),\n 'remove_featured_image' => __( 'Remove featured image', 'wordpress-custom-polls' ),\n 'use_featured_image' => __( 'Use as featured image', 'wordpress-custom-polls' ),\n 'insert_into_item' => __( 'Insert into Poll', 'wordpress-custom-polls' ),\n 'uploaded_to_this_item' => __( 'Uploaded to this Poll', 'wordpress-custom-polls' ),\n 'items_list' => __( 'Polls list', 'wordpress-custom-polls' ),\n 'items_list_navigation' => __( 'Polls list navigation', 'wordpress-custom-polls' ),\n 'filter_items_list' => __( 'Filter Polls list', 'wordpress-custom-polls' ),\n );\n $args = array(\n 'label' => __( 'Poll', 'wordpress-custom-polls' ),\n 'description' => __( 'Custom Polls', 'wordpress-custom-polls' ),\n 'labels' => $labels,\n 'supports' => array( 'title', 'editor' ),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => false,\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-list-view',\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => false,\n 'rewrite' => array('slug' => 'wpcpolls_polls'),\n 'exclude_from_search' => true,\n 'publicly_queryable' => true,\n 'capability_type' => 'post',\n 'show_in_rest' => true,\n );\n\n register_post_type( 'wpcpolls_polls', $args );\n}", "public function register_post_types() {\n require_once('includes/post-types.php');\n }", "public static function register_post_type()\n {\n\n \t register_post_type( 'books',\n\t\t array(\n\t\t 'labels' => array(\n\t\t 'name' => __( 'Books' ),\n\t\t 'singular_name' => __( 'Books' )\n\t\t ),\n\t\t 'public' => true,\n\t\t 'has_archive' => false,\n\t\t )\n\t\t );\n\n }", "function create_posttype() \n {\n register_post_type( 'mist_employee',\n array(\n 'labels' => array(\n 'name' => __( 'Employees' ),\n 'singular_name' => __( 'Employee' )\n ),\n \n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array('slug' => 'employees'),\n 'supports' => array('title','editor','thumbnail','excerpt'),\n 'menu_icon' => 'dashicons-businessman'\n )\n );\n register_post_type( 'mist_message',\n array(\n 'labels' => array(\n 'name' => __( 'Person Messages' ),\n 'singular_name' => __( 'Message' ),\n ),\n \n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array('slug' => 'message'),\n 'supports' => array('title','editor','thumbnail','excerpt'),\n 'menu_icon' => 'dashicons-testimonial'\n )\n );\n add_post_type_support('mist_message', 'excerpt');\n \n }", "function thirdtheme_custom_post_type()\n {\n $args = array(\n 'labels' => array('name' =>__(' my custom post'),\n 'singular name' =>__('my custom post')),\n 'public' => true,\n 'show_in_menu' => true,\n 'has_archive' => true,\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail'));\n register_post_type('custompost',$args);\n \n }", "function carbon_register_post_type($settings){\n\n $labels = array(\n 'name' => _x($settings['plural'],'post type plural name','carbon'),\n 'singular_name' => _x($settings['singular'],'post type singular name','carbon'),\n 'add_new' => _x('Add New',$settings['singular'],'carbon'),\n 'add_new_item' => __('Add New ' .$settings['singular']),\n 'edit_item' => __('Edit ' .$settings['singular']),\n 'new_item' => __('New ' .$settings['singular']),\n 'all_items' => __('All ' .$settings['plural']),\n 'view_item' => __('View ' .$settings['singular']),\n 'search_items' => __('Search ' .$settings['plural']),\n 'not_found' => __('No ' .$settings['plural'].' found'),\n 'not_found_in_trash' => __('No ' .$settings['plural'].' found in Trash'),\n 'parent_item_colon' => ':',\n 'menu_name' => $settings['plural'],\n );\n\n $args = array(\n 'labels' => $labels,\n 'can_export' => (isset($settings['can_export']) ? $settings['can_export'] : true), // defaults true\n 'capability_type' => (isset($settings['capability_type']) ? $settings['behavior'] : 'post'), // default post\n // 'capabilities' // default capability_type\n 'exclude_from_search' => (isset($settings['exclude_from_search']) ? $settings['exclude_from_search'] : false), // default opposite of public\n 'hierarchical' => (isset($settings['hierarchical']) ? $settings['hierarchical'] : false), // default false\n 'has_archive' => (isset($settings['has_archive']) ? $settings['has_archive'] : false), // default false\n // 'permalink_epmask' // default EP_PERMALINK\n 'public' => (isset($settings['public']) ? $settings['public'] : true), // default false\n 'publicly_queryable' => (isset($settings['publicly_queryable']) ? $settings['publicly_queryable'] : true), // default public\n 'query_var' => (isset($settings['query_var']) ? $settings['query_var'] : true), // default true type\n 'show_ui' => (isset($settings['show_ui']) ? $settings['show_ui'] : true), // default public\n 'show_in_menu' => (isset($settings['show_in_menu']) ? $settings['show_in_menu'] : true), // default public\n 'show_in_admin_bar' => (isset($settings['show_in_admin_bar']) ? $settings['show_in_admin_bar'] : true), // default show_in_menu\n 'menu_position' => (isset($settings['menu_position']) ? $settings['menu_position'] : null), // default null\n 'menu_icon' => (isset($settings['menu_icon']) ? $settings['menu_icon'] : 'dashicons-admin-post'),\n 'supports' => (isset($settings['supports']) ? $settings['supports'] : array('title', 'editor', 'excerpt', 'thumbnail', 'revisions', 'page-attributes')), // default title editor\n 'taxonomies' => (isset($settings['taxonomies']) ? $settings['taxonomies'] : array()), // default none\n // 'register_meta_box_cb' // default none\n 'rewrite' => (isset($settings['rewrite']) ? $settings['rewrite'] : array( // default true name\n 'slug' => (isset($settings['slug']) ? $settings['slug'] : $settings['type']), // default type\n 'with_front' => (isset($settings['with_front']) ? $settings['with_front'] : false), // default true\n 'feeds' => (isset($settings['feeds']) ? $settings['feeds'] : false), // default has_archive\n 'pages' => (isset($settings['pages']) ? $settings['pages'] : true), // defaults true\n // 'ep_mask' // default permalink_epmask EP_PERMALINK\n )),\n );\n register_post_type($settings['type'], $args);\n }", "function add_custom_post_type() \n {\n // add custom type evenementen\n $labels = array(\n 'name' => _x('Quotes', 'post type general name', $this->localization_domain),\n 'singular_name' => _x('Quote', 'post type singular name', $this->localization_domain),\n 'add_new' => _x('Add Quote', 'event', $this->localization_domain),\n 'add_new_item' => __('Add New Quote', $this->localization_domain),\n 'edit_item' => __('Edit Quote', $this->localization_domain),\n 'new_item' => __('New Quote', $this->localization_domain),\n 'view_item' => __('View Quote', $this->localization_domain),\n 'search_items' => __('Search Quotes', $this->localization_domain),\n 'not_found' => __('No Quotes found', $this->localization_domain),\n 'not_found_in_trash' => __('No Quotes found in Trash', $this->localization_domain), \n 'parent_item_colon' => ''\n );\n $type_args = array(\n 'labels' => $labels,\n 'description' => __('bbQuotations offers a simple quotes custom post type. Useful for pull quotes or just random quotes on your site.',\n $this->localization_domain),\n 'public' => false,\n 'publicly_queryable' => false,\n 'show_ui' => true, \n 'query_var' => true,\n 'rewrite' => array('slug' => $this->options['bbquotations-slug']),\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'menu_position' => 5,\n 'supports' => array('title','editor','author')\n ); \n register_post_type( $this->custom_post_type_name, $type_args);\n }", "function tev_post_factory_register($postType, $className) {\n Tev\\Application\\Application::getInstance()\n ->fetch('post_factory')\n ->register($postType, $className);\n }", "function planoType() {\r\n\t$labels = array(\r\n\t\t'name' => _x('Planos', 'post type general name'),\r\n\t 'singular_name' => _x('Plano', 'post type singular name'),\r\n\t 'add_new' => _x('Adicionar Novo', 'slideshow item'),\r\n\t 'add_new_item' => __('Adicionar Novo Plano'),\r\n\t 'edit_item' => __('Editar Plano'),\r\n\t 'new_item' => __('Novo Plano'),\r\n\t 'view_item' => __('Ver Plano'),\r\n\t 'search_items' => __('Procurar Plano'),\r\n\t 'not_found' => __('Nenhum Plano Encontrado'),\r\n\t 'not_found_in_trash' => __('Nenhum Plano na Lixeira'),\r\n\t 'parent_item_colon' => ''\r\n\t);\r\n\r\n $args = array(\r\n 'labels' => $labels,\r\n 'public' => true,\r\n 'publicly_queryable' => true,\r\n 'show_ui' => true,\r\n 'query_var' => true,\r\n 'rewrite' => true,\r\n 'capability_type' => 'post',\r\n 'hierarchical' => false,\r\n 'menu_position' => 4,\r\n 'supports' => array('title','editor'),\r\n 'rewrite' => array('slug' => 'plano')\r\n );\r\n\r\n register_post_type( 'plano' , $args ); # registering the new post type\r\n}", "function badge_create_post_type()\n{\n\t// initial Scheme type.\n\tregister_post_type('badge',\n\t\tarray(\n\t\t\t'label' => __('Badge'),\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __('Badges'),\n\t\t\t\t'singular_name' => __('Badge'),\n\t\t\t\t'add_new_item' => __('Add New Badge'),\n\t\t\t\t'edit_item' => __('Edit Badge'),\n\t\t\t\t'new_item' => __('New Badge'),\n\t\t\t\t'view_item' => __('View Badge'),\n\t\t\t\t'search_item' => __('Search Badges'),\n\t\t\t\t'not_found' => __('No badge found'),\n\t\t\t\t'not_found_in_trash' => __('No badge found in Trash')\n\t\t\t),\n\t\t\t'description' => __('A badge or label that shows you recognise specific websites'),\n\t\t\t'public' => true,\n\t\t\t'menu_position' => 40, // at the top, 5=Posts\n\t\t\t'hierarchical' => false, // default\n\t\t\t'supports' => array(\n\t\t\t\t'title',\n\t\t\t\t'editor', // i.e. content\n\t\t\t\t'thumbnail', // i.e. featured image\n\t\t\t),\n\t\t\t'has_archive' => true,\n\t\t)\n\t);\n}", "function wpass_register_post_type_status() {\r\n\r\n\t$labels = array(\r\n\t\t'menu_name' => __( 'Custom Status', 'wpass_statuses' ),\r\n\t\t'name' => _x( 'Status', 'Post Type General Name', 'wpass_statuses' ),\r\n\t\t'singular_name' => _x( 'Status', 'Post Type Singular Name', 'wpass_statuses' ),\r\n\t\t'add_new_item' => __( 'Add New Status', 'wpass_statuses' ),\r\n\t\t'add_new' => __( 'New Status', 'wpass_statuses' ),\r\n\t\t'not_found' => __( 'No Status found', 'wpass_statuses' ),\r\n\t\t'not_found_in_trash' => __( 'No Status found in Trash', 'wpass_statuses' ),\r\n\t\t'parent_item_colon' => __( 'Parent Status:', 'wpass_statuses' ),\r\n\t\t'all_items' => __( 'Custom Status', 'wpass_statuses' ),\r\n\t\t'view_item' => __( 'View Status', 'wpass_statuses' ),\r\n\t\t'edit_item' => __( 'Edit Status', 'wpass_statuses' ),\r\n\t\t'update_item' => __( 'Update Status', 'wpass_statuses' ),\r\n\t\t'search_items' => __( 'Search Status', 'wpass_statuses' ),\r\n\t);\r\n\r\n\t/* Post type capabilities */\r\n\t$cap = array(\r\n\t\t'read'\t\t\t\t\t => 'view_ticket',\r\n\t\t'read_post'\t\t\t\t => 'view_ticket',\r\n\t\t'read_private_posts' \t => 'view_private_ticket',\r\n\t\t'edit_post'\t\t\t\t => 'edit_ticket',\r\n\t\t'edit_posts'\t\t\t => 'edit_ticket',\r\n\t\t'edit_others_posts' \t => 'edit_other_ticket',\r\n\t\t'edit_private_posts' \t => 'edit_private_ticket',\r\n\t\t'edit_published_posts' \t => 'edit_ticket',\r\n\t\t'publish_posts'\t\t\t => 'create_ticket',\r\n\t\t'delete_post'\t\t\t => 'delete_ticket',\r\n\t\t'delete_posts'\t\t\t => 'delete_ticket',\r\n\t\t'delete_private_posts' \t => 'delete_private_ticket',\r\n\t\t'delete_published_posts' => 'delete_ticket',\r\n\t\t'delete_others_posts' \t => 'delete_other_ticket'\r\n\t);\t\r\n\t\r\n\t$args = array(\r\n\t\t'labels' => $labels,\r\n\t\t'hierarchical' => true,\r\n\t\t'description' => __( 'Ticket Status', 'wpass_statuses' ),\r\n\t\t'supports' => array( 'title' ),\r\n\t\t'public' => false,\r\n\t\t'show_ui' => true,\r\n\t\t//'show_in_menu' => 'edit.php?post_type=ticket',\r\n\t\t'show_in_menu' => false,\r\n\t\t'show_in_nav_menus' => false,\r\n\t\t'show_in_admin_bar' => true,\r\n\t\t'publicly_queryable' => true,\r\n\t\t'exclude_from_search' => true,\r\n\t\t'has_archive' => false,\r\n\t\t'can_export' => true,\r\n\t\t'capabilities' => $cap,\t\t\t\t\r\n\t\t'capability_type' => 'edit_ticket'\r\n\t);\r\n\r\n\tregister_post_type( 'wpass_status', $args );\r\n\r\n}", "function obdiy_create_lp_post_type() {\n\tregister_post_type( 'landing_page',\n\t\tarray(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __( 'Landing Pages' ),\n\t\t\t\t'singular_name' => __( 'Landing Page' )\n\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'hierarchical' => true, //Behave like a page\n\t\t\t'query_var' => true,\n\t\t\t'supports' => array( 'title', 'editor', 'revisions', 'custom-fields', 'thumbnail', 'page-attributes' ),\n\t\t\t'rewrite' => array( 'slug' => 'valuable-stuff', 'with_front' => false ),\n\t\t\t'permalink_epmask' => EP_PERMALINK,\n\t\t\t'menu_icon' => 'dashicons-tag',\n\t\t)\n\t);\n}", "static function register_post_type ()\n {\n register_post_type(\n 'person',\n array(\n 'labels' => array(\n 'name' => __x( 'People', 'post type general name' ),\n 'singular_name' => __x( 'Person', 'post type singular name' ),\n 'menu_name' => __x( 'People', 'admin menu' ),\n 'name_admin_bar' => __x( 'Person', 'add new on admin bar' ),\n 'add_new' => __x( 'Add New', 'book' ),\n 'add_new_item' => ___( 'Add New Person' ),\n 'new_item' => ___( 'New Person' ),\n 'edit_item' => ___( 'Edit Person' ),\n 'view_item' => ___( 'View Person' ),\n 'all_items' => ___( 'All People' ),\n 'search_items' => ___( 'Search People' ),\n 'parent_item_colon' => ___( 'Parent People:' ),\n 'not_found' => ___( 'No persons found.' ),\n 'not_found_in_trash' => ___( 'No persons found in Trash.' )\n ),\n 'description' => ___( 'Noteworthy people' ),\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'people' ),\n 'capability_type' => 'post',\n 'has_archive' => true,\n 'hierarchical' => false,\n 'menu_position' => null,\n 'menu_icon' => 'dashicons-welcome-learn-more',\n 'supports' => array( 'title', 'editor', 'thumbnail' )\n ));\n }", "function create_experience_post_type() {\n \n register_post_type( 'experiences',\n // CPT Options\n array(\n 'labels' \t=> array(\n 'name' \t\t\t=> __( 'Experiences' ),\n 'singular_name' => __( 'Experience' )\n ),\n 'public' \t\t=> true,\n 'has_archive' \t=> true,\n 'rewrite' \t\t=> array(\n \t'slug' => 'experiences'\n ),\n )\n );\n}", "function tt_register_cpt($single, $plural = '') {\n if (empty($plural)) {\n $plural = $single.'s';\n }\n register_post_type(\n strtolower($single),\n array(\n 'label' => $plural,\n 'labels' => array(\n 'add_new_item' => \"Add New $single\",\n 'edit_item' => \"Edit $single\",\n 'new_item' => \"New $single\",\n 'view_item' => \"View $single\",\n 'search_items' => \"Search $plural\",\n 'not_found' => \"No $plural found\",\n 'not_found_in_trash' => \"No $plural found in Trash\",\n ),\n 'public' => true,\n 'has_archive' => true,\n 'supports' => array(\n 'title',\n 'editor',\n 'thumbnail',\n 'custom-fields',\n 'excerpt',\n ),\n 'taxonomies' => array('category'),\n )\n );\n}", "function create_post_type() {\n\n // register external_post as a Custom Post Type\n register_post_type( 'external_post', \n array( \n 'labels' => array( \n 'name' => __('External Posts'), \n 'singular_name' => __('External Post') \n ),\n 'public' => true,\n 'menu_position' => 5,\n 'supports' => array('title', 'excerpt'),\n 'rewrite' => array('slug' => 'external','with_front' => false) \n ) \n ); \n\n // connect external_post to category taxonomy\n register_taxonomy_for_object_type('category', 'external_post');\n register_taxonomy_for_object_type('post_tag', 'external_post');\n\n\n // register wp_tool as a Custom Post Type\n register_post_type('wp_tool',\n array( \n 'labels' => array( \n 'name' => __('WordPress Tools'), \n 'singular_name' => __('WordPress Tool') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'author', 'editor', 'excerpt', 'thumbnail', 'post-formats', 'revisions', 'meta_info'),\n 'rewrite' => array('slug' => 'tool','with_front' => false) \n ) \n );\n\n // connect wp_tool to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'wp_tool');\n register_taxonomy_for_object_type('category', 'wp_tool');\n\n\n // reregister default post so we can set a custom slug\n register_post_type('post', array(\n 'labels' => array(\n 'name_admin_bar' => _x('Post', 'add new on admin bar' ),\n ),\n 'public' => true,\n '_builtin' => false, \n '_edit_link' => 'post.php?post=%d', \n 'capability_type' => 'post',\n 'map_meta_cap' => true,\n 'show_in_menu' => false,\n 'hierarchical' => false,\n 'rewrite' => array('slug' => 'article'),\n 'query_var' => false,\n 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats', 'column_info'),\n )); \n\n // register external_tool as a Custom Post Type\n register_post_type('external_tool',\n array(\n 'labels' => array( \n 'name' => __('External Tools'), \n 'singular_name' => __('External Tool') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'author', 'excerpt', 'thumbnail', 'revisions', 'meta_info'),\n 'rewrite' => array('slug' => 'special','with_front' => false) \n ) \n ); \n\n // connect external_tool to category taxonomy\n register_taxonomy_for_object_type('category', 'external_tool');\n register_taxonomy_for_object_type('meta_info', 'external_tool');\n\n\n // register city_journal as a Custom Post Type\n register_post_type('city_journal',\n array(\n 'labels' => array( \n 'name' => __('CityJournal Entry'),\n 'singular_name' => __('CityJournal Entry')\n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'editor', 'author', 'excerpt', 'thumbnail', 'revisions', 'meta_info', 'comments'),\n 'rewrite' => array('slug' => 'cityjournal','with_front' => false) \n ) \n ); \n\n // connect city_journal to category taxonomy\n register_taxonomy_for_object_type('category', 'city_journal');\n register_taxonomy_for_object_type('meta_info', 'city_journal'); \n\n\n // register people_project as a Custom Post Type\n register_post_type('people_project',\n array(\n 'labels' => array( \n 'name' => __('People & Projects'),\n 'singular_name' => __('People & Project')\n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'excerpt', 'thumbnail', 'meta_info'),\n ) \n ); \n\n // connect people_project to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'people_project'); \n\n\n register_post_type('discussion',\n array( \n 'labels' => array( \n 'name' => __('Discussions'), \n 'singular_name' => __('Discussion') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'post-formats', 'revisions', 'meta_info', 'comments'),\n 'rewrite' => array('slug' => 'discussion','with_front' => false) \n ) \n );\n\n // connect discussion to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'discussion');\n register_taxonomy_for_object_type('category', 'discussion');\n\n}", "public static function init() {\n\t\tadd_action( 'init', array( __CLASS__, 'register_post_type' ), 1 );\n\t}", "protected function addPostTypeConfigs()\n {\n // TODO: add post type configs\n }", "public function create_post_type() {\n\n register_post_type( self::POST_TYPE,\n array(\n\n 'labels' => array(\n 'name' => __( 'Fundraisers' ),\n 'singular_name' => __( 'Fundraiser' )\n ),\n 'description' => 'Fundraisers that allow users to purchase items through the WooCommerce Stores',\n 'menu_icon' => 'dashicons-chart-line',\n 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt',\n 'revisions' ),\n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array(\n 'slug' => __( 'fundraisers' ),\n 'with_front' => false\n )\n )\n );\n }", "private function initCustomPostType(){\n //Instantiate our custom post type object\n $this->cptWPDS = new PostType($this->wpdsPostType);\n \n //Set our custom post type properties\n $this->cptWPDS->setSingularName($this->wpdsPostTypeName);\n $this->cptWPDS->setPluralName($this->wpdsPostTypeNamePlural);\n $this->cptWPDS->setMenuName($this->wpdsPostTypeNamePlural);\n $this->cptWPDS->setLabels('Add New', 'Add New '.$this->wpdsPostTypeName, 'Edit '.$this->wpdsPostTypeName, 'New '.$this->wpdsPostTypeName, 'All '.$this->wpdsPostTypeNamePlural, 'View '.$this->wpdsPostTypeNamePlural, 'Search '.$this->wpdsPostTypeNamePlural, 'No '.strtolower($this->wpdsPostTypeNamePlural).' found', 'No '.strtolower($this->wpdsPostTypeNamePlural).' found in the trash');\n $this->cptWPDS->setMenuIcon('dashicons-welcome-write-blog');\n $this->cptWPDS->setSlug($this->wpdsPostType);\n $this->cptWPDS->setDescription('Writings from the universe');\n $this->cptWPDS->setShowInMenu(true);\n $this->cptWPDS->setPublic(true);\n $this->cptWPDS->setTaxonomies([$this->wpdsPostType]);\n $this->cptWPDS->removeSupports(['title']);\n \n //Register custom post type\n $this->cptWPDS->register();\n }", "function register_post_type(){\n \n $capability = acf_get_setting('capability');\n \n if(!acf_get_setting('show_admin'))\n $capability = false;\n \n register_post_type($this->post_type, array(\n 'label' => 'Options Page',\n 'description' => 'Options Page',\n 'labels' => array(\n 'name' => 'Options Pages',\n 'singular_name' => 'Options Page',\n 'menu_name' => 'Options Pages',\n 'edit_item' => 'Edit Options Page',\n 'add_new_item' => 'New Options Page',\n ),\n 'supports' => array('title'),\n 'hierarchical' => true,\n 'public' => false,\n 'show_ui' => true,\n 'show_in_menu' => 'edit.php?post_type=acf-field-group',\n 'menu_icon' => 'dashicons-layout',\n 'show_in_admin_bar' => false,\n 'show_in_nav_menus' => false,\n 'can_export' => false,\n 'has_archive' => false,\n 'rewrite' => false,\n 'exclude_from_search' => true,\n 'publicly_queryable' => false,\n 'capabilities' => array(\n 'publish_posts' => $capability,\n 'edit_posts' => $capability,\n 'edit_others_posts' => $capability,\n 'delete_posts' => $capability,\n 'delete_others_posts' => $capability,\n 'read_private_posts' => $capability,\n 'edit_post' => $capability,\n 'delete_post' => $capability,\n 'read_post' => $capability,\n ),\n 'acfe_admin_orderby' => 'title',\n 'acfe_admin_order' => 'ASC',\n 'acfe_admin_ppp' => 999,\n ));\n \n }", "public static function registerWPPostType()\n {\n register_post_type\n (\n 'fs_feed_entry',\n array\n (\n 'label' => 'Feed Entries',\n 'labels' => array\n (\n 'name' => 'Feed Entries',\n 'singular_name' => 'Feed Entry',\n 'add_new' => 'Add New',\n 'add_new_item' => 'Add New Feed Entry',\n 'edit_item' => 'Edit Feed Entry',\n 'new_item' => 'New Feed Entry',\n 'view_item' => 'View Feed Entry',\n 'search_items' => 'Search Feed Entries',\n 'not_found' => 'No Feed Entries Found',\n 'not_found_in_trash' => 'No Feed Entries Found In Trash',\n 'parent_item_colon' => 'Parent Feed Entries:',\n 'edit' => 'Edit',\n 'view' => 'View Feed Entry'\n ),\n 'public' => false,\n 'show_ui' => true\n )\n );\n }", "function compendium_register_type($slug, $name, $pname, $dicon) {\n $pt_slug = $slug;\n $tax_slug = $slug . '-category';\n\n register_post_type($pt_slug, array(\n 'labels' => array(\n 'name' => $pname,\n 'singular_name' => $name,\n 'add_new' => 'Add New',\n 'add_new_item' => 'Add New '.$name,\n 'edit_item' => 'Edit '.$name,\n 'new_item' => 'New '.$name,\n 'view_item' => 'View '.$name,\n 'search_items' => 'Search '.$pname,\n 'not_found' => 'No '.$pname.' found',\n 'not_found_in_trash' => 'No '.$pname.' found in trash',\n ),\n 'public' => true,\n 'menu_position' => 35,\n 'supports' => array('title','editor','thumbnail','excerpt'),\n 'menu_icon' => $dicon,\n 'rewrite' => array(\n 'slug' => 'resource-center/' . $pt_slug,\n 'with_front' => true\n ),\n ));\n\n register_taxonomy($tax_slug, $pt_slug, array(\n 'labels' => array(\n 'name' => 'Categories',\n 'singular_name' => 'Category',\n ),\n 'hierarchical' => true,\n ));\n}", "function BH_register_posttypes() {\r\n\r\n\tBH_register_posttype_event();\r\n\tBH_register_posttype_gallery();\r\n\r\n}", "function yee_post_type_testimonial_init(){\n\t$labels =array(\n\t\t'name'=>'Testimonials',\n\t\t'sigular_name'=>'Testimonial',\n\t\t'add_new'=>__('Add New Testimonial','Storefront-Child'),\n\t\t'add_new_item'=>__('Add New Testimonial','Storefront-Child'),\n\t\t'edit_item'=>__('Edit Testimonial','Storefront-Child'),\n\t\t'new_item'=>__('New Testimonial','Storefront-Child'),\n\t\t'view_item'=>__('View Testimonial','Storefront-Child'),\n\t\t'view_items'=>__('View Testimonials','Storefront-Child'),\n\t\t'all_items'=>__('All Testimonials','Storefront-Child'),\n\t\t'search_items'=>__('Search Testimonials','Storefront-Child')\n\t);\n\t$args =array(\n\t\t'labels'=>$labels,\n\t\t'public'=>true,\n\t\t'menu_position'=>5,\n\t\t'menu_icon'=>'dashicons-visibility',\n\t\t'hierarchical'=>false,\n\t\t'has_archive'=>true,\n\t\t'supports'=>array('title','editor','thumbnail','excerpt'),\n\t\t'rewrite'=>array('slug'=>'testimonial')\n\t\t\n\t);\n\tregister_post_type('yee_testimonial',$args);\n}", "public function init_post_type() {\n\t\t\t\n\t\t\t$labels = array(\n\t\t\t\t'name'\t\t\t\t=> 'Meetups',\n\t\t\t\t'new_item'\t\t\t=> 'Neues Meetup',\n\t\t\t\t'singular_name'\t\t=> 'Meetup',\n\t\t\t\t'view_item'\t\t\t=> 'Zeige Meetups',\n\t\t\t\t'edit_item'\t\t\t=> 'Editiere Meetup',\n\t\t\t\t'add_new_item'\t\t=> 'Meetup hinzuf&uuml;gen',\n\t\t\t\t'not_found'\t\t\t=> 'Kein Meetup gefunden',\n\t\t\t\t'search_items'\t\t=> 'Durchsuche Meetups',\n\t\t\t\t'parent_item_colon' => ''\n\t\t\t);\n\t\t\t\n\t\t\t$supports = array(\n\t\t\t\t'title',\n\t\t\t\t'editor',\n\t\t\t\t'comments',\n\t\t\t);\n\t\t\t\n\t\t\t$args = array(\n\t\t\t\t'public'\t\t\t\t=> TRUE,\n\t\t\t\t'publicly_queryable'\t=> TRUE,\n\t\t\t\t'show_ui'\t\t\t\t=> TRUE, \n\t\t\t\t'query_var'\t\t\t\t=> TRUE,\n\t\t\t\t'capability_type'\t\t=> 'post',\n\t\t\t\t'hierarchical'\t\t\t=> FALSE,\n\t\t\t\t'menu_position'\t\t\t=> NULL,\n\t\t\t\t'supports'\t\t\t\t=> $supports,\n\t\t\t\t'has_archive'\t\t\t=> TRUE,\n\t\t\t\t'rewrite'\t\t\t\t=> TRUE,\n\t\t\t\t'labels'\t\t\t\t=> $labels\n\t\t\t);\n\t\t\t\n\t\t\tregister_post_type( 'wpmeetups', $args );\n\t\t}", "protected function register_post_type() {\n\t\t$labels = array(\n\t\t\t'name' => __( 'geopin', 'geopin-post-type' ),\n\t\t\t'singular_name' => __( 'geopin Member', 'geopin-post-type' ),\n\t\t\t'add_new' => __( 'Add geopin', 'geopin-post-type' ),\n\t\t\t'add_new_item' => __( 'Add geopin', 'geopin-post-type' ),\n\t\t\t'edit_item' => __( 'Edit geopin', 'geopin-post-type' ),\n\t\t\t'new_item' => __( 'New geopin', 'geopin-post-type' ),\n\t\t\t'view_item' => __( 'View geopin', 'geopin-post-type' ),\n\t\t\t'search_items' => __( 'Search geopin', 'geopin-post-type' ),\n\t\t\t'not_found' => __( 'No geopins found', 'geopin-post-type' ),\n\t\t\t'not_found_in_trash' => __( 'No geopins in the trash', 'geopin-post-type' ),\n\t\t);\n\n\t\t$supports = array(\n\t\t\t'title',\n\t\t\t// 'editor',\n\t\t\t'thumbnail',\n\t\t\t// 'custom-fields',\n\t\t\t// 'revisions',\n\t\t);\n\n\t\t$args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'supports' => $supports,\n\t\t\t'public' => true,\n\t\t\t'capability_type' => 'post',\n\t\t\t'rewrite' => array( 'slug' => 'geopin', ), \n\t\t\t'menu_position' => 5,\n\t\t\t'menu_icon' => 'dashicons-admin-site',\n\t\t);\n\n\t\t$args = apply_filters( 'geoPin_post_type_args', $args );\n\n\t\tregister_post_type( $this->post_type, $args );\n\t}", "function stock_toolkit_custom_post()\n\t{\n\tregister_post_type('slide', array(\n\t\t'labels' => array(\n\t\t\t'name' => __('Slides') ,\n\t\t\t'singular_name' => __('Slide')\n\t\t) ,\n\t\t'supports' => array(\n\t\t\t'title',\n\t\t\t'editor',\n\t\t\t'custom-fields',\n\t\t\t'thumbnail',\n\t\t\t'page-attributes'\n\t\t) ,\n\t\t'public' => false,\n\t\t'show_ui' => true\n\t));\n\t}", "function humcore_register_post_type() {\n\n\t// Define the labels to be used by the post type humcore_deposits.\n\t$labels = array(\n\t\t// 'name' => _x( 'HumCORE Deposits', 'post type general name', 'humcore_domain' ),\n\t\t'singular_name' => _x( 'Deposit', 'post type singular name', 'humcore_domain' ),\n\t\t'menu_name' => _x( 'HumCORE Deposits', 'admin menu', 'humcore_domain' ),\n\t\t'name_admin_bar' => _x( 'Deposit', 'add new on admin bar', 'humcore_domain' ),\n\t\t'add_new' => _x( 'Add New', 'add new', 'humcore_domain' ),\n\t\t'add_new_item' => __( 'Add New Deposits', 'humcore_domain' ),\n\t\t'new_item' => __( 'New Deposit', 'humcore_domain' ),\n\t\t'edit_item' => __( 'Edit Deposit', 'humcore_domain' ),\n\t\t'view_item' => __( 'View Deposit', 'humcore_domain' ),\n\t\t'all_items' => __( 'All Deposits', 'humcore_domain' ),\n\t\t'search_items' => __( 'Search Deposits', 'humcore_domain' ),\n\t\t'not_found' => __( 'No Deposits found', 'humcore_domain' ),\n\t\t'not_found_in_trash' => __( 'No Deposits found in Trash', 'humcore_domain' ),\n\t\t'parent_item_colon' => '',\n\t);\n\n\t$post_type_args = array(\n\t\t'label' => __( 'HumCORE Deposits', 'humcore_domain' ),\n\t\t'labels' => $labels,\n\t\t'public' => false,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_admin_bar' => false,\n\t\t'query_var' => false,\n\t\t'rewrite' => array(\n\t\t\t'slug' => 'humcore_deposit',\n\t\t\t'with_front' => true,\n\t\t),\n\t\t'capability_type' => 'post',\n\t\t'has_archive' => false,\n\t\t'hierarchical' => true,\n\t\t'menu_position' => null,\n\t\t'supports' => array( 'title', 'author', 'excerpt' ),\n\t\t// 'supports' => array( 'title', 'author', 'excerpt', 'custom-fields', revisions', 'page-attributes' ),\n\t\t'register_meta_box_cb' => 'humcore_add_post_type_metabox',\n\t);\n\n\tregister_post_type( 'humcore_deposit', $post_type_args );\n}", "public function registered_post_type( $post_type, $args ) {\n\n\t\tglobal $wp_post_types, $wp_rewrite, $wp;\n\n\t\tif( $args->_builtin or !$args->publicly_queryable or !$args->show_ui ){\n\t\t\treturn false;\n\t\t}\n\t\t$permalink = get_option( $post_type.'_structure' );\n\n\t\tif( !$permalink ) {\n\t\t\t$permalink = $this->default_structure;\n\t\t}\n\n\t\t$permalink = '%'.$post_type.'_slug%'.$permalink;\n\t\t$permalink = str_replace( '%postname%', '%'.$post_type.'%', $permalink );\n\n\t\tadd_rewrite_tag( '%'.$post_type.'_slug%', '('.$args->rewrite['slug'].')','post_type='.$post_type.'&slug=' );\n\n\t\t$taxonomies = get_taxonomies( array(\"show_ui\" => true, \"_builtin\" => false), 'objects' );\n\t\tforeach ( $taxonomies as $taxonomy => $objects ):\n\t\t\t$wp_rewrite->add_rewrite_tag( \"%tax-$taxonomy%\", '(.+?)', \"$taxonomy=\" );\n\t\tendforeach;\n\n\t\t$permalink = trim($permalink, \"/\" );\n\t\tadd_permastruct( $post_type, $permalink, $args->rewrite );\n\n\t}", "public function registerPostTypes()\n {\n // Get the post types from the config.\n $postTypes = config('post-types');\n\n $translater = new Translater($postTypes, 'post-types');\n $postTypes = $translater->translate([\n '*.label',\n '*.labels.*',\n '*.names.singular',\n '*.names.plural',\n ]);\n\n // Iterate over each post type.\n collect($postTypes)->each(function ($item, $key) {\n\n // Check if names are set, if not keep it as an empty array\n $names = $item['names'] ?? [];\n\n // Unset names from item\n unset($item['names']);\n\n // Register the extended post type.\n register_extended_post_type($key, $item, $names);\n });\n }", "function create_post_type() {\r\n\r\n\t\t$args = apply_filters( 'agentpress_listings_post_type_args',\r\n\t\t\tarray(\r\n\t\t\t\t'labels' => array(\r\n\t\t\t\t\t'name'\t\t\t\t\t=> __( 'Listings', 'apl' ),\r\n\t\t\t\t\t'singular_name'\t\t\t=> __( 'Listing', 'apl' ),\r\n\t\t\t\t\t'add_new'\t\t\t\t=> __( 'Add New', 'apl' ),\r\n\t\t\t\t\t'add_new_item'\t\t\t=> __( 'Add New Listing', 'apl' ),\r\n\t\t\t\t\t'edit'\t\t\t\t\t=> __( 'Edit', 'apl' ),\r\n\t\t\t\t\t'edit_item'\t\t\t\t=> __( 'Edit Listing', 'apl' ),\r\n\t\t\t\t\t'new_item'\t\t\t\t=> __( 'New Listing', 'apl' ),\r\n\t\t\t\t\t'view'\t\t\t\t\t=> __( 'View Listing', 'apl' ),\r\n\t\t\t\t\t'view_item'\t\t\t\t=> __( 'View Listing', 'apl' ),\r\n\t\t\t\t\t'search_items'\t\t\t=> __( 'Search Listings', 'apl' ),\r\n\t\t\t\t\t'not_found'\t\t\t\t=> __( 'No listings found', 'apl' ),\r\n\t\t\t\t\t'not_found_in_trash'\t=> __( 'No listings found in Trash', 'apl' )\r\n\t\t\t\t),\r\n\t\t\t\t'public'\t\t=> true,\r\n\t\t\t\t'query_var'\t\t=> true,\r\n\t\t\t\t'menu_position'\t=> 6,\r\n\t\t\t\t'menu_icon'\t\t=> APL_URL . 'images/apl-icon-16x16.png',\r\n\t\t\t\t'has_archive'\t=> true,\r\n\t\t\t\t'supports'\t\t=> array( 'title', 'editor', 'comments', 'thumbnail', 'genesis-seo', 'genesis-layouts', 'genesis-simple-sidebars' ),\r\n\t\t\t\t'rewrite'\t\t=> array( 'slug' => 'listings' ),\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\tregister_post_type( 'listing', $args );\r\n\r\n\t}", "function faq_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'F.A.Q', 'Post Type General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'F.A.Q', 'Post Type Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'F.A.Q', 'text_domain' ),\n\t\t'name_admin_bar' => __( 'Post Type', 'text_domain' ),\n\t\t'archives' => __( 'Item Archives', 'text_domain' ),\n\t\t'attributes' => __( 'Item Attributes', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n\t\t'all_items' => __( 'todos as pegruntas frequentes', 'text_domain' ),\n\t\t'add_new_item' => __( 'Add nova pergunta', 'text_domain' ),\n\t\t'add_new' => __( 'nova pergunta', 'text_domain' ),\n\t\t'new_item' => __( 'nova pergunta', 'text_domain' ),\n\t\t'edit_item' => __( 'Edit Item', 'text_domain' ),\n\t\t'update_item' => __( 'Update Item', 'text_domain' ),\n\t\t'view_item' => __( 'View Item', 'text_domain' ),\n\t\t'view_items' => __( 'View Items', 'text_domain' ),\n\t\t'search_items' => __( 'Search Item', 'text_domain' ),\n\t\t'not_found' => __( 'não encontrato', 'text_domain' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n\t\t'featured_image' => __( 'Featured Image', 'text_domain' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n\t\t'insert_into_item' => __( 'Insert into item', 'text_domain' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),\n\t\t'items_list' => __( 'Items list', 'text_domain' ),\n\t\t'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),\n\t\t'filter_items_list' => __( 'Filter items list', 'text_domain' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'F.A.Q', 'text_domain' ),\n\t\t'description' => __( 'F.A.Q', 'text_domain' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'editor', 'thumbnail' ),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'page',\n\t);\n\tregister_post_type( 'faq_post_type', $args );\n\n}", "public function register_post_status() {\n\t\tif ( ! isset( $this->slug ) ) {\n\n\t\t\treturn;\n\t\t} elseif ( ! isset( $this->args ) ) {\n\t\t\t$this->args = $this->create_args();\n\t\t}\n\t\t$this->init();\n\t}", "function rawlins_register_post_types() {\n\t$rawlins_magic_post_type_maker_array = array(\n\t\t/*array(\n\t\t\t'cpt_single' => 'Resource',\n\t\t\t'cpt_plural' => 'Resources',\n\t\t\t'slug' => 'resource',\n\t\t\t'cpt_icon' => 'dashicons-index-card',\n\t\t\t'exclude_from_search' => false,\n\t\t),*/\n\n\t);\n\n\tforeach( $rawlins_magic_post_type_maker_array as $post_type ){\n\t\t$cpt_single = $post_type['cpt_single'];\n\t\t$cpt_plural = $post_type['cpt_plural'];\n\t\t$slug = $post_type['slug'];\n\t\t$cpt_icon = $post_type['cpt_icon'];\n\t\t$exclude_from_search = $post_type['exclude_from_search'];\n\n\t\t// Admin Labels\n\t \t$labels = rawlins_generate_label_array($cpt_plural, $cpt_single);\n\n\t \t// Arguments\n\t\t$args = rawlins_generate_post_type_args($labels, $cpt_plural, $cpt_icon, $exclude_from_search);\n\n\t\t// Just do it\n\t\tregister_post_type( $slug, $args );\n\t}\n\n}", "public function create_post_type() {\n\t\t\n \t\tregister_post_type(self::POST_TYPE,\n \t\t\tarray(\n \t\t\t\t'labels' => array(\n \t\t\t\t\t'name' => \"Custom\",\n \t\t\t\t\t'singular_name' => __(ucwords(str_replace(\"_\", \" \", self::POST_TYPE)))\n \t\t\t\t),\n \t\t\t\t'public' => true,\n \t\t\t\t'has_archive' => true,\n \t\t\t\t'description' => __(\"This is WP Custom Post Type\"),\n \t\t\t\t'supports' => array('title', 'editor', 'excerpt','thumbnail','custom-fields'),\n \t\t\t)\n \t\t);\n\n\t\t\tregister_taxonomy(\n\t\t\t\t'custom-category',\n\t\t\t\tself::POST_TYPE,\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Category' ),\n\t\t\t\t\t'rewrite' => array( 'slug' => 'custom-category' ),\n\t\t\t\t\t'hierarchical' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t}", "function howTo_post_type() {\n\n $labels = array(\n 'name' => _x( 'Como Funciona', 'Post Type General Name', 'text_domain' ),\n 'singular_name' => _x( 'Como Funciona', 'Post Type Singular Name', 'text_domain' ),\n 'menu_name' => __( 'Como Funciona', 'text_domain' ),\n 'name_admin_bar' => __( 'Post Type', 'text_domain' ),\n 'archives' => __( 'Item Archives', 'text_domain' ),\n 'attributes' => __( 'Item Attributes', 'text_domain' ),\n 'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n 'all_items' => __( 'todos os cards', 'text_domain' ),\n 'add_new_item' => __( 'Add novo card', 'text_domain' ),\n 'add_new' => __( 'novo card', 'text_domain' ),\n 'new_item' => __( 'novo card', 'text_domain' ),\n 'edit_item' => __( 'Edit Item', 'text_domain' ),\n 'update_item' => __( 'Update Item', 'text_domain' ),\n 'view_item' => __( 'View Item', 'text_domain' ),\n 'view_items' => __( 'View Items', 'text_domain' ),\n 'search_items' => __( 'Search Item', 'text_domain' ),\n 'not_found' => __( 'não encontrato', 'text_domain' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n 'featured_image' => __( 'Featured Image', 'text_domain' ),\n 'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n 'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n 'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n 'insert_into_item' => __( 'Insert into item', 'text_domain' ),\n 'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),\n 'items_list' => __( 'Items list', 'text_domain' ),\n 'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),\n 'filter_items_list' => __( 'Filter items list', 'text_domain' ),\n );\n $args = array(\n 'label' => __( 'Como Funciona', 'text_domain' ),\n 'description' => __( 'Como Funciona', 'text_domain' ),\n 'labels' => $labels,\n 'supports' => array( 'title', 'editor', 'thumbnail' ),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n register_post_type( 'howTo_post_type', $args );\n\n}", "function create_volunteer_custom_post() {\n register_post_type( 'volunteers',\n array(\n 'labels' => array(\n 'name' => __( 'Board Members' ),\n 'singular_name' => __( 'Board Member' ),\n ),\n 'public' => true,\n 'has_archive' => true,\n 'supports' => array(\n 'title',\n 'editor',\n 'thumbnail',\n 'custom-fields'\n )\n ));\n}", "function add_config_post_type() {\n\t\t\n\t\t$labels = array(\n 'name' => _x( 'Công trình', 'Post Type General Name'),\n 'singular_name' => _x( 'Công trình', 'Post Type Singular Name'),\n 'menu_name' => __( 'Công trình'),\n 'name_admin_bar' => __( 'Công trình'),\n 'archives' => __( 'Item Archives'),\n 'attributes' => __( 'Item Attributes'),\n 'parent_item_colon' => __( 'Parent Item:'),\n 'all_items' => __( 'Tất cả công trình'),\n 'add_new_item' => __( 'Add công trình'),\n 'add_new' => __( 'Thêm công trình'),\n 'new_item' => __( 'Thêm mới'),\n 'edit_item' => __( 'Chỉnh sửa'),\n 'update_item' => __( 'Cập nhật'),\n 'view_item' => __( 'View Item'),\n 'view_items' => __( 'View Items'),\n 'search_items' => __( 'Search Item'),\n 'not_found' => __( 'Not found'),\n 'not_found_in_trash' => __( 'Not found in Trash'),\n 'featured_image' => __( 'Featured Image'),\n 'set_featured_image' => __( 'Set featured image'),\n 'remove_featured_image' => __( 'Remove featured image'),\n 'use_featured_image' => __( 'Use as featured image'),\n 'insert_into_item' => __( 'Insert into item'),\n 'uploaded_to_this_item' => __( 'Uploaded to this item'),\n 'items_list' => __( 'Bản ghi'),\n 'items_list_navigation' => __( 'Items list navigation'),\n 'filter_items_list' => __( 'Filter items list'),\n );\n $args = array(\n 'label' => __( 'Công trình'),\n 'description' => __( 'Công trình'),\n 'labels' => $labels,\n 'supports' => array( 'title','editor','revisions','thumbnail','author'),\n 'taxonomies' => array('category'),\n 'hierarchical' => true,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'post',\n // 'rewrite' => array( 'slug' => 'danhsach' ),\n 'query_var' => true,\n 'menu_icon' => 'dashicons-admin-home'\n );\n register_post_type( 'estate', $args );\n \n }", "function obdiy_create_ep_post_type() {\n\tregister_post_type( 'execution_plan',\n\t\tarray(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __( 'Execution Plans' ),\n\t\t\t\t'singular_name' => __( 'Execution Plan' )\n\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'hierarchical' => true, //Behave like a page\n\t\t\t'query_var' => true,\n\t\t\t'supports' => array( 'title', 'editor', 'revisions', 'custom-fields', 'thumbnail', 'page-attributes', 'comments' ),\n\t\t\t'rewrite' => array( 'slug' => 'resources', 'with_front' => false ),\n\t\t\t'permalink_epmask' => EP_PERMALINK,\n\t\t\t'menu_icon' => 'dashicons-welcome-learn-more',\n\t\t)\n\t);\n}", "public function registerPostTypes()\n {\n $projectLabels = array(\n 'name' => __( 'Projects'),\n 'singular_name' => __( 'Project'),\n 'menu_name' => __( 'Projects'),\n 'parent_item_colon' => __( 'Parent Project'),\n 'all_items' => __( 'All Projects'),\n 'view_item' => __( 'View Project'),\n 'add_new_item' => __( 'Add New Project'),\n 'add_new' => __( 'Add New'),\n 'edit_item' => __( 'Edit Project'),\n 'update_item' => __( 'Update Project'),\n 'search_items' => __( 'Search Project'),\n 'not_found' => __( 'Not Found'),\n 'not_found_in_trash' => __( 'Not found in Trash'),\n );\n $componentLabels = array(\n 'name' => __( 'Components'),\n 'singular_name' => __( 'Component'),\n 'menu_name' => __( 'Components'),\n 'parent_item_colon' => __( 'Parent Component'),\n 'all_items' => __( 'All Components'),\n 'view_item' => __( 'View Component'),\n 'add_new_item' => __( 'Add New Component'),\n 'add_new' => __( 'Add New'),\n 'edit_item' => __( 'Edit Component'),\n 'update_item' => __( 'Update Component'),\n 'search_items' => __( 'Search Component'),\n 'not_found' => __( 'Not Found'),\n 'not_found_in_trash' => __( 'Not found in Trash'),\n );\n $componentTypeTaxLabels = array(\n 'name' => __('Component types'),\n 'singular_name' => __('Component type'),\n 'search_items' => __( 'Search Component types' ),\n 'popular_items' => __( 'Popular Component types' ),\n 'all_items' => __( 'All Component types' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Component type' ),\n 'update_item' => __( 'Update Component type' ),\n 'add_new_item' => __( 'Add New Component type' ),\n 'new_item_name' => __( 'New Component type Name' ),\n 'separate_items_with_commas' => __( 'Separate component types with commas' ),\n 'add_or_remove_items' => __( 'Add or remove component types' ),\n 'choose_from_most_used' => __( 'Choose from the most used ones' ),\n 'menu_name' => __( 'Component types' ),\n ); \n \n // Set other options for custom post types\n $projectArgs = array(\n 'label' => __( 'projects'),\n 'description' => __( 'Stuff that you have done or used'),\n 'labels' => $projectLabels,\n 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields'),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 6,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n \n $componentArgs = array(\n 'label' => __( 'components'),\n 'description' => __( 'Things used in projects'),\n 'labels' => $componentLabels,\n 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields'),\n 'taxonomies' => array('components'),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 7,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n \n $componentTypeTaxArgs = array(\n 'hierarchical' => false,\n 'labels' => $componentTypeTaxLabels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'type' ),\n );\n \n // Registering your Custom Post Type\n register_taxonomy('component_type', 'component', $componentTypeTaxArgs);\n register_post_type('component', $componentArgs);\n register_post_type( 'project', $projectArgs );\n }", "function experiences_create_post_type() {\n register_post_type( 'experiences',\n [\n 'labels' => ['name' => __( 'Experiences' ), 'singular_name' => __( 'Experience')],\n 'public' => true,\n 'has_archive' => true,\n 'show_ui' => true,\n 'menu_icon' => 'dashicons-palmtree',\n 'query_var' => true,\n 'capability_type' => 'post',\n 'hierarchical' => true,\n 'supports' => [\n 'title',\n 'thumbnail',\n 'page-attributes',\n ],\n 'rewrite' => ['slug' => 'experiences'],\n ]\n );\n}", "function classTools_post_type() {\n\n $labels = array(\n 'name' => _x( 'Ferramentas', 'Post Type General Name', 'text_domain' ),\n 'singular_name' => _x( 'ferramenta', 'Post Type Singular Name', 'text_domain' ),\n 'menu_name' => __( 'Ferramenta', 'text_domain' ),\n 'name_admin_bar' => __( 'Post Type', 'text_domain' ),\n 'archives' => __( 'Item Archives', 'text_domain' ),\n 'attributes' => __( 'Item Attributes', 'text_domain' ),\n 'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n 'all_items' => __( 'todas as ferramentas', 'text_domain' ),\n 'add_new_item' => __( 'Add novaferramenta', 'text_domain' ),\n 'add_new' => __( 'nova ferramenta', 'text_domain' ),\n 'new_item' => __( 'nova ferramenta', 'text_domain' ),\n 'edit_item' => __( 'Edit Item', 'text_domain' ),\n 'update_item' => __( 'Update Item', 'text_domain' ),\n 'view_item' => __( 'View Item', 'text_domain' ),\n 'view_items' => __( 'View Items', 'text_domain' ),\n 'search_items' => __( 'Search Item', 'text_domain' ),\n 'not_found' => __( 'não encontrado', 'text_domain' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n 'featured_image' => __( 'Featured Image', 'text_domain' ),\n 'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n 'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n 'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n 'insert_into_item' => __( 'Insert into item', 'text_domain' ),\n 'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),\n 'items_list' => __( 'Items list', 'text_domain' ),\n 'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),\n 'filter_items_list' => __( 'Filter items list', 'text_domain' ),\n );\n $args = array(\n 'label' => __( 'ferramentas', 'text_domain' ),\n 'description' => __( 'ferramentas', 'text_domain' ),\n 'labels' => $labels,\n 'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields'),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n register_post_type( 'classTools_post_type', $args );\n\n}", "static function register_post_type() {\n\n $args = array(\n 'labels' => array(\n\t\t'name' => __( 'Forms', 'pwp' ),\n\t\t'singular_name' => __( 'Form', 'pwp' ),\n\t\t'add_new' => __( 'Add New', 'pwp' ),\n\t\t'add_new_item' => __( 'Add New Form', 'pwp' ),\n\t\t'edit_item' => __( 'Edit Form', 'pwp' ),\n\t\t'new_item' => __( 'New Form', 'pwp' ),\n\t\t'all_items' => __( 'All Forms', 'pwp' ),\n\t\t'view_item' => __( 'View Form', 'pwp' ),\n\t\t'search_items' => __( 'Search Forms', 'pwp' ),\n\t\t'not_found' => __( 'No forms found', 'pwp' ),\n\t\t'not_found_in_trash' => __( 'No forms found in Trash', 'pwp' ),\n\t\t'parent_item_colon' => __( ':', 'pwp' ),\n\t\t'menu_name' => __( 'Forms', 'pwp' )\n\t ),\n 'public' => false,\n 'show_ui' => true,\n 'query_var' => false,\n 'supports' => array( 'title', 'custom-fields', 'editor' )\n );\n\tregister_post_type( 'form', $args );\n }", "function garoe_create_post_type(){\n\n\t/*|>>>>>>>>>>>>>>>>>>>> BANNERS <<<<<<<<<<<<<<<<<<<<|*/\n\t\n\t$labels = array(\n\t\t'name' => __('Banners'),\n\t\t'singular_name' => __('Banner'),\n\t\t'add_new' => __('Nuevo Banner'),\n\t\t'add_new_item' => __('Agregar nuevo Banner'),\n\t\t'edit_item' => __('Editar Banner'),\n\t\t'view_item' => __('Ver Banner'),\n\t\t'search_items' => __('Buscar Banners'),\n\t\t'not_found' => __('Banner no encontrado'),\n\t\t'not_found_in_trash' => __('Banner no encontrado en la papelera'),\n\t);\n\n\t$args = array(\n\t\t'labels' => $labels,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag','banner_category'),\n\t\t'menu_icon' => 'dashicons-visibility',\n\t);\n\n\t/*|>>>>>>>>>>>>>>>>>>>> TESTIMONIO <<<<<<<<<<<<<<<<<<<<|*/\n\t$labels2 = array(\n\t\t'name' => __('Testimonios'),\n\t\t'singular_name' => __('Testimonio'),\n\t\t'add_new' => __('Nuevo Testimonio'),\n\t\t'add_new_item' => __('Agregar nuevo Testimonio'),\n\t\t'edit_item' => __('Editar Testimonio'),\n\t\t'view_item' => __('Ver Testimonio'),\n\t\t'search_items' => __('Buscar Testimonios'),\n\t\t'not_found' => __('Testimonio no encontrado'),\n\t\t'not_found_in_trash' => __('Testimonio no encontrado en la papelera'),\n\t);\n\n\t$args2 = array(\n\t\t'labels' => $labels2,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag','testimonio_category'),\n\t\t'menu_icon' => 'dashicons-megaphone'\n\t);\n\n\t/*|>>>>>>>>>>>>>>>>>>>> Galería Imágenes <<<<<<<<<<<<<<<<<<<<|*/\n\t$labels3 = array(\n\t\t'name' => __('Galería Imagen'),\n\t\t'singular_name' => __('Imagen'),\n\t\t'add_new' => __('Nueva Imagen'),\n\t\t'add_new_item' => __('Agregar nueva Imagen'),\n\t\t'edit_item' => __('Editar Imagen'),\n\t\t'view_item' => __('Ver Imagen'),\n\t\t'search_items' => __('Buscar Imagen'),\n\t\t'not_found' => __('Imagen no encontrado'),\n\t\t'not_found_in_trash' => __('Imagen no encontrado en la papelera'),\n\t);\n\n\t$args3 = array(\n\t\t'labels' => $labels3,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag'),\n\t\t'menu_icon' => 'dashicons-format-gallery'\n\t);\n\n\t/*|>>>>>>>>>>>>>>>>>>>> Galería Videos <<<<<<<<<<<<<<<<<<<<|*/\n\t$labels4 = array(\n\t\t'name' => __('Galería Videos'),\n\t\t'singular_name' => __('Video'),\n\t\t'add_new' => __('Nueva Video'),\n\t\t'add_new_item' => __('Agregar nueva Video'),\n\t\t'edit_item' => __('Editar Video'),\n\t\t'view_item' => __('Ver Video'),\n\t\t'search_items' => __('Buscar Video'),\n\t\t'not_found' => __('Video no encontrado'),\n\t\t'not_found_in_trash' => __('Video no encontrado en la papelera'),\n\t);\n\n\t$args4 = array(\n\t\t'labels' => $labels4,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag'),\n\t\t'menu_icon' => 'dashicons-video-alt3'\n\t);\n\n\t/*|>>>>>>>>>>>>>>>>>>>> SERVICIO <<<<<<<<<<<<<<<<<<<<|*/\n\t$labels5 = array(\n\t\t'name' => __('Servicios'),\n\t\t'singular_name' => __('Servicio'),\n\t\t'add_new' => __('Nuevo Servicio'),\n\t\t'add_new_item' => __('Agregar nuevo Servicio'),\n\t\t'edit_item' => __('Editar Servicio'),\n\t\t'view_item' => __('Ver Servicio'),\n\t\t'search_items' => __('Buscar Servicio'),\n\t\t'not_found' => __('Testimonio no encontrado'),\n\t\t'not_found_in_trash' => __('Testimonio no encontrado en la papelera'),\n\t);\n\n\t$args5 = array(\n\t\t'labels' => $labels5,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag'),\n\t\t'menu_icon' => 'dashicons-portfolio'\n\t);\n\t\n\t/*|>>>>>>>>>>>>>>>>>>>> REGISTRAR <<<<<<<<<<<<<<<<<<<<|*/\n\tregister_post_type('banner',$args);\n\tregister_post_type('testimonio',$args2);\n\tregister_post_type('galeria-imagen',$args3);\n\tregister_post_type('galeria-video',$args4);\n\tregister_post_type('servicio',$args5);\n}", "function setup_booking_post_type()\n{\n\tregister_post_type('slides', array(\t'label' => 'Slides','description' => '','public' => true,'show_ui' => true,'show_in_menu' => true,'capability_type' => 'post','map_meta_cap'=>true,'hierarchical' => false,'rewrite' => array('slug' => 'slides'),'query_var' => true,'exclude_from_search' => false,'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','page-attributes',),'labels' => array (\n\t 'name' => 'Slides',\n\t 'singular_name' => 'Slide',\n\t 'menu_name' => 'Slides',\n\t 'add_new' => 'Add Slide',\n\t 'add_new_item' => 'Add New Slide',\n\t 'edit' => 'Edit',\n\t 'edit_item' => 'Edit Slide',\n\t 'new_item' => 'New Slide',\n\t 'view' => 'View Slide',\n\t 'view_item' => 'View Slide',\n\t 'search_items' => 'Search Slides',\n\t 'not_found' => 'No Slides Found',\n\t 'not_found_in_trash' => 'No Slides Found in Trash',\n\t 'parent' => 'Parent Slide',\n\t),) );\n\t\n\t\n\t/*\n\t******* Properties (new) ********\n\t*/\n\t\n\t\n\tregister_post_type('vehicles', array(\t'label' => 'vehicles','description' => '','public' => true,'show_ui' => true,'show_in_menu' => true,'capability_type' => 'post','hierarchical' => false,'rewrite' => array('slug' => 'vehicles'),'query_var' => true,'exclude_from_search' => false,'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','page-attributes',),'labels' => array (\n\t 'name' => 'vehicles',\n\t 'singular_name' => 'vehicle',\n\t 'menu_name' => 'vehicles',\n\t 'add_new' => 'Add vehicle',\n\t 'add_new_item' => 'Add New vehicle',\n\t 'edit' => 'Edit',\n\t 'edit_item' => 'Edit vehicle',\n\t 'new_item' => 'New vehicle',\n\t 'view' => 'View vehicle',\n\t 'view_item' => 'View vehicle',\n\t 'search_items' => 'Search vehicles',\n\t 'not_found' => 'No vehicles Found',\n\t 'not_found_in_trash' => 'No vehicles Found in Trash',\n\t 'parent' => 'Parent vehicle',\n\t),) );\n\t\n\t\n\t/*\n\t******* Accommodations (saranno figlie di properties es hotel-> camere)********\n\t*/\n\t\n\t\n\tregister_post_type('properties', array(\t'label' => 'Properties','description' => '','public' => true,'show_ui' => true,'show_in_menu' => true,'capability_type' => 'post','hierarchical' => false,'rewrite' => array('slug' => 'prop'),'query_var' => true,'exclude_from_search' => false,'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','page-attributes',),'labels' => array (\n\t 'name' => 'Properties',\n\t 'singular_name' => 'Property',\n\t 'menu_name' => 'Properties',\n\t 'add_new' => 'Add Property',\n\t 'add_new_item' => 'Add New Property',\n\t 'edit' => 'Edit',\n\t 'edit_item' => 'Edit Property',\n\t 'new_item' => 'New Property',\n\t 'view' => 'View Property',\n\t 'view_item' => 'View Property',\n\t 'search_items' => 'Search Property',\n\t 'not_found' => 'No Property Found',\n\t 'not_found_in_trash' => 'No Property Found in Trash',\n\t 'parent' => 'Parent Property',\n\t),) );\n\t\n\t/*\n\t+++ team ++++++\n\t*/\n\tregister_post_type('services', array(\t'label' => 'Services','description' => '','public' => true,'show_ui' => true,'show_in_menu' => true,'capability_type' => 'post','hierarchical' => false,'rewrite' => array('slug' => 'services'),'query_var' => true,'exclude_from_search' => false,'supports' => array('title','editor','thumbnail','author','page-attributes',),'labels' => array (\n\t 'name' => 'Service',\n\t 'singular_name' => 'Service',\n\t 'menu_name' => 'Service',\n\t 'add_new' => 'Add Service',\n\t 'add_new_item' => 'Add new Service',\n\t 'edit' => 'Edit',\n\t 'edit_item' => 'Edit Service',\n\t 'new_item' => 'New Service',\n\t 'view' => 'View Service',\n\t 'view_item' => 'View Service',\n\t 'search_items' => 'Search Service',\n\t 'not_found' => 'No Service Found',\n\t 'not_found_in_trash' => 'No Service Found in Trash',\n\t 'parent' => 'Parent Service',\n\t),) );\n\t\n\n\t/*\n\t+++ team ++++++\n\t*/\n\tregister_post_type('portfolio', array(\t'label' => 'portfolio','description' => '','public' => true,'show_ui' => true,'show_in_menu' => true,'capability_type' => 'post','hierarchical' => false,'rewrite' => array('slug' => 'portfolio'),'query_var' => true,'exclude_from_search' => false,'supports' => array('title','editor','thumbnail','author','page-attributes',),'labels' => array (\n\t 'name' => 'Team',\n\t 'singular_name' => 'portfolio',\n\t 'menu_name' => 'portfolio',\n\t 'add_new' => 'Add portfolio',\n\t 'add_new_item' => 'Add portfolio',\n\t 'edit' => 'Edit',\n\t 'edit_item' => 'Edit portfolio',\n\t 'new_item' => 'New portfolio',\n\t 'view' => 'View portfolio',\n\t 'view_item' => 'View portfolio',\n\t 'search_items' => 'Search portfolio',\n\t 'not_found' => 'No portfolio Found',\n\t 'not_found_in_trash' => 'No portfolio Found in Trash',\n\t 'parent' => 'Parent portfolio',\n\t),) );\n\t\n\n\n\t\n\t/*\n\t******* Taxonomy Areas ********\n\t*/\n\t\n\t\n\tregister_taxonomy('areas',array (\n\t 0 => 'accommodations',\n\t 1 => 'advertisement',\n\t),array( 'hierarchical' => true, 'label' => 'Areas','show_ui' => true,'query_var' => true,'rewrite' => array('slug' => 'zone'),'singular_label' => 'Area') );\n\t\n\t/*\n\t******* Taxonomy Type ********\n\t*/\n\t\n\tregister_taxonomy('types',array (\n\t 0 => 'accommodations',\n\t),array( 'hierarchical' => true, 'label' => 'Types','show_ui' => true,'query_var' => true,'rewrite' => array('slug' => 'property-type'),'singular_label' => 'Type') );\n\t\n\t\n\t/*\n\t******* Taxonomy Stars (stelle hotel e classificazioni varie ) ********\n\t*/\n\t\n\tregister_taxonomy('stars',array (\n\t 0 => 'accommodations',\n\t),array( 'hierarchical' => true, 'label' => 'stars','show_ui' => true,'query_var' => true,'rewrite' => array('slug' => 'stars'),'singular_label' => 'Stars') );\n\n\t/*\n\t******* gestione eruoli e capabilities ********\n\t*/\n\n$result = add_role('customer', 'Customer', array(\n 'read' => true, // True allows that capability\n 'edit_posts' => false,\n 'delete_posts' => false // Use false to explicitly deny\n \n));\n\n$result = add_role('property_owner', 'Owner / Manager', array(\n\n));\n\n$result = add_role('sales_agent', 'agente di vendita', array(\n 'read' => true, // True allows that capability\n 'edit_posts' => false,\n 'delete_posts' => false, // Use false to explicitly deny\n 'create_users' => true\n));\n\n\n\n\n}", "function themo_tour_custom_post_type() {\n\n $labels = array(\n 'name' => _x( 'Tours', 'Post Type General Name', 'th-widget-pack' ),\n 'singular_name' => _x( 'Tour', 'Post Type Singular Name', 'th-widget-pack' ),\n 'menu_name' => __( 'Tours', 'th-widget-pack' ),\n 'parent_item_colon' => __( 'Parent Tour:', 'th-widget-pack' ),\n 'all_items' => __( 'All Tours', 'th-widget-pack' ),\n 'view_item' => __( 'View Tour', 'th-widget-pack' ),\n 'add_new_item' => __( 'Add New Tours', 'th-widget-pack' ),\n 'add_new' => __( 'Add New', 'th-widget-pack' ),\n 'edit_item' => __( 'Edit Tour', 'th-widget-pack' ),\n 'update_item' => __( 'Update Tour', 'th-widget-pack' ),\n 'search_items' => __( 'Search Tour', 'th-widget-pack' ),\n 'not_found' => __( 'Not found', 'th-widget-pack' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'th-widget-pack' ),\n );\n\n if ( function_exists( 'get_theme_mod' ) ) {\n $custom_slug = get_theme_mod( 'themo_tour_rewrite_slug', 'tour' );\n } else {\n $custom_slug = 'tour';\n }\n\n $rewrite = array(\n 'slug' => $custom_slug,\n 'with_front' => false,\n 'pages' => true,\n 'feeds' => true,\n );\n $args = array(\n 'label' => __( 'themo_tour', 'th-widget-pack' ),\n 'description' => __( 'Tours', 'th-widget-pack' ),\n 'labels' => $labels,\n 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', ),\n 'taxonomies' => array( 'themo_tour_type' ),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-location-alt',\n 'can_export' => true,\n 'has_archive' => false,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'rewrite' => $rewrite,\n 'capability_type' => 'post',\n );\n register_post_type( 'themo_tour', $args );\n\n }", "function create_posttype() {\n \n register_post_type( 'headlines',\n // CPT Options\n array(\n 'labels' => array(\n 'name' => __( 'Headlines' ),\n 'singular_name' => __( 'Headline' )\n\t\t\t),\n\t\t\t'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields'),\n 'public' => true,\n\t\t\t'has_archive' => true,\n 'menu_icon' => 'dashicons-text-page',\n 'rewrite' => array('slug' => 'headlines'),\n 'show_in_rest' => true,\n )\n );\n}", "function poi_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'poi Types', 'Post Type General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'poiType', 'Post Type Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'poi', 'text_domain' ),\n\t\t'name_admin_bar' => __( 'poi Type', 'text_domain' ),\n\t\t'archives' => __( 'poi Archives', 'text_domain' ),\n\t\t'attributes' => __( 'poi Attributes', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Parent poi', 'text_domain' ),\n\t\t'all_items' => __( 'All poi', 'text_domain' ),\n\t\t'add_new_item' => __( 'Add New poi', 'text_domain' ),\n\t\t'add_new' => __( 'Add New', 'text_domain' ),\n\t\t'new_item' => __( 'New poi', 'text_domain' ),\n\t\t'edit_item' => __( 'Edit poi', 'text_domain' ),\n\t\t'update_item' => __( 'Update poi', 'text_domain' ),\n\t\t'view_item' => __( 'View poi', 'text_domain' ),\n\t\t'view_items' => __( 'View pois', 'text_domain' ),\n\t\t'search_items' => __( 'Search poi', 'text_domain' ),\n\t\t'not_found' => __( 'Not found', 'text_domain' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n\t\t'featured_image' => __( 'Featured Image', 'text_domain' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n\t\t'insert_into_item' => __( 'Insert into poi', 'text_domain' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this poi', 'text_domain' ),\n\t\t'items_list' => __( 'pois list', 'text_domain' ),\n\t\t'items_list_navigation' => __( 'pois list navigation', 'text_domain' ),\n\t\t'filter_items_list' => __( 'Filter pois list', 'text_domain' ),\n\t);\n\t$rewrite = array(\n\t\t'slug' => 'poi',\n\t\t'with_front' => true,\n\t\t'pages' => true,\n\t\t'feeds' => true,\n\t);\n\t$args = array(\n\t\t'label' => __( 'poiType', 'text_domain' ),\n\t\t'description' => __( 'poi Type Description', 'text_domain' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats' ),\n\t\t'taxonomies' => array( 'category', 'post_tag' ),\n\t\t'hierarchical' => true,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-editor-customchar',\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'rewrite' => $rewrite,\n\t\t'capability_type' => 'post',\n\t\t'show_in_rest' => true,\n\t);\n\tregister_post_type( 'poi_type', $args );\n\n}", "public static function createPostType() {\n $plural = 'Travel Cards';\n $singular = 'Travel Card';\n $p_lower = strtolower($plural);\n $s_lower = strtolower($singular);\n\n $labels = [\n 'name' => $plural,\n 'singular_name' => $singular,\n 'add_new_item' => \"New $singular\",\n 'edit_item' => \"Edit $singular\",\n 'view_item' => \"View $singular\",\n 'view_items' => \"View $plural\",\n 'search_items' => \"Search $plural\",\n 'not_found' => \"No $p_lower found\",\n 'not_found_in_trash' => \"No $p_lower found in trash\",\n 'parent_item_colon' => \"Parent $singular\",\n 'all_items' => \"All $plural\",\n 'archives' => \"$singular Archives\",\n 'attributes' => \"$singular Attributes\",\n 'insert_into_item' => \"Insert into $s_lower\",\n 'uploaded_to_this_item' => \"Uploaded to this $s_lower\",\n ];\n\n $supports = ['title', 'editor', 'thumbnail', 'excerpt'];\n\n register_post_type( 'travelcard',\n array(\n 'rewrite' => ['slug' => 'travelcard'],\n 'taxonomies' => array('card_category', 'card_tag'),\n 'register_meta_box_cb' => [self::class, 'addMetaBox'],\n 'labels' => $labels,\n 'public' => true,\n 'has_archive' => false,\n 'menu_icon' => 'dashicons-id',\n 'supports' => $supports,\n 'capability_type' => array('travelcard', 'travelcards'),\n 'map_meta_cap' => false,\n 'exclude_from_search' => true,\n )\n );\n }", "public function setup_posttype() {\n register_post_type( 'brg_post_templates',\n array(\n 'labels' => array(\n 'name' => 'Templates',\n 'singular_name' => 'Template'\n ),\n 'description' => 'Template for a post type single view',\n 'public' => false,\n 'show_ui' => true\n )\n );\n }" ]
[ "0.7652043", "0.7373033", "0.7366022", "0.729813", "0.7241988", "0.72414076", "0.72075504", "0.7206499", "0.71905524", "0.7181688", "0.71801776", "0.7170963", "0.7161476", "0.7099544", "0.7098865", "0.70391744", "0.703729", "0.703729", "0.70089895", "0.70007676", "0.69947815", "0.69744456", "0.69603175", "0.6942565", "0.6936561", "0.6921911", "0.69197935", "0.6907731", "0.6891802", "0.6853863", "0.68470794", "0.68379074", "0.68213797", "0.6787717", "0.67424124", "0.6732413", "0.6701669", "0.669195", "0.666487", "0.6653026", "0.6650362", "0.6647077", "0.6645204", "0.66434276", "0.6635708", "0.6623793", "0.6623726", "0.6612315", "0.6593485", "0.6585214", "0.65812427", "0.65542954", "0.654962", "0.6547249", "0.6542832", "0.6536349", "0.6533182", "0.6530199", "0.6523048", "0.6521554", "0.65206623", "0.65156335", "0.6512559", "0.65104145", "0.64906067", "0.648946", "0.64815867", "0.64811987", "0.64756095", "0.6467324", "0.6458231", "0.6441636", "0.6440763", "0.6438901", "0.6434063", "0.6430512", "0.64290386", "0.6416827", "0.6405039", "0.6404052", "0.64027005", "0.63990897", "0.63969433", "0.63968205", "0.6386156", "0.638431", "0.63800347", "0.63789076", "0.63712835", "0.6364831", "0.63647044", "0.6362008", "0.6353934", "0.63483936", "0.6346696", "0.63418454", "0.6337192", "0.63359845", "0.63305056", "0.6320831" ]
0.718849
9
/ With this function, it will allow for the user end of the widget to be created.
public function widget( $args, $instance ) { extract($args); $title = apply_filters('widget_title', $instance['title']); $rama = $instance['rama']; echo $before_widget; if($title) { echo $before_title . $title . $after_title; } $this->get_my_events($rama); echo $after_widget; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addWidget()\r\n {\r\n }", "public function widget( $args, $instance ){}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "protected function makeJqWidget()\n {\n parent::makeJqWidget();\n Application::executeJsFunction('qc.dialog', $this->getJqControlId(), Application::PRIORITY_HIGH);\n }", "function onReady() {\n\t\t$this->text = $this->config->text;\n\t\tif (empty($this->text))\n\t\t\t$this->text = \"initial settings| set this widget | /admin set headsup\";\n\t\t\n\t\t$this->url = $this->config->url;\n\t\tif (empty($this->url))\n\t\t\t$this->url = \"\";\n\t\t\n\t\t$this->width = $this->config->width;\n\t\tif (empty($this->width))\n\t\t\t$this->width = 50;\n\t\t\n\t\t$this->pos = $this->config->pos;\n\t\tif (empty($this->pos))\n\t\t\t$this->pos = \"80,-85\";\n\t\t\n\t\tforeach ($this->storage->players as $login => $player) {\n\t\t\t$this->showWidget($login);\n\t\t}\n\t\tforeach ($this->storage->spectators as $login => $player) {\n\t\t\t$this->showWidget($login);\n\t\t}\n\t}", "protected function Form_Create() {\n\t\t\t// Define the Label\n\t\t\t$this->lblMessage = new QLabel($this);\n\t\t\t$this->lblMessage->Text = 'Click the button to change my message.';\n\n\t\t\t// Define the Button\n\t\t\t$this->btnButton = new QButton($this);\n\t\t\t$this->btnButton->Text = 'Click Me!';\n\n\t\t\t// Add a Click event handler to the button\n\t\t\t$this->btnButton->AddAction(new QClickEvent(), new QServerAction('btnButton_Click'));\n\t\t}", "function widget_setup(){\n\n\t\treturn false;\n\t}", "public function _register_widgets()\n {\n }", "public function add_widget_box() {\n\t\t\t$nonce = wp_create_nonce ( 'delete-wprt-widget_area-nonce' ); ?>\n\t\t\t <script type=\"text/html\" id=\"wprt-add-widget-template\">\n\t\t\t\t<div id=\"wprt-add-widget\" class=\"widgets-holder-wrap\">\n\t\t\t\t <div class=\"\">\n\t\t\t\t <input type=\"hidden\" name=\"wprt-nonce\" value=\"<?php echo esc_attr( $nonce ); ?>\" />\n\t\t\t\t <div class=\"sidebar-name\">\n\t\t\t\t <h3><?php esc_html_e( 'Create a Widget Area', 'fundrize' ); ?> <span class=\"spinner\"></span></h3>\n\t\t\t\t </div>\n\t\t\t\t <div class=\"sidebar-description\">\n\t\t\t\t\t<form id=\"addWidgetAreaForm\" action=\"\" method=\"post\">\n\t\t\t\t\t <div class=\"widget-content\">\n\t\t\t\t\t\t<input id=\"wprt-add-widget-input\" name=\"wprt-add-widget-input\" type=\"text\" class=\"regular-text\" title=\"<?php esc_attr_e( 'Name', 'fundrize' ); ?>\" placeholder=\"<?php esc_attr_e( 'Name', 'fundrize' ); ?>\" />\n\t\t\t\t\t </div>\n\t\t\t\t\t <div class=\"widget-control-actions\">\n\t\t\t\t\t\t<div class=\"aligncenter\">\n\t\t\t\t\t\t <input class=\"addWidgetArea-button button-primary\" type=\"submit\" value=\"<?php esc_attr_e( 'Create Widget Area', 'fundrize' ); ?>\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<br class=\"clear\">\n\t\t\t\t\t </div>\n\t\t\t\t\t</form>\n\t\t\t\t </div>\n\t\t\t\t </div>\n\t\t\t\t</div>\n\t\t\t </script>\n\t\t\t<?php\n\t\t}", "function widget_manager_create_object_handler($event, $object_type, $object) {\n\n\tif (elgg_instanceof($object, \"object\", \"widget\", \"ElggWidget\")) {\n\t\t$owner = $object->getOwnerEntity();\n\t\t// Updates access for privately created widgets in a group\n\t\tif ($owner instanceof ElggGroup && $object->access_id === ACCESS_PRIVATE) {\n\t\t\t$old_ia = elgg_set_ignore_access();\n\t\t\t$object->access_id = $owner->group_acl;\n\t\t\t$object->save();\n\t\t\telgg_set_ignore_access($old_ia);\n\t\t}\n\t\t\t\t\n\t\t// Adds a relation between a widget and a multidashboard object\n\t\t$dashboard_guid = get_input(\"multi_dashboard_guid\");\n\t\tif ($dashboard_guid && widget_manager_multi_dashboard_enabled()) {\n\t\t\t$dashboard = get_entity($dashboard_guid);\n\t\t\tif (elgg_instanceof($dashboard, \"object\", MultiDashboard::SUBTYPE, \"MultiDashboard\")) {\n\t\t\t\tadd_entity_relationship($object->getGUID(), MultiDashboard::WIDGET_RELATIONSHIP, $dashboard->getGUID());\n\t\t\t}\n\t\t}\n\t}\n}", "protected function OnCreateElements() {}", "protected function OnCreateElements() {}", "function duende_load_widget() {\n\tregister_widget( 'duende_widget' );\n}", "public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }", "public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }", "public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }", "public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }", "public static function widget() {\n require_once( 'includes/widget.php' );\n }", "public function widget_addition_form_confirm()\r\n\t{\r\n\t\t$package_id = $_POST[\"package_id\"];\r\n\t\t\r\n\t\tif($package_id=='')\r\n\t\t{\r\n\t\t\r\n\t\t\t$default_widgets = get_option('userultra_default_user_tabs');\r\n\t\t\t$custom_widgets = get_option('userultra_custom_user_widgets');\r\n\t\t\t\r\n\t\t\t$unused_widgets = get_option('uultra_unused_user_widgets');\r\n\t\t\t$unused_widgets = unserialize($unused_widgets);\r\n\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\t$default_widgets = get_option('userultra_default_user_tabs_package_'.$package_id.'');\r\n\t\t\t$custom_widgets = get_option('userultra_custom_user_widgets_package_'.$package_id.'');\r\n\t\t\t\t\r\n\t\t\t$unused_widgets = get_option('uultra_unused_user_widgets_package_'.$package_id.'');\r\n\t\t\t$unused_widgets = unserialize($unused_widgets);\r\n\t\t\r\n\t\t}\r\n\t\tif(!is_array($custom_widgets))\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$custom_widgets = array();\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t$uu_title = $_POST[\"uu_title\"];\r\n\t\t$uu_type = $_POST[\"uu_type\"];\r\n\t\t$uu_editable = $_POST[\"uu_editable\"];\r\n\t\t$uu_content = $_POST[\"uu_content\"];\r\n\t\t\r\n\t\t$new_widget_key = count($default_widgets) + count($custom_widgets) +10;\r\n\t\t\r\n\t\techo \"new widget: \".$new_widget_key;\r\n\t\t\r\n\t\tif($uu_title!=\"\")\r\n\t\t{\r\n\t\t\r\n\t\t\t$default_widgets[$new_widget_key] =array(\r\n\t\t\t\t 'position' =>$new_widget_key,\r\n\t\t\t\t 'icon' => 'fa-file-text',\t\t\t\r\n\t\t\t\t 'title' => $uu_title,\r\n\t\t\t\t 'type' =>$uu_type, // 1-text, 2-shortcode\t\r\n\t\t\t\t 'editable' =>$uu_editable ,\t\r\n\t\t\t\t 'native' =>0,\r\n\t\t\t\t 'content' =>$uu_content,\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t 'visible' => 1\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$custom_widgets[$new_widget_key] =array(\r\n\t\t\t\t 'position' =>$new_widget_key,\r\n\t\t\t\t 'icon' => 'fa-file-text',\t\t\t\r\n\t\t\t\t 'title' => $uu_title,\r\n\t\t\t\t 'type' =>$uu_type, // 1-text, 2-shortcode\t\r\n\t\t\t\t 'editable' =>$uu_editable ,\t\r\n\t\t\t\t 'native' =>0,\t\t\r\n\t\t\t\t 'content' =>$uu_content,\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t 'visible' => 1\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$unused_widgets[] = $new_widget_key;\r\n\t\t\t\r\n\t\t\t//unusde widgets\r\n\t\t\t\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif($package_id=='')\r\n\t\t{\r\n\t\t\r\n\t\t\tupdate_option('userultra_custom_user_widgets', $custom_widgets );\r\n\t\t\tupdate_option('userultra_default_user_tabs', $default_widgets );\r\n\t\t\tupdate_option('uultra_unused_user_widgets',serialize($unused_widgets));\r\n\t\t\t\r\n\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tupdate_option('userultra_custom_user_widgets_package_'.$package_id.'', $custom_widgets );\r\n\t\t\tupdate_option('userultra_default_user_tabs_package_'.$package_id.'', $default_widgets );\r\n\t\t\tupdate_option('uultra_unused_user_widgets_package_'.$package_id.'',serialize($unused_widgets));\r\n\t\t\r\n\t\t\r\n\t\t}\r\n\t\tprint_r($default_widgets);\t\r\n\t\tprint_r($custom_widgets);\r\n\t\tprint_r($unused_widgets);\t\r\n\t\tdie();\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "function create_new_dashboard_widgets_right_now()\n\t\t{\n\t\t\t// delete the current widget\n\t\t\tremove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );\n\t\t\t\n\t\t\t//add a new widget\n\t\t\twp_add_dashboard_widget('dashboard_right_nowNew', __( 'Right Now' ), array($this,'dashboard_widget_right_now_lite'));\n\t\t}", "protected function Form_Create() {\n\t\t\t$this->txtValue1 = new QTextBox($this);\n\t\t\t\n\t\t\t$this->txtValue2 = new QTextBox($this);\n\t\t\t\n\t\t\t$this->lstOperation = new QListBox($this);\n\t\t\t$this->lstOperation->AddItem('+', 'add');\n\t\t\t$this->lstOperation->AddItem('-', 'subtract');\n\t\t\t$this->lstOperation->AddItem('*', 'multiply');\n\t\t\t$this->lstOperation->AddItem('/', 'divide');\n\t\t\t\n\t\t\t$this->btnCalculate = new QButton($this);\n\t\t\t$this->btnCalculate->Text = 'Calculate';\n\t\t\t$this->btnCalculate->AddAction(new QClickEvent(), new QServerAction('btnCalculate_Click'));\n\t\t\t\n\t\t\t$this->lblResult = new QLabel($this);\n\t\t\t$this->lblResult->HtmlEntities = false;\n\t\t}", "function ftagementor_description_Widget() {\r\r\n register_widget( 'ftagementor_description_Widget' );\r\r\n}", "public function create()\n {\n $this->openModal();\n $this->resetInputFields();\n }", "public function create()\n {\n $this->openModal();\n $this->resetInputFields();\n }", "public function output_widget_control_templates()\n {\n }", "function register_zijcareebuilderjobswidget() {\n register_widget( 'ZijCareerBuilderJobs' );\n}", "function uultra_update_user_widget_customization()\r\n\t{\r\n\t\tglobal $xoouserultra;\t\t\r\n\t\t\r\n\t\t$html =\"\";\r\n\t\t$user_id = get_current_user_id();\r\n\t\t\r\n\t\t$widget_id = $_POST[\"widget_id\"];\r\n\t\t$widget_custom_text = $_POST[\"widget_custom_text\"];\r\n\t\t$custom_user_optons = 'uultra_custom_user_widget_id_' .$widget_id;\r\n\t\t\r\n\t}", "public function create() {\n try {\n return view('admin.widget');\n } catch (Exception $ex) {\n return false;\n }\n return false;\n }", "function after_create() {}", "function suhv_widgets()\n{\n register_widget( 'Suhv_Widgets' );\n}", "static function register_widget() {\n\t\t\t$classname = get_called_class();\n\t\t\tregister_widget( $classname );\n\t\t}", "protected function Form_Run() {}", "function aw_add_load_widget() {\r\n\t\tregister_widget( 'AW_AddFeed' );\r\n\t}", "function SetWidget() {\n\t\t\n\t\t\tif ( !function_exists('register_sidebar_widget') ) \n\t\t\treturn;\n\t\t\t\n\t\t\t// This registers our widget so it appears with the other available\n\t\t\t// widgets and can be dragged and dropped into any active sidebars.\n\t\t\tregister_sidebar_widget(array('3B Meteo', 'widgets'), array(\"TreBiMeteo\",'WidgetMeteo'));\n\t\t\n\t\t\t// This registers our optional widget control form.\n\t\t\tregister_widget_control(array('3B Meteo', 'widgets'), array(\"TreBiMeteo\",'WidgetMeteoControl'), 450, 325);\n\t\t}", "function add_new_widget(){\n\t\t?>\n\t\t<div id=\"ww-add-new-widget\">\n\t\t\t<h2><?php _e('Add Widget', 'widgetwrangler'); ?></h2>\n\t\t\t<div class=\"ww-inner\">\n\t\t\t\t<select id=\"ww-add-new-widget-widget\">\n\t\t\t\t\t<option value=\"0\">-- <?php _e('Select a Widget', 'widgetwrangler'); ?> --</option>\n\t\t\t\t\t<?php foreach ( $this->all_widgets as $widget ){ ?>\n\t\t\t\t\t\t<option value=\"<?php print esc_attr( $widget->ID ); ?>\"><?php print $widget->post_title; ?></option>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</select>\n\t\t\t\t<select id=\"ww-add-new-widget-corral\">\n\t\t\t\t\t<option value=\"0\">-- <?php _e('Select a Corral', 'widgetwrangler'); ?> --</option>\n\t\t\t\t\t<?php foreach($this->all_corrals as $corral_slug => $corral_name) { ?>\n\t\t\t\t\t\t<option value=\"<?php print esc_attr( $corral_slug ); ?>\"><?php print $corral_name; ?></option>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</select>\n\t\t\t\t<span id=\"ww-add-new-widget-button\" class=\"button button-large\"><?php _e('Add Widget to Corral', 'widgetwrangler'); ?></span>\n\t\t\t</div>\n\t\t\t<p class=\"description ww-inner\"><?php _e('Select a widget you would like to add, and the corral where you would like to add it. Click the button Add Widget to Corral.', 'widgetwrangler'); ?></p>\n\n\t\t\t<script type=\"text/html\" id=\"tmpl-add-widget\">\n\t\t\t\t<?php\n\t\t\t\t$tmpl_widget = array(\n\t\t\t\t\t'weight' => '__widget-weight__',\n\t\t\t\t\t'id' => '__widget-ID__',\n\t\t\t\t\t'title' => '__widget-post_title__',\n\t\t\t\t\t'corral' => array(\n\t\t\t\t\t\t'slug' => '__widget-corral_slug__',\n\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\t\tprint $this->sortable_corral_item( $tmpl_widget, '__ROW-INDEX__' );\n\t\t\t\t?>\n\t\t\t</script>\n\t\t</div>\n\t\t<?php\n\t\t//\n\t}", "function register_broker_widget() {\n register_widget( 'Broker_Widget' );\n}", "public function add_widget_area() {\n\t\t\tif ( ! empty( $_POST['wprt-add-widget-input'] ) ) {\n\t\t\t\t$this->widget_areas = $this->get_widget_areas();\n\t\t\t\tarray_push( $this->widget_areas, $_POST['wprt-add-widget-input'] );\n\t\t\t\t$this->save_widget_areas();\n\t\t\t\twp_redirect( admin_url( 'widgets.php' ) );\n\t\t\t\tdie();\n\t\t\t}\n\t\t}", "public function get_widget_control($args)\n {\n }", "function register_service_box()\n{\n register_widget( 'CtaWidget' );\n}", "public static function widget() {\n\t\t$username = self::get_dashboard_widget_option(self::wid, 'username');\n\t\t$apikey = self::get_dashboard_widget_option(self::wid, 'apikey');\n\t\t$project_id = self::get_dashboard_widget_option(self::wid, 'project_id');\n\t\t$ref_url = 'http://go.endcore.64905.digistore24.com/';\n\t\t$check = ($username && $apikey && $project_id ? true : false);\n \n\t\tif(!$check) {\n\t\t\techo '<h4 style=\"text-align:right; padding-right: 40px; padding-top: 10px\">' . __( 'Bitte prüfe die Einstellungen &and;', 'affiliatetheme-backend' ) . '</h4>&nbsp;';\n ?>\n <div class=\"rankalyst-text\">\n <a href=\"<?php echo $ref_url; ?>\" target=\"_blank\"><img src=\"<?php echo get_template_directory_uri(); ?>/_/img/rankalyst.png\"></a>\n <p><?php printf(__('Mit <a href=\"%s\" target=\"_blank\">Rankalyst</a> kannst du 10 Keywords kostenlos tracken!', 'affiliatetheme-backend'), $ref_url); ?></p>\n <a href=\"<?php echo $ref_url; ?>\" target=\"_blank\" class=\"button button-primary\"><?php _e('Kostenlos starten', 'affiliatetheme-backend'); ?></a>\n </div>\n <?php\n\t\t}\n\t\t\n\t\t/* @TODO Rankingchange <span class=\"plus\">+</span> bzw Minus ausgeben, jenachdem ob Change positiv oder negativ. */\n\n ?>\n <div class=\"rankalyst-data\">\n <ul class=\"rankalyst-tabs\">\n <li><a href=\"#\" data-type=\"organic\" class=\"active\"><?php _e('Organic', 'affiliatetheme-backend'); ?></a></li>\n <li><a href=\"#\" data-type=\"mobile\"><?php _e('Mobile', 'affiliatetheme-backend'); ?></a></li>\n <li><a href=\"#\" data-type=\"local\"><?php _e('Local', 'affiliatetheme-backend'); ?></a></li>\n </ul>\n\n <div class=\"rankalyst-tab active\" data-type=\"organic\">\n <?php\n $rankalyst = new AT_Rankalyst_API($username, $apikey, $project_id, 1);\n if($rankalyst) {\n\t $response = $rankalyst->data();\n\t if($response) {\n\t\t if ( $response->status != 'success' ) {\n\t\t\t echo '<div class=\"rankalyst-text\"><p style=\"color: #c01313; margin-top: 10px\">' . $response->message . '</p></div>';\n\t\t } else {\n\t\t\t if ( $response->data ) {\n\t\t\t\t $data = $response->data->items;\n\t\t\t\t $rankalyst->output( $data );\n\t\t\t }\n\t\t }\n\t }\n }\n ?>\n </div>\n\n <div class=\"rankalyst-tab\" data-type=\"mobile\">\n <?php\n $rankalyst = new AT_Rankalyst_API($username, $apikey, $project_id, 2);\n if($rankalyst) {\n\t $response = $rankalyst->data();\n\t if($response) {\n\t\t if ( $response->status != 'success' ) {\n\t\t\t echo '<div class=\"rankalyst-text\"><p style=\"color: #c01313; margin-top: 10px\">' . $response->message . '</p></div>';\n\t\t } else {\n\t\t\t if ( $response->data ) {\n\t\t\t\t $data = $response->data->items;\n\t\t\t\t $rankalyst->output( $data );\n\t\t\t }\n\t\t }\n\t }\n }\n ?>\n </div>\n\n <div class=\"rankalyst-tab\" data-type=\"local\">\n <?php\n $rankalyst = new AT_Rankalyst_API($username, $apikey, $project_id, 3);\n if($rankalyst) {\n\t $response = $rankalyst->data();\n\t if($response) {\n\t\t if ( $response->status != 'success' ) {\n\t\t\t echo '<div class=\"rankalyst-text\"><p style=\"color: #c01313; margin-top: 10px\">' . $response->message . '</p></div>';\n\t\t } else {\n\t\t\t if ( $response->data ) {\n\t\t\t\t $data = $response->data->items;\n\t\t\t\t $rankalyst->output( $data );\n\t\t\t }\n\t\t }\n\t }\n }\n ?>\n </div>\n </div>\n <?php\n }", "public function register_widget() {\n register_widget( 'WPP_Widget' );\n }", "function post() {\n\t\t\n\t\t$this->doFormatAction($this->params['format']);\n\t\n\t\t// used to add outer wrapper to widget if it's the first view.\n\t\t$iv = $this->getParam('initial_view');\n\t\tif ($iv == true):\n\t\t\t$this->data['subview'] = $this->data['view'];\n\t\t\t$this->data['view'] = 'base.widget';\n\t\t\t// we dont want to keep passing this.\n\t\t\tunset($this->data['params']['initial_view']);\n\t\tendif;\n\t\t\n\t\t\n\t\t$this->data['wrapper'] = $this->getParam('wrapper');\n\t\t$this->data['widget'] = $this->params['do'];\n\t\t$this->data['do'] = $this->params['do'];\n\t\t\n\t\t// set default dimensions\n\t\t\n\t\tif (array_key_exists('width', $this->params)):\n\t\t\t$this->setWidth($this->params['width']);\n\t\tendif;\n\t\t\n\t\tif (array_key_exists('height', $this->params)):\n\t\t\t$this->setHeight($this->params['height']);\n\t\tendif;\n\n\t}", "function OnBeforeCreateEditControl(){\n }", "public static function register() {\n\t register_widget( __CLASS__ );\n\t}", "function ShopNowWidget() {\n\t\tparent::__construct( false, 'Shop Now Widget' );\n\t}", "protected function formCreate() {\n\t\t\t// Define the Simple Message Dialog Box\n\t\t\t$this->dlgSimpleMessage = new \\QCubed\\Project\\Jqui\\Dialog($this);\n\t\t\t$this->dlgSimpleMessage->Title = \"Hello World!\";\n\t\t\t$this->dlgSimpleMessage->Text = '<p><em>Hello, world!</em></p><p>This is a standard, no-frills dialog box.</p><p>Notice how the contents of the dialog '.\n\t\t\t\t'box can scroll, and notice how everything else in the application is grayed out.</p><p>Because we set <strong>MatteClickable</strong> to <strong>true</strong> ' .\n\t\t\t\t'(by default), you can click anywhere outside of this dialog box to \"close\" it.</p><p>Additional text here is just to help show the scrolling ' .\n\t\t\t\t'capability built-in to the panel/dialog box via the \"Overflow\" property of the control.</p>';\n\t\t\t$this->dlgSimpleMessage->AutoOpen = false;\n\n\t\t\t// Make sure this Dialog Box is \"hidden\"\n\t\t\t// Like any other \\QCubed\\Control\\Panel or QControl, this can be toggled using the \"Display\" or the \"Visible\" property\n\t\t\t$this->dlgSimpleMessage->Display = false;\n\n\t\t\t// The First \"Display Simple Message\" button will utilize an AJAX call to Show the Dialog Box\n\t\t\t$this->btnDisplaySimpleMessage = new \\QCubed\\Project\\Jqui\\Button($this);\n\t\t\t$this->btnDisplaySimpleMessage->Text = t('Display Simple Message \\QCubed\\Project\\Jqui\\Dialog');\n\t\t\t$this->btnDisplaySimpleMessage->AddAction(new \\QCubed\\Event\\Click(), new \\QCubed\\Action\\Ajax('btnDisplaySimpleMessage_Click'));\n\n\t\t\t// The Second \"Display Simple Message\" button will utilize Client Side-only JavaScripts to Show the Dialog Box\n\t\t\t// (No postback/postajax is used)\n\t\t\t$this->btnDisplaySimpleMessageJsOnly = new \\QCubed\\Project\\Jqui\\Button($this);\n\t\t\t$this->btnDisplaySimpleMessageJsOnly->Text = 'Display Simple Message \\QCubed\\Project\\Jqui\\Dialog (ClientSide Only)';\n\t\t\t$this->btnDisplaySimpleMessageJsOnly->AddAction(new \\QCubed\\Event\\Click(), new \\QCubed\\Action\\ShowDialog($this->dlgSimpleMessage));\n\n\t\t\t$this->pnlAnswer = new \\QCubed\\Control\\Panel($this);\n\t\t\t$this->pnlAnswer->Text = 'Hmmm';\n\t\t\t\n\t\t\t$this->btnDisplayYesNo = new \\QCubed\\Project\\Jqui\\Button($this);\n\t\t\t$this->btnDisplayYesNo->Text = t('Do you love me?');\n\t\t\t$this->btnDisplayYesNo->AddAction(new \\QCubed\\Event\\Click(), new \\QCubed\\Action\\Ajax('showYesNoClick'));\n\t\t\t\n\t\t\t\n\t\t\t// Define the CalculatorWidget example. passing in the Method Callback for whenever the Calculator is Closed\n\t\t\t// This is example uses \\QCubed\\Project\\Jqui\\Button's instead of the JQuery UI buttons\n\t\t\t$this->dlgCalculatorWidget = new CalculatorWidget($this);\n\t\t\t$this->dlgCalculatorWidget->setCloseCallback('btnCalculator_Close');\n\t\t\t$this->dlgCalculatorWidget->Title = \"Calculator Widget\";\n\t\t\t$this->dlgCalculatorWidget->AutoOpen = false;\n\t\t\t$this->dlgCalculatorWidget->Resizable = false;\n\t\t\t$this->dlgCalculatorWidget->Modal = false;\n\n\t\t\t// Setup the Value Textbox and Button for this example\n\t\t\t$this->txtValue = new \\QCubed\\Project\\Control\\TextBox($this);\n\n\t\t\t$this->btnCalculator = new \\QCubed\\Project\\Jqui\\Button($this);\n\t\t\t$this->btnCalculator->Text = 'Show Calculator Widget';\n\t\t\t$this->btnCalculator->AddAction(new \\QCubed\\Event\\Click(), new \\QCubed\\Action\\Ajax('btnCalculator_Click'));\n\n\t\t\t// Validate on JQuery UI buttons\n\t\t\t$this->dlgValidation = new \\QCubed\\Project\\Jqui\\Dialog($this);\n\t\t\t$this->dlgValidation->AddButton ('OK', 'ok', true, true); // specify that this button causes validation and is the default button\n\t\t\t$this->dlgValidation->AddButton ('Cancel', 'cancel');\n\n\t\t\t// This next button demonstrates a confirmation button that is styled to the left side of the dialog box.\n\t\t\t// This is a QCubed addition to the jquery ui functionality\n\t\t\t$this->dlgValidation->AddButton ('Confirm', 'confirm', true, false, 'Are you sure?', array('class'=>'ui-button-left'));\n\t\t\t$this->dlgValidation->Width = 400; // Need extra room for buttons\n\n\t\t\t$this->dlgValidation->AddAction (new \\QCubed\\Event\\DialogButton(), new \\QCubed\\Action\\Ajax('dlgValidate_Click'));\n\t\t\t$this->dlgValidation->Title = 'Enter a number';\n\n\t\t\t// Set up a field to be auto rendered, so no template is needed\n\t\t\t$this->dlgValidation->AutoRenderChildren = true;\n\t\t\t$this->txtFloat = new \\QCubed\\Control\\FloatTextBox($this->dlgValidation);\n\t\t\t$this->txtFloat->Placeholder = 'Float only';\n\t\t\t$this->txtFloat->PreferredRenderMethod = 'RenderWithError'; // Tell the panel to use this method when rendering\n\n\t\t\t$this->btnValidation = new \\QCubed\\Project\\Jqui\\Button($this);\n\t\t\t$this->btnValidation->Text = 'Show Validation Example';\n\t\t\t$this->btnValidation->AddAction(new \\QCubed\\Event\\Click(), new \\QCubed\\Action\\ShowDialog($this->dlgValidation));\n\n\t\t\t/*** Alert examples ***/\n\n\t\t\t$this->btnErrorMessage = new \\QCubed\\Project\\Jqui\\Button($this);\n\t\t\t$this->btnErrorMessage->Text = 'Show Error';\n\t\t\t$this->btnErrorMessage->AddAction(new \\QCubed\\Event\\Click(), new \\QCubed\\Action\\Ajax('btnErrorMessage_Click'));\n\n\t\t\t$this->btnInfoMessage = new \\QCubed\\Project\\Jqui\\Button($this);\n\t\t\t$this->btnInfoMessage->Text = 'Get Info';\n\t\t\t$this->btnInfoMessage->AddAction(new \\QCubed\\Event\\Click(), new \\QCubed\\Action\\Ajax('btnGetInfo_Click'));\n\t\t}", "function profilecomplete_init()\n {\n\t\t// add a blog widget\n\t\telgg_register_widget_type('profilecomplete', elgg_echo('profilecomplete:title'), elgg_echo('profilecomplete:widget:description'));\n }", "function wpb_load_widget() {\n\t\tregister_widget( 'dmv_widget' );\n\t}", "public function render_widget() {\n\t\t$this->get_db_values();\n\t\tif ( wponion_is_callable( $this->option( 'callback' ) ) ) {\n\t\t\techo wponion_callback( $this->option( 'callback' ), array( $this->get_db_values(), $this ) );\n\t\t}\n\t}", "public function afterLoadRegisterControlsUI(){\n\t\t\n\t}", "function widget_wrap()\n{\n\tregister_widget('ag_pag_familie_w');\n\tregister_widget('ag_social_widget_container');\n\tregister_widget('ag_agenda_widget');\n}", "public static function a_widget_init() {\n\t\t\treturn register_widget(__CLASS__);\n\t\t}", "function wpb_load_widget() {\n register_widget( 'lrq_widget' );\n }", "public function makeFullyRenderedButton() {}", "public function event()\n {\n $this->CI->type->add_css('textarea_limited', 'textarea_limited.css');\n $this->CI->type->add_js('textarea_limited', 'jquery.textareaCounter.plugin.js');\n }", "function wp_ajax_save_widget()\n {\n }", "public function widgets() {\r\n\t\t// Make sure the user has capability.\r\n\t\tif ( Permission::user_can( 'analytics' ) || ! is_admin() ) {\r\n\t\t\t// Most popular contents.\r\n\t\t\tregister_widget( Widgets\\Popular::instance() );\r\n\t\t}\r\n\t}", "function abc_load_widget()\n{\n register_widget('awesome_bmi_widget');\n}", "public function after_editor() {\n echo '</div>';\n $this->render_builder();\n }", "public function onRun()\n {\n $this->page['visible'] = $this->property('visible');\n $this->page['button'] = $this->property('button');\n }", "function oncreate(){\n\t\treturn true;\n\t}", "public function afterRun(WidgetEvent $event)\n {\n $event; // unused\n if (isset($this->widgetId)) {\n $id = $this->widgetId;\n } else {\n $id = $this->owner->options['id'];\n }\n $js = <<<JS\n;(function(widget){\n\n{$this->script}\n\n})($('#{$id}'));\nJS\n ;\n $this->owner->getView()->registerJs($js, $this->position);\n }", "function buildCustomPostWidgets()\n {\n // add_meta_box( $id, $title, $callback, $screen, $context, $priority, $callback_args );\n add_meta_box( 'cover_image_meta_box', 'Add an Image', array($this,'selectImageMetaBox'), 'playscripts', 'normal', 'high' );\n add_meta_box( 'cover_sound_meta_box', 'Add a Sound', array($this,'selectSoundMetaBox'), 'playscripts', 'normal', 'high' );\n }", "function hotpro_load_widget() {register_widget( 'data_hotpro_widget' );}", "function rs_load_widget()\n{\n\tregister_widget('rs_Widget_Agenda');\n}", "function register_widget($widget)\n {\n }", "public function create_widgets () {\n wp_enqueue_style( 'wedevs-latest-post-style' );\n\n add_action( 'wp_dashboard_setup', [ $this, 'add_dashboard_widgets' ] );\n }", "public function createForm()\n {\n }", "public static function widget() {\n \n\t\t$start = self::get_dashboard_widget_option(self::wid, 'starting_conversion');\n\t\t$remaining_days = self::get_dashboard_widget_option(self::wid, 'starting_conversion');\n\t\t\n\t\t// Display Dashboard widget\n\t\trequire_once( 'red-flag-parking-display.php' );\n }", "public function run() {\n $data = array('project' => $this->getProject(),\n 'sprint' => $this->getSprint());\n $this->render('widget_user_menu', array('data' => $data));\n }", "public function create_page()\n {\n ?>\n <div class=\"wrap\">\n <div id=\"icon-users\">\n <?php\n echo '<h1>' . esc_html__('Available Cron Schedules') . '</h1>'; \n $this->screen = get_current_screen();\n $this->prepare_items();\n $this->display();\n ?>\n </div>\n <?php settings_errors(); ?>\n <form method=\"post\" action=\"options.php\">\n <?php \n //Prints out all hidden fields\n settings_fields('custom-schedules-group');\n do_settings_sections('custom-schedules-admin');\n submit_button();\n ?>\n </form>\n </div>\n <?php \n }", "function WeblizarTwitterWidget() {\r\n\tregister_widget( 'WeblizarTwitter' );\r\n}", "public function create()\n {\n //for the PAGE on which to create\n }", "function register_ib_act_widget() {\n\tregister_widget( 'IB_Act_Widget_Widget' );\n}", "public function run()\n\t{\n\t\tlist($name,$id)=$this->resolveNameID();\n\t\tif(isset($this->htmlOptions['id']))\n\t\t\t$id=$this->htmlOptions['id'];\n\t\telse\n\t\t\t$this->htmlOptions['id']=$id;\n\t\tif(isset($this->htmlOptions['name']))\n\t\t\t$name=$this->htmlOptions['name'];\n\n\t\t#$this->registerClientScript($id);\n\t\t#$this->htmlOptions[\"class\"]=\"form-control\";\n\t\t$this->htmlOptions=array_merge($this->htmlOptions,array(\n\t\t\t// 'htmlOptions'=>array('container'=>null),\n\t\t\t'labelOptions'=>array('style'=>'width: 100%;height: 100%;cursor:pointer','class'=>'ptm pbm mbn'),\n\t\t\t'template'=>'<div class=\"col-lg-1\"><a href=\"#\" class=\"thumbnail text-center\" style=\"margin-left: -10px;margin-right: -10px;\">{beginLabel}{labelTitle}<div class=\"text-center\">{input}</div>{endLabel}</a></div>',\n\t\t\t'separator'=>'',\n\t\t));\n\t\t\n\t\t#echo \"<small class=\\\"text-muted\\\"><em>Here a message for user</em></small>\";\n\t\t#echo CHtml::activeTextField($this->model,$this->attribute,$this->htmlOptions);\n\t\techo '<div class=\"row\">'.Chtml::activeRadioButtonList($this->model,$this->attribute,\n\t\t $this->listData,$this->htmlOptions).'</div>';\n\t}", "public function widget( $args, $instance ) {\n\t\t// outputs the content of the widget\n \n \n \n if(isset($instance['widgettitle']))\n {\n $widgettitle=esc_attr($instance['widgettitle']); \n }\n else\n {\n $widgettitle='Subscribe For Newsletter';\n }\n \n if(isset($instance['uniquelist']))\n {\n $uniquelist=esc_attr($instance['uniquelist']);\n }\n else\n {\n $uniquelist='';\n }\n if(isset($instance[thankyoupage]))\n {\n $thankyoupage=esc_attr($instance[thankyoupage]);\n }\n else\n {\n $thankyoupage='';\n }\n $widgetbgcolor=esc_attr($instance['widgetbgcolor']);\n $widgetfontcolor=esc_attr($instance['widgetfontcolor']);\n $widgetbtncolor=esc_attr($instance['widgetbtncolor']);\n \n ?>\n <style>\n .rf_widget_container input[type=\"submit\"]\n {\n background-color:<?php echo $widgetbtncolor ?>;\n }\n .rf_widget_container input[type=\"submit\"]:hover\n {\n background-color:#999;\n }\n </style> \n\n <div class=\"rf_widget_container\" style=\"background-color:<?php echo $widgetbgcolor ?>;color:<?php echo $widgetfontcolor ?> \">\n <span><?php echo $widgettitle ?></span><br/>\n <div class=\"rf_widget_form_container\">\n <form method=\"post\" action=\"https://www.aweber.com/scripts/addlead.pl\">\n <input type=\"hidden\" name=\"listname\" value=\"<?php echo $uniquelist ?>\" />\n <input type=\"hidden\" name=\"redirect\" value=\"<?php echo $thankyoupage ?>\" />\n <input type=\"hidden\" name=\"meta_adtracking\" value=\"custom form\" />\n <input type=\"hidden\" name=\"meta_message\" value=\"1\" /> \n <input type=\"hidden\" name=\"meta_required\" value=\"name,email\" /> \n <input type=\"hidden\" name=\"meta_forward_vars\" value=\"1\" /> \n <span>User Name</span><br/>\n <input type=\"text\" placeholder=\"john\"><br/>\n <span>Email</span><br/>\n <input type=\"text\" placeholder=\"[email protected]\"><br/>\n <input type=\"submit\" class=\"rf_sbrb_btn\" name=\"submit\" value=\"Subscribe\" /> \n </form>\n </div>\n \n </div> \n\n\n <?php\n \n\t}", "public function sarbacane_save_widget() {\n\t\t$this->save_newsletter ();\n\t}", "public function create(){\n // enter your stuff here if you want...\n\treturn(parent::create());\n }", "public function run()\n { \n self::create();\n }", "public static function init()\n {\n add_action( 'widgets_init', array(__CLASS__, 'register') );\n }", "function pre_load_widget() {\n register_widget( 'events_widget' );\n register_widget( 'fundys_widget' );\n}", "public static function init() {\n //Register widget settings...\n self::update_dashboard_widget_options(\n self::wid, //The widget id\n array( //Associative array of options & default values\n 'username' => '',\n\t\t\t\t'apikey' => '',\n\t\t\t\t'project_id' => '',\n ),\n true //Add only (will not update existing options)\n );\n\n //Register the widget...\n wp_add_dashboard_widget(\n self::wid, //A unique slug/ID\n __( 'Rankalyst Statistik', 'affiliatetheme-backend' ),//Visible name for the widget\n array('AT_Rankalyst_Widget','widget'), //Callback for the main widget content\n array('AT_Rankalyst_Widget','config') //Optional callback for widget configuration content\n );\n }", "function registerBBwidget(){\r\n\tregister_widget('BbWidgetArea');\r\n\t\r\n\t}", "function hw_load_widget() {\n\tregister_widget( 'hw_cal_widget' );\n\tregister_widget( 'hw_custom_post_list_widget' );\n}", "function register()\n {\n // Incluimos el widget en el panel control de Widgets\n wp_register_sidebar_widget( 'widget_ultimosp', 'Últimos post por autor', array( 'Widget_ultimosPostPorAutor', 'widget' ) );\n\n // Formulario para editar las propiedades de nuestro Widget\n wp_register_widget_control('widget_ultimos_autor', 'Últimos post por autor', array( 'Widget_ultimosPostPorAutor', 'control' ) );\n }", "function on_creation() {\n $this->init();\n }", "function register_unlock_widget() {\n register_widget( 'Unlock_Widget' );\n}", "protected function retrieve_widgets()\n {\n }", "protected function retrieve_widgets()\n {\n }", "public function actionLoadWidget() {\n\t\ttry {\n\t\t\tif (($id = Yii::app()->getRequest()->getQuery(\"medcard\")) == null) {\n\t\t\t\tthrow new CException(\"Can't resolve \\\"medcard\\\" identification number as query parameter\");\n\t\t\t}\n\t\t\tif (Laboratory_Medcard::model()->findByPk($id) == null) {\n\t\t\t\tthrow new CException(\"Unresolved laboratory's medcard identification number \\\"{$id}\\\"\");\n\t\t\t}\n\t\t\t$widget = $this->getWidget(\"AutoForm\", [\n\t\t\t\t\"model\" => new Laboratory_Form_Direction(\"laboratory.treatment.register\", [\n\t\t\t\t\t\"medcard_id\" => $id\n\t\t\t\t])\n\t\t\t]);\n\t\t\t$this->leave([\n\t\t\t\t\"component\" => $widget,\n\t\t\t\t\"status\" => true\n\t\t\t]);\n\t\t} catch (Exception $e) {\n\t\t\t$this->exception($e);\n\t\t}\n\t}", "public function addsButtons() {}", "public function init()\n {\n // Initialize widget.\n }", "public function init(){\n /*you can set initial default values and other stuff here.\n * it's also a good place to register any CSS or Javascript your\n * widget may need. */ \n }", "function custom_register_widget()\n{\n register_widget('oferta_widget');\n register_widget('events_widget');\n register_widget('group_list_widget');\n}", "public function save_widget() {\n\t\t$this->get_cache();\n\t\t$this->get_db_values();\n\t\tif ( 'POST' === $_SERVER['REQUEST_METHOD'] && isset( $_POST[ $this->unique() ] ) ) {\n\t\t\t$this->get_db_values();\n\t\t\t$this->get_cache();\n\t\t\t$instance = new Save_Handler( array(\n\t\t\t\t'module' => &$this,\n\t\t\t\t'unique' => $this->unique(),\n\t\t\t\t'fields' => $this->fields(),\n\t\t\t\t'db_values' => $this->get_db_values(),\n\t\t\t) );\n\t\t\t$instance->run();\n\n\t\t\t$this->options_cache['field_errors'] = $instance->get_errors();\n\t\t\t$this->set_db_cache( $this->options_cache );\n\t\t\t$this->set_db_values( $instance->get_values() );\n\t\t\tif ( ! empty( $instance->get_errors() ) ) {\n\t\t\t\twp_redirect( add_query_arg( 'wponion-save', 'error' ) );\n\t\t\t\texit;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->init_theme()->render();\n\t\t}\n\t}", "function widgets_init_now() {\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Текст вверху шапки'\n\t\t\t,'id' => 'header_top'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Несколько виджетов будут расположены в строчку. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Блок для виджета рассылки в подвале'\n\t\t\t,'id' => 'footer_mailings'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Блок контактов в подвале'\n\t\t\t,'id' => 'footer_contacts'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Подробнее о системе обучения в Linguamore'\n\t\t\t,'id' => 'homepage_education-feats'\n\t\t\t,'description' => 'Блок, расположенный на странице \"Преимущества\". Добавьте сюда виджет \"Rich Text\" из левой части страницы. Иконки можно добавить кнопкой \"Add Media\". Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t}", "function CreateChildControls() {\n }", "function anariel_homesponsorstext_Widget() {\n\t\n\t\t/* Widget settings. */\n\t\t$widget_ops = array( 'classname' => 'anariel_homesponsorstext_widget', 'description' => __('Sponsors Text Block - place to add sposors text (we used this widget on home and about pages)', 'anariel') );\n\n\t\t/* Widget control settings. */\n\t\t$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'anariel_homesponsorstext_widget' );\n\n\t\t/* Create the widget. */\n\t\t$this->WP_Widget( 'anariel_homesponsorstext_widget', __('Anariel-Sponsors Text Widget', 'anariel'), $widget_ops, $control_ops );\n\t}", "function Eternizer_user_new($args) {\n if (!SecurityUtil::checkPermission('Eternizer::', '::', ACCESS_COMMENT)) {\n return false;\n }\n\n $dom = ZLanguage::getModuleDomain('Eternizer');\n\n $render = & FormUtil::newpnForm('Eternizer');\n\n if (!empty($tpl) && $pnRender->template_exists('Eternizer_user_'. DataUtil::formatForOS($tpl) .'_form.tpl')) {\n $tpl = 'Eternizer_user_'.DataUtil::formatForOS($tpl).'_form.tpl';\n } else {\n $tpl ='Eternizer_user_form.tpl';\n }\n\n Loader::requireOnce('modules/Eternizer/classes/Eternizer_user_newHandler.class.php');\n\n return $render->pnFormExecute($tpl, new Eternizer_user_newHandler($args['inline']));\n}", "protected function generateButtons() {}" ]
[ "0.69187385", "0.62519264", "0.6249595", "0.6249595", "0.61652976", "0.6151104", "0.61351955", "0.6130932", "0.6126627", "0.6088478", "0.60428894", "0.60367996", "0.60367996", "0.5971482", "0.5961715", "0.5961715", "0.5961715", "0.5961715", "0.5955849", "0.5955159", "0.5914392", "0.59017295", "0.58824027", "0.5870076", "0.5870076", "0.5869728", "0.58645785", "0.5848005", "0.5827844", "0.58237445", "0.58144224", "0.58024234", "0.5799576", "0.5796592", "0.5780241", "0.57665056", "0.57658046", "0.5760128", "0.5750659", "0.57462335", "0.5742336", "0.57278633", "0.5725914", "0.57121766", "0.57121074", "0.5709799", "0.5709256", "0.57062685", "0.5692998", "0.56895924", "0.5669222", "0.5667933", "0.56597257", "0.5646453", "0.56384003", "0.56344026", "0.5632162", "0.56286126", "0.5615708", "0.561274", "0.5610613", "0.56089616", "0.56075674", "0.56038964", "0.5601222", "0.5590119", "0.55848753", "0.5584556", "0.55840534", "0.55834633", "0.55823207", "0.5579923", "0.5578394", "0.5573406", "0.5568853", "0.5564848", "0.5563169", "0.555026", "0.5546752", "0.55452013", "0.55398995", "0.55302197", "0.55291635", "0.55290276", "0.55289", "0.5525747", "0.55219084", "0.55164874", "0.5512598", "0.5512598", "0.5511664", "0.5506995", "0.55023587", "0.55022377", "0.5500977", "0.54989356", "0.54905474", "0.54819447", "0.54784644", "0.5478133", "0.5466522" ]
0.0
-1
/ A custom query that returns the post's title and Learn More text as links to the rest of the content. The query also returns a thumbnail and the excerpt. There will be only 3 posts returned, they will be from the custom 'Portfolio' post type and they will appear in descending order.
function get_my_events($rama) { global $post; $events = new WP_Query(); $events->query('post_type=Rama&showposts=5&order=desc' . $rama); if($events->found_posts>0) { echo '<ul class="rama_widget">'; while($events->have_posts()) { $events->the_post(); $image = (has_post_thumbnail($post->ID)) ? get_the_post_thumbnail($post->ID) : '<div class="missingthumbnail"></div>'; $eventItem = '<li>' . $image; $eventItem .= '<a href="' . get_permalink() . '">'; $eventItem .= get_the_title() . '</a>'; $eventItem .= '<span>' . get_the_excerpt() . ''; $eventItem .= '<a class="widgetmore" href="' . get_permalink() . '">'; $eventItem .= '<p>Read More... </p>' . '</a></span></li>'; echo $eventItem; } echo '</ul>'; wp_reset_postdata(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function accouk_homepage_latest_posts() {\n\n $args = array('post_type' => 'post', 'category_name' => 'blog', 'posts_per_page' => 4, 'orderby' => 'date', 'order' => 'DESC');\n $query = new WP_Query( $args );\n\n if ( $query->have_posts() ) {\n\n echo '<ul class=\"post-list homepage-post-list\">';\n\n \twhile ( $query->have_posts() ) {\n \t\t$query->the_post(); ?>\n\n <li>\n <a href=\"<?php the_permalink(); ?>\" title=\"<?php the_title(); ?>\">\n <div class=\"main-tile-part\">\n <?php echo accouk_post_tile_image(); ?>\n <span><h3><?php the_title(); ?></h3></span>\n </div>\n <div class=\"sub-tile-part\">\n <span class=\"excerpt\"><?php the_excerpt(); ?></span>\n <span class=\"date\"><?php echo get_the_date(); ?></span>\n <span class=\"cta\">Read Now</span>\n </div>\n </a>\n </li>\n <?php\n \t}\n\n \techo '</ul>';\n\n } else {\n \techo \"<p>Sorry, an error has occurred</p>\";\n }\n\n}", "function blog_post_shortcode($atts) {\n // Defaults\n extract(shortcode_atts(array(\n\t \"no_of_post\" => '',\n\t \"order\" => 'desc',\n\t \"order_by\" => 'rand',\n\t \"excerpt_length\" => '80',\n\t \"link_text\" => 'Continue Reading'\n ), $atts));\n $paged = (get_query_var('paged')); \n $the_query = '';\n // de-funkify query\n $the_query = preg_replace('~&#x0*([0-9a-f]+);~ei', 'chr(hexdec(\"\\\\1\"))', $the_query);\n $the_query = preg_replace('~&#0*([0-9]+);~e', 'chr(\\\\1)', $the_query);\n \n \n\t$the_query = array(\n\t\t\"posts_per_page\" => $no_of_post,\n\t\t\"order\" => $order,\n\t\t\"orderby\" => $order_by,\n\t\t\"paged\" => $paged\n\t);\n // query is made \n query_posts($the_query);\n\n // Reset and setup variables\n $output = '';\n $temp_title = '';\n $temp_link = '';\n $temp_ex = '';\n $temp_content = '';\n $temp_thumb = '';\n $temp_id = '';\n\n // the loop\n $output = '';\n if (have_posts()) : while (have_posts()) : the_post();\n global $post;\n \t $temp_id = get_the_ID();\n $temp_title = get_the_title($temp_id);\n $temp_link = get_permalink($temp_id);\n $temp_content = ShortenText(strip_shortcodes(strip_tags(get_the_content($temp_id))), $excerpt_length) ;\n\t \n\t $meta = '<p>Posted by <span class=\"author\">';\n\t $meta .= '<a href=\" '. get_author_posts_url($post -> author). '\">'; \n\t $meta .= get_the_author_meta('display_name');\n\t $meta .= '</a></span>';\n\t \n\t \n\t $meta .= ' On '.get_the_time('F j, Y');\n\t $meta .= '</p>';\n\t $category = get_the_category_list(', ');\n\t \n\t \n\t \n $output .= '<article id=\"post-'.$temp_id.'\" class=\"post clearfix\" role=\"article\">\n \t<header>\n \t\t<h2 class=\"blogTitle\"><a href=\"'.$temp_link.'\" rel=\"bookmark\">'.$temp_title.'</a></h2>\n \t<div class=\"meta clearfix\">\n <div class=\"post-format-icon\"></div>\n\t\t\t\t\t\t '.$meta.'\n <p>Categories: '.$category.'</p> \n </div>\n </header>\n \n <div class=\"blogContent\">';\n \n $meta = get_post_meta($post->ID, 'drive_post_options', false);\n\t\t\t\t\t\n if( !empty($meta) )\n extract($meta[0]);\n\n $fcs_video = isset($fcs_video) ? $fcs_video : '';\n $fcs_audio = isset($fcs_audio) ? esc_url($fcs_audio) : '';\n\n if ( has_post_format( 'audio' ) ){\n if(!empty($fcs_audio)){\n $output .= '<div class=\"fcs-post-audio\">'.do_shortcode('[audio src=\"'. $fcs_audio .'\"]').'</div>';\n }\n }\n elseif ( has_post_format( 'video' ) ){\n if (!empty($fcs_video)) {\n $output .= '<div class=\"fcs-post-video\">'.$fcs_video.'</div>';\n }\n }\n else{\n if( has_post_thumbnail() && function_exists('dfi_get_featured_images') ) {\n \n \t$output .= '<div class=\"post-thumbnail\">\n <div class=\"flexslider\">\n <ul class=\"slides\">'; \n\t\t\t\t\t\t\t\n $img = '';\n // Checks if post has a feature image, grabs the feature-image and outputs that along with thumbnail SRC as a REL attribute \n if (has_post_thumbnail()) { // checks if post has a featured image and then outputs it. \n $image_id = get_post_thumbnail_id ($post->ID ); \n $image_thumb_url = wp_get_attachment_image_src( $image_id, 'full'); \n if(!empty($image_thumb_url))\n $img = aq_resize($image_thumb_url[0], 1100, 300, true, true); \n\n if($img){\n $output .= '<li><img src=\"' . $img . '\" alt=\"\"></li>';\n }else{\n $output .= '<li><img src=\"' . $image_thumb_url[0] . '\" alt=\"\"></li>'; \n }\n }\n\n \n if( function_exists('dfi_get_featured_images') ) {\n $featuredImages = dfi_get_featured_images();\n\n if(!empty($featuredImages)){\n\n foreach ($featuredImages as $featuredImage) {\n $img = aq_resize($featuredImage['full'], 817, 300, true, true);\n \n if($img){\n $output .= '<li><img src=\"' . $img . '\" alt=\"\"></li>';\n }else{\n $output .= '<li><img src=\"' . $featuredImage['full'] . '\" alt=\"\"></li>'; \n }\n }\n }\n }\n \n \n $output .= '</ul>\n </div><!-- end #slider -->\n </div>'; \n \n }\n }\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\n\n $output .= '<p>'.$temp_content.'</p>';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n \n $output .= '<a href=\"'.$temp_link.'\" class=\"permalink\" rel=\"bookmark\">'.$link_text.'</a>\n </div>\n </article>';\n\t\t\n\t\t\n\t\t\t\n endwhile; \n $output .= shortcode_nav( '<div class=\"sep\"></div><div class=\"pagination theme-style\">','</div><div class=\"sep\"></div>');\n else:\n $output .= \"Post not found.\";\n endif;\n wp_reset_query();\n return $output;\n}", "function tutsplus_featured_query() {\n\t\n\t//query parameters\n\t$args = array(\n\t\t'posts_per_page' => 1,\n\t\t'orderby' => 'rand',\n\t\t'category_name' => 'featured'\n\t);\n\t\n\t//the query\n\t$query = new WP_Query( $args );\n\t\n\t//the loop\n\tif( $query->have_posts() ) {\n\t\t\n\t\techo '<aside class=\"featured-post container\">';\n\t\t\n\t\t\twhile( $query->have_posts() ) {\n\t\t\t\t$query->the_post();\n\t\t\t\t\n\t\t\t\techo '<h3>Featured Post - <a href=\"' . get_the_permalink() . ' \">' . get_the_title() . '</a></h3>';\n\t\t\t\t\n\t\t\t\tif( has_post_thumbnail() ) {\n\t\t\t\t\t\n\t\t\t\t\techo '<a href=\"' . get_the_permalink() . ' \">';\n\t\t\t\t\t\tthe_post_thumbnail( 'medium', array(\n\t\t\t\t\t\t\t'class' => 'alignleft'\n\t\t\t\t\t\t));\n\t\t\t\t\techo '</a>';\n\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\tthe_excerpt();\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\techo'</aside>';\n\t\t\n\t\twp_reset_postdata();\n\t\t\n\t}\n\t\n}", "function quasar_get_the_content(){\n\tglobal $post;\n\t$content = get_the_content('',FALSE);\n\t$content = apply_filters('the_content', $content);\n\t$content = str_replace(']]>', ']]&gt;', $content);\t\n\tif(!is_single()):\n\t\t$content = $content.quasar_get_read_more_link();\n\tendif;\n\treturn $content;\n}", "function emc_single_big_ideas() {\r\n\r\n\t// custom loop for connected content foci\r\n\t$big_ideas = new WP_Query( array(\r\n\t \t'connected_type' => 'big_ideas_to_posts',\r\n\t \t'connected_items' => get_queried_object(),\r\n\t \t'nopaging' => true,\r\n\t) );\r\n\r\n\t// Display Big Ideas\r\n\tif ( $big_ideas->have_posts() ) :\r\n\r\n\t\twhile ( $big_ideas->have_posts() ) : $big_ideas->the_post(); ?>\r\n\r\n\t\t\t<article id=\"post-<?php the_ID(); ?>\" <?php post_class( 'emc-related-post' ); ?>>\r\n\t\t\t\t<div class=\"emc-format\">\r\n\t\t\t\t\t<img src=\"<?php echo get_stylesheet_directory_uri(); ?>/img/key.png\" alt=\"<?php esc_attr_e( 'Key icon for Big Ideas', 'emc' ); ?>\"/>\r\n\t\t\t\t</div>\r\n\t\t\t\t<h3 class=\"entry-title\"><?php esc_html_e( 'Big Idea', 'emc' ); ?></h3>\r\n\r\n\t\t\t\t<div class=\"entry-content\">\r\n\t\t\t\t\t<p><?php the_title(); ?> <a class=\"emc-learn-more\" href=\"<?php the_permalink(); ?>\"><?php esc_html_e( 'More', 'emc' ); ?></a>\r\n\t\t\t\t</div><!-- .entry-content -->\r\n\t\t\t</article>\r\n\r\n\t\t<?php\r\n\t\tendwhile;\r\n\t\twp_reset_postdata();\r\n\r\n\tendif;\r\n\r\n}", "function tutsplus_wp_query() {\n\t\n\t// query parameters\n\t$args = array(\n\t\t'posts_per_page' => 5\n\t);\n\t\n\t// the query\n\t$query = new WP_Query( $args );\n\t\n\t//the loop\n\tif( $query-> have_posts() ) {\n\t\t\n\t\techo'<h3>';\n\t\t\t_e( 'Latest Posts', 'tutsplus' );\n\t\techo'</h3>';\n\t\t\n\t\techo'<ul>';\n\t\t\t\n\t\t\twhile( $query->have_posts() ) {\n\t\t\t\t$query->the_post();\n\t\t\t\t\n\t\t\t\techo'<li>';\n\t\t\t\t\techo '<a href=\"' . get_the_permalink() . '\">' . get_the_title() . '</a>';\n\t\t\t\techo'</li>';\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\techo'</ul>';\n\t\t\n\t\twp_reset_postdata();\n\t\t\n\t}\n\t\n}", "function gymchamps_testimonials_list() { ?>\n\n <!-- --- hello from queries.php --- -->\n <ul class=\"testimonials-list\">\n\n <?php \n // method for querying the data from \"Testimonials\" post type in gym_post_types.php in Plugins folder\n $args = array(\n // if 'posts_type' = queried from blogs = HEADACHE\n 'post_type' => 'testimonials', // testimonial name located at gym_post_type.php\n 'posts_per_page' => 10\n );\n\n $testimonials = new WP_Query($args);\n while( $testimonials->have_posts() ): $testimonials->the_post(); ?>\n \n\n <li class=\"testimonial text-center\">\n <blockquote>\n <?php the_content(); ?>\n </blockquote>\n\n <footer class=\"testimonial-footer\">\n <?php the_post_thumbnail('thumbnail'); ?>\n <p><?php the_title(); ?></p>\n </footer>\n </li>\n\n <?php endwhile; wp_reset_postdata(); ?>\n </ul>\n\n<?php }", "function dg_excerpt() {\n global $post;\n $excerpt = '<p>' . get_the_excerpt() . ' <a class=\"more\" href=\"'. get_permalink($post->ID) . '\" title=\"'. get_the_title($post->ID) .'\">Read&nbsp;more&nbsp;»</a></p>';\n echo $excerpt;\n}", "function emc_related_big_ideas(){\r\n\r\n\tglobal $wp_query;\r\n\t$term = $wp_query->get_queried_object();\r\n\r\n\t$args = array(\r\n\t\t'post_type' => 'emc_big_idea',\r\n\t\t'posts_per_page' => -1,\r\n\t\t'tax_query' => array(\r\n\t\t\tarray(\r\n\t\t\t\t'taxonomy' => $term->taxonomy,\r\n\t\t\t\t'field' => 'slug',\r\n\t\t\t\t'terms' => $term->slug,\r\n\t\t\t)\r\n\t\t)\r\n\t);\r\n\t$posts = get_posts( $args );\r\n\r\n\tif ( empty( $posts ) ) return;\r\n\r\n\techo '<h2 class=\"emc-section-heading-posts\">'. esc_html( 'Related Big Ideas', 'emc' ) .'</h2>';\r\n\r\n\tforeach( $posts as $p ){ ?>\r\n\r\n\t\t<article id=\"post-<?php echo $p->ID; ?>\" <?php post_class( 'emc-related-post' ); ?>>\r\n\t\t\t<div class=\"emc-format\">\r\n\t\t\t\t<img src=\"<?php echo get_stylesheet_directory_uri(); ?>/img/key.png\" alt=\"<?php esc_attr_e( 'Key icon for Big Ideas', 'emc' ); ?>\"/>\r\n\t\t\t</div>\r\n\t\t\t<h3 class=\"entry-title\"><?php esc_html_e( 'Big Idea', 'emc' ); ?></h3>\r\n\r\n\t\t\t<div class=\"entry-content\">\r\n\t\t\t\t<p><?php echo get_the_title( $p->ID ); ?> <a class=\"emc-learn-more\" href=\"<?php echo get_permalink( $p->ID ); ?>\"><?php esc_html_e( 'More', 'emc' ); ?></a>\r\n\t\t\t</div><!-- .entry-content -->\r\n\t\t</article>\r\n\t<?php\r\n\t}\r\n}", "function custom_loop_shortcode_get_posts( $atts ) {\n\t\n\t// get global post variable\n\tglobal $post;\n\t\n\t// define shortcode variables\n\textract( shortcode_atts( array( \n\t\t\n\t\t'posts_per_page' => 5,\n\t\t'orderby' => 'date',\n\t\t\n\t), $atts ) );\n\t\n\t// define get_post parameters\n\t$args = array( 'posts_per_page' => $posts_per_page, 'orderby' => $orderby );\n\t\n\t// get the posts\n\t$posts = get_posts( $args );\n\t\n\t// begin output variable\n\t$output = '<h3>Custom Loop Example: get_posts()</h3>';\n\t$output .= '<ul>';\n\t\n\t// loop thru posts\n\tforeach ( $posts as $post ) {\n\t\t\n\t\t// prepare post data\n\t\tsetup_postdata( $post );\n\t\t\n\t\t// continue output variable\n\t\t$output .= '<li><a href=\"'. get_permalink() .'\">'. get_the_title() .'</a></li>';\n\t\t\n\t}\n\t\n\t// reset post data\n\twp_reset_postdata();\n\t\n\t// complete output variable\n\t$output .= '</ul>';\n\t\n\t// return output\n\treturn $output;\n\t\n}", "function projects_shortcode($atts) \n{\n\t//Options\n extract(shortcode_atts(array(\n 'limit' => '-1',\n 'location' => '',\n 'category' => '',\n ), $atts));\n\n global $post;\n \n //Query Options\n $args = array(\n 'posts_per_page' => $limit, \n 'orderby' => 'post_date',\n 'post_type' => 'projects',\n 'tax_query' => array(\n 'relation' => 'OR',\n array(\n 'taxonomy' => 'location',\n 'field' => 'slug',\n 'terms' => array($location)\n ),\n array(\n 'taxonomy' => 'category',\n 'field' => 'slug',\n 'terms' => array($category)\n ),\n ));\n \n //Query for projects \n $get_projects = NEW WP_Query($args);\n\t\n\t//Wrapper\n\t$output .= '<div class=\"row wrap-projects\">';\n\t\n\t//Loop\n while($get_projects->have_posts()) \n {\n $get_projects->the_post();\n $img_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), \"full\");\n\t\t$feat_img = $img_src[0];\n \n $output .= '<a href=\"#\" class=\"project-post one-third column\" data-url=\"'.get_permalink().'\" style=\"background-image:url('.$feat_img.');\"><div class=\"hover-wrap\">';\n $output .= '<h3>'.get_the_title().'</h3>';\n $output .= '<div class=\"post-excerpt\">'.get_the_excerpt().'</div>';\n $output .= '<div class=\"meta\">'.get_post_meta( $post->ID, 'Awards', true).'</div>';\n $output .= '</div></a>';\n };\n \n $output .= '</div>';\n \n //Important: Reset wp query\n wp_reset_query();\n \n return $output;\n}", "public function get_content_posts() {\r\n\t\tglobal $wpdb;\r\n\t\t$options = get_option( 'mf_timeline' );\r\n\t\t\r\n\t\tif( isset( $options['options']['wp']['content']) && !empty($options['options']['wp']['content'] ) ) {\t\t\t\r\n\t\t\t/**\r\n\t\t\t * // HACK\r\n\t\t\t * Wordpress $wpdb->prepare() doesn't handle passing multiple arrays to its values. So we have to merge them.\r\n\t\t\t * It is also unable to determine how many placeholders are needed for handling array values, so we have to work out how many we need.\r\n\t\t\t * To be blunt, this is crap and needs to be looked at by the Wordpress dev team.\r\n\t\t\t **/\r\n\t\t\t$post_types = array_keys( $options['options']['wp']['content'] );\r\n\t\t\t\r\n\t\t\tforeach( $post_types as $post_type ) {\r\n\t\t\t\t$post_types_escape[] = '%s';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$since = date('Y-m-01', strtotime('-1 months'));\r\n\t\t\t$sql = \"SELECT {$wpdb->posts}.ID AS id, {$wpdb->posts}.post_title AS title, {$wpdb->posts}.post_content AS content, {$wpdb->posts}.post_excerpt AS excerpt, {$wpdb->posts}.post_date AS date, {$wpdb->posts}.post_author AS author, {$wpdb->terms}.term_id AS term_id\r\n\t\t\t\tFROM `{$wpdb->posts}` \r\n\t\t\t\tINNER JOIN {$wpdb->term_relationships} ON ({$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id) \r\n\t\t\t\tINNER JOIN {$wpdb->term_taxonomy} ON ({$wpdb->term_relationships}.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)\r\n\t\t\t\tINNER JOIN {$wpdb->terms} ON ({$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id)\r\n\t\t\t\tWHERE {$wpdb->posts}.post_status = 'publish' AND {$wpdb->posts}.post_date >= '$since'\r\n\t\t\t\tAND {$wpdb->posts}.post_type IN (\".implode(',', $post_types_escape).\")\";\r\n\t\t\t\r\n\t\t\t// Check if we are filtering the post types by hireachrical taxonomy terms\r\n\t\t\tif( isset( $options['options']['wp']['filter']['taxonomy'] ) && !empty( $options['options']['wp']['filter']['taxonomy'] ) ) {\r\n\t\t\t\t$term_ids = array_keys( $options['options']['wp']['filter']['taxonomy'] );\r\n\t\t\t\t\r\n\t\t\t\tforeach( $term_ids as $term_id ) {\r\n\t\t\t\t\t$term_ids_escape[] = '%d';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Check if we are filter the post types by non-hireachrical taxonomy terms\r\n\t\t\tif( isset($options['options']['wp']['filter']['term'] ) && !empty( $options['options']['wp']['filter']['term'] ) ) {\r\n\t\t\t\tforeach( $options['options']['wp']['filter']['term'] as $taxonomy_name=>$terms ) {\r\n\t\t\t\t\tforeach( explode( ',', $terms ) as $term ) {\r\n\t\t\t\t\t\t$the_term = get_term_by( 'slug', str_replace( ' ', '-', trim( $term ) ), $taxonomy_name );\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif( $the_term != false ) {\r\n\t\t\t\t\t\t\t$term_ids[] = $the_term->term_id;\r\n\t\t\t\t\t\t\t$term_ids_escape[] = '%d';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Append the filters to the SQL statement\r\n\t\t\tif( isset( $term_ids_escape ) && !empty( $term_ids_escape ) ) {\r\n\t\t\t\t$sql .= \"AND {$wpdb->terms}.term_id IN (\" . implode( ',', $term_ids_escape ) . \")\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$sql .= \"GROUP BY {$wpdb->posts}.ID\";\r\n\t\t\t\r\n\t\t\t$query = $wpdb->prepare( $sql, array_merge( (array) $post_types, (array) $term_ids ) );\r\n\t\t\t$results = $wpdb->get_results( $query, 'ARRAY_A' );\r\n\t\t\t\r\n\t\t\tforeach($results as $post) {\r\n\t\t\t\t$date_group = date( 'F Y', strtotime( $post['date'] ) );\r\n\t\t\t\t$post['source'] = 'wp';\r\n\t\t\t\t$posts[$date_group][] = $post;\r\n\t\t\t}\r\n\t\t\r\n\t\t\treturn $posts;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "function quasar_get_post_loop_description(){\n\tglobal $post;\n\tif(!$post) return;\n\t\n\t$summary_choice = xr_get_option('post_summary','content');//or excerpt;\n\t\n\t$return = '';\n\t\n\tif($summary_choice === 'content'){\n\t\t$return = quasar_get_the_content();\n\t}elseif($summary_choice === 'excerpt'){\n\t\t$return = rock_check_p(get_the_excerpt());\n\t\t$return .= quasar_get_read_more_link();\n\t}\n\t\n\treturn $return;\n}", "function get_random_quote($content = null) {\r\n\t//remove_all_filters('posts_orderby');\r\n\t$args = array( 'post_type' => 'quote', 'posts_per_page' => 1, 'post_status' => 'publish', 'orderby' => 'rand' );\r\n\r\n\t$quote_posts = new WP_Query( $args );\r\n\tob_start();\r\n\tif($quote_posts->have_posts()) {\r\n\t\tglobal $post;\r\n\t\t//$posts_list = array();\r\n\t\twhile($quote_posts->have_posts()): $quote_posts->the_post();\r\n\t\t\t//$posts_list[] = $post->ID;\r\n\t\t\t?>\r\n\t\t\t<div class=\"quote_of_the_day\">\r\n\t\t\t\t<p><?php echo get_the_excerpt(); ?></p>\r\n\t\t\t\t<a href=\"<?php echo get_permalink(); ?>\" class=\"more_link\">Read More</a>\r\n\t\t\t</div>\r\n\t\t\t<?php\r\n\r\n\t\tendwhile;\r\n\t\twp_reset_postdata();\r\n\t}\r\n\r\n\r\n\t$content = ob_get_clean();\r\n\treturn $content;\r\n}", "function wpb_postsbycategory() {\n// the query\n$the_query = new WP_Query( array( 'category_name' => 'announcements', 'posts_per_page' => 10 ) ); \n\n// The Loop\nif ( $the_query->have_posts() ) {\n\t$string .= '<ul class=\"postsbycategory widget_recent_entries\">';\n\twhile ( $the_query->have_posts() ) {\n\t\t$the_query->the_post();\n\t\t\tif ( has_post_thumbnail() ) {\n\t\t\t$string .= '<li>';\n\t\t\t$string .= '<a href=\"' . get_the_permalink() .'\" rel=\"bookmark\">' . get_the_post_thumbnail($post_id, array( 50, 50) ) . get_the_title() .'</a></li>';\n\t\t\t} else { \n\t\t\t// if no featured image is found\n\t\t\t$string .= '<li><a href=\"' . get_the_permalink() .'\" rel=\"bookmark\">' . get_the_title() .'</a></li>';\n\t\t\t}\n\t\t\t}\n\t} else {\n\t// no posts found\n}\n$string = '</ul>';\n\nreturn $string;\n\n/* Restore original Post Data */\nwp_reset_postdata();\n}", "function custom_loop_shortcode_get_posts($atts){\n\n // get global post variable\n global $post;\n\n // define shortcode variable\n extract(shortcode_atts(array(\n 'posts_per_page' => 5,\n 'orderby' => 'date'\n ), $atts));\n\n // define get_posts parameters\n $args = array(\n 'posts_per_page' => $posts_per_page,\n 'orderby' => $orderby\n );\n\n // get the posts\n $posts = get_posts($args);\n\n // begin output variable\n $output = '<h3>Custom Loop Example: get_posts()</h3>';\n $output .= '<ul>';\n\n // loop thru posts\n foreach($posts as $post){\n\n // prepare post data\n setup_postdata($post);\n\n // continue output\n $output .= '<li><a href=\"' . get_permalink() . '\">' . get_the_title() . '</a></li>';\n\n }\n\n // reset post data\n wp_reset_postdata();\n\n // complete output variable\n $output .= '</ul>';\n\n // return output\n return $output;\n}", "public static function posts($args) {\n\n $cache_key = md5(serialize($args));\n\n $strawberry_query = StrawberryCache::get($cache_key);\n\n if (false === $strawberry_query) {\n\n $posts_q = new WP_Query($args);\n\n if (!isset($args['thumb_size'])) {\n $args['thumb_size'] = self::$thumb_size;\n }\n\n if (!isset($args['excerpt_length'])) {\n $args['excerpt_length'] = self::$excerpt_length;\n }\n\n $x = 0;\n $arr = \"\";\n\n if (defined('WP_DEBUG') && WP_DEBUG === true) {\n echo '<div class=\"alert alert-info\">' . $posts_q->request . '</div>';\n }\n\n while ($posts_q->have_posts()) : $posts_q->the_post();\n $pid = get_the_ID();\n $content = wpautop(get_the_content($pid));\n\n $arr[$x]['ID'] = $pid;\n $arr[$x]['title'] = get_the_title($pid);\n $arr[$x]['content'] = $content;\n $arr[$x]['excerpt'] = get_the_excerpt();\n $arr[$x]['content_excerpt'] = self::crop_text($args['excerpt_length'], $content);\n //$arr[$x]['images'] = self::images($pid);\n //$arr[$x]['thumb'] = self::feature_image($pid, false);\n $arr[$x]['permalink'] = get_permalink($pid);\n $arr[$x]['meta'] = self::metas($pid);\n $arr[$x]['author'] = array('name' => get_the_author(), 'permalink' => get_the_author_link());\n $arr[$x]['date'] = strtotime(get_the_date('Y-m-d H:i:s'));\n\n if (isset($args['taxonomy']) && $args['taxonomy'] === true) {\n $arr[$x]['terms'] = self::terms($pid);\n }\n\n $x++;\n endwhile;\n\n wp_reset_postdata();\n\n StrawberryCache::time(self::$cache_time)->set($cache_key, $arr);\n return $arr;\n } else {\n return $strawberry_query;\n }\n }", "function get_related_posts($user_atts = [], $content = null, $tag = '') {\n\n $default_title = get_option('cp_related_posts_title', __('Related Posts', 'cool_plugin'));\n $default_post_amount = get_option('cp_related_posts_amount', __('Amount of related posts', 'cool_plugin'));\n\n // Default Attributes (If user makes no input)\n $default_atts = [\n 'posts_per_page' => $default_post_amount,\n 'title' => $default_title,\n ];\n \n // Combines default and user provided attributes\n $atts = shortcode_atts($default_atts, $user_atts, $tag);\n\n $current_post_id = get_the_ID();\n $category_ids = wp_get_post_terms($current_post_id, 'category', ['fields' => 'ids']);\n\n // Query includes filtering if posts that are the same as current in either ID/category\n $posts = new WP_Query([\n 'posts_per_page' => $atts['posts_per_page'],\n 'post__not_in' => [$current_post_id],\n 'category__in' => $category_ids,\n ]);\n \n $output = \"<h1>\" . $atts['title'] . \"</h1>\";\n\n if ($posts->have_posts()) {\n\n $output .= \"<ul>\";\n\n while ($posts->have_posts()) {\n $posts->the_post();\n $output .= \"<li>\";\n $output .= \"<a href='\" . get_the_permalink() . \"'>\" . get_the_title() . \"</a>\";\n $output .= ' by <a href=\"' . get_the_author_link() . '\">' . get_the_author() . '</a>';\n $output .= ' in ' . get_the_category_list(', ');\n $output .= '<br>';\n $output .= 'Posted: ' . human_time_diff(get_the_time('U')) . ' ago'; \n $output .= \"</li>\";\n }\n \n wp_reset_postdata();\n $output .= \"</ul>\";\n\n } else {\n $output .= __('No posts were found :(', 'cool_plugin');\n }\n\n return $output;\n}", "function oppen_pre_get_posts($query) {\n /*if ($_GET['infinity'] === 'scrolling' && !$query->is_category('blogg')) {\n return;\n }*/\n\n // If we're in the admin, don't modify the query\n if (is_admin()) {\n return;\n }\n\n // If we're on the front page, fetch the 3 latest blog posts\n if ($query->is_home() && $query->is_main_query()) {\n $query->set('is_category_blog', true);\n $query->set('category_name', 'blogg');\n $query->set('showposts', 3);\n return;\n }\n\n // If we're on the blog category page, increase the post\n // limit to 90 posts and order descending by date.\n if (!$query->is_home() && $query->is_category('blogg')) {\n $query->set('showposts', 9);\n $query->set('orderby', 'date');\n $query->set('order', 'desc');\n } else {\n // Otherwise, order ascending by title\n $query->set('orderby', 'title');\n $query->set('order', 'asc');\n }\n}", "function idaho_webmaster_recent_posts_func( $atts, $content = '' ) {\n\n\t\t$html = (string) '<div class=\"shortcode_recent-posts\"><div class=\"list-group\">';\n\n\t\t$params = (array) shortcode_atts( array(\n\t\t\t'heading' \t\t=> 'h4',\n 'limit' => 5\n\t\t), $atts );\n\n\t\t$args = array(\n\t\t\t'numberposts' => (int) $params['limit'],\n\t\t\t'post_status' => 'publish',\n\t\t);\n\n\t\t$recent_posts = wp_get_recent_posts( $args );\n $loop_count = 0;\n\t\tforeach ( $recent_posts as $recent ) {\n \n $loop_count++;\n $content = (string) '';\n \n if ($loop_count === 1 ) {\n $content = sprintf( '<p class=\"list-group-item-text\">%1$s</p>', wp_trim_words( $recent['post_content'], 40 ) );\n }\n \n\t\t\t$html .= sprintf('\n\t\t\t\t<a href=\"%1$s\" class=\"list-group-item\">\n <%4$s class=\"list-group-item-heading\">%2$s</%4$s>\n %3$s\n </a>',\n get_permalink( $recent['ID'] ),\n\t\t\t\tesc_attr( $recent['post_title'] ),\n\t\t\t\t$content,\n\t\t\t\ttag_escape( $params['heading'] )\n\t\t\t);\n\t\t}\n\n\t\treturn $html . '</div><a href=\"'.get_permalink( get_option( 'page_for_posts' ) ).'\" class=\"btn btn-default btn-block\">View all posts.</a></div>';\n\t}", "function query_testimonials() {\r\n\t\r\n\t// global $query;\r\n\t$args = array(\r\n\t 'post_type' => 'post',\r\n\t'category_name' => 'testimonial',\r\n\t 'order' => 'ASC'\r\n\t);\r\n\tquery_posts($args);\t\r\n}", "function emc_the_link_excerpt() {\r\n\r\n\t$title = ( get_field( 'link_title' ) ) ? get_field( 'link_title' ) : get_the_title();\r\n\t$url = ( is_single() ) ? get_field( 'link_url' ) : get_permalink();\r\n\t$source = get_field( 'source' );\r\n\t$excerpt = get_field( 'excerpt' );\r\n\r\n\tif ( ! $url ) return false; ?>\r\n\r\n\t<div class=\"emc-link\">\r\n\t\t<a href=\"<?php echo esc_url( $url ); ?>\">\r\n\t\t\t<!--<?php echo get_the_post_thumbnail( get_the_ID(), 'thumbnail' ); ?>-->\r\n\t\t\t<div class=\"emc-link-content\">\r\n\t\t\t\t<h2 class=\"emc-link-title\"><?php echo esc_html( $title ); ?></h2>\r\n\t\t\t\t<?php if(is_single()) {\r\n\t\t \techo '<div class=\"link-post-icon\"><img src=\"http://earlymath.erikson.edu/wp-content/themes/emc/img/icon-link.png\"></div>';\r\n\t\t \t}?>\r\n\t\t\t\t<div class=\"emc-link-source\"><?php echo esc_html( $source ); ?></div>\r\n\t\t\t\t<?php echo esc_html( $excerpt ); ?>\r\n\t\t\t</div>\r\n\t\t</a>\r\n\t</div><!-- .emc-link -->\r\n\r\n<?php }", "function mattu_portfolio_items_shortcode() {\n\t$loop = new WP_Query(\n\t\tarray(\n\t\t\t'post_type' => 'portfolio',\n\t\t\t'orderby' => 'date',\n\t\t\t'order' => 'ASC',\n\t\t\t'posts_per_page' => -1, // -1 shows all \n\t\t)\n\t);\n\n\t/* Check if any portfolio items were returned. */\n\tif ( $loop->have_posts() ) {\n\n\t\t/* Open an unordered list. */\n\t\t$output = '<ul class=\"portfolio-items\">';\n\n\t\t/* Loop through the portfolio items (The Loop). */\n\t\twhile ( $loop->have_posts() ) {\n\n\t\t\t$loop->the_post();\n\n\t\t\t/* Display the portfolio item title. */\n\t\t\t$output .= the_title(\n\t\t\t\t'<li><a href=\"' . get_permalink() . '\">',\n\t\t\t\t'</a></li>',\n\t\t\t\tfalse\n\t\t\t);\n\t\t\t\n\t\t}\n\n\t\t/* Close the unordered list. */\n\t\t$output .= '</ul>';\n\t}\n\n\t/* If no portfolio items were found. */\n\telse {\n\t\t$output = '<p>No Projects have been published.';\n\t}\n\n\t/* Return the portfolio items list. */\n\treturn $output;\n}", "function et_excerpt_more($more) {\n global $post;\n return '<div><a href=\"'. get_permalink($post->ID) . '\" > ... Click to View Full Post</a></div>;';\n}", "function projects_list( $request ) {\n\n\n $args = $request->get_query_params();\n\n$project_args = array(\n 'post_type' => 'project',\n 'post_status' => 'publish',\n 'posts_per_page' => 3 \n );\n\n $standard_params = array(\n 'order',\n 'orderby',\n 'author',\n 'paged',\n 'page',\n 'nopaging',\n 'posts_per_page',\n 's',\n );\n\n\n foreach ( $standard_params as $standard_param ) {\n if ( isset( $args[ $standard_param ] ) && ! empty( $args[ $standard_param ] ) ) {\n $project_args[ $standard_param ] = $args[ $standard_param ];\n }\n }\n\n \n $the_query = new WP_Query( $project_args );\n\n\n $return = array(\n 'total' => (int) $the_query->found_posts,\n 'count' => (int) $the_query->post_count,\n 'pages' => (int) $the_query->max_num_pages,\n 'posts_per_page' => (int) $project_args['posts_per_page'],\n 'query_args' => $project_args,\n 'featured' => empty($args) ? get_slider_projects() : '',\n 'project' => array(),\n );\n\n\n if ( $the_query->have_posts() ):\n\n $i = 0;\n\n while ( $the_query->have_posts() ):\n $the_query->the_post();\n\n $title = get_the_title();\n $body = get_the_content();\n \n $size = !empty($project_args['s']) ? 'medium' : 'thumbnail';\n $thumbnail = get_post_thumbnail_id( get_the_ID());\n if ( empty( $thumbnail ) ) {\n $thumbnail = false;\n } else {\n $thumbnail = wp_get_attachment_image_src( $thumbnail, $size );\n if ( is_array( $thumbnail ) ) {\n $thumbnail = array(\n 'src' => $thumbnail[0],\n 'width' => $thumbnail[1],\n 'height' => $thumbnail[2],\n );\n }\n }\n\n \n $date = get_the_date();\n\n $fields = get_fields(get_the_ID());\n $comments_query = new WP_Comment_Query;\n\n foreach( $fields as $k => $v){\n \n $comments = $comments_query->query(['post_id' => get_the_ID(), 'status' => 'approve', 'post_type' => 'project']);\n \n $return['project'][$i]['id'] = get_the_ID(); \n $return['project'][$i]['comments'] = count($comments); \n $return['project'][$i]['title'] = $title; \n $return['project'][$i]['body'] = $body; \n $return['project'][$i]['created'] = $date; \n $return['project'][$i]['thumbnail'] = $thumbnail; \n\n $return['project'][$i][$k] = get_field($k, get_the_ID());\n\n }\n\n $i ++;\n \n endwhile;\n \n wp_reset_postdata();\n \n endif;\n\n$response = new WP_REST_Response( $return );\n$response->header( 'Access-Control-Allow-Origin', apply_filters( 'access_control_allow_origin', '*' ) );\n$response->header( 'Cache-Control', 'max-age=' . apply_filters( 'api_max_age', WEEK_IN_SECONDS ) );\nreturn $response;\n\n}", "function get_the_content($more_link_text = \\null, $strip_teaser = \\false, $post = \\null)\n {\n }", "function monaco_child_get_the_excerpt($content) {\n global $post;\n $link = '<a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> ' . __('[Read the full article...]', 'patrick') . '</a>';\n return preg_replace('/\\[.*\\]$/', '', $content) . $link;\n}", "private function getPosts(){\n $posts = DB::connection('mysql')->select('\n SELECT e.title, eu.titleURL, e.teaser, Date_Format(e.publishAt, \"%b %e, %Y\") AS publishDate,\n c.name AS categoryName, cu.name AS categoryURL,\n count(distinct(ed.id)) AS discussionCount,\n fsp.squareURL AS imageURL, fsp.title AS imageTitle,\n group_concat(DISTINCT concat(\"<a href=\\'/category/\", cu.name ,\"\\'>\", c.name, \"</a>\")) AS categoryNames\n FROM entries e\n INNER JOIN entryurls eu ON eu.entryId = e.id AND eu.isActive = 1 AND eu.deletedAt IS NULL\n LEFT JOIN entrycategories ec ON ec.entryId = e.id AND ec.deletedAt IS NULL\n LEFT JOIN categories c ON c.id = ec.categoryId\n LEFT JOIN categoryurls cu ON cu.categoryId = c.id AND cu.isActive = 1 AND cu.deletedAt iS NULL\n LEFT JOIN entrydiscussions ed ON ed.entryId = e.id AND ed.deletedAt IS NULL\n LEFT JOIN entryflickrsets efs ON efs.entryId = e.id AND efs.deletedAt IS NULL\n LEFT JOIN flickrsets fs ON fs.id = efs.flickrSetId AND fs.deletedAt IS NULL\n LEFT JOIN flickrcollections fc ON fc.id = fs.flickrCollectionid AND fc.deletedAt IS NULL\n LEFT JOIN flickrsetphotos fsp ON fsp.flickrSetId = fs.id AND fsp.deletedAt IS NULL\n WHERE e.deletedAt IS NULL\n GROUP BY e.id\n ORDER BY e.publishAt desc\n LIMIT 10');\n\n return $posts;\n }", "function MyPosts() {\n\n\n\t// Ici je définis mes arguments\n\t$args = array(\n\t\t\t\t//\t'category__in' => array(1,2), // Publiés\n\t\t\t\t\t'post_type' \t\t=> 'project',\t\t// Type de post\n\t\t\t\t\t'post_status' => 'publish', // Publiés\n\t\t\t\t\t'orderby' => 'date', // Ordonnée par date\n\t\t\t\t\t'order' => 'ASC' // + grand au + petit\n\t\t\t\t);\n\t// J'effectue la requête\n\t$the_query = new WP_query ($args);\n\n\t// Je récupère mon template\n\t$i = 0;\n\twhile ( $the_query->have_posts() ) : $the_query->the_post();\n\t\trequire(TEMPLATEPATH.'/template-parts/loop-home.php');\n\t\t$i++;\n\tendwhile;\n\n\t// Je reste mes requêtes de post\n\twp_reset_postdata();\n}", "function et_excerpt_more($more) {\n global $post;\n return '<div class=\"view-full-post\"><a href=\"'. get_permalink($post->ID) . '\" class=\"view-full-post-btn\">Skaityti</a></div>';\n}", "function barjeel_excerpt($more) {\n global $post;\n return '&nbsp; &nbsp;<a href=\"'. get_permalink($post->ID) . '\">...Continue Reading</a>';\n}", "public function related_posts() {\n\t\tglobal $post;\n\t\t$cats = wp_get_object_terms(\n\t\t\t$post->ID,\n\t\t\t'category',\n\t\t\tarray(\n\t\t\t\t'fields' => 'ids',\n\t\t\t)\n\t\t);\n\t\t$args = array(\n\t\t\t'posts_per_page' => 3,\n\t\t\t'cat' => $cats,\n\t\t\t'orderby' => 'date',\n\t\t\t'ignore_sticky_posts' => true,\n\t\t\t'post__not_in' => array( $post->ID ),\n\t\t);\n\t\t$allowed_html = array(\n\t\t\t'br' => array(),\n\t\t\t'em' => array(),\n\t\t\t'strong' => array(),\n\t\t\t'i' => array(\n\t\t\t\t'class' => array(),\n\t\t\t),\n\t\t\t'span' => array(),\n\t\t);\n\n\t\t$loop = new WP_Query( $args );\n\t\tif ( $loop->have_posts() ) :\n\t\t\t?>\n\t\t\t<div class=\"section related-posts\">\n\t\t\t\t<div class=\"container\">\n\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t<div class=\"col-md-12\">\n\t\t\t\t\t\t\t<h2 class=\"hestia-title text-center\"><?php echo apply_filters( 'hestia_related_posts_title', esc_html__( 'Related Posts', 'hestia' ) ); ?></h2>\n\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\twhile ( $loop->have_posts() ) :\n\t\t\t\t\t\t\t\t\t$loop->the_post();\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<div class=\"col-md-4\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"card card-blog\">\n\t\t\t\t\t\t\t\t\t\t\t<?php if ( has_post_thumbnail() ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"card-image\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"<?php the_permalink(); ?>\" title=\"<?php the_title_attribute(); ?>\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php the_post_thumbnail( 'hestia-blog' ); ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\t\t\t\t\t\t\t<h6 class=\"category text-info\"><?php echo hestia_category( false ); ?></h6>\n\t\t\t\t\t\t\t\t\t\t\t\t<h4 class=\"card-title\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"blog-item-title-link\" href=\"<?php echo esc_url( get_permalink() ); ?>\" title=\"<?php the_title_attribute(); ?>\" rel=\"bookmark\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php echo wp_kses( force_balance_tags( get_the_title() ), $allowed_html ); ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t</h4>\n\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"card-description\"><?php echo wp_kses_post( get_the_excerpt() ); ?></p>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\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<?php endwhile; ?>\n\t\t\t\t\t\t\t\t<?php wp_reset_postdata(); ?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<?php\n\t\tendif;\n\t}", "function tutsplus_featured_posts() {\n\t$args = array(\n\t\t'category_name' => 'featured',\n\t\t'posts_per_page' => 6\n\t);\n\t\n\t$query = new WP_query ( $args );\n\t\n\tif ( $query->have_posts() ) {\n\t\n\t echo '<section class=\"widget\">';\n\t \t\n\t \techo '<h3>Featured Posts</h3>';\n\t \t\n\t \techo '<ul>';\n\t \n\t \twhile ( $query->have_posts() ) : $query->the_post();\n\t \n\t \t\t//contents of loop\n\t \t\techo '<li><a href=\"' . get_the_permalink() . '\">' . get_the_title() . '</a></li>';\n\t \n\t \tendwhile;\n\t \n\t \trewind_posts();\n\t \techo '</ul>';\n\t \n\t echo '</section>';\n\t \n\t}\t\n\t\n}", "function dt_sc_blog_related_post( $attrs, $content = null ){\n\t\textract( shortcode_atts( array(\n\t\t\t'id' => '',\n\t\t\t'post_class' => '',\n\t\t\t'post_style' => '',\n\t\t), $attrs ) );\n\n\t\t$cats = wp_get_post_categories($id);\n\n\t\t$args = array(\n\t\t\t'category__in'\t\t\t=> $cats,\n\t\t\t'ignore_sticky_posts'\t=> true,\n\t\t\t'no_found_rows'\t\t\t=> true,\n\t\t\t'post__not_in'\t\t\t=> array( $id ),\n\t\t\t'posts_per_page'\t\t=> 3,\n\t\t\t'post_status'\t\t\t=> 'publish');\n\n\t\t$hide_post_format = classymissy_option('pageoptions','post-format-meta'); \n\t\t$hide_post_format = isset( $hide_post_format )? \"yes\" : \"\";\n\t\n\t\t$hide_author_meta = classymissy_option('pageoptions','post-author-meta');\n\t\t$hide_author_meta = isset( $hide_author_meta ) ? \"yes\" : \"\";\n\t\n\t\t$hide_date_meta = classymissy_option('pageoptions','post-date-meta');\n\t\t$hide_date_meta = isset( $hide_date_meta ) ? \"yes\" : \"\";\t\n\n\t\t$hide_comment_meta = classymissy_option('pageoptions','post-comment-meta');\n\t\t$hide_comment_meta = isset( $hide_comment_meta ) ? \"yes\" : \"\";\n\n\t\t$hide_category_meta = classymissy_option('pageoptions','post-category-meta');\n\t\t$hide_category_meta = isset( $hide_category_meta ) ? \"yes\" : \"\";\n\t\n\t\t$hide_tag_meta = classymissy_option('pageoptions','post-tag-meta');\n\t\t$hide_tag_meta = isset( $hide_tag_meta ) ? \"yes\" : \"\";\n\n\t\t$allow_excerpt = classymissy_option('pageoptions','post-archives-enable-excerpt');\n\t\t$allow_excerpt = isset( $allow_excerpt ) ? \"yes\" : \"no\";\n\t\t$excerpt_length = classymissy_option('pageoptions','post-archives-excerpt');\n\t\n\t\t$allow_read_more = classymissy_option('pageoptions','post-archives-enable-readmore');\n\t\t$allow_read_more = isset( $allow_read_more ) ? \"yes\" : \"no\";\n\t\t$read_more = classymissy_option('pageoptions','post-archives-readmore');\n\n\t\t$out = '';\n\n\t\t$the_query = new WP_Query( $args );\n\t\tif( $the_query->have_posts() ) {\n\t\t\t$i = 1;\n\n\t\t\t$out .= '<div class=\"dt-sc-hr-invisible-small\"></div>';\n\t\t\t$out .= '<div class=\"dt-sc-clear\"></div>';\n\t\t\t$out .= '<section class=\"related-post\">';\n\t\t\t$out .= \t'<h4>'.esc_html__('Related posts','classymissy-core').'</h4>';\n\n\t\t\twhile ( $the_query->have_posts() ){\n\t\t\t\t$the_query->the_post();\n\n\t\t\t\t$temp_class = \"\";\n\t\t\t\tif($i == 1) $temp_class = $post_class.\" first\"; else $temp_class = $post_class;\n\t\t\t\tif($i == 3 ) $i = 1; else $i = $i + 1;\n\n\t\t\t\t$the_id = get_the_id();\n\t\t\t\t$out .= '<div class=\"'.esc_attr($temp_class).'\">';\n\t\t\t\t\t\t\t$sc = '[dt_sc_post id=\"'.$the_id.'\" style=\"'.$post_style.'\" allow_excerpt=\"'.$allow_excerpt.'\" excerpt_length=\"'.$excerpt_length.'\" show_post_format=\"'.$hide_post_format.'\" show_author=\"'.$hide_author_meta.'\" show_date=\"'.$hide_date_meta.'\" show_comment=\"'.$hide_comment_meta.'\" show_category=\"'.$hide_category_meta.'\" show_tag=\"'.$hide_tag_meta.'\"]';\n\t\t\t\t\t\t\t$sc .= $read_more;\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$sc .= '[/dt_sc_post]';\n\t\t\t\t$out .= do_shortcode($sc);\n\t\t\t\t$out .= '</div>';\n\t\t\t}\n\t\t\t$out .= '</section>';\n\t\t}\n\n\t\treturn $out;\n\t}", "public function featured_q_display() {\n\t\t// Build the output to return for use by the shortcode.\n\t\tob_start();\n\n\t\t$args = array(\n\t\t\t'posts_per_page' => 1,\n\t\t\t'post_type' => 'post',\n\t\t\t'tax_query' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t'field' => 'slug',\n\t\t\t\t\t'terms' => 'featured-q',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$my_posts = new WP_Query( $args );\n\n\t\tif ( $my_posts->have_posts() ) : while( $my_posts->have_posts() ) : $my_posts->the_post();\n\t\t?>\n\t\t\t<div class=\"nested-halves\">\n\t\t\t\t<div class=\"nested-one\">\n\t\t\t<h1 class=\"blog-title\"><a href=\"<?php the_permalink(); ?>\" class=\"crimson\"><?php echo get_the_title(); ?></a></h1>\n\t\t\t<p class=\"blog-excerpt\"><?php echo wp_trim_words( get_the_excerpt(), 72, '...' ); ?></p>\n\t\t\t<p class=\"rmore\"><a href=\"<?php the_permalink(); ?>\">Read more</a></p>\n\t\t</div>\n\t\t\t<div class=\"nested-two\">\n\t\t\t<?php echo get_the_post_thumbnail( $post_id, 'spine-large_size'); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php endwhile; endif;\n\n\t\twp_reset_query();\n\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\n\t\treturn $content;\n\t}", "function new_excerpt_more($more) {\n global $post;\n\treturn '<p><a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> Read More</a></p>';\n}", "function tcsn_recentpost_sc( $atts, $content = null ) {\n extract ( shortcode_atts( array(\n\t\t'title' => '',\n\t\t'thumbnail'\t=> '',\n\t\t'excerpt' => '',\n\t\t'date' \t=> '',\n\t\t'limit' => -1,\n\t\t'order' => '',\n\t\t'orderby' => '',\n\t\t'cat'\t => '',\n\t), $atts ) );\n\n\t$cat = str_replace(' ','-',$cat);\n\t \n\tglobal $post;\n\t$args = array(\n\t\t'post_type' => '',\n\t\t'posts_per_page' => esc_attr( $limit ),\n\t\t'order' => esc_attr( $order ), \n\t\t'orderby' => $orderby,\n\t\t'post_status' => 'publish',\n\t\t'category_name' => $cat, \n\t);\n\n\tquery_posts( $args );\n\t$output = '';\n\tif( have_posts() ) : \n\t\t$output .= '<div class=\"recentpost-carousel wpb_custom_element\">';\n\t\twhile ( have_posts() ) : the_post();\n\t\t\t$output .= '<div class=\"item clearfix\">';\n\t\t\t$permalink\t\t= get_permalink();\n\t\t\t$thumb \t\t= get_post_thumbnail_id(); \n\t\t\t$img_url \t\t= wp_get_attachment_url( $thumb, 'full' ); \n\t\t\t$image \t= aq_resize( $img_url, 350, 220, true );\n\t\t\t$thumb_title\t= get_the_title();\t\n\n\t\t\t// thumbnail\n\t\t\tif( $thumbnail !== 'yes' ):\n\t\t\t\tif( has_post_thumbnail() ) { \n\t\t\t\t\t$output .= '<a href=\"' . $permalink . '\" rel=\"bookmark\"><img src=\"' . $image . '\" alt=\"' . $thumb_title . '\"/></a>';\n\t\t\t\t} \n\t\t\tendif;\t\n\t\t\t\n\t\t\t// title\n\t\t\tif( $title !== 'yes' ):\n\t\t\t\t$output .= '<h4 class=\"recentpost-heading\"><a href=\"' . $permalink . '\" rel=\"bookmark\">' . get_the_title() . '</a></h4>';\n\t\t\tendif;\t\n\t\t\tif( $date !== 'yes' ):\n\t\t\t\t$output .= '<span class=\"recentpost-date\">' . get_the_date() . '</span>';\n\t\t\tendif;\t\n\t\t\t// excerpt\n\t\t\tif($excerpt!=='yes'):\t\n\t\t\t\t$output .= '<div class=\"recentpost-excerpt\">';\n\t\t\t\t$content = get_the_excerpt();\n\t\t\t\t$content = wp_trim_words( $content , '35' );\n\t\t\t\t$content = str_replace( ']]>', ']]&gt;', $content );\n\t\t\t\t$output .= $content;\n\t\t\t\t$output .= '<a href=\"' . $permalink . '\" rel=\"bookmark\" class=\"link-underline\">Read More</a>';\n\t\t\t\t$output .= '</div>';\n\t\t\tendif;\t\n\n\t\t\t$output .= '</div>';\n\t\tendwhile;\n\t\t$output .= '</div>';\n\t\twp_reset_query();\n\tendif;\n\treturn $output;\n}", "function display_brand_articles(){\n $args = array(\n 'post_type' => 'brand_articles',\n 'posts_per_page' => '21',\n 'publish_status' => 'published',\n );\n \n $query = new WP_Query($args);\n \n if($query->have_posts()){\n \n $result .='<div class=\"owl-carousel brand-article-wrapper\">';\n \n while($query->have_posts()) :\n $query->the_post() ;\n \n $thumb = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), \"full\" );\n \n $result .= '<a href=\"'.get_the_permalink().'\"><div class=\"brand-article-item\">';\n $result .= '<div class=\"brand-article-thumbnail\" style=\"background-image: url('. $thumb[0] . ')\"> </div>';\n $result .= '<h3 class=\"brand-article-title\">' . get_the_title() . '</h3>';\n $result .= '<span class=\"brand-article-auth\"> by ' . get_the_author() . '</span>'; \n $result .= '</div></a>';\n \n endwhile;\n \n $result .= \"</div>\";\n \n wp_reset_postdata();\n }else{\n $result = \"<p>Sorry, No posts yet.</p>\";\n }\n \n return $result;\n}", "public function get_content( $post, $args ) {\n\n\n\t\t$default_args = array(\n\t\t\t'use_excerpt' => false,\n\t\t\t'create_excerpt' => false,\n\t\t\t'apply_filters' => true,\n\t\t\t'length' => 50,\n\t\t\t'link' => get_permalink( $post->ID ),\n\t\t\t'trailing' => array(),\n\t\t\t'read_more' => true,\n\t\t\t'get_thumbnail' => false,\n\t\t\t'thumb_size' => null,\n\t\t\t'thumb_caption' => null,\n\t\t\t'thumb_align' => null,\n\t\t\t'use_words' => true\n\t\t);\n\t\t$args = array_merge($default_args, $args);\n\t\textract($args);\n\n\t\tif ( $create_excerpt )\n\t\t{\n\t\t\tif ( isset($this->params['description_length']) )\n\t\t\t\t$excerpt_length = $this->params['description_length'];\n\t\t\telse\n\t\t\t\t$excerpt_length = $length;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// use the full length content\n\t\t\t$excerpt_length = 0;\n\t\t}\n\n\t\tif ( $get_thumbnail ) {\n\t\t\t$thumb_args = array(\n\t\t\t\t'thumb_size' => $thumb_size,\n\t\t\t\t'thumb_caption' => $thumb_caption,\n\t\t\t\t'thumb_align' => $thumb_align,\n\t\t\t\t'thumb_link' => $link\n\t\t\t);\n\t\t\t$content = $this->get_thumbnail( $post, $thumb_args );\n\t\t}\n\n\t\tif ( $use_excerpt )\n\t\t\t$content .= $post->post_excerpt;\n\t\telse\n\t\t\t$content .= $post->post_content;\n\n\t\tif ( $apply_filters )\n\t\t\t$content = apply_filters('the_content', $content);\n\n\t\t$desc_array = array(\n\t\t\t'text' => $content,\n\t\t\t'length' => $excerpt_length,\n\t\t\t'link' => $link,\n\t\t\t'read_more' => $read_more,\n\t\t\t'trailing' => $trailing,\n\t\t\t'use_words' => $use_words\n\t\t);\n\n\t\treturn kickpress_the_excerpt($desc_array);\n\t}", "function get_custom_posts($post_type){\n //Get the number of all posts that are published\n $count_posts = wp_count_posts( $post_type )->publish;\n //Define the arguments for WP_Query\n $args = array('post_type'=> $post_type,\n 'posts_per_page' =>$count_posts,\n 'orderby' => 'post_id',\n 'order' => 'asc'\n );\n //Construct the WP object with the past arguments\n $custom_posts = new WP_Query($args);\n return $custom_posts;\n}", "function ideja_query($atts) {\n\n $a = shortcode_atts( array(\n 'tip' => 'kuca'\n ), $atts );\n\n $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;\n\n\t$args = array(\n \t\t\t\t\t'post_type' \t\t => array('nekretnine','gallery','attachment'),\n \t\t\t\t\t'post_status' \t\t=> 'publish',\n \t\t\t\t\t'posts_per_page' \t=> '8',\n 'paged' => $paged,\n 'meta_key' => 'tip',\n \t 'meta_value' => $a['tip']\n );\n\n $posts = new WP_Query($args);\n\n // Pagination fix\n $temp_query = $wp_query;\n $wp_query = NULL;\n $wp_query = $posts;\n\n\n\t?>\n\n <div class=\"container\">\n <div class=\"row\">\n\n <?php\n\n if($posts->have_posts()):\n while($posts->have_posts()):$posts->the_post();\n\n $nekretnine_slika = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );\n $nekretnine_meta = get_post_custom($post->ID);\n $tip_oglasa = $nekretnine_meta['tip_oglasa'][0];\n $nekretnine_status = $nekretnine_meta['status'][0];\n $nekretnine_cijena = $nekretnine_meta['cijena'][0];\n\n ?>\n\n <!-- Start Nekretnina Card -->\n <div class=\"col-xs-12 col-sm-12 col-md-3 col-lg- 3\">\n <div class=\"card\">\n <div class=\"row\">\n\n <!-- START Nekretnina image -->\n <div class=\"col-xs-5 col-sm-5 col-md-12 col-lg-12\">\n\n <a class=\"nekretnina-img-a\" href=\"<?php the_permalink(); ?>\">\n\n <?php if ($nekretnine_status) : ?>\n <div class=\"ribbon\"><span><?php echo $nekretnine_status; ?></span></div>\n <?php endif; ?>\n\n <?php if ($nekretnine_slika) : ?>\n <img class=\"nekretnina-img\" src=\"<?php echo $nekretnine_slika; ?>\" alt=\"\"/>\n <?php endif; ?>\n\n </a>\n\n </div>\n <!-- END Nekretnina image -->\n\n <!-- START Nekretnina text area -->\n <div class=\"col-xs-7 col-sm-7 col-md-12 col-lg-12\">\n <div class=\"nekretnina-card-text\">\n\n <h3><a href=\"<?php the_permalink(); ?>\"><?php echo the_title(); ?></a></h3>\n <span class=\"objavljeno hidden-xs\"><i class=\"fa fa-clock-o fa-lg\"></i>&nbsp;&nbsp; <?php echo the_time('d. m. Y.'); ?>&nbsp;&nbsp;</span>\n <?php if($tip_oglasa) : ?><span class=\"label label-danger\"><?php echo $tip_oglasa; ?></span><?php endif; ?>\n\n <div class=\"hidden-xs hidden-sm\">\n <p>\n <?php echo get_the_excerpt(); ?>\n </p>\n </div>\n\n </div><!--card-text-->\n </div><!--col-->\n\n <!-- START Nekretnina action area -->\n <div class=\"nekretnina-card-action\">\n\n <span class=\"objavljeno hidden-md hidden-lg\"><i class=\"fa fa-clock-o fa-lg\"></i> <?php echo the_time('d. m. Y.'); ?></span>\n\n <?php\n\n if($nekretnine_cijena && $nekretnine_cijena !== '0.00') {\n\n echo '<span class=\"cijena\"><i class=\"fa fa-money\"></i> ' . number_format($nekretnine_cijena, 2) . 'KM</span>';\n\n } else {\n ?>\n <a href=\"mailto:[email protected]\" class=\"btn btn-danger btn-xs\" role=\"button\">\n <?php echo 'Cijena: po dogovoru'; ?>\n </a>\n <?php\n }\n ?>\n </div><!-- / card action -->\n </div><!-- / row -->\n </div><!-- / card col -->\n </div><!-- /col -->\n <!-- END Nekretnina card -->\n\n <?php $counter++;\n if ($counter % 4 == 0) {\n echo '</div><div class=\"row\">';\n }\n\n endwhile; ?>\n\n </div>\n\n <?php else:\n\n get_template_part( 'template-parts/content', 'none' );\n\n\n endif; ?>\n\n\n\n <?php\n\n // Custom query loop pagination\n echo ideja_paginacija($paged, $posts);\n\n // Reset postdata\n wp_reset_postdata();\n\n // Reset main query object\n $wp_query = NULL;\n $wp_query = $temp_query;\n\n ?>\n\n </div><!-- /.row -->\n </div><!-- .container -->\n\n<?php\n\n}", "function grve_print_recent_portfolio_items() {\n\n\t$exclude_ids = array( get_the_ID() );\n\t$args = array(\n\t\t'post_type' => 'portfolio',\n\t\t'post_status'=>'publish',\n\t\t'post__not_in' => $exclude_ids ,\n\t\t'posts_per_page' => 3,\n\t\t'paged' => 1,\n\t);\n\n\n\t$query = new WP_Query( $args );\n\n\tif ( $query->have_posts() && $query->found_posts > 1 ) {\n?>\n\t<div class=\"grve-related-post\">\n\t\t<h5 class=\"grve-related-title\"><?php _e( 'Recent Entries', GRVE_THEME_TRANSLATE ); ?></h5>\n\t\t<ul>\n\n<?php\n\n\t\tif ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post();\n\t\t\techo '<li>';\n\t\t\tget_template_part( 'templates/portfolio', 'recent' );\n\t\t\techo '</li>';\n\t\tendwhile;\n\t\telse :\n\t\tendif;\n?>\n\t\t</ul>\n\t</div>\n<?php\n\t\twp_reset_postdata();\n\t}\n}", "function voyage_mikado_get_blog_query() {\n global $wp_query;\n\n $id = voyage_mikado_get_page_id();\n $category = esc_attr(get_post_meta($id, \"mkdf_blog_category_meta\", true));\n if(esc_attr(get_post_meta($id, \"mkdf_show_posts_per_page_meta\", true)) != \"\") {\n $post_number = esc_attr(get_post_meta($id, \"mkdf_show_posts_per_page_meta\", true));\n } else {\n $post_number = esc_attr(get_option('posts_per_page'));\n }\n\n $paged = voyage_mikado_paged();\n $query_array = array(\n 'post_type' => 'post',\n 'paged' => $paged,\n 'cat' => $category,\n 'posts_per_page' => $post_number\n );\n if(is_archive()) {\n $blog_query = $wp_query;\n } else {\n $blog_query = new WP_Query($query_array);\n }\n\n return $blog_query;\n\n }", "function otm_show_featured_posts() {\n\n\t$my_query = new WP_Query( array( \n\t\t'meta_key' \t\t\t\t=> 'is_featured',\n\t\t'post_type'\t\t\t\t=> 'post',\n\t\t'meta_value'\t\t\t=> true,\n\t\t'numberposts' \t\t=> 3\n\t) );\n\n\t// If our query has posts\n\tif ( $my_query->have_posts() ) :\n\t\twhile ( $my_query->have_posts() ) : $my_query->the_post();\n\n\t\t\t// Get specific template-part\n\t\t\tget_template_part( 'template-parts/post/content-featured' );\n\n\t\tendwhile;\n\tendif;\n\n\twp_reset_query();\n}", "function quasar_frontend_init(){\n\tadd_post_type_support( 'post', 'excerpt');\n}", "function new_excerpt_more($more) {\n global $post;\n return '<a class=\"post-link\" href=\"'. get_permalink($post->ID) . '\"> ...Read the full article</a>';\n}", "function the_excerpt()\n {\n }", "public function query_posts()\n {\n }", "function fzproject_function($type = 'fzproject_function')\n{\n $args = array(\n 'post_type' => 'fzproject_post',\n 'posts_per_page' => 20\n );\n \n $result = '<section id=\"options\" class=\"clearfix\">';\n \n $terms = get_terms(\"fzproject_categories\");\n $count = count($terms);\n \n if ($count > 0) {\n $result .= '<ul id=\"filters\" class=\"option-set clearfix\" data-option-key=\"filter\">\n\t\t <li><a href=\"#filter\" data-option-value=\"*\" class=\"selected\">show all</a></li>';\n \n foreach ($terms as $term) {\n $result .= '<li><a href=\"#filter\" data-option-value=\".' . $term->slug . '\">' . $term->name . '</a></li>'; \n }\n $result .= '</ul></section> <!-- #options -->';\n }\n \n $result .= '<div id=\"containerk\" class=\"containersmall clearfix\">';\n \n //the loop \n $loop = new WP_Query($args);\n while ($loop->have_posts()) {\n $loop->the_post();\n\t\n\t// thumbnail url\n $the_url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );\n \n\t// url to single post\n\t$source = get_post_meta(get_the_ID(), 'source', true);\n\t\t\n\t// get title of current post\n $title = get_post($post->ID)->post_title;\n\n $terms = get_the_terms($post->ID, 'fzproject_categories');\n \n\t// looping slug for class\n $result .= '<a href=\"' . $source . '\"><div class=\"element ';\n foreach ($terms as $term) {\n $result .= ' ' . $term->slug;\n }\n \n $result .= '\" data-symbol=\"Hg\" data-category=\"';\n \n\t// looping slug for data category\n foreach ($terms as $term) {\n $result .= ' ' . $term->slug;\n }\n \n \n $result .= '\" style=\"background-image:url(\\'' . $the_url . '\\')\">\n\n <p class=\"weight\">' . $title . '</p>\n </div></a>';\n }\n $result .= '</div> <!-- #container -->';\n return $result;\n}", "function get_the_excerpt($post = \\null)\n {\n }", "function add_shortcode_for_our_plugin ($attr , $content = null ){\n\t\textract(shortcode_atts(array(\n\t\t\t'post_type'=>'post',\n\t\t\t'posts_per_page'=>2,\n\t\t\t\n\t\t\t\n\t\t\n\t\t), $attr,'our_shortcode' ));\n\t\n\t$query = new WP_Query(array(\n\t\t'post_type'=>$post_type,\n\t\t'posts_per_page'=>$posts_per_page,\n\t\n\t));\n\t\n\tif($query->have_posts()):\n\t\t$output = '<div class=\"recent_posts\"><ul>';\n\t\t$i=0;\n\t\twhile($query->have_posts()){\n\t\t\t\n\t\t\t$query->the_post();\n\t\t\tif($i == 0):\n\t\t\t$output .= '<li><a href=\"'.get_the_permalink().'\" style=\"color:red;\" >'.get_the_title().'</a></li>';\n\t\t\telse:\n\t\t\t$output .= '<li><a href=\"'.get_the_permalink().'\">'.get_the_title().'</a></li>';\n\t\t\tendif;\n\t\t\t\n\t\t\t\n\t\t$i++; }\n\t\twp_reset_postdata();\n\t$output .= '</ul></div>';\n\treturn $output;\n\telse:\n\t return 'no post found';\n\t\n\tendif;\n\t\n\t\n\t\n\t\n\t\n\t\n}", "function getPageDescription() {\n global $wp_query,\n $post;\n\n $description = get_bloginfo( 'description' );\n\n // single / page\n if( ( is_single() || is_page() ) && !is_front_page() ) {\n $_description = $post->post_content;\n\n // try fetching first text blocks\n if( function_exists( 'get_field' ) ) {\n if( $blocks = get_field( 'blocks', $post->ID ) ) {\n for( $i = 0; $i < count( $blocks ); $i++ ) {\n if( $blocks[$i]['acf_fc_layout'] === 'text' ) {\n $_description = $blocks[$i]['text'];\n break;\n }\n }\n }\n }\n\n if( function_exists( 'get_field' ) ) {\n if( get_field( 'linkpreview--description', $post->ID ) ) {\n $_description = get_field( 'linkpreview--description', $post->ID );\n }\n }\n\n $description = ( !empty( $_description ) ) ? $_description : $description;\n }\n\n // custom taxonomy terms\n if( !empty( $wp_query->query_vars['term'] ) ) {\n $term = get_term_by( 'slug', $wp_query->query_vars['term'], $wp_query->query_vars['taxonomy'] );\n if( $term ) {\n $description = ( !empty( $term->description ) ) ? $term->description : $description;\n }\n }\n\n // tags\n if( is_tag() ) {\n $tag = get_term_by( 'slug', $wp_query->query['tag'], 'post_tag' );\n if( $tag ) {\n $description = ( !empty( $tag->description ) ) ? $tag->description : $description;\n }\n }\n\n // category\n if( is_category() ) {\n $category = get_term_by( 'slug', $wp_query->query['category_name'], 'category' );\n if( $category ) {\n $description = ( !empty( $category->description ) ) ? $category->description : $description;\n }\n }\n\n // author\n if( !empty( $wp_query->query['author_name'] ) ) {\n $author = get_user_by( 'slug', $wp_query->query['author_name'] );\n if( $author ) {\n $biography = get_the_author_meta( 'description', $author->ID );\n $description = ( !empty( $biography ) ) ? $biography : $description;\n }\n }\n\n return wp_trim_words( $description, 115, null );\n}", "function cah_news_display_post($post, $dept=0) {\r\n if (!is_object($post)) {\r\n return;\r\n }\r\n\r\n $title = $post->title->rendered;\r\n $excerpt = cah_news_excerpt($post->excerpt->rendered);\r\n \r\n $link = $post->link;\r\n if ($dept) {\r\n $link = add_query_arg(['dept' => $dept], $link);\r\n }\r\n $link = esc_url($link);\r\n \r\n $date = date_format(date_create($post->date), 'F d, Y');\r\n $thumbnail = '';\r\n // // $thumbnail = $post.embedded.{'wp:featuredmedia'}.media_details.sizes.thumbnail.source_url;\r\n if (isset($post->_embedded->{'wp:featuredmedia'}[0]->media_details->sizes->thumbnail->source_url))\r\n {\r\n $thumbnail = $post->_embedded->{'wp:featuredmedia'}[0]->media_details->sizes->thumbnail->source_url;\r\n }\r\n\t\r\n\t// Looking to see if it links to an outside page\r\n\t$links_to = (bool) get_post_meta( $post->id, '_links_to', true );\r\n\t$links_to_target = (bool) get_post_meta( $post->id, '_links_to_target', true) == \"_blank\";\r\n\r\n ?>\r\n\r\n <a class=\"cah-news-item\" href=\"<?=$link?>\"<?= $links_to && $links_to_target ? 'target=\"_blank\" rel=\"noopener\"' : ''?>>\r\n <div class=\"media py-3 px-2\">\r\n <?\r\n if ($thumbnail) {\r\n echo '<img data-src=\"' . $thumbnail . '\" class=\"d-flex align-self-start mr-3\" aria-label=\"Featured image\">';\r\n echo '<noscript><img src=\"' . $thumbnail . '\" width=\"150\" height=\"150\" class=\"d-flex align-self-start mr-3\" aria-label=\"Featured image\"></noscript>';\r\n }\r\n else {\r\n echo '<input type=\"hidden\" value=\"' . get_the_post_thumbnail_url( $post->ID ) . '\">';\r\n }\r\n ?>\r\n <div class=\"media-body\">\r\n <h5 class=\"mt-0\"><?=$title?></h5>\r\n <p>\r\n <span class=\"text-muted\"><?=$date?>&nbsp;</span>\r\n <span class=\"cah-news-item-excerpt\"><?=$excerpt?></span>\r\n </p>\r\n </div>\r\n </div>\r\n </a>\r\n <?\r\n}", "function dm_solution_news_shortcode($atts, $content = null) {\n\tglobal $post;\n\textract(shortcode_atts(array(\n\t\t'post_id' => ($post ? $post->ID : ''),\n\t\t'title' => \"In the News\",\n\t\t'limit' => 1,\n\t), $atts));\n\n\tif (!$post_id) {\n\t\treturn '';\n\t}\n\n\t$term_ids = dm_get_post_term_ids($post_id, 'solutions');\n\n\tif (empty($term_ids)) return '';\n\n\t$args = array(\n\t\t'post_status' => 'publish',\n\t\t'post_type' => 'post',\n\t\t'posts_per_page' => $limit,\n\t\t'orderby' => 'date',\n\t\t'order' => 'DESC',\n\t\t'tax_query' => array(\n\t\t\tarray(\n\t\t\t\t'taxonomy' => 'solutions',\n\t\t\t\t'field' => 'id',\n\t\t\t\t'terms' => $term_ids,\n\t\t\t)\n\t\t),\n\t);\n\t$query = new WP_Query($args);\n\n\tif (!$query->have_posts()) return '';\n\n\tob_start();\n?>\n\t<div class=\"sidebar_news_excerpt\">\n\t\t<?php while($query->have_posts()): $query->the_post(); ?>\n\t\t\t<p>\n\t\t\t\t<strong><?php echo $title; ?>:</strong>\n\t\t\t\t<?php the_title(); ?>\n\t\t\t\t<a href=\"<?php the_permalink(); ?>\">READ MORE &raquo;</a>\n\t\t\t</p>\n\t\t<?php endwhile; ?>\n\t</div>\n<?php\n\t$output = ob_get_clean();\n\treturn $output;\n}", "function frontend__display_category_post_items($posts, $parrent_cat_name, $cat_id, $paged)\n {\n\n //$args = array( 'cat' => $cat_id, 'posts_per_archive_page' => 100, 'posts_per_page' => 100, 'paged' => $paged );\n\n //order by theo media nổi bật\n\n if ($posts->have_posts()) {\n\n $index = 0;\n\n while ($posts->have_posts()) {\n\n $posts->the_post();\n\n global $post;\n\n if ($index == 0 || $index % 3 == 0) { ?>\n\n <div class='row-fluid'>\n\n <?php }\n\n\n if ($index == 0) { ?>\n\n <div class='span8 hidden-phone'>\n\n <a class='press-item press-item-large' href='<?php echo get_permalink(get_the_id()); ?>'>\n\n <?php if (has_post_thumbnail()) { ?>\n\n <img alt='' class='press-item-img-large' src='<?php echo the_post_thumbnail_url(); ?>'>\n\n <?php } ?>\n\n <img alt='' class='press-item-img-large-rollover'\n\n src='<?php echo get_template_directory_uri() . '/images/press_item_rollover_large.png'; ?>'>\n\n <div class='press-item-content-large'>\n\n <div class='press-item-date-large'>\n\n <em><?php echo get_the_time('d.m.Y', $post); ?></em>\n\n <span>- <?php echo $parrent_cat_name; ?></span>\n\n </div>\n\n <h2><?php echo wp_trim_words(get_the_title(), 8, '...'); ?></h2>\n\n </div>\n\n </a>\n\n </div>\n\n <?php } else {\n\n $meta_colortitle = 0;\n\n $meta_colortitle = get_post_meta(get_the_id(), '_is_media_colortitle', true);\n\n if ($meta_colortitle) {\n\n $meta_colortitle = $meta_colortitle;\n\n } else {\n\n $meta_colortitle = 0;\n\n }\n\n ?>\n\n <div class='span4'>\n\n <a class='press-item press-item-small blue' href='<?php echo get_permalink(get_the_id()); ?>'>\n\n <?php if (has_post_thumbnail()) { ?>\n\n <img alt='' class='press-item-img-small match-height-2'\n\n src='<?php echo the_post_thumbnail_url(); ?>'>\n\n <?php } ?>\n\n <img alt='' class='press-item-img-small-rollover'\n\n src='<?php echo get_template_directory_uri() . '/images/press_item_rollover_small.png'; ?>'>\n\n <div class='press-item-content-small match-height-2'>\n\n <div class='press-item-table'>\n\n <div class='press-item-cell'>\n\n <div\n\n class='press-item-date-small <?php echo $meta_colortitle == 1 ? 'colorwhite_media' : ''; ?>'>\n\n <em><?php echo get_the_time('d.m.Y', $post); ?></em>\n\n <span>- <?php echo $parrent_cat_name; ?></span>\n\n </div>\n\n <h3 class='<?php echo $meta_colortitle == 1 ? 'colorwhite_media' : ''; ?>'><?php echo wp_trim_words(get_the_title(), 10, '...'); ?></h3>\n\n </div>\n\n </div>\n\n </div>\n\n </a>\n\n </div>\n\n <?php } ?>\n\n\n\n <?php if ($index>0&&$index % 3 == 2) { ?>\n\n </div>\n\n <?php }\n\n $index++;\n\n }\n\n wp_reset_postdata();\n\n }\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}", "function PostList($data = []) {\n $data = params([\n \"query\" => null, // Pass in a new WP_Query() to see magic\n \"template\" => __NAMESPACE__ . \"\\PostListItem\", // could also pass a callable directly\n ], $data);\n\n // And now, for my next trick...\n // The main query uses global functions, but custom queries resort to\n // object methods. That requires two loops, or this.\n if (is_null($data[\"query\"])) {\n $havePosts = \"have_posts\";\n $thePost = \"the_post\";\n } else {\n // https://stackoverflow.com/questions/16380745/is-is-possible-to-store-a-reference-to-an-object-method\n $havePosts = [$data[\"query\"], \"have_posts\"];\n $thePost = [$data[\"query\"], \"the_post\"];\n } ?>\n\n <div class=\"post-list\"><?php\n while ($havePosts()) { $thePost();\n $data[\"template\"]([\n \"title\" => get_the_title(),\n \"image\" => get_post_thumbnail_id(),\n \"content\" => \\Vincit\\Post\\excerpt(),\n \"permalink\" => get_permalink(),\n ]);\n } wp_reset_postdata(); ?>\n </div><?php\n}", "function new_excerpt_more($more) {\n global $post;\n return ' <a class=\"read_more\" href=\"' . get_permalink($post->ID) . '\">[...]</a>';\n}", "function <%= functionPrefix %>_custom_post_more($more) {\n global $post;\n return '... <a class=\"article-more\" href=\"' . get_permalink($post->ID) . '\">' . __('Read More', '<%= projectName %>') . '</a>';\n}", "function new_excerpt_more($more) {\n global $post;\n\treturn '<a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> read more...</a>';\n}", "protected function related_article_content($atts, $content = \"\", $counter) {\n $title = \"\";\n extract(shortcode_atts(array('src'=>'', 'attachment'=>'', 'title'=>'', 'category'=>'', 'card_type'=>'','align'=>'', 'linka' => '', 'linkb' => '', 'linkc' => '', 'link'=>'', 'target'=>'no', 'show_type' => ''), $atts));\n \n $alt = $title;\n $pId = explode(',', $linka);\n\n $que = array();\n $class = \" \";\n $output = \"\";\n $out_output = \"\";\n $i = 0;\n\n // ugly...I know. will be updated once all test is done.\n if ($show_type == '3cols') {\n \tif($pId[2] == '' || $pId[3] == '') {\n \t\t$queB = explode(',', $linkb);\n \t\t$queC = explode(',', $linkc);\n \t\t$pId[2] = $queB[1];\n \t\t$pId[3] = $queC[1];\n \t}\n $que = array($pId[1], $pId[2], $pId[3]);\n $output .= \"<div class='related_articles flex_column av_one_full clearfix'>\";\n $output .= '<div class=\"grid-element-section-divider is-full-width is-aligned-right\"><div class=\"slug related-title\" style=\"background: none;\">RELATED ARTICLES</div></div>';\n $class = \"av_one_third\";\n } else {\n $que = array($pId[4]);\n $output .= \"<div class='related_articles flex_column av_one_full clearfix'>\";\n $output .= '<div></div>';\n }\n\n $post_query = new WP_Query(array('post_type' => array('post', 'mks-edit', 'fashion', 'jet', 'page'),\n \t\t'orderby' => 'post__in',\n 'post__in' => $que,\n 'posts_per_page' => 9999));\n\n while ( $post_query->have_posts() ) : $post_query->the_post();\n $i++;\n if ($i == 1) {\n $class = \"av_one_third\";\n }\n else{\n $class = \"av_one_third\";\n }\n $id = get_the_ID();\n $output .=\"<div class='center has-card grid-element-subcategory \" . $class .\"'>\"; // wrapper . class grid-element-home\n\n $args = array(\n 'post_type' => 'attachment',\n 'numberposts' => -1,\n 'post_status' => null,\n 'post_parent' => $id\n );\n\n $attachments = get_posts( $args ); // not getting any from enfold type of things :S\n\n if ($show_type == '3cols') {\n $featured = \"<a href='\".get_permalink().\"' >\".get_the_post_thumbnail( $id, \"default-thumbnail\");\n //$featured = get_the_post_thumbnail( $id, \"large-thumbnail\");\n }\n else {\n $featured = \"<a href='\".get_permalink().\"' >\".get_the_post_thumbnail( $id, \"1/2-image-with-text\");\n //$featured = get_the_post_thumbnail( $id, \"1/2-image-with-text\");\n }\n if ($featured) {\n $output .= $featured;\n } else if ($attachments) {\n foreach ($attachments as $attachment) {\n $output .= wp_get_attachment_image( $attachment->ID, 'large-thumbnail' );\n $output .= '<p>';\n $output .= apply_filters( 'the_title', $attachment->post_title );\n $output .= '</p>';\n break;\n }\n }\n\n $output .= '<div class=\"content-card-container is-bottom-aligned img_align-up\">';\n $output .= ' <div class=\"content-card cat-landing-content-block white-card is-medium-small\">';\n $output .= ' <div class=\"table-container\">';\n // no slug necessary, i don't think\n //$output .= swedenWpFunctions::all_taxonomies_links($id);\n $output .= \" <div class='headline'>\" . trimOnWord(get_the_title(),28) . \"</div>\";\n $output .= \" <span class='read-more cta'>read more<span class='icon-arrow-right'></span></span>\";\n $output .= \" </div>\";//table-container\n $output .= \" </div>\";//content-card\n $output .= \"</div>\";//content-card-container\n $output .= \"</a>\";// anchor that wraps image and content card\n $output .= \"</div>\";//grid-element-subcategory\n\n endwhile;\n wp_reset_postdata();\n $output .= \"</div>\";\n\n //prepare a slide\n $slidenum = $counter+1;\n $slidedisplaynum = $slidenum;\n if ($counter<10) {\n $slidenumdisplaynum = \"0\".$slidenum;\n }\n $out_output .='<div class=\"slide-element\" data-slide-num=\"'.$slidenum.'\">';\n if (!empty($src)) {\n if(is_numeric($src))\n {\n $out_output .= '<div class=\"image\">';\n $out_output .= wp_get_attachment_image($src,'full');\n $out_output .= '<div class=\"relative_article\"><div class=\"bg_cover\"></div>';\n $out_output .= '<div class=\"relart\"><div class=\"tbl\"><div class=\"tbl-cell\">'.$output.'</div></div></div>';\n $out_output .= '</div></div>';\n }\n else\n {\n $out_output .= '<div class=\"image\">';\n $out_output .= '<img src=\"'.$src.'\">';\n $out_output .= '<div class=\"relative_article\"><div class=\"bg_cover\"></div>';\n $out_output .= '<div class=\"relart\"><div class=\"tbl\"><div class=\"tbl-cell\">'.$output.'</div></div></div>';\n $out_output .= '</div></div>';\n }\n }\n $out_output .='<div class=\"content\" data-link=\"\">';\n $out_output .='<div class=\"title\">'.$title.'</div>';\n $out_output .='<div class=\"slug\">'.$content.'</div>';\n $out_output .='</div>';\n $out_output .='</div>';\n\n return $out_output;\n }", "function new_excerpt_more($more) {\n global $post;\n\treturn '<div class=\"readmore\"><a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> Read More <i class=\"fa fa-long-arrow-right\" aria-hidden=\"true\"></i></a></div>';\n}", "function new_excerpt_more($more) {\n global $post;\n // return '<a class=\"read_more\" href=\"'. get_permalink($post->ID) . '\">'.__('Read More','textdomain').'</a>';\n return '';\n}", "function kstHelpWordpressBlogPosts_excerptsAndMoreTeasers() {\n ?>\n <p>\n Your theme uses the excerpt field as well as the &lt;--more--&gt; tag giving\n you many options for formatting your blog index. Many themes use either the\n excerpt or the &lt;--more--&gt; tag to control what content appears on your\n blog index.\n </p>\n <p>\n Posts are displayed on the index in one of these formats (and order shown):\n </p>\n <ol>\n <li>Title and excerpt (if you type anything in the excerpt field)</li>\n <li>Title and the post up to the &lt;--more--&gt; (if you insert &lt;--more--&gt; in the post)</li>\n <li>Title and the entire post (if you do not enter an excerpt or the &lt;--more--&gt; tag)</li>\n </ol>\n <p><em>i.e. If you enter an excerpt and include a &lt;--more--&gt; tag only the excerpt will display</em></p>\n <p>\n <strong>How to use the \"more\" tag:</strong>\n </p>\n <p>\n In \"Visual\" mode:<br />\n Place the cursor <em>after</em> the content you would like to appear on the blog index for that post.\n Click the button above the post editor that looks like\n a rectangle cut in two pieces (a small rectangle on top and a longer rectangle on the button).\n A line that says \"more\" will appear.\n </p>\n <p>\n In \"html\" mode:<br />\n Place the cursor <em>after</em> the content you would like to appear on the blog index for that post.\n Type &lt;--more--&gt; on it's own line.\n </p>\n <p>\n Note: You may also customize the \"more\" link text that is shown per post (only possible using \"html\" mode).<br />\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Simply type the text to use after \"more\" e.g. &lt;--more But wait, there's more! --&gt;\n </p>\n <?php\n}", "function donkin_get_about_page() {\n\t$args = [\n\t\t'post_type' => 'page',\n\t\t'post__in' => [11, 29],\n\t\t'posts_per_page' => 2\n\t];\n\n\treturn new WP_Query($args);\n\n}", "function new_excerpt_more( $more ) {\n return ' <a class=\"read-more\" href=\"' . get_permalink( get_the_ID() ) . '\">' . __( 'Read More...', 'your-text-domain' ) . '</a>';\n}", "function new_excerpt_more($more) {\n global $post;\n\treturn ' <a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\">[ more ]</a>';\n}", "function virtuoso_portfolio_display_posts() {\n $taxonomy = ($_POST['taxonomy'] !== null) ? $_POST['taxonomy'] : ''; // for single term pagination\n $numberOfPosts = (count($_POST) > 0) ? (int) $_POST['numberOfPosts'] : 6; // default number of posts or grab from ajax\n\n // VIRTUOSO PORTFOLIO OPTIONS\n $pluralCPTName = get_option('virtuoso_portfolio_cpt_name_plural');\n $cptSlug = strtolower($pluralCPTName);\n $taxonomyNamePlural = get_option('virtuoso_portfolio_taxonomy_name_plural');\n $taxonomySlug = strtolower($taxonomyNamePlural);\n\n if ($taxonomy !== '') {\n\n // single term\n $taxonomies = array($taxonomy);\n\n } else {\n\n $styles = get_terms( array(\n 'taxonomy' => $taxonomySlug,\n 'hide_empty' => false, ) );\n\n $taxonomies = array();\n\n foreach ($styles as $style) {\n $taxonomies[] = $style->slug;\n }\n\n }\n\n // WP_Query arguments\n $args = array(\n 'post_type' => array( $cptSlug ),\n 'post_status' => array( 'publish' ),\n 'orderby' => 'post_date',\n 'order' => 'DESC',\n 'posts_per_page' => -1, // show all posts\n// 'numberposts' => $numberOfPosts,\n// 'offset' => $offset,\n 'tax_query' => array(\n array(\n 'taxonomy' => $taxonomySlug,\n 'field' => 'slug',\n 'terms' => $taxonomies\n )\n )\n );\n\n // The Query\n $loop = new WP_Query( $args );\n\n if ( $loop->have_posts() ) :?>\n <?php\n // loop through posts\n while ( $loop->have_posts() ): $loop->the_post();\n\n $image_attributes = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), array(400,400));\n\n if ( $image_attributes ) {\n\n $taxonomies = get_the_terms( get_the_ID(), $taxonomySlug );\n\n ?>\n <li data-taxonomy-slug=\"<?php echo $taxonomies[0]->slug?>\">\n <div class=\"item_wrap\">\n <a href=\"<?php the_permalink(); ?>\" class=\"portfolio_image_link\">\n <img class=\"single_slider_item\" src=\"<?php echo $image_attributes[0]; ?>\"/>\n <div class=\"portfolio_header_wrap\">\n <a class=\"portfolio_name\" href=\"<?php the_permalink(); ?>\"><span><?php the_title(); ?></span></a>\n <span class=\"portfolio_category\"><?php echo get_field('category'); ?></span>\n </div>\n </a>\n </div>\n </li>\n <?php\n\n }\n\n endwhile; ?>\n <?php\n\n endif;\n\n wp_reset_query();\n wp_reset_postdata();\n\n// if (count($loop->posts) === $numberOfPosts) {\n ?>\n<!-- </div> .gallery_wrap -->\n<!-- <div class=\"show_more\">-->\n<!-- <a>Show more <i class=\"ti-reload icon\"></i></a>-->\n<!-- <a href=\"#/\" data-offset=\"0\" data-number-of-posts=\"--><?php ////echo $numberOfPosts?><!--\" data-taxonomy-slug=\"--><?php ////echo $taxonomy?><!--\">Show more <i class=\"ti-reload icon\"></i></a>-->\n<!-- </div>-->\n <?php\n// }\n\n// if ($offset > 0) {\n// exit; // avoid trailing 0 from json\n// }\n\n}", "function nightsky_excerpt_more( $more ) {\n global $post;\n return ' <p class=\"readmore\"><a href=\"' . get_permalink( $post->ID ) . '\">Continue reading ' . $post->post_title . '</a></p>';\n}", "public function index()\n\t{\n\t\t$query = Request::get('q');\n\n\t\t$posts = $query\n\t\t\t? $this->post->published()->search($query)->orderBy('published_at', 'DESC')->paginate(10)\n\t\t\t: $this->post->published()->orderBy('published_at', 'DESC')->paginate(10);\n\n\t\treturn View::make('posts.index', compact('posts','query'));\n\n\t}", "function dacig_modify_the_posts( $results ) {\n\t$num_posts = count( $results );\n\n\tfor ( $i = 0; $i < $num_posts; $i++ ) {\n\t\tif ( $results[$i]->post_content )\n\t\t\t$results[$i]->post_excerpt = $results[$i]->post_content;\n\t}\n\n\treturn $results;\n}", "function medigroup_mikado_get_blog_query() {\n global $wp_query;\n\n $id = medigroup_mikado_get_page_id();\n $category = esc_attr(get_post_meta($id, \"mkd_blog_category_meta\", true));\n if(esc_attr(get_post_meta($id, \"mkd_show_posts_per_page_meta\", true)) != \"\") {\n $post_number = esc_attr(get_post_meta($id, \"mkd_show_posts_per_page_meta\", true));\n } else {\n $post_number = esc_attr(get_option('posts_per_page'));\n }\n\n $paged = medigroup_mikado_paged();\n $query_array = array(\n 'post_type' => 'post',\n 'paged' => $paged,\n 'cat' => $category,\n 'posts_per_page' => $post_number\n );\n if(is_archive()) {\n $blog_query = $wp_query;\n } else {\n $blog_query = new WP_Query($query_array);\n }\n\n return $blog_query;\n\n }", "function publicacoes_relacionadas() { \n $limitpost = 3;\n global $post;\n \n $tags = wp_get_post_tags($post->ID);\n $tag_ids = array();\n foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;\n $args_tags = array( 'tag__in' => $tag_ids, 'post__not_in' => array($post->ID), 'order' => 'RAND', 'posts_per_page'=> $limitpost, 'ignore_sticky_posts'=> 1 );\n $my_query_tags = new WP_Query($args_tags);\n \n \n if ($my_query_tags->have_posts()) {\n $i = 1;\n while($my_query_tags->have_posts()) {\n $my_query_tags->the_post();\n ?>\n \n <div class=\"item\" style=\"background-image: url('<?php thumb_url(); ?>');\">\n <a href=\"<?php the_permalink(); ?>\"><h5><?php the_title(); ?></h5></a>\n </div> \n\n\n <?php $i++; }\n }\n \n else {}\n wp_reset_query();\n}", "public function get_excerpt();", "function new_excerpt_more($more) {\n global $post;\n\treturn ' <a href=\"'. get_permalink($post->ID) . '\"><em>(Continue Reading...)</em></a>';\n}", "function get_post_objects( $query_args ) {\n $args = wp_parse_args( $query_args, array(\n 'post_type' => 'project',\n ) );\n $posts = get_posts( $args );\n $post_options = array();\n if ( $posts ) {\n foreach ( $posts as $post ) {\n $post_options [ $post->ID ] = $post->post_title;\n }\n }\n return $post_options;\n}", "function grav_related_posts() {\n\techo '<ul id=\"grav-related-posts\">';\n\tglobal $post;\n\t$tags = wp_get_post_tags($post->ID);\n\tif($tags) {\n\t\tforeach($tags as $tag) { $tag_arr .= $tag->slug . ','; }\n $args = array(\n \t'tag' => $tag_arr,\n \t'numberposts' => 5, /* you can change this to show more */\n \t'post__not_in' => array($post->ID)\n \t);\n $related_posts = get_posts($args);\n if($related_posts) {\n \tforeach ($related_posts as $post) : setup_postdata($post); ?>\n\t \t<li class=\"related_post\"><a href=\"<?php the_permalink() ?>\" title=\"<?php the_title_attribute(); ?>\"><?php the_title(); ?></a></li>\n\t <?php endforeach; } \n\t else { ?>\n <li class=\"no_related_post\">No Related Posts Yet!</li>\n\t\t<?php }\n\t}\n\twp_reset_query();\n\techo '</ul>';\n}", "function thinkup_input_blogtext() {\nglobal $post;\n\n// Get theme options values.\n$thinkup_blog_postswitch = thinkup_var ( 'thinkup_blog_postswitch' );\n\n\t// Output full content - EDD plugin compatibility\n\tif( function_exists( 'EDD' ) and is_post_type_archive( 'download' ) ) {\n\t\tthe_content();\n\t\treturn;\n\t}\n\n\t// Output post content\n\tif ( is_search() ) {\n\t\tthe_excerpt();\n\t} else if ( ! is_search() ) {\n\t\tif ( ( empty( $thinkup_blog_postswitch ) or $thinkup_blog_postswitch == 'option1' ) ) {\n\t\t\tif( ! is_numeric( strpos( $post->post_content, '<!--more-->' ) ) ) {\n\t\t\t\tthe_excerpt();\n\t\t\t} else {\n\t\t\t\tthe_content();\n\t\t\t\twp_link_pages( array( 'before' => '<div class=\"page-links\">' . esc_html__( 'Pages:', 'ESTSB' ), 'after' => '</div>', ) );\n\t\t\t}\n\t\t} else if ( $thinkup_blog_postswitch == 'option2' ) {\n\t\t\tthe_content();\n\t\t\twp_link_pages( array( 'before' => '<div class=\"page-links\">' . esc_html__( 'Pages:', 'ESTSB' ), 'after' => '</div>', ) );\n\t\t}\n\t}\n}", "function new_excerpt_more($more) {\n global $post;\n\treturn '... (<a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\">Read more</a>)';\n}", "function accouk_post_excerpt() {\n if(has_excerpt()) {\n the_excerpt();\n }\n}", "function emc_slider_html( $content, $args, $post ) {\r\n\r\n\t$image = get_the_post_thumbnail( get_the_ID(), $args['size'] );\r\n\r\n\t// Determine our More link\r\n\t$link = get_field( 'slider_link' );\r\n\t$text = ( get_field( 'slider_link_text' ) ) ? get_field( 'slider_link_text' ) : __( 'More&nbsp;&rarr;', 'emc' );\r\n\t$external = ( get_field( 'slider_external' ) ) ? ' target=\"_blank\"' : false;\r\n\t$more = ( $link ) ? sprintf( '&nbsp;&nbsp;<a class=\"emc-slider-more\" href=\"%1$s\"%2$s>%3$s</a>',\r\n\t\t\tesc_url( $link ),\r\n\t\t\t$external,\r\n\t\t\tesc_html( $text )\r\n\t\t) : false;\r\n\r\n\t$excerpt = '';\r\n\tif ( ( $args['display_excerpt'] == 'true' || $args['display_excerpt'] == 1 ) && has_excerpt( get_the_ID() ) ) {\r\n\t\t$excerpt = get_the_excerpt();\r\n\t\tif ( $more ) $excerpt .= $more;\r\n\t\t$excerpt = wpautop( $excerpt );\r\n\t}\r\n\r\n\t$title = get_the_title( get_the_ID() );\r\n\tif ( $args['link_title'] == 'true' || $args['link_title'] == 1 ) {\r\n\t\t$title = '<a href=\"' . get_permalink( $post ) . '\">' . $title . '</a>';\r\n\t\t$image = '<a href=\"' . get_permalink( $post ) . '\">' . $image . '</a>';\r\n\t}\r\n\r\n\t$content = $image . '<div class=\"slide-excerpt\"><h2 class=\"slide-title\">' . $title . '</h2>' . $excerpt . '</div>';\r\n\tif ( $args['layout'] == 'text-top' ) {\r\n\t\t$content = '<div class=\"slide-excerpt\"><h2 class=\"slide-title\">' . $title . '</h2>' . $excerpt . '</div>' . $image;\r\n\t}\r\n\r\n\treturn $content;\r\n\r\n}", "function pickle_indexloop(){\n\n\n//Use php to create a new loop. \n if (is_home() & !is_paged()) { \n \n //NOTE: this is where angel created divs to hold her loop content and also category header,\n //because she is adding her function as an action hook below_container\n //but in my case, i'm filtering the thematic_indexloop, so no html is necessary here for me.\n \n\n\n//Create a query to use with a loop. Big thanks to Allan Cole - www.allancole.com - for sharing his code!\n// First, grab any global settings you may need for your loop.\nglobal $paged, $more, $post; //the post variable is for calling meta data created with custom write panels\n$more = 0;\n\n// Second, create a new temporary Variable for your query.\n// $feature_pickle_query is the Variable used in this example query.\n// If you run any new Queries, change the variable to something else more specific ie: $feature_wp_query.\n$temp = $feature_pickle_query;\n\n// Next, set your new Variable to NULL so it's empty.\n$feature_pickle_query = null;\n\n// Then, turn your variable int the WP_Query() function.\n$feature_pickle_query = new WP_Query();\n\n// Set you're query parameters. Need more Parameters?: http://codex.wordpress.org/Template_Tags/query_posts\n$feature_pickle_query->query(array(\n\n// This will create a loop that shows 1 post from the featured-pickle.\n 'category_name' => 'featured-pickle',\n 'showposts' => '1',\n )); \n\n// Add Previous and Next post links here. (http://codex.wordpress.org/Template_Tags/previous_post_link)\n// Or just use the thematic action.\nthematic_navigation_above();\n\n// While posts exists in the Query, display them.\nwhile ($feature_pickle_query->have_posts()) : $feature_pickle_query->the_post();\n\n \n // Start the looped content here. ?> \n <div id=\"post-<?php the_ID(); ?>\" class=\"<?php thematic_post_class() ?>\">\n \n <div id=\"post-content\"> \n <?php the_post_thumbnail(); // we just called for the thumbnail ?>\n <div class=\"entry-content\">\n <!-- Display the Title as a link to the Post's permalink. -->\n <h2 class=\"entry-title\"><a href=\"<?php the_permalink() ?>\" rel=\"bookmark\" title=\"Permanent Link to <?php the_title_attribute(); ?>\"><?php the_title(); ?></a></h2>\n <?php if(get_post_meta($post->ID, 'pickle-maker')){ ?><p class=\"maker_name\"><?php echo get_post_meta($post->ID, 'pickle-maker', $single = true); ?></p><?php } ?>\n <?php echo polldaddy_get_rating_html(); ?>\n <?php the_content('Read more...'); ?>\n </div>\n </div> \n </div><?php //#featured\n \nendwhile; //This is how to end a loop\n}\n\n// Add Previous and Next post links here. (http://codex.wordpress.org/Template_Tags/previous_post_link)\n// Or us the thematic action.\nthematic_navigation_below(); \n\n// End the Query and set it back to temporary so that it doesn't interfere with other queries.\n$feature_pickle_query = null; $feature_pickle_query = $temp;\n\n// Thats it! End of the feature pickle query.\n\n\n\n//------------------------Now we want to create another loop that shows 6 posts as a gallery below the feature pickle post.\n//------------------------Remember we are still within the same funtion, which is ultimately replacing the index loop.\n \n//Use php to create a new loop. \n if (is_home() & !is_paged()) { \n\n// Second, create a new temporary Variable for your query.\n// $front_page_gallery is the Variable used in this example query.\n// If you run any new Queries, change the variable to something else more specific ie: $feature_wp_query.\n$temp = $front_page_gallery;\n\n// Next, set your new Variable to NULL so it's empty.\n$front_page_gallery = null;\n\n// Then, turn your variable int the WP_Query() function.\n$front_page_gallery = new WP_Query();\n\n// Set you're query parameters. Need more Parameters?: http://codex.wordpress.org/Template_Tags/query_posts\n$front_page_gallery->query(array(\n\n// This will create a loop that shows 6 posts from the front-page-gallery category.\n 'category_name' => 'front-page-gallery',\n 'showposts' => '6',\n ));\n\n// Add Previous and Next post links here. (http://codex.wordpress.org/Template_Tags/previous_post_link)\n// Or just use the thematic action.\nthematic_navigation_above(); \n\n\n// While posts exists in the Query, display them.\nwhile ($front_page_gallery->have_posts()) : $front_page_gallery->the_post(); \n\n // Start the looped content here. ?>\n <div class=\"gallery_thumb_container\">\n <div id=\"post-<?php the_ID(); ?>\" class=\"<?php thematic_post_class();?>\">\n <?php the_post_thumbnail(); // we just called for the thumbnail ?>\n <div class=\"gallery-content\">\n <!-- Display the Title as a link to the Post's permalink. -->\n <h2 class=\"entry-title\"><a href=\"<?php the_permalink() ?>\" rel=\"bookmark\" title=\"Permanent Link to <?php the_title_attribute(); ?>\"><?php the_title(); ?></a></h2>\n <?php if(get_post_meta($post->ID, 'pickle-maker')){ ?><p class=\"maker_name\"><?php echo get_post_meta($post->ID, 'pickle-maker', $single = true); ?></p><?php } ?>\n <?php echo polldaddy_get_rating_html(); ?>\n </div>\n </div>\n </div>\n<?php\n \nendwhile; //This is how to end a loop\n}\n\n// Add Previous and Next post links here. (http://codex.wordpress.org/Template_Tags/previous_post_link)\n// Or us the thematic action.\nthematic_navigation_below();\n\n\n// End the Query and set it back to temporary so that it doesn't interfere with other queries.\n$front_page_gallery = null; $front_page_gallery = $temp; ?>\n\n<?php // Thats it! End of front page gallery.\n\n\n\n \n}", "function the_content_limit($max_char, $more_link_text = 'Read More', $stripteaser = 0, $more_file = '') {\r\n\r\n $content = get_the_content($more_link_text, $stripteaser, $more_file);\r\n $content = apply_filters('the_content', $content);\r\n $content = str_replace(']]>', ']]&gt;', $content);\r\n $content = strip_tags($content);\r\n\r\n if (strlen($_GET['p']) > 0) {\r\n echo \"<p>\";\r\n echo $content;\r\n echo \"&nbsp;<a href='\";\r\n the_permalink();\r\n echo \"'>\".$more_link_text.\"</a>\";\r\n echo \"</p>\";\r\n }\r\n\r\n else if ((strlen($content)>$max_char) && ($espacio = strpos($content, \" \", $max_char ))) {\r\n\r\n $content = substr($content, 0, $espacio);\r\n $content = $content;\r\n echo \"<p>\";\r\n echo $content;\r\n echo \"...\";\r\n echo \"&nbsp;<a href='\";\r\n the_permalink();\r\n echo \"'>\".$more_link_text.\"</a>\";\r\n echo \"</p>\";\r\n }\r\n \r\n else {\r\n echo \"<p>\";\r\n echo $content;\r\n echo \"&nbsp;<a href='\";\r\n the_permalink();\r\n echo \"'>\".$more_link_text.\"</a>\";\r\n echo \"</p>\";\r\n\r\n }\r\n}", "public function getAllBlogContent() {\n\t \n\t // Get content\n\t $sql = \"SELECT * FROM {$this->tableName}\n\t\t\t\t\tWHERE type = 'post' AND published <= NOW()\n\t\t\t\t\tORDER BY updated DESC;\";\n\t\n\t\t$result = $this->db->ExecuteSelectQueryAndFetchAll($sql);\n\t\treturn $result;\n }", "public function get_posts( $custom_query_args = array(), $query_object = false ) {\n\t\t$default_query_args = array(\n\t\t\t'post_type' => $this->post_type,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'post_status' => 'publish',\n\t\t\t'order' => 'DESC',\n\t\t\t'orderby' => 'date',\n\t\t);\n\t\t$query_args = array_merge( $default_query_args, $custom_query_args );\n\t\t$transient_title = $this->_custom_transient_title( $query_args );\n\n\t\t// $transient = ( $this->is_localhost() ) ? false : get_transient( $transient_title );\n\t\t$transient = get_transient( $transient_title );\n\t\t// $transient = false;\n\n\t\tif ( $transient ) {\n\t\t\tif ( $query_object ) {\n\t\t\t\t$query = $transient;\n\t\t\t\t$post = $query->get_posts();\n\t\t\t} else {\n\t\t\t\t$posts = $transient;\n\t\t\t} // if/else()\n\n\t\t} else {\n\t\t\t$query = new WP_Query( $query_args );\n\t\t\t$posts = $query->get_posts();\n\n\t\t\t// Set all transients as an option value so we have\n\t\t\t// access them to reset them when a post is saved\n\t\t\t$transient_titles = get_option( $this->_transient_title_option, array() );\n\t\t\t$current_titles = ( ! empty( $transient_titles ) ) ? $transient_titles[$this->post_type] : null;\n\t\t\tif ( isset( $current_titles ) ) {\n\t\t\t\t$new_title = array( $transient_title );\n\t\t\t\t$transient_titles[$this->post_type] = array_merge( $current_titles, $new_title );\n\t\t\t\t$transient_titles[$this->post_type] = array_unique( $transient_titles[$this->post_type] );\n\t\t\t\t$transient_titles[$this->post_type] = array_filter( $transient_titles[$this->post_type] );\n\t\t\t} else {\n\t\t\t\t$transient_titles[$this->post_type] = array( $transient_title );\n\t\t\t} // if()\n\t\t\tupdate_option( $this->_transient_title_option, $transient_titles );\n\n\t\t\t// Set transient\n\t\t\tif ( $query_object ) {\n\t\t\t\tset_transient( $transient_title, $query, $this->transient_expiry );\n\t\t\t} else {\n\t\t\t\tset_transient( $transient_title, $posts, $this->transient_expiry );\n\t\t\t} // if/else()\n\t\t} // if/else()\n\n\t\t// $this->posts = $posts;\n\n\t\tif ( $query_object ) {\n\t\t\treturn $query;\n\t\t} // if()\n\n\t\treturn $posts;\n\t}", "function excerpt($num) {\n$limit = $num+1;\n$excerpt = explode(' ', get_the_excerpt(), $limit);\narray_pop($excerpt);\n$excerpt = implode(\" \",$excerpt).\" <a href='\" .get_permalink($post->ID) .\" ' class='\".readmore.\"'>Read More</a>\";\necho $excerpt;\n}", "public function index()\n {\n return PostShort::collection(\n BlogPost::orderByRaw('(CASE WHEN publication = 0 THEN id END) DESC')\n ->orderBy('publication_date', 'desc')\n ->paginate(20)\n );\n }", "public function home_blog_display() {\n\t\t// Build the output to return for use by the shortcode.\n\t\tob_start();\n\t\t?>\n\t\t<ul class=\"blog-loop\">\n\t\t\t<?php\n\t\t\t$args = array(\n\t\t\t\t'posts_per_page' => 4,\n\t\t\t\t'offset' => 0,\n\t\t\t\t'post_type' => 'post',\n\t\t\t\t'tax_query' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t\t'field' => 'slug',\n\t\t\t\t\t\t'terms' => 'home',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t$my_posts = new WP_Query( $args );\n\n\t\t\tif ( $my_posts->have_posts() ) : while ( $my_posts->have_posts() ) : $my_posts->the_post();\n\t\t\t\t?>\n\t\t\t\t<li class=\"nested-seperated\">\n\t\t\t\t\t<h4><a href=\"<?php the_permalink(); ?>\"><?php the_title(); ?></a></h4>\n\t\t\t\t\t<hgroup class=\"source\">\n\t\t\t\t\t\t<time class=\"article-date\" datetime=\"<?php echo get_the_date( 'c' ); ?>\"><?php echo get_the_date(); ?></time>\n\t\t\t\t\t\t<cite class=\"article-author\" role=\"author\"><?php the_author_posts_link(); ?></cite>\n\t\t\t\t\t</hgroup>\n\t\t\t\t\t<span class=\"blog-excerpt\"><?php the_excerpt(); ?></span>\n\t\t\t\t\t<span class=\"blog-cattag\"><?php the_tags( 'Tags: ', ', ', '' ); ?></span>\n\t\t\t\t</li>\n\t\t\t<?php endwhile;\nendif;\n\t\t\twp_reset_postdata();\n\t\t\t?>\n\n\t\t</ul>\n\t\t<?php\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\n\t\treturn $content;\n\t}", "function my_post_queries( $query ) {\n\t if (!is_admin() && $query->is_main_query()){\n\n\t // alter the query for the home and category pages \n\n\t if(is_home()){\n\t $query->set('posts_per_page', 4);\n\t }\n\n\t if(is_category() || is_archive() || is_tag() || is_search()){\n\t $query->set('posts_per_page', 3);\n\t }\n\n\t }\n\t}", "function create_excerpt($post_content, $excerpt_length, $post_permalink, $excerpt_words = NULL)\n{\n\n $keep_excerpt_tags = get_option('rps_keep_excerpt_tags');\n\n\n if (!$keep_excerpt_tags) {\n\n $post_excerpt = strip_shortcodes($post_content);\n\n $post_excerpt = str_replace(']]>', ']]&gt;', $post_excerpt);\n\n $post_excerpt = strip_tags($post_excerpt);\n\n } else {\n\n $post_excerpt = $post_content;\n\n }\n\n\n $link_text = get_option('rps_link_text');\n\n if (!empty($link_text)) {\n\n $more_link = \"\";\n\n } else {\n\n $more_link = \"\";\n\n }\n\n if (!empty($excerpt_words)) {\n\n if (!empty($post_excerpt)) {\n\n $words = explode(' ', $post_excerpt, $excerpt_words + 1);\n\n array_pop($words);\n\n array_push($words, ' <a href=\"' . $post_permalink . '\">' . $more_link . '</a>');\n\n $post_excerpt_rps = implode(' ', $words);\n\n return $post_excerpt_rps;\n\n } else {\n\n return;\n\n }\n\n } else {\n\n $post_excerpt_rps = substr($post_excerpt, 0, $excerpt_length);\n\n if (!empty($post_excerpt_rps)) {\n\n if (strlen($post_excerpt) > strlen($post_excerpt_rps)) {\n\n $post_excerpt_rps = substr($post_excerpt_rps, 0, strrpos($post_excerpt_rps, ' '));\n\n }\n\n $post_excerpt_rps .= ' <a href=\"' . $post_permalink . '\">' . $more_link . '</a>';\n\n return $post_excerpt_rps;\n\n } else {\n\n return;\n\n }\n\n }\n\n}", "function getPublishedPosts() {\n\t// use global $conn object in function\n\tglobal $conn;\n\t$sql = \"SELECT * FROM news ORDER BY date DESC\";\n\t$result = mysqli_query($conn, $sql);\n\n\t// fetch all posts as an associative array called $posts\n\t$posts = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n\treturn $posts;\n}", "function food_tours()\n{\n\n $args['pagination'] = 'false';\n $args['posts_per_page'] = '-1';\n $args['post_type'] = 'tour';\n $args['orderby'] = 'title';\n $args['order'] = 'ASC';\n $args['tax_query'][0] = array(\n 'taxonomy' => 'tour_category',\n 'field' => 'slug',\n 'terms' => 'food-tours',\n );\n\n // The Query\n $query = new WP_Query($args);\n\n // The Loop\n if ($query->have_posts()) {\n\n while ($query->have_posts()) {\n\n $query->the_post();\n\n if ($website = get_field('website')) {\n\n $tour_title = '<strong><a href=\"' . $website . '\" target=\"_blank\">' . get_the_title() . ': </a></strong>';\n\n } else {\n\n $tour_title = '<strong>' . get_the_title() . ': </strong>';\n\n }\n\n $food_tours .= '<li>' . $tour_title . get_the_content() . '</li>';\n\n }\n\n $food_tours = '<ul>' . $food_tours . '</ul>';\n\n }\n\n // Restore original Post Data\n wp_reset_postdata();\n\n return $food_tours;\n\n}", "function wpsites_query( $query ) {\nif ( $query->is_archive() && $query->is_main_query() && !is_admin() ) {\n $query->set( 'posts_per_page', 100 );\n }\n}", "public function get_posts()\n {\n }", "function emc_related_posts_list( $connection, $heading = false ) {\r\n\r\n\t$related = new WP_Query( array(\r\n\t \t'connected_type' => $connection,\r\n\t \t'connected_items' => get_queried_object(),\r\n\t \t'nopaging' => true,\r\n\t) );\r\n\r\n\tif ( ! $related || ! $heading ) return false;\r\n\r\n\tp2p_list_posts( $related, array(\r\n\t\t'before_list' => '<h2 class=\"emc-section-heading\">' . esc_html( $heading ) . '</h2><ul>',\r\n\t\t'after_list' => '</ul>',\r\n\t) );\r\n\r\n\r\n}", "function genesisawesome_related_posts( $number = 5 ) {\n\n\tglobal $post;\n\n\t$categories = get_categories( $post->ID );\n\t$cat_ids = array();\n\n\tif ( ! $categories ) {\n\t\techo '<p>' . __( 'No Related Posts!', 'genesisawesome' ) . '</p>';\n\t\treturn;\n\t}\n\n\tforeach ( $categories as $cat ) {\n\t\t$cat_ids[] = $cat->term_id;\n\t}\n\n\t$args = array(\n\t\t'category__in' => $cat_ids,\n\t\t'post__not_in' => array( $post->ID ),\n\t\t'posts_per_page' => absint( $number ),\n\t\t'ignore_sticky_posts' => 1,\n\t);\n\n\t$ga_related = new WP_Query( $args );\n\n\tif ( $ga_related->have_posts() ) {\n\t\techo '<ul>';\n\t\twhile ( $ga_related->have_posts() ) {\n\t\t\t$ga_related->the_post();\n\t\t\tprintf( \n\t\t\t\t'<li><a href=\"%s\" class=\"related-image\">%s</a><a href=\"%s\" title=\"%s\" class=\"related-title\">%s</a></li>',\n\t\t\t\tget_permalink(),\n\t\t\t\tget_the_post_thumbnail( get_the_ID(), 'thumbnail' ),\n\t\t\t\tget_permalink(),\n\t\t\t\tthe_title_attribute( 'echo=0' ),\n\t\t\t\tget_the_title()\n\t\t\t);\n\t\t}\n\t\techo '</ul>';\n\t}\n\n\twp_reset_query();\n\n}", "function pm_portfolio_shortcode( $atts, $content = null) {\n\textract(shortcode_atts(array(\n\t\t\t'number_of_portfolio'\t=> '',\n\t\t\t'class'\t=> '',\n\t), $atts));\n\n\t$result = '';\n\n\tob_start(); \n\n\t// Assigning a master css class and hooking into KC\n\t$master_class = apply_filters( 'kc-el-class', $atts );\n\t$master_class[] = 'pm_portfolio';\n\n\t// Retrieving user define classes\n\t$classes = array( 'row items' );\n\t(!empty($class)) ? $classes[] = $class : ''; ?>\n\n\t\t<div id=\"portfolio\" class=\"<?php echo esc_attr( implode( ' ', $master_class ) ); ?>\">\n\t\t\t<div class=\"<?php echo esc_attr( implode( ' ', $classes ) ); ?>\">\n\t\t\t\t<div class=\"twelve columns\">\n\t\t\t\t\t<div id=\"portfolio-wrapper\" class=\"bgrid-fourth s-bgrid-third mob-bgrid-half group\">\n\t\t\t\t\t<?php \n\t\t\t\t\t\t//start wp query..\n\t\t\t\t\t\t$args = array(\n\t\t\t\t\t\t\t'post_type'\t\t\t=> 'portfolio',\n\t\t\t\t\t\t\t'orderby'\t\t\t=> 'date',\n\t\t\t\t\t\t\t'order'\t\t\t\t=> 'DESC',\n\t\t\t\t\t\t\t'posts_per_page'\t=> $number_of_portfolio\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t$data = new WP_Query( $args );\n\t\t\t\t\t\t//Check post\n\t\t\t\t\t\tif( $data->have_posts() ) :\n\t\t\t\t\t\t\t//startloop here..\n\t\t\t\t\t\t\twhile( $data->have_posts() ) : $data->the_post();\n\n\t\t\t\t\t\t\t$term_list = wp_get_post_terms( get_the_ID(), 'field' ); \n\t\t\t\t\t\t\tglobal $post;\n\t\t\t\t $image = wp_prepare_attachment_for_js( get_post_thumbnail_id( $post->ID ) );\n\t\t\t\t $image_alt = ( !empty( $image['alt'] ) ) ? 'alt=\"' . esc_attr( $image['alt'] ) . '\"' : 'alt=\"' .get_the_title() . '\"';\n\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<div class=\"bgrid item\">\n\t\t\t\t\t\t\t<div class=\"item-wrap\">\n\t\t\t\t\t\t\t\t<a href=\"<?php the_permalink(); ?>\">\n\t\t\t\t\t\t\t\t\t<img src=\"<?php esc_url( the_post_thumbnail_url('portfolio-small-thum') ); ?>\" alt=\"<?php echo esc_attr( $image_alt ); ?>\">\n\t\t\t\t\t\t\t\t\t<div class=\"overlay\"></div> \n\t\t\t\t\t\t\t\t\t<div class=\"portfolio-item-meta\">\n\t\t\t\t\t\t\t\t\t\t<h5><?php echo the_title(); ?></h5>\n\t\t\t\t\t\t\t\t\t\t<p><?php foreach ($term_list as $sterm) { echo $sterm->name.' '; } ?></p>\n\t\t\t\t\t\t\t\t\t</div> \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</div> <!-- /item -->\n\t\t\t\t\t\t<?php \n\t\t\t\t\t\t\tendwhile;\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\twp_reset_postdata();\n\t\t\t\t\t\t?>\n\t\t\t\t\t</div> <!-- /portfolio-wrapper -->\n\t\t\t\t</div> <!-- /twelve -->\n\t\t\t</div> <!-- /row --> \n\t\t</div> <!-- /Portfolio -->\n\n\t<?php \n\t$result .= ob_get_clean();\n\treturn $result;\n\n}", "function ci_e_content($more_link_text = null, $stripteaser = false)\n{\n\tglobal $post, $ci;\n\tif (is_single() or is_page())\n\t\tthe_content(); \n\telse\n\t{\n\t\tif(ci_setting('preview_content')=='enabled')\n\t\t{\n\t\t\tthe_content($more_link_text, $stripteaser);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthe_excerpt();\n\t\t}\n\t}\n}", "function custom_field_excerpt3() {\n\tglobal $post;\n\t$text = get_field('quick_facts');\n\tif ( '' != $text ) {\n\t\t$text = strip_shortcodes( $text );\n\t\t$text = apply_filters('the_content', $text);\n\t\t$text = str_replace(']]>', ']]>', $text);\n\t\t$excerpt_length = 20; // 20 words\n\t\t$excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');\n\t\t$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );\n\t}\n\treturn apply_filters('the_excerpt', $text);\n}", "function RBTM_RelPost_display($content){\n\tif( is_single() && is_main_query() ) {\n\t $content .= RBTM_RelPost_baseline_html();\n\t}\n\treturn $content;\n}", "function pm_blog_shortcode( $atts, $content = null) {\n\textract(shortcode_atts(array(\n\t\t'number_of_post' => '',\n\t\t'exclude' \t\t => '',\n\t\t'class'\t\t\t => '',\n\t), $atts));\n\n\t$result = '';\n\n\tob_start(); \n\n\t// Assigning a master css class and hooking into KC\n\t$master_class = apply_filters( 'kc-el-class', $atts );\n\t$master_class[] = 'pm-team';\n\n\t// Retrieving user define classes\n\t$classes = array( 'row about-content' );\n\t(!empty($class)) ? $classes[] = $class : ''; ?>\n\t<div id=\"journal\">\n\t\t<div class=\"row\">\n\t\t\t<div class=\"twelve columns\">\n\t\t\t\t<div id=\"blog-wrapper\" class=\"bgrid-third s-bgrid-half mob-bgrid-whole group\">\n\t\t\t\t\t<?php \n\t\t\t\t\t$cat_exclude = str_replace(',', ' ', $exclude);\n\t\t\t\t\t$cat_excludes = explode( \" \", $cat_exclude );\n\t\t\t\t\t//start query..\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_type'\t\t\t\t=> 'post',\n\t\t\t\t\t\t'posts_per_page'\t\t=> $number_of_post,\n\t\t\t\t\t\t'post_status'\t\t\t=> 'publish',\n\t\t\t\t\t\t'order'\t\t\t\t\t=> 'DESC',\n\t\t\t\t\t\t'category__not_in' \t\t=> $cat_excludes\n\t\t\t\t\t);\n\n\t\t\t\t\t$count_posts = wp_count_posts();\n\t\t\t\t\t$published_posts = $count_posts->publish;\n\n\t\t\t\t\t$data = new WP_Query( $args );\n\n\t\t\t\t\tif( $data->have_posts() ) :\n\t\t\t\t\t\twhile( $data->have_posts() ) : $data->the_post(); ?>\n\n\t\t\t\t\t\t<article id=\"post-<?php the_ID(); ?>\" <?php post_class( 'bgrid' ); ?>>\n\t\t\t\t\t\t\t<h5> <?php the_time('F d, Y'); ?></h5>\n\t\t\t\t\t\t\t<h3><a href=\"<?php the_permalink(); ?>\"><?php the_title(); ?></a></h3>\n\n\t\t\t\t\t\t\t<p><?php echo wp_trim_words( get_the_excerpt(), 37 ); ?></p>\n\t\t\t\t\t\t</article> \n\n\t\t\t\t<?php \n\t\t\t\t\t\tendwhile;\n\t\t\t\t\tendif;\n\t\t\t\t\twp_reset_postdata();\t\n\t\t\t\t ?>\n\t\t\t\t</div> <!-- /blog-wrapper -->\n\t\t\t\t<?php if( $published_posts > $number_of_post ) : ?>\n\t\t\t\t\t<p class=\"position-y\"><a href=\"<?php echo esc_url( get_permalink( get_option( 'page_for_posts' ) ) ); ?>\" class=\"button orange\">View More</a></p>\n\t\t\t\t<?php endif; ?>\n\t\t\t</div> <!-- /twelve -->\n\t\t</div> <!-- /row -->\n\t</div> <!-- /blog -->\n\t<?php \n\t$result .= ob_get_clean();\n\treturn $result;\n\n}" ]
[ "0.64511055", "0.63517827", "0.6329098", "0.6320667", "0.6284656", "0.6250807", "0.61685264", "0.6159238", "0.6129849", "0.60873276", "0.60358024", "0.6032005", "0.60119677", "0.60119534", "0.6008413", "0.60030293", "0.59892267", "0.59686154", "0.59680957", "0.59212637", "0.5885981", "0.58837306", "0.583525", "0.5834091", "0.5833886", "0.58192503", "0.58188796", "0.58149284", "0.58093274", "0.58091295", "0.5804446", "0.5802404", "0.57844746", "0.5778075", "0.5769053", "0.57673687", "0.5760801", "0.5730628", "0.5724612", "0.5716758", "0.5714692", "0.5713603", "0.57125515", "0.57084674", "0.56974876", "0.56901276", "0.56808555", "0.567693", "0.5676574", "0.5653948", "0.5647393", "0.564181", "0.5638029", "0.5633124", "0.5632819", "0.5630408", "0.562553", "0.5624515", "0.56236225", "0.5617667", "0.5611737", "0.5602024", "0.56012", "0.5597175", "0.5579549", "0.55791205", "0.5578879", "0.5573523", "0.5571523", "0.5568091", "0.5567913", "0.5566557", "0.5560149", "0.5546739", "0.5541229", "0.55397904", "0.55308497", "0.552003", "0.5512869", "0.5512618", "0.55086595", "0.5494526", "0.5488279", "0.54876083", "0.5486014", "0.5467029", "0.5466927", "0.5460199", "0.5453245", "0.5450121", "0.5449845", "0.5448881", "0.54421973", "0.54363006", "0.54343843", "0.543387", "0.5430761", "0.54295874", "0.54294366", "0.5426701", "0.5422777" ]
0.0
-1
/ the below function will allow for a form to be created on the WordPress backend for the
public function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) ); $title = strip_tags($instance['title']); ?> <!-- Creates a 'Title' label and an input for the user to enter a custom widget title. --> <p> <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /> </p> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createForm();", "public function createForm();", "function create_form(){\n\t\n\t$table =\"<html>\";\n\t$table.=\"<head>\";\n\t$table.=\"\t<title>New Article Entry Page</title>\";\n\t$table.=\"</head>\";\n\t\n\t// URL for the wordpress post handling page\n\t$link_admin_post = admin_url('admin-post.php');\n\t$table.=\"<form name = 'myform' method=\\\"POST\\\" action='\" . $link_admin_post . \"' id = \\\"form1\\\">\";\n\n\t// Input for Faculty member\n\t$table.= \"\t<br>\";\n\t$table.= \" <div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Tag\\\">Faculty Member/Tag: </label></p>\";\n\t$list_of_names = wp_post_tag_names();\n\t$table.=\"\t<select name=\\\"Tag\\\">\" . $list_of_names . \"</select>\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for PMID\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"PMID\\\">PMID*: </label></p>\";\n\t$table.=\"\t<input type=\\\"number\\\" name=\\\"PMID\\\" id=\\\"PMID\\\" required>\";\n\t\n\t//autofill button\n\t$table.=' <a class=\"pmid\" data-test=\"hi\"><button id=\"autofill_btn\" type=\"button\" >Auto-Fill</button></a>';\n\t$table.=\"\t</div>\";\n\t\t\n\t// Input for Journal Issue\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label style=\\\"width: 200px;\\\" for=\\\"Journal_Issue\\\">Journal Issue: </label></p>\";\n\t$table.=\"\t<input id = 'issue' type=\\\"number\\\" name=\\\"Journal_Issue\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Volume\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Volume\\\">Journal Volume: </label></p>\";\n\t$table.=\"\t<input id = 'journal_volume' type=\\\"number\\\" name=\\\"Journal_Volume\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Title\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Title\\\">Journal Title: </label></p>\";\n\t$table.=\"\t<input id = 'journal_title' type=\\\"text\\\" name=\\\"Journal_Title\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Year\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Year\\\">Journal Year: </label></p>\";\n\t$table.=\"\t<input id = 'year' value=\\\"2000\\\" type=\\\"number\\\" name=\\\"Journal_Year\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Month\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Month\\\">Journal Month: </label></p>\";\n\t$table.=\"\t<select id='journal_month' name=\\\"Journal Month\\\">\";\n\t$table.=\"\t\t<option value=\\\"01\\\">Jan</option>\";\n\t$table.=\"\t\t<option value=\\\"02\\\">Feb</option>\";\n\t$table.=\"\t\t<option value=\\\"03\\\">Mar</option>\";\n\t$table.=\"\t\t<option value=\\\"04\\\">Apr</option>\";\n\t$table.=\"\t\t<option value=\\\"05\\\">May</option>\";\n\t$table.=\"\t\t<option value=\\\"06\\\">Jun</option>\";\n\t$table.=\"\t\t<option value=\\\"07\\\">Jul</option>\";\n\t$table.=\"\t\t<option value=\\\"08\\\">Aug</option>\";\n\t$table.=\"\t\t<option value=\\\"09\\\">Sep</option>\";\n\t$table.=\"\t\t<option value=\\\"10\\\">Oct</option>\";\n\t$table.=\"\t\t<option value=\\\"11\\\">Nov</option>\";\n\t$table.=\"\t\t<option value=\\\"12\\\">Dec</option>\";\n\t$table.=\"\t</select>\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Day\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Day\\\">Journal Day: </label></p>\";\n\t$table.=\"\t<input id = 'journal_day' type=\\\"text\\\" name=\\\"Journal_Day\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Date\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Date\\\">Journal Date: </label></p>\";\n\t$table.=\"\t<input id = 'journal_date' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Journal_Date\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Abbreviation\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Abbreviation\\\">Journal Abbreviation: </label></p>\";\n\t$table.=\"\t<input id = 'journal_ab' type=\\\"text\\\" name=\\\"Journal_Abbreviation\\\">\";\n\t$table.=\"\t</div>\";\n\n\t// Input for Journal Citation\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Citation\\\">Journal Citation: </label></p>\";\n\t$table.=\"\t<input id = 'journal_citation' type=\\\"text\\\" name=\\\"Journal_Citation\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Title\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Title\\\">Article Title: </label></p>\";\n\t$table.=\"\t<input id=\\\"article_title\\\" type=\\\"text\\\" name=\\\"Article_Title\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for article abstract\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Abstract\\\">Article Abstract: </label></p>\";\n\t$table.=\" <textarea id='abstract' rows = '4' cols = '60' name=\\\"Article_Abstract\\\"></textarea>\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article URL\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_URL\\\">Article URL: </label></p>\";\n\t$table.=\"\t<input id = 'article_url' type=\\\"text\\\" name=\\\"Article_URL\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Pagination\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Pagination\\\">Article Pagination: </label></p>\";\n\t$table.=\"\t<input id='pages' type=\\\"text\\\" name=\\\"Article_Pagination\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Date\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Date\\\">Article Date: </label></p>\";\n\t$table.=\"\t<input id='article_date' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Article_Date\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Authors\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Authors\\\">Article Authors: </label></p>\";\n\t$table.=\"\t<input id='article_authors' type=\\\"text\\\" name=\\\"Article_Authors\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Affiliations\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Affiliation\\\">Article Affiliation: </label></p>\";\n\t$table.=\"\t<input id = 'article_affiliation' type=\\\"text\\\" name=\\\"Article_Affiliation\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Date Created\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Date_Created\\\">Date Created: </label></p>\";\n\t$table.=\"\t<input id='date_created' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Date_Created\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Date Completed\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Date_Completed\\\">Date Completed: </label></p>\";\n\t$table.=\"\t<input id='date_completed' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Date_Completed\\\">\";\n\t$table.=\"\t</div>\";\n\n\t// Input for Date Revised\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Date_Revised\\\">Date Revised: </label></p>\";\n\t$table.=\"\t<input id='date_revised' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Date_Revised\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Hidden input (for specifying hook)\n\t$table.=\"\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"new_article_form\\\">\";\n\t\n\t// Submit and reset buttons\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div id=\\\"form_btns\\\">\"; \n\t$table.=\"\t<button class=\\\"form_btn\\\"><input type=\\\"reset\\\" value=\\\"Reset!\\\" onclick=\\\"window.location.reload()\\\"></button>\";\n\t$table.=\"\t<input class=\\\"form_btn\\\" type=\\\"submit\\\" value=\\\"Submit\\\">\"; \n\t$table.=\"\t</div>\";\n\t$table.=\"</form>\";\n\n\t// Styling of the form (needs to be put in a seperate stylesheet)\n\t$table.=\"<style type=\\\"text/css\\\">\";\n\t$table.=\"\t#form_btns {\";\n\t$table.=\"\t\tmargin-left: 150px;\";\n\t$table.=\"\t}\";\n\t$table.=\"\t.form_btn {\";\n\t$table.=\"\t\twidth: 80px;\";\n\t$table.=\"\t}\";\n\t$table.=\"\t.label {\";\n\t$table.=\"\t\twidth: 150px;\";\n\t$table.=\"\t\tmargin: 0;\";\n\t$table.=\"\t\tfloat: left;\";\n\t$table.=\"\t}\";\n\t$table.=\"\tinput::placeholder {\";\n\t$table.=\"\t\tcolor: #a4a4a4;\";\n\t$table.=\"\t}\";\n\t$table.=\"</style>\";\n\t\n\t$table.=\"<script type='text/javascript' src=\" . plugin_dir_url(__FILE__) . \"js/autofill_ajax.js></script>\";\n\n \techo $table;\n}", "public static function create() {\n\t\tFrmAppHelper::permission_check('frm_edit_forms');\n check_ajax_referer( 'frm_ajax', 'nonce' );\n\n\t\t$field_type = FrmAppHelper::get_post_param( 'field_type', '', 'sanitize_text_field' );\n\t\t$form_id = FrmAppHelper::get_post_param( 'form_id', 0, 'absint' );\n\n\t\t$field = self::include_new_field( $field_type, $form_id );\n\n // this hook will allow for multiple fields to be added at once\n do_action('frm_after_field_created', $field, $form_id);\n\n wp_die();\n }", "public function CreateForm();", "function create_add_form( $fields, $form_name, $post_id, $action = '' ){\n\t\t$nonce = wp_create_nonce( 'wck-fep-add-post' );\n\n if( $action == 'edit' ){\n\n if( $this->args['post_type'] != get_post_type( $post_id ) )\n return '<div class=\"fep-error fep-access-denied\">' . __( \"Wrong form for this post type\", \"wck\" ) . '</div>';\n\n $fep_form = get_post( $post_id );\n if ( $fep_form ){\n $author_id = $fep_form->post_author;\n $user_ID = get_current_user_id();\n if ( !current_user_can( 'edit_others_posts' ) && !wp_verify_nonce( $_REQUEST['_wpnonce'], 'wck-fep-dashboard-edit-'.$post_id.'-'.$user_ID ) ){\n if ($author_id != $user_ID) {\n $error = '<div class=\"fep-error fep-access-denied\">' . __( \"You are not allowed to edit this post.\", \"wck\" ) . '</div>';\n return $error;\n }\n }\n }\n }\n\n $form = '<form id=\"'. $form_name .'\" method=\"post\" action=\"\">';\n\n\t\t$element_id = 0;\n\n\t\tif( function_exists( 'wck_cfc_create_boxes_args' ) )\n\t\t\t$all_box_args = wck_cfc_create_boxes_args();\n\n\t\tif( !empty( $fields ) ){\n\t\t\tforeach( $fields as $details ){\n\n\t\t\t\tdo_action( \"wck_fep_before_form_{$form_name}_element_{$element_id}\" );\n\n\t\t\t\t$form .= apply_filters( \"wck_fep_filter_before_form_{$form_name}_element_{$element_id}\", '<div id=\"fep-'. Wordpress_Creation_Kit::wck_generate_slug( $details['title'] ) .'\" class=\"fep-element-wrap\">', $details );\n\n\t\t\t\tif( empty( $details['cfc'] ) ){\n\n\t\t\t\t\tif( $action == 'edit' ){\n\t\t\t\t\t\t/* build edit values depending on the field */\n\t\t\t\t\t\t$value = self::wck_fep_get_edit_value( $post_id, $details );\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$value = apply_filters('wck_fep_default_value_' . $form_name . '_' . Wordpress_Creation_Kit::wck_generate_slug($details['title']), '');\n\n\t\t\t\t\t$form .= parent::wck_output_form_field( $form_name, $details, $value, 'fep', $post_id );\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\n\t\t\t\t\t/* add CFC boxes created with Custom Fields Creator */\n\t\t\t\t\tif( !empty( $all_box_args ) ){\n\t\t\t\t\t\tforeach( $all_box_args as $box_args ){\n\t\t\t\t\t\t\tif( ( $box_args['post_type'] == $this->args['post_type'] ) && ( $box_args['metabox_title'] == $details['title'] ) ){\n\n\t\t\t\t\t\t\t\t/* treat single cfcs case */\n\t\t\t\t\t\t\t\tif( $box_args['single'] ){\n\t\t\t\t\t\t\t\t\t$form .= '<div id=\"'. $box_args['meta_name'].'\" class=\"single-cfc\">';\n\t\t\t\t\t\t\t\t\tif( !empty( $box_args['meta_array'] ) ){\n\t\t\t\t\t\t\t\t\t\tforeach( $box_args['meta_array'] as $details ){\n\n\t\t\t\t\t\t\t\t\t\t\tif( $action == 'edit' ){\n\t\t\t\t\t\t\t\t\t\t\t\t/* build edit values depending on the field */\n\t\t\t\t\t\t\t\t\t\t\t\t$value = self::wck_fep_get_edit_value( $post_id, $details, $box_args['meta_name'] );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\tif( isset( $details['default'] ) )\n\t\t\t\t\t\t\t\t\t\t\t\t\t$value = $details['default'];\n\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t$value = '';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$form .= '<div class=\"fep-single-element-wrap\">';\n\t\t\t\t\t\t\t\t\t\t\t$form .= parent::wck_output_form_field( $box_args['meta_name'], $details, $value, 'fep', $post_id );\n\t\t\t\t\t\t\t\t\t\t\t$form .= '</div>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$form .= '</div>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tob_start();\n\t\t\t\t\t\t\t\t\tparent::create_add_form( $box_args['meta_array'], $box_args['meta_name'], get_post($post_id), 'fep' );\n\t\t\t\t\t\t\t\t\t$parent_form = ob_get_contents();\n\t\t\t\t\t\t\t\t\tob_end_clean();\n\n\t\t\t\t\t\t\t\t\t$form .= $parent_form;\n\t\t\t\t\t\t\t\t\t$form .= parent::wck_output_meta_content( $box_args['meta_name'], $post_id, $box_args['meta_array'], $box_args );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n $form .= apply_filters( \"wck_fep_filter_after_form_{$form_name}_element_{$element_id}\", '</div>' );\n\n\t\t\t\tdo_action( \"wck_after_form_{$form_name}_element_{$element_id}\" );\n\n\t\t\t\t$element_id++;\n\t\t\t}\n\t\t}\n\n\n\t\tif( $action == 'edit' )\n\t\t\t$submit_text = apply_filters( 'wck_fep_form_button_update', __( 'Update Post', 'wck' ), $form_name );\n\t\telse\n\t\t\t$submit_text = apply_filters( 'wck_fep_form_button_add', __( 'Add Post', 'wck' ), $form_name );\n\n\t\tif (function_exists('icl_register_string') && function_exists('icl_translate') ) {\n\t\t\ticl_register_string( 'plugin wck', 'wck_label_translation_'.Wordpress_Creation_Kit::wck_generate_slug( $submit_text ), $submit_text );\n\t\t\t$submit_text = icl_translate( 'plugin wck', 'wck_label_translation_'.Wordpress_Creation_Kit::wck_generate_slug( $submit_text ), $submit_text );\n\t\t}\n\n\t\t$form .= '<input type=\"submit\" id=\"submit_'.$form_name.'\" value=\"'. $submit_text .'\" onclick=\"wckFepAddPost(\\''. $form_name .'\\', '. $post_id .', \\''. $action .'\\', \\''. $nonce .'\\');return false;\"/>';\n\n\t\t$form .= '</form>';\n\n\t\treturn $form;\n\t}", "public function save_add_new_form() {\n $page = filter_input(INPUT_GET, 'page');\n $action = filter_input(INPUT_POST, 'action');\n\n if ('swpm-form-builder' !== $page || 'create_form' !== $action) {\n return;\n }\n $level = absint(filter_input(INPUT_POST, 'form_for_level'));\n $type = absint(filter_input(INPUT_POST, 'form_type'));\n\n check_admin_referer('create_form');\n $reg_form_id = SwpmFbFormmeta::get_registration_form_id_by_level($level);\n if ($type == SwpmFbFormCustom::REGISTRATION) {\n if (!empty($reg_form_id)) { // Rego form for given level exists so no need to auto-create the corresponding profile form.\n return;\n }\n $form = new SwpmFbRegistrationFormmeta();\n } else if ($type == SwpmFbFormCustom::PROFILE) {\n $edit_form = SwpmFbFormmeta::get_profile_form_id_by_level($level);\n\n if (!empty($edit_form)) { // edit form for given level exists\n return;\n }\n $form = new SwpmFbProfileFormmeta();\n\n if (empty($reg_form_id)) {\n return;\n }\n $form->load($reg_form_id, true);\n }\n\n $form->key = sanitize_title(filter_input(INPUT_POST, 'form_title'));\n $form->title = esc_html(filter_input(INPUT_POST, 'form_title'));\n $form->for_level = $level;\n $success = $form->create();\n // Redirect to keep the URL clean (use AJAX in the future?)\n if ($success) {\n if ($type == SwpmFbFormCustom::REGISTRATION) {\n //Lets auto create the corresponding profile edit form also\n $edit_form = new SwpmFbProfileFormmeta();\n $edit_form->load($form->id, true);\n\n // Lets remove Verification and Secret fields as those are not required for Profile form\n foreach ($edit_form->fields as $key => $field) {\n if ($field->type == 'verification' || $field->type == 'secret') {\n unset($edit_form->fields[$key]);\n }\n }\n $edit_form->fields = array_values($edit_form->fields);\n\n $edit_form->title = 'Profile edit form for level: ' . $edit_form->for_level; //Set a meaningful title for this auto-created form.\n $edit_form->create();\n }\n wp_redirect('admin.php?page=swpm-form-builder&action=edit&form=' . $form->id);\n exit();\n }\n }", "function add_my_forms( $forms ) {\n $forms['form_slug'] = \"Coinwink\";\n return $forms;\n}", "abstract public function createForm();", "abstract public function createForm();", "public function xadmin_createform() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\t/* get the form field title */\n\t\t$form_title = $args [1];\n\t\t$form_type = @$args [2] ? $args [2] : 'blank';\n\t\t\n\t\t/* Load Model */\n\t\t$form = $this->getModel ( 'form' );\n\t\t$this->session->returnto ( 'forms' );\n\t\t\n\t\t/* create the form */\n\t\t$form->createNewForm ( $form_title, $form_type );\n\t\t\n\t\t$this->loadPluginModel ( 'forms' );\n\t\t$plug = Plugins_Forms::getInstance ();\n\t\t\n\t\t$plug->_pluginList [$form_type]->onAfterCreateForm ( $form );\n\t\t\n\t\t/* set the view file (optional) */\n\t\t$this->_redirect ( 'xforms' );\n\t\n\t}", "public function createForm()\n {\n }", "public function save_add_new_form() {\n\t\tglobal $wpdb;\n\n\t\tif ( !isset( $_REQUEST['action'] ) || !isset( $_GET['page'] ) )\n\t\t\treturn;\n\n\t\tif ( 'vfb-add-new' !== $_GET['page'] )\n\t\t\treturn;\n\n\t\tif ( 'create_form' !== $_REQUEST['action'] )\n\t\t\treturn;\n\n\t\tcheck_admin_referer( 'create_form' );\n\n\t\t$form_key \t\t= sanitize_title( $_REQUEST['form_title'] );\n\t\t$form_title \t= $_REQUEST['form_title'];\n\t\t$form_from_name = $_REQUEST['form_email_from_name'];\n\t\t$form_subject \t= $_REQUEST['form_email_subject'];\n\t\t$form_from \t\t= $_REQUEST['form_email_from'];\n\t\t$form_to \t\t= serialize( $_REQUEST['form_email_to'] );\n\n\n\t\t$email_design = array(\n\t\t\t'format' \t\t\t\t=> 'html',\n\t\t\t'link_love' \t\t\t=> 'yes',\n\t\t\t'footer_text' \t\t\t=> '',\n\t\t\t'background_color' \t\t=> '#eeeeee',\n\t\t\t'header_text' \t\t\t=> $form_subject,\n\t\t\t'header_image' \t\t\t=> '',\n\t\t\t'header_color' \t\t\t=> '#810202',\n\t\t\t'header_text_color' \t=> '#ffffff',\n\t\t\t'fieldset_color' \t\t=> '#680606',\n\t\t\t'section_color' \t\t=> '#5C6266',\n\t\t\t'section_text_color' \t=> '#ffffff',\n\t\t\t'text_color' \t\t\t=> '#333333',\n\t\t\t'link_color' \t\t\t=> '#1b8be0',\n\t\t\t'row_color' \t\t\t=> '#ffffff',\n\t\t\t'row_alt_color' \t\t=> '#eeeeee',\n\t\t\t'border_color' \t\t\t=> '#cccccc',\n\t\t\t'footer_color' \t\t\t=> '#333333',\n\t\t\t'footer_text_color' \t=> '#ffffff',\n\t\t\t'font_family' \t\t\t=> 'Arial',\n\t\t\t'header_font_size' \t\t=> 32,\n\t\t\t'fieldset_font_size' \t=> 20,\n\t\t\t'section_font_size' \t=> 15,\n\t\t\t'text_font_size' \t\t=> 13,\n\t\t\t'footer_font_size' \t\t=> 11\n\t\t);\n\n\t\t$newdata = array(\n\t\t\t'form_key' \t\t\t\t=> $form_key,\n\t\t\t'form_title' \t\t\t=> $form_title,\n\t\t\t'form_email_from_name'\t=> $form_from_name,\n\t\t\t'form_email_subject'\t=> $form_subject,\n\t\t\t'form_email_from'\t\t=> $form_from,\n\t\t\t'form_email_to'\t\t\t=> $form_to,\n\t\t\t'form_email_design' \t=> serialize( $email_design ),\n\t\t\t'form_success_message'\t=> '<p class=\"vfb-form-success\">Your form was successfully submitted. Thank you for contacting us.</p>'\n\t\t);\n\n\t\t// Create the form\n\t\t$wpdb->insert( $this->form_table_name, $newdata );\n\n\t\t// Get form ID to add our first field\n\t\t$new_form_selected = $wpdb->insert_id;\n\n\t\t// Setup the initial fieldset\n\t\t$initial_fieldset = array(\n\t\t\t'form_id' \t\t\t=> $wpdb->insert_id,\n\t\t\t'field_key' \t\t=> 'fieldset',\n\t\t\t'field_type' \t\t=> 'fieldset',\n\t\t\t'field_name' \t\t=> 'Fieldset',\n\t\t\t'field_sequence' \t=> 0\n\t\t);\n\n\t\t// Add the first fieldset to get things started\n\t\t$wpdb->insert( $this->field_table_name, $initial_fieldset );\n\n\t\t$verification_fieldset = array(\n\t\t\t'form_id' \t\t\t=> $new_form_selected,\n\t\t\t'field_key' \t\t=> 'verification',\n\t\t\t'field_type' \t\t=> 'verification',\n\t\t\t'field_name' \t\t=> 'Verification',\n\t\t\t'field_description' => '(This is for preventing spam)',\n\t\t\t'field_sequence' \t=> 1\n\t\t);\n\n\t\t// Insert the submit field\n\t\t$wpdb->insert( $this->field_table_name, $verification_fieldset );\n\n\t\t$verify_fieldset_parent_id = $wpdb->insert_id;\n\n\t\t$secret = array(\n\t\t\t'form_id' \t\t\t=> $new_form_selected,\n\t\t\t'field_key' \t\t=> 'secret',\n\t\t\t'field_type' \t\t=> 'secret',\n\t\t\t'field_name' \t\t=> 'Please enter any two digits',\n\t\t\t'field_description'\t=> 'Example: 12',\n\t\t\t'field_size' \t\t=> 'medium',\n\t\t\t'field_required' \t=> 'yes',\n\t\t\t'field_parent' \t\t=> $verify_fieldset_parent_id,\n\t\t\t'field_sequence' \t=> 2\n\t\t);\n\n\t\t// Insert the submit field\n\t\t$wpdb->insert( $this->field_table_name, $secret );\n\n\t\t// Make the submit last in the sequence\n\t\t$submit = array(\n\t\t\t'form_id' \t\t\t=> $new_form_selected,\n\t\t\t'field_key' \t\t=> 'submit',\n\t\t\t'field_type' \t\t=> 'submit',\n\t\t\t'field_name' \t\t=> 'Submit',\n\t\t\t'field_parent' \t\t=> $verify_fieldset_parent_id,\n\t\t\t'field_sequence' \t=> 3\n\t\t);\n\n\t\t// Insert the submit field\n\t\t$wpdb->insert( $this->field_table_name, $submit );\n\n\t\t// Redirect to keep the URL clean (use AJAX in the future?)\n\t\twp_redirect( 'admin.php?page=visual-form-builder-pro&action=edit&form=' . $new_form_selected );\n\t\texit();\n\t}", "public function cs_generate_form() {\n global $post;\n }", "function create_add_form($fields, $meta, $post, $context = '' ){\r\n\t\t$nonce = wp_create_nonce( 'wck-add-meta' );\r\n\t\tif( !empty( $post->ID ) )\r\n\t\t\t$post_id = $post->ID;\r\n\t\telse\r\n\t\t\t$post_id = '';\r\n\r\n /* for single forms we need the values that are stored in the meta */\r\n if( $this->args['single'] == true ) {\r\n if ($this->args['context'] == 'post_meta')\r\n $results = get_post_meta($post_id, $meta, true);\r\n else if ($this->args['context'] == 'option')\r\n $results = get_option( apply_filters( 'wck_option_meta' , $meta ));\r\n\r\n /* Filter primary used for CFC/OPC fields in order to show/hide fields based on type */\r\n $wck_update_container_css_class = apply_filters(\"wck_add_form_class_{$meta}\", '', $meta, $results );\r\n }\r\n ?>\r\n\t\t<div id=\"<?php echo $meta ?>\" style=\"padding:10px 0;\" class=\"wck-add-form<?php if( $this->args['single'] ) echo ' single' ?> <?php if( !empty( $wck_update_container_css_class ) ) echo $wck_update_container_css_class; ?>\">\r\n\t\t\t<ul class=\"mb-list-entry-fields\">\r\n\t\t\t\t<?php\r\n\t\t\t\t$element_id = 0;\r\n\t\t\t\tif( !empty( $fields ) ){\r\n\t\t\t\t\tforeach( $fields as $details ){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tdo_action( \"wck_before_add_form_{$meta}_element_{$element_id}\" );\r\n\r\n /* set values in the case of single forms */\r\n $value = '';\r\n if( $this->args['single'] == true ) {\r\n $value = null;\r\n if (isset($results[0][Wordpress_Creation_Kit_PB::wck_generate_slug($details['title'], $details )]))\r\n $value = $results[0][Wordpress_Creation_Kit_PB::wck_generate_slug($details['title'], $details )];\r\n }\r\n ?>\r\n\t\t\t\t\t\t\t<li class=\"row-<?php echo esc_attr( Wordpress_Creation_Kit_PB::wck_generate_slug( $details['title'], $details ) ) ?>\">\r\n <?php echo self::wck_output_form_field( $meta, $details, $value, $context, $post_id ); ?>\r\n\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tdo_action( \"wck_after_add_form_{$meta}_element_{$element_id}\" );\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$element_id++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t?>\r\n <?php if( ! $this->args['single'] || $this->args['context'] == 'option' ){ ?>\r\n <li style=\"overflow:visible;\" class=\"add-entry-button\">\r\n <a href=\"javascript:void(0)\" class=\"button-primary\" onclick=\"addMeta('<?php echo esc_js($meta); ?>', '<?php echo esc_js( $post_id ); ?>', '<?php echo esc_js($nonce); ?>')\"><span><?php if( $this->args['single'] ) echo apply_filters( 'wck_add_entry_button', __( 'Save', 'profile-builder' ), $meta, $post ); else echo apply_filters( 'wck_add_entry_button', __( 'Add Entry', 'wck' ), $meta, $post ); ?></span></a>\r\n </li>\r\n <?php }elseif($this->args['single'] && $this->args['context'] == 'post_meta' ){ ?>\r\n <input type=\"hidden\" name=\"_wckmetaname_<?php echo $meta ?>#wck\" value=\"true\">\r\n <?php } ?>\r\n </ul>\r\n\t\t</div>\r\n\t\t<script>wck_set_to_widest( '.field-label', '<?php echo $meta ?>' );</script>\r\n\t\t<?php\r\n\t}", "function awm_create_form($options)\n{\n\n $defaults = array(\n 'library' => '',\n 'id' => '',\n 'method' => 'post',\n 'action' => '',\n 'submit' => true,\n 'submit_label' => __('Register', 'awm'),\n 'nonce' => true\n );\n\n $settings = array_merge($defaults, $options);\n $library = $settings['library'];\n\n ob_start();\n?>\n <form id=\"<?php echo $settings['id']; ?>\" action=\"<?php echo $settings['action']; ?>\" method=\"<?php echo $post; ?>\">\n <?php\n if ($settings['nonce']) {\n wp_nonce_field($settings['id'], 'awm_form_nonce_field');\n }\n ?>\n <?php echo awm_show_content($library); ?>\n <?php if ($settings['submit']) {\n ?>\n <input type=\"submit\" id=\"awm-submit-<?php echo $settings['id'] ?>\" value=\"<?php echo $settings['submit_label']; ?>\" />\n <?php\n }\n ?>\n </form>\n<?php\n $content = ob_get_contents();\n ob_end_clean();\n return $content;\n}", "function enqueue_form()\n {\n }", "public function create_default_forms() {\n\t\t// Transfer form from Lite, but only if no Pro forms exist yet.\n\t\t$forms = get_posts(\n\t\t\tarray(\n\t\t\t\t'post_type' => 'mc4wp-form',\n\t\t\t\t'post_status' => 'publish'\n\t\t\t)\n\t\t);\n\n\t\tif ( empty( $forms ) ) {\n\n\t\t\t// no Pro forms found, try to transfer from lite.\n\t\t\t$default_form_markup = include dirname( __FILE__ ) . '/config/default-form.php';\n\t\t\t$form_markup = ( isset( $this->lite_options['form']['markup'] ) ) ? $this->lite_options['form']['markup'] : $default_form_markup;\n\t\t\t$lists = isset( $this->lite_options['form']['lists'] ) ? $this->lite_options['form']['lists'] : array();\n\n\t\t\t// create default form\n\t\t\t$default_form_id = $this->create_form( \"Default form\", $form_markup, $lists );\n\n\t\t\t// set default form ID (for when no ID given in shortcode / function args)\n\t\t\tupdate_option( 'mc4wp_default_form_id', $default_form_id );\n\n\t\t\t// create inline form\n\t\t\t$inline_form_markup = include dirname( __FILE__ ) . '/config/inline-form.php';\n\t\t\t$this->create_form( \"Short form\", $inline_form_markup, $lists );\n\t\t}\n\t}", "function psc_save_form($data) {\n\tglobal $wpdb, $psc;\n\t\n\t$old_fields = $data['data'];\n\t$fields = array();\n\tforeach($old_fields as $field) {\n\t\t$fields[] = $field;\n\t}\n\t\n\tforeach($fields as $key => $value) {\n\t\tif(empty($value['options']) || !in_array($value['type'], array('select', 'multiselect', 'radio', 'checkbox'))) {\n\t\t\tunset($fields[$key]['options']);\n\t\t}\n\t\t\n\t\tif(isset($fields[$key]['options'])) {\n\t\t\t$fields[$key]['options'] = explode(',', $fields[$key]['options']);\n\t\t\t$fields[$key]['options'] = array_map('trim', $fields[$key]['options']);\n\t\t}\n\t\t\n\t\t$fields[$key]['slug'] = 'psc_'.str_replace('psc_', '', $value['slug']);\n\t\tif(isset($value['required']) && $value['required']=='on') {\n\t\t\t$fields[$key]['required'] = 'true';\n\t\t} else {\n\t\t\t$fields[$key]['required'] = 'false';\n\t\t}\n\t\t\n\t\tif(isset($value['maps_as']) && $value['maps_as']=='on') {\n\t\t\t$fields[$key]['maps_as'] = 'content';\n\t\t} else {\n\t\t}\n\t}\n\t\n \tif(isset($data['captcha']) && $data['captcha']=='on') {\n\t\t// nothing\n\t\t$data['captcha'] = 1;\n\t} else {\n\t\t$data['captcha'] = 0;\n\t}\n\t\n\tif(isset($data['thanks_url']) && !empty($data['thanks_url'])) {\n\t\t// nothing\n\t} else {\n\t\t$data['thanks_url'] = null;\n\t}\n\t\n\t// echo '<br /><br />';\n\t// var_dump('SET data=\\''.mysql_escape_string(serialize($fields)).'\\', name=\"'.mysql_escape_string($data['title']).'\", slug=\"'.mysql_escape_string($data['slug']).'\", thanks_url=\"'.mysql_escape_string($data['thanks_url']).'\", default_status=\"'.mysql_escape_string($data['default_status']).'\", default_category=\"'.mysql_escape_string($data['default_category']).'\", captcha=\"'.mysql_escape_string($data['captcha']).'\"');\n\t\n\tif(isset($data['psc_id'])) {\n\t\t$wpdb->query('UPDATE '.$psc->forms.' SET data=\\''.serialize($fields).'\\', name=\"'.$data['title'].'\", slug=\"'.$data['slug'].'\", thanks_url=\"'.$data['thanks_url'].'\", default_status=\"'.$data['default_status'].'\", default_category=\"'.$data['default_category'].'\", captcha=\"'.$data['captcha'].'\" WHERE id=\"'.$data['psc_id'].'\"');\n\t\treturn true;\n\t} else {\n\t\t$insert_array = array('data' => serialize($fields), 'name' => $data['title'], 'slug' => $data['slug'], 'thanks_url' => $data['thanks_url'], 'default_status' => $data['default_status'], 'default_category' => $data['default_category'], 'captcha' => $data['catpcha']);\n\t\t$wpdb->insert($psc->forms, $insert_array);\n\t\treturn $wpdb->insert_id;\n\t}\n}", "function wck_fep_create_frontend_form( ){\n\n\t\t/* check for anonymous posting */\n\t\tif( $this->args['anonymous_posting'] == 'no' && !is_user_logged_in() ){\n\t\t\t/* get login logout form */\n\t\t\t$lilo_form = wck_fep_output_lilo_form();\n\t\t\tdie( $lilo_form );\n\t\t}\n\n\t\tif( !empty( $_POST['action_type'] ) )\n\t\t\t$action = sanitize_text_field( $_POST['action_type'] );\n\t\telse\n\t\t\t$action = '';\n\t\tif( !empty( $_POST['post_id'] ) )\n\t\t\t$post_id = absint( $_POST['post_id'] );\n\t\telse\n\t\t\t$post_id = '';\n\n\t\t/* take care of auto_drafts only when adding posts ( the default case ) */\n\t\tif( $action == '' ){\n\t\t\t/* delete auto drafts older than 12 hours */\n\t\t\t$args = array(\n\t\t\t\t\t\t'post_status' \t\t=> \t'auto-draft',\n\t\t\t\t\t\t'numberposts' \t\t=> \t-1,\n\t\t\t\t\t\t'suppress_filters' \t=> \tfalse,\n\t\t\t\t\t\t'post_type' \t\t=> \t'any'\n\t\t\t\t\t);\n\n\t\t\tadd_filter( 'posts_where', array( &$this, 'wck_fep_filter_auto_drafts_where' ) );\n\t\t\t$auto_drafts = get_posts( $args );\n\t\t\tremove_filter( 'posts_where', array( &$this, 'wck_fep_filter_auto_drafts_where' ) );\n\n\n\t\t\tif( !empty($auto_drafts) ){\n\t\t\t\tforeach( $auto_drafts as $auto_draft ){\n\n\t\t\t\t\t/* also delete all post meta for the auto-draft post */\n\t\t\t\t\t$meta_keys = get_post_custom_keys( $auto_draft->ID );\n\t\t\t\t\tif( !empty($meta_keys) ){\n\t\t\t\t\t\tforeach( $meta_keys as $meta_key ){\n\n\t\t\t\t\t\t\tdelete_post_meta( $auto_draft->ID, $meta_key );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t/* delete attachemnts for the auto draft */\n\t\t\t\t\t$args = array(\n\t\t\t\t\t\t'post_parent' => $auto_draft->ID,\n\t\t\t\t\t\t'post_type' => 'attachment',\n\t\t\t\t\t\t'numberposts' => -1\n\t\t\t\t\t);\n\t\t\t\t\t$attachments = get_children( $args );\n\t\t\t\t\tif( !empty( $attachments ) ){\n\t\t\t\t\t\tforeach( $attachments as $attachment ){\n\t\t\t\t\t\t\twp_delete_attachment( $attachment->ID );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t/* delete the post */\n\t\t\t\t\twp_delete_post( $auto_draft->ID, true );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* create a new post? not if we allready have a $post_id ( probabily edit case )*/\n\t\tif ( !$post_id ) {\n\t\tglobal $post;\n\t\t\t$post_id = wp_insert_post( array( 'post_title' => __( 'Auto Draft' ), 'post_type' => $this->args['post_type'], 'post_status' => 'auto-draft' ) );\n\t\t\t$post = get_post( $post_id );\n\t\t}\n\n\t\t/* create default post elements */\n\t\t$form = self::create_add_form( $this->args['meta_array'], $this->args['form_name'], $post_id, $action );\n\n\t\techo $form;\n\n\t\texit();\n\t}", "public function conversational_form_hooks() {\n\n\t\t\\add_filter( 'template_include', array( $this, 'get_form_template' ), PHP_INT_MAX );\n\t\t\\add_filter( 'document_title_parts', array( $this, 'change_form_page_title' ) );\n\t\t\\add_filter( 'post_type_link', array( $this, 'modify_permalink' ), 10, 2 );\n\n\t\t\\remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10 );\n\n\t\t\\add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );\n\n\t\t\\add_action( 'wpforms_wp_footer', array( $this, 'dequeue_scripts' ) );\n\t\t\\add_action( 'wpforms_frontend_confirmation', array( $this, 'dequeue_scripts' ) );\n\t\t\\add_action( 'wp_print_styles', array( $this, 'css_compatibility_mode' ) );\n\t\t\\add_action( 'wp_head', array( $this, 'print_form_styles' ) );\n\t\t\\add_filter( 'body_class', array( $this, 'set_body_classes' ) );\n\n\t\t\\add_filter( 'wpseo_opengraph_desc', array( $this, 'yoast_seo_description' ) );\n\t\t\\add_filter( 'wpseo_twitter_description', array( $this, 'yoast_seo_description' ) );\n\n\t\t\\add_filter( 'wpforms_frontend_form_data', array( $this, 'ignore_pagebreaks' ) );\n\t\t\\add_filter( 'wpforms_field_data', array( $this, 'ignore_date_dropdowns' ), 10, 2 );\n\t\t\\add_filter( 'wpforms_field_properties', array( $this, 'ignore_multi_column_layout' ), 10, 3 );\n\t\t\\add_filter( 'wpforms_field_properties', array( $this, 'add_data_field_type_attr' ), 10, 3 );\n\t\t\\add_action( 'wpforms_display_field_after', array( $this, 'add_file_upload_html' ), 10, 2 );\n\n\t\t\\add_action( 'wpforms_conversational_forms_content_before', array( $this, 'form_loader_html' ) );\n\t\t\\add_action( 'wpforms_conversational_forms_content_before', array( $this, 'form_header_html' ) );\n\t\t\\add_action( 'wpforms_conversational_forms_footer', array( $this, 'form_footer_html' ) );\n\t}", "function psc_edit_form($form_id=null) {\n\tglobal $wpdb, $psc;\n\t\n\tif($form_id) {\n\t\t$form = $wpdb->get_results('SELECT * FROM '.$psc->forms.' WHERE id=\"'.$form_id.'\"');\n\t}\n\t\n\t$categories = $wpdb->get_results('SELECT * FROM '.$wpdb->prefix.'terms');\n\t$stati = array('pending', 'draft', 'published');\n\t$field_types = array('text', 'textarea', 'hidden', 'select', 'multiselect', 'radio', 'checkbox', 'file');\n\t\n\tif(isset($form) && count($form)===0) {\n\t\techo 'Sorry, but a form with that ID does not exist.';\n\t} else {\n\t\tif(isset($form[0]->data)) {\n\t\t\t$fields = unserialize($form[0]->data);\n\t\t} else {\n\t\t\t$form = array(\n\t\t\t\t(object) array(\n\t\t\t\t\t'name' => '',\n\t\t\t\t\t'slug' => '',\n\t\t\t\t\t'default_category' => '',\n\t\t\t\t\t'default_status' => 'pending',\n\t\t\t\t\t'thanks_url' => '',\n\t\t\t\t\t'captcha' => 0\n\t\t\t\t)\n\t\t\t);\n\t\t\t$fields = array();\n\t\t}\n\t\t// Edit the form!!\n\t\techo '\n\t\t<div class=\"wrap\">\n\t\t\t<div id=\"icon-edit\" class=\"icon32 icon32-posts-post\"><br /></div>\n\t\t\t<h2>Edit Form</h2>';\n\t\t\tif($form_id) {\n\t\t\t\techo '<form name=\"post\" action=\"'.get_bloginfo('siteurl').'/wp-admin/admin.php?page=publicly-submitted-content/admin&action=edit_form&id='.$form_id.'\" method=\"post\" id=\"post\">';\n\t\t\t} else {\n\t\t\t\techo '<form name=\"post\" action=\"'.get_bloginfo('siteurl').'/wp-admin/admin.php?page=publicly-submitted-content/admin&action=new_form\" method=\"post\" id=\"post\">';\n\t\t\t}\n\t\t\twp_nonce_field('psc_nonce_field', 'psc_save');\n\t\t\techo '\n\t\t\t\t<div id=\"post-body\">\n\t\t\t\t\t<div id=\"post-body-content\">\n\t\t\t\t\t\t<div id=\"titlediv\">';\n\t\t\t\t\t\tif($form_id) { echo '<input type=\"hidden\" name=\"psc_id\" value=\"'.$form_id.'\" />'; }\n\t\t\t\t\t\techo '<div id=\"titlewrap\">\n\t\t\t\t\t\t\t\t<label class=\"hide-if-no-js\" style=\"visibility:hidden\" id=\"title-prompt-text\" for=\"title\">Enter name here</label>';\n\t\t\t\t\t\t\t\tif($form_id) {\n\t\t\t\t\t\t\t\t\techo '<input type=\"text\" name=\"title\" size=\"30\" tabindex=\"1\" value=\"'.$form[0]->name.'\" id=\"title\" autocomplete=\"off\" />';\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\techo '<input type=\"text\" name=\"title\" size=\"30\" tabindex=\"1\" value=\"\" id=\"title\" autocomplete=\"off\" />';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\techo '</div>\n\t\t\t\t\t\t\t<div class=\"inside\">\n\t\t\t\t\t\t\t\t<div id=\"edit-slug-box\">\n\t\t\t\t\t\t\t\t\t<strong>Slug:</strong> ';\n\t\t\t\t\t\t\t\t\tif($form_id) {\n\t\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"form_slug\" name=\"slug\" value=\"'.$form[0]->slug.'\" /><span id=\"sample-permalink\">'.$form[0]->slug.'</span>';\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"form_slug\" name=\"slug\" value=\"\" /><span id=\"sample-permalink\"></span>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo '</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div id=\"form_edit_options\" class=\"postbox fieldItem\">\n\t\t\t\t\t\t\t\t<h3 class=\"hndle\"><span>Form Options</span></h3>\n\t\t\t\t\t\t\t\t<div class=\"inside\">\n\t\t\t\t\t\t\t\t\t<div class=\"select\">\n\t\t\t\t\t\t\t\t\t\t<label for=\"default_category\">Default Category</label>\n\t\t\t\t\t\t\t\t\t\t<select name=\"default_category\" id=\"default_category\">';\n\t\t\t\t\t\t\t\t\t\tforeach($categories as $category) {\n\t\t\t\t\t\t\t\t\t\t\techo '<option value=\"'.$category->term_id.'\"';\n\t\t\t\t\t\t\t\t\t\t\tif($form_id) {\n\t\t\t\t\t\t\t\t\t\t\t\tif($category->term_id==$form[0]->default_category) { echo ' selected=\"selected\"'; }\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\tif($category->slug=='publicly_submitted_content') { echo ' selected=\"selected\"'; }\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\techo '>'.$category->name.'</option>'.\"\\r\\n\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\techo '</select>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"select\">\n\t\t\t\t\t\t\t\t\t\t<label for=\"default_status\">Default Status</label>\n\t\t\t\t\t\t\t\t\t\t<select name=\"default_status\" id=\"default_status\">';\n\t\t\t\t\t\t\t\t\t\tforeach($stati as $state) {\n\t\t\t\t\t\t\t\t\t\t\techo '<option value=\"'.$state.'\"';\n\t\t\t\t\t\t\t\t\t\t\tif($form_id) {\n\t\t\t\t\t\t\t\t\t\t\t\tif($state==$form[0]->default_status) { echo ' selected=\"selected\"'; }\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\techo '>'.ucfirst($state).'</option>'.\"\\r\\n\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\techo '</select>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"checkbox\">\n\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\"';\n\t\t\t\t\t\t\t\t\t\tif($form_id) {\n\t\t\t\t\t\t\t\t\t\t\tif($form[0]->captcha==1) { echo ' checked'; }\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\techo ' name=\"captcha\" id=\"captcha_option\" />';\n\t\t\t\t\t\t\t\t\t\techo '<label for=\"captcha_option\">Use Captcha?</label>\n\t\t\t\t\t\t\t\t\t</div>';\n\t\t\t\t\t\t\t\t\techo '<div id=\"psc_catcha_info\" style=\"display:none\">\n\t\t\t\t\t\t\t\t\t\t<p>You must enter a re:Captcha public &amp; private keys in order to utilize captcha.</p>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"public_key\" id=\"api_key\" value=\"'.get_option('psc_recaptch_public_key').'\" />\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"private_key\" id=\"private_key\" value=\"'.get_option('psc_recaptch_private_key').'\" />\n\t\t\t\t\t\t\t\t\t<div class=\"text\">\n\t\t\t\t\t\t\t\t\t\t<label for=\"thanks_url\">Thanks Redirect <span class=\"small\">(leave blank to not use a redirect or if the redirect is causing a blank page.)</span></label>\n\t\t\t\t\t\t\t\t\t\t<div class=\"thanksLink\">\n\t\t\t\t\t\t\t\t\t\t\t'.get_bloginfo('siteurl').'<input type=\"text\" name=\"thanks_url\" id=\"thanks_url\" value=\"';\n\t\t\t\t\t\t\t\t\t\t\tif($form_id) { echo $form[0]->thanks_url; }\n\t\t\t\t\t\t\t\t\t\t\techo '\" />\n\t\t\t\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\t<div id=\"major-publishing-actions\">\n\t\t\t\t\t\t\t\t<div id=\"delete-action\">\n\t\t\t\t\t\t\t\t\t<a class=\"submitdelete deletion\" href=\"#\">Delete Form</a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<div id=\"publishing-action\">\n\t\t\t\t\t\t\t\t\t<input name=\"save\" type=\"submit\" class=\"button-primary\" id=\"publish\" tabindex=\"5\" accesskey=\"p\" value=\"Save Form\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"clear\"></div>\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\t';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\techo '</div>\n\t\t\t\t\t\t\t<div id=\"normal-sortables\" class=\"meta-box-sortables ui-sortable fieldItems\">\n\t\t\t\t\t\t\t\t';\n\t\t\t\t\t\t\tif(!$form_id) {\n\t\t\t\t\t\t\t\t$key = 0;\n\t\t\t\t\t\t\t\techo '<div id=\"field'.$key.'item\" class=\"postbox fieldItem\">\n\t\t\t\t\t\t\t\t<div class=\"handlediv\" title=\"Click to toggle\"><br></div><h3 class=\"hndle\"><span>[Label]</span></h3>\n\t\t\t\t\t\t\t\t<div class=\"inside\" style=\"display:block;\">\n\t\t\t\t\t\t\t\t\t<a href=\"#\" class=\"deleteFieldItem\">Delete Field</a>\n\t\t\t\t\t\t\t\t\t<div class=\"text\"><label for=\"field'.$key.'label\">Label</label><input type=\"text\" name=\"data['.$key.'][label]\" class=\"fieldlabel\" id=\"field'.$key.'label\" value=\"\" /></div>';\n\t\t\t\t\t\t\t\t\techo '<div class=\"text\"><label for=\"field'.$key.'slug\">Slug/ID/Name</label><input type=\"text\" name=\"data['.$key.'][slug]\" class=\"slugify\" id=\"field'.$key.'slug\" value=\"\" /></div>';\n\t\t\t\t\t\t\t\t\techo '<div class=\"select\"><label for=\"field'.$key.'type\">Type</label><select name=\"data['.$key.'][type]\" class=\"fieldtype\" id=\"field'.$key.'type\">';\n\t\t\t\t\t\t\t\t\t\tforeach($field_types as $field_type) {\n\t\t\t\t\t\t\t\t\t\t\techo '<option value=\"'.$field_type.'\">';\n\t\t\t\t\t\t\t\t\t\t\tif($field_type=='file') { echo 'Image'; } else { echo ucfirst($field_type); }\n\t\t\t\t\t\t\t\t\t\t\techo '</option>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\techo '</select></div>';\n\t\t\t\t\t\t\t\t\techo '<div class=\"text options\" style=\"display:none;\"><label for=\"field'.$key.'options\">Options</label>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" name=\"data['.$key.'][options]\" id=\"field'.$key.'options\" value=\"\" />\n\t\t\t\t\t\t\t\t\t<p class=\"small\">(comma separated list of options for select, multiselect, checkbox, and radio types)</p></div>';\n\t\t\t\t\t\t\t\t\techo '<div class=\"checkbox\"><input type=\"checkbox\" name=\"data['.$key.'][required]\" id=\"field'.$key.'required\" /><label for=\"field'.$key.'required\">Required</label></div>';\n\t\t\t\t\t\t\t\t\techo '<div class=\"checkbox\"><input type=\"checkbox\" name=\"data['.$key.'][maps_as]\" id=\"field'.$key.'maps_as\" /><label for=\"field'.$key.'maps_as\">Use this as the \"post content\"</label></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} else {\n\t\t\t\t\t\t\t\tforeach($fields as $key => $field) {\n\t\t\t\t\t\t\t\t\techo '<div id=\"field'.$key.'item\" class=\"postbox fieldItem closed\">\n\t\t\t\t\t\t\t\t\t<div class=\"handlediv\" title=\"Click to toggle\"><br></div><h3 class=\"hndle\"><span>'.$field['label'].'</span></h3>\n\t\t\t\t\t\t\t\t\t<div class=\"inside\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#\" class=\"deleteFieldItem\">Delete Field</a>\n\t\t\t\t\t\t\t\t\t\t<div class=\"text\"><label for=\"field'.$key.'label\">Label</label><input type=\"text\" name=\"data['.$key.'][label]\" class=\"fieldlabel\" id=\"field'.$key.'label\" value=\"'.$field['label'].'\" /></div>';\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"text\"><label for=\"field'.$key.'slug\">Slug/ID/Name</label><input type=\"text\" name=\"data['.$key.'][slug]\" class=\"slugify\" id=\"field'.$key.'slug\" value=\"'.str_replace('psc_', '', $field['slug']).'\" /></div>';\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"select\"><label for=\"field'.$key.'type\">Type</label><select name=\"data['.$key.'][type]\" class=\"fieldtype\" id=\"field'.$key.'type\">';\n\t\t\t\t\t\t\t\t\t\t\tforeach($field_types as $field_type) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<option value=\"'.$field_type.'\"';\n\t\t\t\t\t\t\t\t\t\t\t\tif($field_type==$field['type']) { echo ' selected=\"selected\"'; }\n\t\t\t\t\t\t\t\t\t\t\t\techo '>';\n\t\t\t\t\t\t\t\t\t\t\t\tif($field_type=='file') { echo 'Image'; } else { echo ucfirst($field_type); }\n\t\t\t\t\t\t\t\t\t\t\t\techo '</option>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\techo '</select></div>';\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"text options\"';\n\t\t\t\t\t\t\t\t\t\tif(!in_array($field['type'], array('select', 'multiselect', 'radio', 'checkbox'))) {\n\t\t\t\t\t\t\t\t\t\t\techo ' style=\"display:none;\"';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\techo '><label for=\"field'.$key.'options\">Options</label>\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" name=\"data['.$key.'][options]\" id=\"field'.$key.'options\" value=\"';\n\t\t\t\t\t\t\t\t\t\tif(isset($field['options']) && !empty($field['options'])) { echo implode(',', $field['options']); }\n\t\t\t\t\t\t\t\t\t\techo '\" />\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"small\">(comma separated list of options for select, multiselect, checkbox, and radio types)</p>\n\t\t\t\t\t\t\t\t\t\t</div>';\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"checkbox\"><input type=\"checkbox\" name=\"data['.$key.'][required]\" id=\"field'.$key.'required\"';\n\t\t\t\t\t\t\t\t\t\tif($field['required']=='true') {\n\t\t\t\t\t\t\t\t\t\t\techo ' checked';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\techo ' /><label for=\"field'.$key.'required\">Required</label></div>';\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"checkbox\"><input type=\"checkbox\"';\n\t\t\t\t\t\t\t\t\t\tif(isset($field['maps_as']) && $field['maps_as']=='content') {\n\t\t\t\t\t\t\t\t\t\t\techo ' checked';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\techo ' name=\"data['.$key.'][maps_as]\" id=\"field'.$key.'maps_as\" /><label for=\"field'.$key.'maps_as\">Use this as the \"post content\"</label></div>\n\t\t\t\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}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\techo '\n\t\t\t\t\t\t\t</div><input type=\"hidden\" id=\"psckeycount\" value=\"'.($key+1).'\" />\n\t\t\t\t\t\t\t<a id=\"add_form_field\" class=\"preview button\" href=\"#\">Add form field</a>\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</form>';\n\t}\n}", "function post_form($placeholder) {\n\n\n \techo '<form action=\"' . esc_url( $_SERVER['REQUEST_URI'] ) . '\" method=\"post\">';\n \techo '<p>';\n \techo 'Your Name (required) <br/>';\n \techo '<input class=\"inp\" type=\"text\" name=\"cf-name\" pattern=\"[a-zA-Z0-9 ]+\" value=\"' . ( isset( $_POST[\"cf-name\"] ) ? esc_attr( $_POST[\"cf-name\"] ) : '' ) . '\" size=\"40\" />';\n \techo '</p>';\n \techo '<p>';\n \techo 'Your Email (required) <br/>';\n \techo '<input class=\"inp\" type=\"email\" name=\"cf-email\" value=\"' . ( isset( $_POST[\"cf-email\"] ) ? esc_attr( $_POST[\"cf-email\"] ) : '' ) . '\" size=\"40\" />';\n \techo '</p>';\n \techo '<p>';\n \techo 'Subject (required) <br/>';\n \techo '<input class=\"inp\" type=\"text\" name=\"cf-subject\" pattern=\"[a-zA-Z ]+\" value=\"' . ( isset( $_POST[\"cf-subject\"] ) ? esc_attr( $_POST[\"cf-subject\"] ) : '' ) . '\" size=\"40\" />';\n \techo '</p>';\n \techo '<p>';\n \techo 'Your Message (required) <br/>';\n \techo '<textarea rows=\"10\" cols=\"35\" name=\"cf-message\" placeholder=\"'.$placeholder.'\">' . ( isset( $_POST[\"cf-message\"] ) ? esc_attr( $_POST[\"cf-message\"] ) : '' ) . '</textarea>';\n \techo '</p>';\n \techo '<p><input class=\"inp\" type=\"submit\" name=\"cf-submitted\" value=\"Send\"></p>';\n \techo '</form>';\n }", "function cmb2_do_frontend_form_shortcode( $atts = array() ) {\n\tglobal $post;\n\n\t/**\n\t * Depending on your setup, check if the user has permissions to edit_posts\n\t */\n\tif ( ! current_user_can( 'edit_posts' ) ) {\n\t\treturn __( 'You do not have permissions to edit this post.', 'lang_domain' );\n\t}\n\n\t/**\n\t * Make sure a WordPress post ID is set.\n\t * We'll default to the current post/page\n\t */\n\tif ( ! isset( $atts['post_id'] ) ) {\n\t\t$atts['post_id'] = $post->ID;\n\t}\n\n\t// If no metabox id is set, yell about it\n\tif ( empty( $atts['id'] ) ) {\n\t\treturn __( \"Please add an 'id' attribute to specify the CMB2 form to display.\", 'lang_domain' );\n\t}\n\n\t$metabox_id = esc_attr( $atts['id'] );\n\t$object_id = absint( $atts['post_id'] );\n\t// Get our form\n\t$form = cmb2_get_metabox_form( $metabox_id, $object_id );\n\n\treturn $form;\n}", "private function output_acf_form($args = []){\n //if step 1 create new post, otherwise get post_id from url\n $requested_post_id = $this->get_requested_post_id();\n\n //get the current step we are in\n $requested_step = $this->get_requested_step();\n\n $args = wp_parse_args(\n $args,\n array(\n 'post_id' => $requested_post_id,\n 'step' => 'new_post' === $requested_post_id ? 1 : $requested_step,\n 'post_type' => $this->post_type,\n 'post_status' => 'publish',\n )\n );\n\n $submit_label = $args['step'] < count($this->step_ids) ? esc_html__('Save and Continue', 'caims') : esc_html__('Finish', 'caims');\n $current_step_fields = ($args['post_id'] !== 'new_post' && $args['step'] > 1) ? $this->step_ids[(int) $args['step'] - 1] : $this->step_ids[0];\n\n //show the progress bar before the form\n $this->display_progress_bar($args);\n\n /**\n * display the form with acf_form()\n */\n acf_form(\n array(\n 'id' => $this->form_id,\n 'post_id' => $args['post_id'],\n 'new_post' => array(\n 'post_type' => $args['post_type'],\n 'post_status' => $args['post_status']\n ),\n 'field_groups' => $current_step_fields,\n 'submit_value' => $submit_label,\n 'html_after_fields' => $this->output_hidden_fields($args)\n )\n );\n }", "function html_form_code() {\n $form = \"\";\n $form.=\"<form action='\" . esc_url($_SERVER['REQUEST_URI']) . \"' method='post'>\";\n $form.=\"<input type='text' name='ms-name' value='\" . ( isset($_POST[\"ms-name\"]) ? esc_attr($_POST[\"ms-name\"]) : '' ) . \"' placeholder='Ваше Имя'/>\";\n $form.=\"<input type='email' name='ms-email' value='\" . ( isset($_POST[\"ms-email\"]) ? esc_attr($_POST[\"ms-email\"]) : '' ) . \"' placeholder='Ваш E-mail'/>\";\n $form.=\"<input name='ms-submit' type='submit' id='add-share-btn' value='Получить доступ'/>\";\n $form.=\"</form>\";\n echo $form;\n}", "function membersemail_form()\n{\n $content = '';\n $content .= '<form method=\"post\" action=\"http://localhost/wordpress/thank-you/\">';\n\n $content .= '<input type=\"text\" name=\"full_name\" placeholder=\"Your Full Name\"/>';\n $content .= '<br />';\n\n $content .= '<input type=\"text\" name=\"email_address\" placeholder=\"Enter Email Address\"/>';\n $content .= '<br />';\n\n\n\n $content .= '<input type=\"submit\" name=\"membersemail_submit_form\" value=\"SUBMIT\" >';\n\n\n $content .= '</form>';\n return $content;\n}", "public function admin_add_new() {\n?>\n\t<div class=\"wrap\">\n\t\t<h2><?php _e( 'Add New Form', 'visual-form-builder-pro' ); ?></h2>\n<?php\n\t\tinclude_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/admin-new-form.php' );\n?>\n\t</div>\n<?php\n\t}", "function content_form($post_type,$post_id = '',$action='',$thankyou = array()){\n\t$app = \\Jolt\\Jolt::getInstance();\n\t//\tgrab blueprint based on content type..\n\t$blueprint = $app->store('blueprints');\n\t$blueprint = $blueprint[ $post_type ];\n//\tprint_r( $blueprint );\n\t$nonce = generate_nonce();\n\n\tif( isset($_POST['title']) ){\n//\t\tprint_r($_POST);\n\t\t$c_url = site_url().$_SERVER['REQUEST_URI'];\n\t\t$post \t\t\t\t= array();\n\t\t$post['title'] \t\t= $_POST['title'];\n\t\t$post['name'] \t\t= new_slug( slugify( $_POST['title'] ) );\n\t\t$post['type'] \t\t= $post_type;\n\t\t$post['user_id'] \t= '';\n\t\t$post['date'] \t\t= date('Y-m-d H:i:s');\n\t\t$post['modified']\t= date('Y-m-d H:i:s');\n\t\t$post['password'] \t= '';\n\t\t$post['status'] \t= 'draft';\t//\tregardless of post type, we never want a post actually published from here..\n\t\t$post['parent'] \t= 0;\n\t\t$post['guid'] \t\t= generate_uuid();\n\t\t$post['category'] \t= '';\n\t\t$restricted = array('_id','title','name','user_id','date','modified','guid','type','status','parent','password');\n\t\tforeach($blueprint['fields'] as $fname=>$field ){\n\t\t\tif( isset($post[$k]) )\tcontinue;\n\t\t\t//\tThere are fields we don't want to change... This makes sure we don't...\n\t\t\tif( in_array($restricted,$fname) )\tcontinue;\n\t\t\tif( !isset($_POST[ $fname ]) ){\n\t\t\t\tif( $field['type'] == 'related' ){\n\t\t\t\t\t$_POST[ $fname ] = array();\n\t\t\t\t}else{\n\t\t\t\t\t$_POST[ $fname ] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach($_POST as $k=>$v){\n\t\t\tif( isset($post[$k]) )\tcontinue;\n\t\t\tif( in_array($restricted,$k) )\tcontinue;\n\t\t\t$post[$k] = $v;\n\t\t}\n\t\tif( isset($_FILES) ){\n\t\t\tforeach($_FILES as $k=>$file){\n\t\t\t\tif( in_array($restricted,$k) )\tcontinue;\n\t\t\t\t$uploaddir = $this->app->store('upload_path');\n\t\t\t\t$uploadfile = $uploaddir . basename($file['name']);\n\t\t\t\t$uploadurl = $this->app->store('upload_url') . basename($file['name']);\n\t\t\t\tif( file_exists($uploadfile) ){\n\t\t\t\t\t$post[$k] = $uploadurl;\n\t\t\t\t}else{\n\t\t\t\t\tif ( move_uploaded_file($file['tmp_name'], $uploadfile) ) {\n\t\t\t\t\t\t$post[$k] = $uploadurl;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$app->db->insert('post', $post );\n\t\tunset($_POST);\n\t\tif( isset($thankyou['url']) ){\n\t\t\techo '<script>top.location.href=\"'.$thankyou['url'].'\";</script>';\n\t\t}else if( isset($thankyou['msg']) ){\n\t\t\techo '<p>'.$thankyou['msg'].'</p>';\n\t\t}else{\n\t\t\techo '<p><strong>Thank you, your post has been saved.</strong></p>';\n\t\t}\n\t}\n?>\n\t<form role=\"form\" method=\"POST\" action=\"<?php echo $action?>\" enctype=\"multipart/form-data\">\n\t<input type=\"hidden\" name=\"nonce\" value=\"<?php echo $nonce?>\" />\n\t<fieldset>\n\t\t<div class=\"form-group\">\n\t\t\t<label for=\"title\"><?=( isset($blueprint['titlelabel']) ? $blueprint['titlelabel'] : \"Title\")?></label>\n\t\t\t<input type=\"text\" class=\"form-control\" id=\"title\" name=\"title\" placeholder=\"<?=( isset($blueprint['titlelabel']) ? $blueprint['titlelabel'] : \"Enter Title\")?>\" value=\"<?php echo ( isset($post) ? $post['title'] : '');?>\" required>\n\t\t</div>\n<?php\n\t\tforeach($blueprint['fields'] as $fname=>$field ){\n\t\t\tif( $field['adminonly'] )\tcontinue;\n\t\t\tform_field($fname,$field,$post);\n\t\t}\n?>\n\t\t<button type=\"submit\" class=\"btn btn-primary\">Save</button>\n\t</fieldset>\n\t</form>\n<?php\n}", "function bab_pm_makeform()\n{\n global $prefs;\n\n $bab_hidden_input = '';\n $event = gps('event');\n $step = gps('step');\n\n if (!$event) {\n $event = 'postmaster';\n }\n\n if (!$step) {\n $step = 'subscribers';\n }\n\n if ($step == 'subscribers') {\n $bab_columns = array(\n 'subscriberFirstName',\n 'subscriberLastName',\n 'subscriberEmail',\n 'subscriberLists',\n );\n\n for ($i = 1; $i <= BAB_CUSTOM_FIELD_COUNT; $i++) {\n $bab_columns[] = \"subscriberCustom{$i}\";\n }\n\n $bab_submit_value = 'Add Subscriber';\n $bab_prefix = 'new';\n $subscriberToEdit = gps('subscriber');\n\n if ($subscriberToEdit) {\n $bab_hidden_input = '<input type=\"hidden\" name=\"editSubscriberId\" value=\"' . doSpecial($subscriberToEdit) . '\">';\n $bab_prefix = 'edit';\n $bab_submit_value = 'Update Subscriber Information';\n\n $row = safe_row('*', 'bab_pm_subscribers', \"subscriberID=\" . doSlash($subscriberToEdit));\n $subscriber_lists = safe_rows('*', 'bab_pm_subscribers_list', \"subscriber_id = \" . doSlash($row['subscriberID']));\n $fname = doSpecial($row['subscriberFirstName']);\n $lname = doSpecial($row['subscriberLastName']);\n echo \"<fieldset id=bab_pm_edit><legend><span class=bab_pm_underhed>Editing Subscriber: $fname $lname</span></legend>\";\n } else {\n $subscriber_lists = array();\n }\n\n $lists = safe_rows('*', 'bab_pm_list_prefs', '1=1 order by listName');\n }\n\n if ($step == 'lists') {\n $bab_columns = array('listName', 'listAdminEmail','listDescription','listUnsubscribeUrl','listEmailForm','listSubjectLine');\n $bab_submit_value = 'Add List';\n $bab_prefix = 'new';\n\n if ($listToEdit = gps('list')) {\n $bab_hidden_input = '<input type=\"hidden\" name=\"editListID\" value=\"' . $listToEdit . '\">';\n $bab_prefix = 'edit';\n $bab_submit_value = 'Update List Information';\n $bab_prefix = 'edit';\n\n $row = safe_row('*', 'bab_pm_list_prefs', \"listID=\" . doSlash($listToEdit));\n echo \"<fieldset id=bab_pm_edit><legend>Editing List: $row[listName]</legend>\";\n }\n\n $form_prefix = $prefs[_bab_prefix_key('form_select_prefix')];\n\n $forms = safe_column('name', 'txp_form',\"name LIKE '\". doSlash($form_prefix) . \"%'\");\n $form_select = selectInput($bab_prefix.ucfirst('listEmailForm'), $forms, @$row['listEmailForm']);\n // replace class\n $form_select = str_replace('class=\"list\"', 'class=\"bab_pm_input\"', $form_select);\n }\n\n // build form\n\n echo '<form method=\"POST\" id=\"subscriber_edit_form\">';\n\n foreach ($bab_columns as $column) {\n echo '<dl class=\"bab_pm_form_input\"><dt>'.bab_pm_preferences($column).'</dt><dd>';\n $bab_input_name = $bab_prefix . ucfirst($column);\n\n switch ($column) {\n case 'listEmailForm':\n echo $form_select;\n break;\n case 'listSubjectLine':\n $checkbox_text = 'Use Article Title for Subject';\n case 'listUnsubscribeUrl':\n if (empty($checkbox_text)) {\n $checkbox_text = 'Use Default';\n }\n\n $checked = empty($row[$column]) ? 'checked=\"checked\" ' : '';\n $js = <<<eojs\n<script>\n$(document).ready(function () {\n $('#{$column}_checkbox').change(function(){\n if ($(this).is(':checked')) {\n $('input[name={$bab_input_name}]').attr('disabled', true).val('');\n }\n else {\n $('input[name={$bab_input_name}]').attr('disabled', false);\n }\n });\n});\n</script>\n\neojs;\n\n echo $js . '<input id=\"'.$column.'_checkbox\" type=\"checkbox\" class=\"bab_pm_input\" ' . $checked . '/>'.$checkbox_text.'</dd><dd>' .\n '<input type=\"text\" name=\"' . $bab_input_name . '\" value=\"' . doSpecial(@$row[$column]) . '\"' .\n (!empty($checked) ? ' disabled=\"disabled\"' : '') . ' />' .\n '</dd>';\n break;\n case 'subscriberLists':\n foreach ($lists as $list) {\n $checked = '';\n\n foreach ($subscriber_lists as $slist) {\n if ($list['listID'] == $slist['list_id']) {\n $checked = 'checked=\"checked\" ';\n break;\n }\n }\n\n echo '<input type=\"checkbox\" name=\"'. $bab_input_name .'[]\" value=\"'.$list['listID'].'\"' . $checked . '/>'\n . doSpecial($list['listName']) . \"<br>\";\n }\n break;\n default:\n echo '<input type=\"text\" name=\"' . $bab_input_name . '\" value=\"' . doSpecial(@$row[$column]) . '\" class=\"bab_pm_input\">';\n break;\n }\n\n echo '</dd></dl>';\n }\n\n echo $bab_hidden_input;\n echo '<input type=\"submit\" value=\"' . doSpecial($bab_submit_value) . '\" class=\"publish\">';\n echo '</form>';\n}", "function create() {\n\t\tglobal $tpl, $lng;\n\n\t\t$form = $this->initForm(TRUE);\n\t\tif ($form->checkInput()) {\n\t\t\tif ($this->createElement($this->getPropertiesFromPost($form))) {\n\t\t\t\tilUtil::sendSuccess($lng->txt('msg_obj_modified'), TRUE);\n\t\t\t\t$this->returnToParent();\n\t\t\t}\n\t\t}\n\n\t\t$form->setValuesByPost();\n\t\t$tpl->setContent($form->getHtml());\n\t}", "function form( $instance ) {\n\t\t$defaults = array( 'title' => '', 'quote' => 'Lorum ipsum dolor sit amet, consectetur adipscing elit. nullam dapi-bus venenatis lacus, eget viverra mauris.', 'name' => 'John Smith', 'company' => 'RD Managing Director' );\n\t\t$instance = wp_parse_args( (array) $instance, $defaults ); ?>\n\t\t\n\t\t<!--<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'title' ); ?>\">Title:</label>\n\t\t\t<input id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" value=\"<?php echo $instance['title']; ?>\" style=\"width:100%;\" />\n\t\t</p>-->\n\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'quote' ); ?>\">Testimonial:</label>\n\t\t\t<textarea id=\"<?php echo $this->get_field_id( 'quote' ); ?>\" name=\"<?php echo $this->get_field_name( 'quote' ); ?>\" style=\"width:100%;\"><?php echo $instance['quote']; ?></textarea>\n\t\t</p>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'name' ); ?>\">Name:</label>\n\t\t\t<input id=\"<?php echo $this->get_field_id( 'name' ); ?>\" name=\"<?php echo $this->get_field_name( 'name' ); ?>\" value=\"<?php echo $instance['name']; ?>\" style=\"width:100%;\" />\n\t\t</p>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'company' ); ?>\">Company:</label>\n\t\t\t<input id=\"<?php echo $this->get_field_id( 'company' ); ?>\" name=\"<?php echo $this->get_field_name( 'company' ); ?>\" value=\"<?php echo $instance['company']; ?>\" style=\"width:100%;\" />\n\t\t</p>\n\n<?php\n\t}", "function receive_form()\n{\n if (isset($_POST['cf-submitted'])) {\n global $wpdb;\n\n // sanitize form values\n $name = sanitize_text_field($_POST[\"cf-name\"]);\n $email = sanitize_email($_POST[\"cf-email\"]);\n $message = esc_textarea($_POST[\"cf-message\"]);\n Dao::insertMessage($wpdb->prefix . \"livre_dor\", new Livre_dor($message, $email, $name));\n }\n}", "protected function createFormFields() {\n\t}", "function do_form(){\n\t\tob_start();\n\t\t\n\t\t$op = ($this->id_base == $this->id)? __('Add', JCF_TEXTDOMAIN) : __('Edit', JCF_TEXTDOMAIN);\n\t\t?>\n\t\t<div class=\"jcf_edit_field\">\n\t\t\t<h3 class=\"header\"><?php echo $op . ' ' . $this->title; ?></h3>\n\t\t\t<div class=\"jcf_inner_content\">\n\t\t\t\t<form action=\"#\" method=\"post\" id=\"jcform_edit_field\">\n\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<input type=\"hidden\" name=\"field_id\" value=\"<?php echo $this->id; ?>\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"field_number\" value=\"<?php echo $this->number; ?>\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"field_id_base\" value=\"<?php echo $this->id_base; ?>\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"fieldset_id\" value=\"<?php echo $this->fieldset_id; ?>\" />\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->form( $this->instance );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// need to add slug field too\n\t\t\t\t\t\t\t$slug = esc_attr($this->slug);\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<label for=\"<?php echo $this->get_field_id('slug'); ?>\"><?php _e('Slug:', JCF_TEXTDOMAIN); ?></label>\n\t\t\t\t\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id('slug'); ?>\" name=\"<?php echo $this->get_field_name('slug'); ?>\" type=\"text\" value=\"<?php echo $slug; ?>\" />\n\t\t\t\t\t\t\t<br/><small><?php _e('Machine name, will be used for postmeta field name.', JCF_TEXTDOMAIN); ?></small>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t// enabled field\n\t\t\t\t\t\t\tif( $this->is_new ){\n\t\t\t\t\t\t\t\t$this->instance['enabled'] = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<label for=\"<?php echo $this->get_field_id('enabled'); ?>\">\n\t\t\t\t\t\t\t\t<input class=\"checkbox\" type=\"checkbox\" \n\t\t\t\t\t\t\t\t\t\tid=\"<?php echo $this->get_field_id('enabled'); ?>\"\n\t\t\t\t\t\t\t\t\t\tname=\"<?php echo $this->get_field_name('enabled'); ?>\"\n\t\t\t\t\t\t\t\t\t\tvalue=\"1\" <?php checked(true, @$this->instance['enabled']); ?> />\n\t\t\t\t\t\t\t\t<?php _e('Enabled', JCF_TEXTDOMAIN); ?></label>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"field-control-actions\">\n\t\t\t\t\t\t\t<div class=\"alignleft\">\n\t\t\t\t\t\t\t\t<?php if( $op != __('Add', JCF_TEXTDOMAIN) ) : ?>\n\t\t\t\t\t\t\t\t<a href=\"#remove\" class=\"field-control-remove\"><?php _e('Delete', JCF_TEXTDOMAIN); ?></a> |\n\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t<a href=\"#close\" class=\"field-control-close\"><?php _e('Close', JCF_TEXTDOMAIN); ?></a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"alignright\">\n\t\t\t\t\t\t\t\t<?php echo print_loader_img(); ?>\n\t\t\t\t\t\t\t\t<input type=\"submit\" value=\"<?php _e('Save', JCF_TEXTDOMAIN); ?>\" class=\"button-primary\" name=\"savefield\">\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<br class=\"clear\"/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</fieldset>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\t\t\n\t\t$html = ob_get_clean();\n\t\treturn $html;\n\t}", "public static function run () {\n\t\t\t$form = new FormHandler();\n\n\t\t\t$form->addValuesArray($_POST);\n\n\t\t\t# Add all the fields\n\t\t\t$form->addField(array(\n\t\t\t\t'name'\t\t=> 'title', \n\t\t\t\t'title'\t\t=> Lang::get('Site Title'),\n\t\t\t\t'required'\t=> true\n\t\t\t));\n\t\t\t$form->addField(array(\n\t\t\t\t'name'\t\t=> 'url', \n\t\t\t\t'title'\t\t=> Lang::get('URL'),\n\t\t\t\t'required'\t=> true\n\t\t\t));\n\t\t\t$form->addField(array(\n\t\t\t\t'name'\t\t=> 'thumb_url', \n\t\t\t\t'title'\t\t=> Lang::get('URL to Thumbnail')\n\t\t\t));\n\t\t\t$form->addField(array(\n\t\t\t\t'name'\t\t=> 'content', \n\t\t\t\t'title'\t\t=> Lang::get('Description'), \n\t\t\t\t'type'\t\t=> 'textarea',\n\t\t\t\t'required'\t=> true\n\t\t\t));\n\t\t\t$form->addField(array(\n\t\t\t\t'name'\t\t=> 'author', \n\t\t\t\t'title'\t\t=> Lang::get('Your Name'), \n\t\t\t\t'required'\t=> true\n\t\t\t));\n\t\t\t$form->addField(array(\n\t\t\t\t'name'\t\t=> 'email', \n\t\t\t\t'title'\t\t=> Lang::get('And E-mail'), \n\t\t\t\t'required'\t=> true\n\t\t\t));\n\t\t\t$form->addField(array(\n\t\t\t\t'name'\t\t=> 'add_site_submit', \n\t\t\t\t'type'\t\t=> 'hidden', \n\t\t\t\t'value'\t\t=> '1'\n\t\t\t));\n\n\t\t\t# User is submitting form\n\t\t\t# Make sure form is valid (true => check for spam as well)\n\t\t\tif (isset($_POST['add_site_submit']) and $form->validate(true)) {\n\t\t\t\t# Add new site\n\t\t\t\tSites::insert(array(\n\t\t\t\t\t'author'\t\t=> $_POST['author'], \n\t\t\t\t\t'email'\t\t\t=> $_POST['email'], \n\t\t\t\t\t'title'\t\t\t=> $_POST['title'], \r\n\t\t\t\t\t'content'\t\t=> $_POST['content'], \r\n\t\t\t\t\t'thumb_url'\t\t=> isset($_POST['thumb_url']) ? $_POST['thumb_url'] : '', \r\n\t\t\t\t\t'url'\t\t\t=> $_POST['url'], \r\n\t\t\t\t\t'url_str'\t\t=> Router::urlize($_POST['title']), \n\t\t\t\t\t'pub_date'\t\t=> date('Y-m-d H:i:s')\n\t\t\t\t));\n\n\t\t\t\t# Redirect after POST\n\t\t\t\tredirect('?added_site');\r\n\t\t\t}\n\n\t\t\t# Form has been submitted\n\t\t\tif (isset($_GET['added_site'])) {\n\t\t\t\tself::$tplFile = 'ThankYou';\n\t\t\t}\n\t\t\t# Form has NOT been submitted\n\t\t\telse {\n\t\t\t\t# Assign form HTML to template vars\n\t\t\t\tself::$tplVars['form_html'] = $form->asHTML();\n\t\t\t}\n\t\t}", "function form($instance) {\n \n $defaults = array( 'title' => 'John Smith', 'email' => '[email protected]', 'size' => '60', 'description' => '', 'link-text' => 'Learn More', 'link-url' => 'http://www.authorsite.com');\n $instance = wp_parse_args( (array) $instance, $defaults );\n\n ?>\n\n <p><label for=\"<?php echo $this->get_field_id('title'); ?>\">Title <input class=\"widefat\" id=\"<?php echo $this->get_field_id('title'); ?>\" name=\"<?php echo $this->get_field_name('title'); ?>\" type=\"text\" value=\"<?php if( isset($instance['title']) ) echo $instance['title']; ?>\" /></label></p>\n\n <p><label for=\"<?php echo $this->get_field_id('email'); ?>\">Gravatar Email Address <input class=\"widefat\" id=\"<?php echo $this->get_field_id('email'); ?>\" name=\"<?php echo $this->get_field_name('email'); ?>\" type=\"text\" value=\"<?php if( isset($instance['email']) ) echo $instance['email']; ?>\" /></label></p>\n\n <p><label for=\"<?php echo $this->get_field_id('size'); ?>\">Gravatar Size <input class=\"widefat\" id=\"<?php echo $this->get_field_id('size'); ?>\" name=\"<?php echo $this->get_field_name('size'); ?>\" type=\"text\" value=\"<?php if( isset($instance['size']) ) echo $instance['size']; ?>\" /></label></p>\n\n <p><label for=\"<?php echo $this->get_field_id('description'); ?>\">Description <textarea class=\"widefat\" id=\"<?php echo $this->get_field_id('description'); ?>\" name=\"<?php echo $this->get_field_name('description'); ?>\"><?php if( isset($instance['description']) ) echo $instance['description']; ?></textarea></label></p>\n\n <p><label for=\"<?php echo $this->get_field_id('link-text'); ?>\">Link Text <input class=\"widefat\" id=\"<?php echo $this->get_field_id('link-text'); ?>\" name=\"<?php echo $this->get_field_name('link-text'); ?>\" type=\"text\" value=\"<?php if( isset($instance['link-text']) ) echo $instance['link-text']; ?>\" /></label></p>\n\n <p><label for=\"<?php echo $this->get_field_id('link-url'); ?>\">Link URL <input class=\"widefat\" id=\"<?php echo $this->get_field_id('link-url'); ?>\" name=\"<?php echo $this->get_field_name('link-url'); ?>\" type=\"text\" value=\"<?php if( isset($instance['link-url']) ) echo $instance['link-url']; ?>\" /></label></p>\n \n\n <?php\n }", "function abook_create_form($form_url, $name, $title, $button,\n $backend, $defdata=array()) {\n\n global $oTemplate;\n\n $output = addForm($form_url, 'post', 'f_add', '', '', array(), TRUE);\n\n if ($button == _(\"Update address\")) {\n $edit = true;\n $backends = NULL;\n } else {\n $edit = false;\n $backends = getWritableBackends();\n }\n \n $fields = array (\n 'nickname' => 'NickName',\n 'firstname' => 'FirstName',\n 'lastname' => 'LastName',\n 'email' => 'Email',\n 'label' => 'Info',\n );\n $values = array();\n foreach ($fields as $sqm=>$template) {\n $values[$template] = isset($defdata[$sqm]) ? $defdata[$sqm] : '';\n }\n \n $oTemplate->assign('writable_backends', $backends);\n $oTemplate->assign('values', $values);\n $oTemplate->assign('edit', $edit);\n $oTemplate->assign('current_backend', $backend);\n \n $output .= $oTemplate->fetch('addrbook_addedit.tpl');\n\n return $output;\n}", "function cmb2_do_frontend_form_shortcode( $atts = array() ) {\n global $post, $current_user, $wp_roles;\n\n if ( is_user_logged_in() ) {\n \t$user_id = $current_user->ID;\n\t$metabox_id = 'mro_cit_user_edit';\n\n\t\t$form = cmb2_get_metabox_form( 'mro_cit_page_metabox', 1 );\n // var_dump($form);\n }\n\n /**\n * Depending on your setup, check if the user has permissions to edit_posts\n */\n // if ( ! current_user_can( 'edit_posts' ) ) {\n // return __( 'You do not have permissions to edit this post.', 'lang_domain' );\n // }\n\n /**\n * Make sure a WordPress post ID is set.\n * We'll default to the current post/page\n */\n // if ( ! isset( $atts['post_id'] ) ) {\n // $atts['post_id'] = $post->ID;\n // }\n\n // If no metabox id is set, yell about it\n // if ( empty( $atts['id'] ) ) {\n // return __( \"Please add an 'id' attribute to specify the CMB2 form to display.\", 'lang_domain' );\n // }\n\n // $metabox_id = esc_attr( $atts['id'] );\n // $object_id = absint( $atts['post_id'] );\n // Get our form\n // $form = 'hi';\n // $form = cmb2_get_metabox_form( $metabox_id, $object_id );\n\n // return $form;\n}", "function ccdev_hosting_form($form, &$form_state, $entity) {\n $form['site_name'] = array(\n '#type' => 'textfield',\n '#title' => t('Site Name'),\n '#required' => TRUE,\n '#default_value' => $entity->site_name,\n );\n $form['site_domain'] = array(\n '#type' => 'textfield',\n '#title' => t('Site Domain'),\n '#required' => TRUE,\n '#default_value' => $entity->site_domain,\n );\n $form['site_description'] = array(\n '#type' => 'textfield',\n '#title' => t('Description'),\n '#required' => FALSE,\n '#default_value' => $entity->site_description,\n );\n $form['site_cms'] = array(\n '#type' => 'textfield',\n '#title' => t('Site CMS'),\n '#required' => TRUE,\n '#default_value' => $entity->site_cms,\n );\n $form['group_price'] = array(\n '#type' => 'textfield',\n '#title' => t('Package'),\n '#required' => TRUE,\n '#default_value' => $entity->group_price,\n );\n\n $form['basic_entity'] = array(\n '#type' => 'value',\n '#value' => $entity,\n );\n field_attach_form('ccdev_hosting', $entity, $form, $form_state);\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Create Host'),\n '#weight' => 100,\n );\n\n return $form;\n}", "public static function activate()\n\t{\n\t\tif (get_option('magic_form')) {\n\t\t\treturn;\n\t\t}\n\t\t$emailSystem = array(\n\t\t\t\"selectedSystem\" => \"smtp\"\n\t\t);\n\t\tadd_option(\"magicform_email_system\", json_encode($emailSystem));\n\n\t\t/**\n\t\t * Create Database Tables\n\t\t * There are two tables that we use.\n\t\t * %prefix%_magicform_forms for forms\n\t\t * %prefix%_magicform_submissions for submissions\n\t\t */\n\t\t\n\t\trequire_once(ABSPATH . '/wp-admin/includes/upgrade.php');\n\t\t\n\t\tglobal $wpdb;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\t\t$table_name = $wpdb->prefix . 'magicform_forms';\n\t\t$sql = \"CREATE TABLE IF NOT EXISTS \".$table_name.\" (\n id int(11) NOT NULL AUTO_INCREMENT,\n form_name varchar(150) NOT NULL,\n create_date datetime NOT NULL,\n form_data mediumtext NULL,\n preview_form_data mediumtext NULL,\n short_code varchar(100) NOT NULL,\n status int(1) NOT NULL,\n views int(11) NOT NULL,\n owner_id mediumint(9) NOT NULL,\n PRIMARY KEY (id)\n ) $charset_collate;\";\n dbDelta($sql);\n \n $fieldTypeSql = \"SHOW FIELDS FROM \". $table_name .\" WHERE Field ='form_data'\";\n $result = $wpdb->get_results($fieldTypeSql)[0];\n if($result->Type != \"mediumtext\"){\n $sql = \"ALTER TABLE \". $table_name .\" MODIFY COLUMN \n `preview_form_data` MEDIUMTEXT , MODIFY COLUMN `form_data` MEDIUMTEXT\";\n $wpdb->get_results($sql);\n }\n\n\t\t$charset_collate = $wpdb->get_charset_collate();\n $submission_table_name = $wpdb->prefix . 'magicform_submissions';\n \n\t\t$sql = \"CREATE TABLE IF NOT EXISTS \".$submission_table_name.\" (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n form_id mediumint(9) NOT NULL,\n create_date datetime NOT NULL,\n data text NOT NULL,\n ip varchar(50) NULL,\n user_agent varchar(255) NULL,\n os varchar(50) NULL,\n browser varchar(50) NULL,\n device varchar(50) NULL,\n user_id int(11) NULL,\n user_username varchar(50) NULL,\n user_email varchar(200) NULL,\n gdpr int(1) NULL,\n page_title varchar(500) NOT NULL,\n page_url varchar (500) NOT NULL,\n read_status int(1) NOT NULL,\n payment_status int(1) NULL,\n total_amount varchar(200) NULL,\n payment_error varchar(500) NULL, \n PRIMARY KEY (id)\n ) $charset_collate;\";\n\t\tdbDelta($sql);\n\n $fieldTypeSql = \"SHOW FIELDS FROM \". $submission_table_name .\" WHERE Field ='ip'\";\n $result = $wpdb->get_results($fieldTypeSql)[0];\n if($result->Type != \"varchar(50)\"){\n $sql = \"ALTER TABLE \". $submission_table_name .\" MODIFY COLUMN \n `ip` varchar(50)\";\n $wpdb->get_results($sql);\n }\n\n $payment_fields = \"SHOW FIELDS FROM \". $submission_table_name .\" LIKE 'id'\";\n $result = $wpdb->get_results($payment_fields, ARRAY_A);\n if(count($result)>0){\n $payment_sql = \"ALTER TABLE \". $submission_table_name .\"\n ADD payment_status int(1) NULL,\n ADD total_amount varchar(200) NULL,\n ADD payment_error varchar(500) NULL\";\n $wpdb->get_results($payment_sql);\n }\n\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\t\t$notifications_table_name = $wpdb->prefix . 'magicform_notifications';\n\t\t$sql = \"CREATE TABLE IF NOT EXISTS \".$notifications_table_name.\" (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n form_id mediumint(9) NOT NULL,\n create_date datetime NOT NULL,\n title varchar(255) NOT NULL,\n data text NOT NULL,\n read_status int(1) NOT NULL,\n PRIMARY KEY (id)\n ) $charset_collate;\";\n dbDelta($sql);\n \n $charset_collate = $wpdb->get_charset_collate();\n\t\t$products_table_name = $wpdb->prefix . 'magicform_products';\n\t\t$sql = \"CREATE TABLE IF NOT EXISTS \".$products_table_name.\" (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n product_name varchar(255) NOT NULL,\n product text NOT NULL,\n status int(1) NOT NULL,\n create_date datetime NOT NULL,\n PRIMARY KEY (id)\n ) $charset_collate;\";\n\t\tdbDelta($sql);\n\t}", "function form($instance){\n\t\t//Defaults\n\t\t//$instance = wp_parse_args( (array) $instance, array('title'=>'Follow Us Online:', 'facebook_url'=>'http://www.facebook.com', 'twitter_url'=>'https://twitter.com/', 'gp_url'=>'https://plus.google.com/', 'in_url'=>'http://www.linkedin.com/') );\n\n\t\t//$title = htmlspecialchars($instance['title']);\n\t\t$desc = $instance['desc'];\n\t\t$facebook_url = $instance['facebook_url'];\n\t\t$twitter_url = $instance['twitter_url'];\n\t $yt_url = $instance['yt_url'];\n\t\t\n\t\t# Title\n\n\t\t//echo '<p><label for=\"' . $this->get_field_id('title') . '\">' . 'Title:' . '</label><input class=\"widefat\" id=\"' . $this->get_field_id('title') . '\" name=\"' . $this->get_field_name('title') . '\" type=\"text\" value=\"' . esc_attr($title) . '\" /></p>';\n\n\t\techo '<p><label for=\"' . $this->get_field_id('facebook_url') . '\">' . 'Facebook URL:' . '</label><input class=\"widefat\" id=\"' . $this->get_field_id('facebook_url') . '\" name=\"' . $this->get_field_name('facebook_url') . '\" type=\"text\" value=\"' . esc_attr($facebook_url) . '\" /></p>';\n\n\t \techo '<p><label for=\"' . $this->get_field_id('twitter_url') . '\">' . 'Twitter URL:' . '</label><input class=\"widefat\" id=\"' . $this->get_field_id('twitter_url') . '\" name=\"' . $this->get_field_name('twitter_url') . '\" type=\"text\" value=\"' . esc_attr($twitter_url) . '\" /></p>';\n\t\t\n\t\techo '<p><label for=\"' . $this->get_field_id('yt_url') . '\">' . 'Youtube URL:' . '</label><input class=\"widefat\" id=\"' . $this->get_field_id('yt_url') . '\" name=\"' . $this->get_field_name('yt_url') . '\" type=\"text\" value=\"' . esc_attr($yt_url) . '\" /></p>';\n\t\t?>\n <?php\n\t}", "abstract protected function _setNewForm();", "private static function register_form_post_type() {\n\t\tif ( post_type_exists( self::$forms_post_type ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$post_type_args = apply_filters(\n\t\t\t'wphf_register_post_type_' . self::$forms_post_type,\n\t\t\tarray(\n\t\t\t\t'labels' => array(\n\t\t\t\t\t'name' => __( 'Forms', 'fff-rest-contact-form' ),\n\t\t\t\t\t'singular_name' => __( 'Form', 'fff-rest-contact-form' ),\n\t\t\t\t),\n\t\t\t\t'public' => true,\n\t\t\t\t'supports' => array( 'title' ),\n\t\t\t)\n\t\t);\n\n\t\tregister_post_type( self::$forms_post_type, $post_type_args );\n\t}", "function form($instance) {\n\t\t$defaults = array( 'subdomain_key' => '', \n 'title_link' => '1',\n 'group_nickname' => '',\n 'plaza_display' => 'prayers', \n 'items_to_display' => '10',\n 'show_dates' => '0', \n 'show_type' => '0',\n 'cache_duration' => '86400');\n\n\t\t$instance = wp_parse_args( (array) $instance, $defaults ); \n\n $title = strip_tags($instance['title']);\n $subdomain_key = strip_tags($instance['subdomain_key']);\n $title_link = strip_tags($instance['title_link']);\n $group_nickname = strip_tags($instance['group_nickname']);\n $plaza_display = strip_tags($instance['plaza_display']);\n $items_to_display = strip_tags($instance['items_to_display']);\n $show_dates = strip_tags($instance['show_dates']);\n $show_type = strip_tags($instance['show_type']);\n $cache_duration = strip_tags($instance['cache_duration']);\n\n $clear_cache_msg = '';\n if (isset($_POST['clear_cache_now'])) {\n global $wpdb;\n $cacher = new PlazaWordPressCache( $subdomain_key );\n $cacher->set_db_connection($wpdb);\n $cacher->clear_cache();\n $clear_cache_msg = 'Cache cleared';\n }\n\n ?>\n\n <p>\n <label for=\"<?php echo $this->get_field_id('title'); ?>\">\n Widget Title: \n <input class=\"widefat\" \n id=\"<?php echo $this->get_field_id('title'); ?>\" \n name=\"<?php echo $this->get_field_name('title'); ?>\" \n type=\"text\" \n value=\"<?php echo attribute_escape($title); ?>\" />\n </label>\n <i>The title to display at the top of the widget</i>\n\n <br>\n\n <?php\n $title_link_checked = empty($title_link) ? '' : 'checked=\"checked\"';\n ?>\n <label for=\"<?php echo $this->get_field_id('title_link'); ?>\">\n <input type=\"checkbox\" \n id=\"<?php echo $this->get_field_id('title_link'); ?>\" \n name=\"<?php echo $this->get_field_name('title_link'); ?>\"\n <?php echo $title_link_checked ?> /> Title links to main plaza page \n </label> \n </p>\n\n\n <p>\n <label for=\"<?php echo $this->get_field_id('subdomain_key'); ?>\">\n Subdomain: \n <input class=\"widefat\" \n id=\"<?php echo $this->get_field_id('subdomain_key'); ?>\" \n name=\"<?php echo $this->get_field_name('subdomain_key'); ?>\" \n type=\"text\" \n value=\"<?php echo attribute_escape($subdomain_key); ?>\" />\n </label>\n <i>Ex: https://[subdomain].OnTheCity.org</i>\n </p>\n\n\n <p>\n <label for=\"<?php echo $this->get_field_id('group_nickname'); ?>\">\n Group Nickname (optional): \n <input class=\"widefat\" \n id=\"<?php echo $this->get_field_id('group_nickname'); ?>\" \n name=\"<?php echo $this->get_field_name('group_nickname'); ?>\" \n type=\"text\" \n value=\"<?php echo attribute_escape($group_nickname); ?>\" />\n </label>\n <i>Only items for this group will be pulled.</i>\n </p> \n\n \n <p>\n <?php \n $topics_s = $events_s = $prayers_s = $needs_s = $album_s = '';\n switch($instance['plaza_display']) {\n case 'all':\n $all_s = 'selected=\"selected\"'; \n break;\n case 'topics':\n $topics_s = 'selected=\"selected\"'; \n break;\n case 'events':\n $events_s = 'selected=\"selected\"'; \n break;\n case 'prayers':\n $prayers_s = 'selected=\"selected\"';\n break;\n case 'needs':\n $needs_s = 'selected=\"selected\"'; \n break;\n case 'albums':\n $album_s = 'selected=\"selected\"';\n break;\n }\n ?> \n \n <label for=\"<?php echo $this->get_field_id('plaza_display'); ?>\">\n Display: \t\t\t\n <select class=\"widefat\" \n id=\"<?php echo $this->get_field_id('plaza_display'); ?>\" \n name=\"<?php echo $this->get_field_name('plaza_display'); ?>\">\n <option value=\"all\" <?php echo $all_s; ?> >Show All</option>\n \t\t<option value=\"topics\" <?php echo $topics_s; ?> >Topics</option>\n \t\t<option value=\"events\" <?php echo $events_s; ?> >Events</option>\n \t\t<option value=\"prayers\" <?php echo $prayers_s; ?> >Prayers</option>\n \t\t<option value=\"needs\" <?php echo $needs_s; ?> >Needs</option>\n \t\t<option value=\"albums\" <?php echo $album_s; ?> >Albums</option>\n </select>\n </label>\n\n\n <?php\n $show_dates_checked = empty($show_dates) ? '' : 'checked=\"checked\"';\n ?>\n <label for=\"<?php echo $this->get_field_id('show_dates'); ?>\">\n <input type=\"checkbox\" \n id=\"<?php echo $this->get_field_id('show_dates'); ?>\" \n name=\"<?php echo $this->get_field_name('show_dates'); ?>\"\n <?php echo $show_dates_checked ?> /> Show Dates \n </label>\n\n <br>\n\n <?php\n $show_type_checked = empty($show_type) ? '' : 'checked=\"checked\"';\n ?>\n <label for=\"<?php echo $this->get_field_id('show_type'); ?>\">\n <input type=\"checkbox\" \n id=\"<?php echo $this->get_field_id('show_type'); ?>\" \n name=\"<?php echo $this->get_field_name('show_type'); ?>\"\n <?php echo $show_type_checked ?> /> Show Plaza item type above title \n </label> \n </p>\n \n\n <p>\n <label for=\"<?php echo $this->get_field_id('items_to_display'); ?>\">\n Items to display: \n <select class=\"widefat\" \n id=\"<?php echo $this->get_field_id('items_to_display'); ?>\" \n name=\"<?php echo $this->get_field_name('items_to_display'); ?>\">\n\n <?php \n $item_count_selected = '';\n for($i=1; $i<=15; $i++) {\n $item_count_selected = $items_to_display == $i ? 'selected=\"selected\"' : '';\n echo \"<option value=\\\"$i\\\" $item_count_selected>$i</option>\"; \n }\n ?>\n </select>\n </label> \n </p>\n\n \n <p>\n <?php \n $one_hour = $one_day = $one_week = $one_month = '';\n switch($instance['cache_duration']) {\n case '3600': // One Hour\n $one_hour = 'selected=\"selected\"'; \n break;\n case '86400': // One Day\n $one_day = 'selected=\"selected\"'; \n break;\n case '604800': // One Week\n $one_week = 'selected=\"selected\"';\n break;\n case '2592000': // One Month (30 days)\n $one_month = 'selected=\"selected\"'; \n }\n ?> \n \n <label for=\"<?php echo $this->get_field_id('cache_duration'); ?>\">\n Cache data for: \t\t\t\n <select class=\"widefat\" \n id=\"<?php echo $this->get_field_id('cache_duration'); ?>\" \n name=\"<?php echo $this->get_field_name('cache_duration'); ?>\">\n \t\t<option value=\"3600\" <?php echo $one_hour; ?> >One Hour</option>\n \t\t<option value=\"86400\" <?php echo $one_day; ?> >One Day</option>\n \t\t<option value=\"604800\" <?php echo $one_week; ?> >One Week</option>\n \t\t<option value=\"2592000\" <?php echo $one_month; ?> >One Month (30 days)</option>\n </select>\n </label>\n\n <label for=\"clear_cache_now\">\n <input type=\"checkbox\" id=\"clear_cache_now\" name=\"clear_cache_now\" /> Clear cache on save \n </label>\n\n <?php if(!empty($clear_cache_msg)) { echo '<div style=\"color:#990000\">'.$clear_cache_msg.'</div>'; } ?>\n </p>\n <?php\n }", "public function ajax_create_field() {\n global $wpdb;\n\n $data = array();\n $field_options = $field_validation = '';\n\n foreach ($_REQUEST['data'] as $k) {\n $data[$k['name']] = $k['value'];\n }\n\n check_ajax_referer('create-field-' . $data['form_id'], 'nonce');\n\n $form_id = absint($data['form_id']);\n $field_key = esc_html($_REQUEST['field_key']);\n $field_name = ucwords(esc_html(str_replace('_', ' ', $field_key)));\n $field_type = strtolower(sanitize_title($_REQUEST['field_type']));\n $field_description = ucwords(str_replace('_', ' ', $field_key));\n\n // Set defaults for validation\n switch ($field_type) {\n case 'select' :\n if ($field_key == 'gender') {\n $field_options = serialize(array('male' => 'Male', 'female' => 'Female', 'not specified' => 'Not Specified'));\n } else if ($field_key == 'title') {\n $field_options = serialize(array('mr' => 'Mr', 'mrs' => 'Mrs', 'ms' => 'Ms', 'dr' => 'Dr', 'not specified' => 'Not Specified'));\n } else {\n $field_options = serialize(array('Option 1', 'Option 2', 'Option 3'));\n }\n break;\n case 'radio' :\n case 'checkbox' :\n $field_options = serialize(array('Option 1', 'Option 2', 'Option 3'));\n break;\n case 'email' :\n case 'url' :\n case 'phone' :\n $field_validation = $field_type;\n break;\n\n case 'currency' :\n $field_validation = 'number';\n break;\n\n case 'number' :\n $field_validation = 'digits';\n break;\n\n case 'time' :\n $field_validation = 'time-12';\n break;\n\n case 'file-upload' :\n $field_options = ($field_key == 'profile_image') ? serialize(array('png|jpe?g|gif')) : '';\n break;\n }\n\n $newdata = array(\n 'form_id' => $form_id,\n 'field_key' => $field_key,\n 'field_name' => $field_name,\n 'field_type' => $field_type,\n 'field_options' => $field_options,\n 'field_validation' => $field_validation,\n 'field_description' => $field_description\n );\n\n $insert_id = $this->create_field($newdata);\n\n $query = $wpdb->prepare(\"SELECT form_id FROM $this->form_table_name WHERE form_type= 1 AND `form_membership_level` = \"\n . \" (SELECT `form_membership_level` FROM $this->form_table_name WHERE form_type= 0 AND `form_id` = %d)\", $form_id);\n $edit_form = $wpdb->get_var($query);\n if (!empty($edit_form)) {\n $newdata['form_id'] = $edit_form;\n $this->create_field($newdata, $insert_id);\n }\n\n echo $this->field_output($form_id, $insert_id);\n\n die(1);\n }", "function reserv_display_form($fields = array(), $errors = null) {\n if (is_wp_error($errors) && count($errors->get_error_messages()) > 0) {\n\n // Display errors\n ?><ul><?php\n foreach ($errors->get_error_messages() as $key => $val) {\n ?><li>\n <?php echo $val; ?>\n </li><?php\n }\n ?></ul><?php\n }\n\n // Disaply form\n\n ?><form action=\"<?php $_SERVER['REQUEST_URI'] ?>\" method=\"post\">\n <div>\n <label for=\"title\">Title <strong>*</strong></label>\n <input type=\"text\" name=\"title\" value=\"<?php echo (isset($fields['title']) ? $fields['title'] : '') ?>\">\n </div>\n\n \n\n <input type=\"submit\" name=\"submit\" value=\"Register\">\n </form><?php\n}", "abstract function setupform();", "function rad_options_build_form(){\n\t//check capability for security purposes\n\tif( ! current_user_can( 'manage_options' ) ):\n\t\twp_die( 'Access denied' );\n\telse:\n\t\t//include the external form file\n\t\trequire_once( plugin_dir_path( __FILE__ ) . 'rad-options-form.php' );\n\tendif;\n}", "function wpgnv_process_form() {\n\tif ( empty( $_POST['post-title'] ) && wp_verify_nonce( $_POST['wpgnv_new_idea'], 'wpgnv_new_idea' ) ) {\n\t\tglobal $wpgnv_error;\n\t\t$wpgnv_error = 'You left the Idea field empty. Please enter an Idea and THEN submit it.';\n\t\treturn;\n\t}\n\tif ( isset( $_POST ) && wp_verify_nonce( $_POST['wpgnv_new_idea'], 'wpgnv_new_idea' ) ) {\n\t\t$post_args = array (\n\t\t\t'post_type' => 'ideas',\n\t\t\t'post_status' => 'pending',\n\t\t\t'post_title' => esc_html( $_POST['post-title'] )\n\t\t);\n\t\t$post_id = wp_insert_post( $post_args );\n\n\t\tif ( is_wp_error( $post_id ) ) {\n\t\t\tglobal $wpgnv_error;\n\t\t\t$wpgnv_error = 'Sorry, there was an error processing your new idea.';\n\t\t} else {\n\t\t\tglobal $wpgnv_success;\n\t\t\t$wpgnv_success = 'Awesome! Your idea has been submitted and is awaiting moderation.';\n\t\t}\n\t}\t\n}", "function manage_form($form, $form_state) {\n module_load_include('inc','ccHosting','includes/lib');\n $form = array();\n global $user;\n\n\t$sitedata = array();\n\t$sitedata = getSiteData($form_state['site_id']);\n\n\tif(isset($sitedata)){\n\n\t\t$form['site_name'] = array(\n\t\t\t'#type' => 'textfield',\n\t\t\t'#title' => t('Site Name'),\n\t\t\t'#required' => TRUE,\n\t\t\t'#default_value' => $sitedata['site_name'],\n\t\t);\n\t\t$form['site_description'] = array(\n\t\t\t'#type' => 'textfield',\n\t\t\t'#title' => t('Description'),\n\t\t\t'#required' => TRUE,\n\t\t\t'#default_value' => $sitedata['site_description'],\n\t\t);\n\n\t\t$form['site_domain'] = array(\n\t\t\t'#type' => 'textfield',\n\t\t\t'#title' => t('Domain'),\n\t\t\t'#required' => TRUE,\n\t\t\t'#default_value' => $sitedata['site_domain'],\n\t\t);\n\n\t\t$form['site_cms'] = array(\n\t\t\t'#type' => 'textfield',\n\t\t\t'#title' => t('CMS'),\n\t\t\t'#required' => TRUE,\n\t\t\t'#default_value' => $sitedata['site_cms'],\n\t\t);\n\n\t\t/////// required for form\n\t\t$form['basic_id'] = array(\n\t\t\t'#type' => 'value',\n\t\t\t'#value' => $form_state['site_id'],\n\t\t);\n\t\t$form['bundle_type'] = array(\n\t\t\t'#type' => 'value',\n\t\t\t'#value' => 'ccdev_hosting_bundle',\n\t\t);\n\t\t$form['submit'] = array(\n\t\t\t'#type' => 'submit',\n\t\t\t'#value' => t('Save'),\n\t\t\t'#attributes' => array('class' => array('btn', 'btn-success'), 'style' => \"float:right; padding: 5px 10px;\"),\n\t\t\t'#theme' => \"submit\",\n\t\t\t'#prefix' => \"<div class=''>\",\n\t\t\t'#suffix' => \"</div>\",\n\t\t\t '#ajax' => array(\n\t\t\t 'callback' => 'manage_form_submit',),\n\t\t\t); \n\t}\n return $form;\n}", "public function html()\r\n\t{\r\n\t\t$nonce = wp_create_nonce('wpgmza');\r\n\t\t\r\n\t\t?>\r\n\t\t\r\n\t\t<form id=\"wpgmza-custom-fields\" \r\n\t\t\taction=\"<?php echo admin_url('admin-post.php'); ?>\" \r\n\t\t\tmethod=\"POST\">\r\n\t\t\t\r\n\t\t\t<input name=\"action\" value=\"wpgmza_save_custom_fields\" type=\"hidden\"/>\r\n\t\t\t<input name=\"security\" value=\"<?php echo $nonce; ?>\" type=\"hidden\"/>\r\n\t\t\t\r\n\t\t\t<h1>\r\n\t\t\t\t<?php\r\n\t\t\t\t_e('WP Google Maps - Custom Fields', 'wp-google-maps');\r\n\t\t\t\t?>\r\n\t\t\t</h1>\r\n\t\t\t\r\n\t\t\t<table class=\"wp-list-table widefat fixed striped pages\">\r\n\t\t\t\t<thead>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th scope=\"col\" id=\"id\" class =\"manage-column column-id\">\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t_e('ID', 'wp-google-maps');\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t<th scope=\"col\" id=\"id\" class =\"manage-column column-id\">\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t_e('Name', 'wp-google-maps');\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t<th>\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t_e('Icon', 'wp-google-maps');\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t<th>\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t_e('Attributes', 'wp-google-maps');\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t<th>\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t_e('Filter Type', 'wp-google-maps');\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t<th>\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t_e('Actions', 'wp-google-maps');\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t</th>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</thead>\r\n\t\t\t\t<tbody>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t$this->tableBodyHTML();\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<tr id=\"wpgmza-new-custom-field\">\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<input \r\n\t\t\t\t\t\t\t\tname=\"ids[]\"\r\n\t\t\t\t\t\t\t\tvalue=\"-1\"\r\n\t\t\t\t\t\t\t\treadonly\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<input\r\n\t\t\t\t\t\t\t\trequired\r\n\t\t\t\t\t\t\t\tname=\"names[]\"\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<input name=\"icons[]\" class=\"wpgmza-fontawesome-iconpicker\"/>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<input name=\"attributes[]\" type=\"hidden\"/>\r\n\t\t\t\t\t\t\t<table class=\"attributes\">\r\n\t\t\t\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\t\t\t\t<input\r\n\t\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"<?php _e('Name', 'wp-google-maps'); ?>\"\r\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"attribute-name\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\t\t\t\t<input \r\n\t\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"<?php _e('Value', 'wp-google-maps'); ?>\"\r\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"attribute-value\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t</tbody>\r\n\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<select name=\"widget_types[]\">\r\n\t\t\t\t\t\t\t\t<option value=\"none\">\r\n\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t_e('None', 'wp-google-maps');\r\n\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t</option>\r\n\t\t\t\t\t\t\t\t<option value=\"text\">\r\n\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t_e('Text', 'wp-google-maps');\r\n\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t</option>\r\n\t\t\t\t\t\t\t\t<option value=\"dropdown\">\r\n\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t_e('Dropdown', 'wp-google-maps');\r\n\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t</option>\r\n\t\t\t\t\t\t\t\t<option value=\"checkboxes\">\r\n\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t_e('Checkboxes', 'wp-google-maps');\r\n\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t</option>\r\n\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t// Use this filter to add options to the dropdown\r\n\t\t\t\t\t\t\t\techo apply_filters('wpgmza_custom_fields_widget_type_options', '');\r\n\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<button type=\"submit\" class=\"button button-primary wpgmza-add-custom-field\">\r\n\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t_e('Add', 'wp-google-maps');\r\n\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t</button>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</tbody>\r\n\t\t\t</table>\r\n\t\t\t\r\n\t\t\t<p style=\"text-align: center;\">\r\n\t\t\t\t<input \r\n\t\t\t\t\ttype=\"submit\" \r\n\t\t\t\t\tclass=\"button button-primary\" \r\n\t\t\t\t\tvalue=\"<?php _e('Save', 'wp-google-maps'); ?>\"\r\n\t\t\t\t\t/>\r\n\t\t\t</p>\r\n\t\t</form>\r\n\t\t\r\n\t\t<?php\r\n\t}", "public function init_form_fields() {\n\n\t\t// Get all pages to select Public offer agreement pages\n\t\t$term_posts = array( '' => __( 'Select Public offer agreement Page', AGW_GATEWAY_NAME ));\n\t\t$args = array(\n\t\t\t'post_type' => 'page',\n\t\t\t'post_status' => 'publish',\n\t\t\t'orderby' => 'title', \n\t\t\t'order' => 'ASC',\n\t\t\t'nopaging' => true\n\t\t);\n\t\t$query = new WP_Query;\n\t\t$posts = $query->query( $args );\n\t\tforeach( $posts as $post ) {\n\t\t\t$term_posts[$post->ID] = $post->post_title;\n\t\t}\n\n\t\t$this->form_fields = array(\n\n\t\t\t'enabled' => array(\n\t\t\t\t'title'\t\t\t=> __( 'Enable/Disable', AGW_GATEWAY_NAME ),\n\t\t\t\t'label'\t\t\t=> __( 'Enable payments via AcquiroPay.com', AGW_GATEWAY_NAME ),\n\t\t\t\t'description'\t=> '',\n\t\t\t\t'type'\t\t\t=> 'checkbox',\n\t\t\t\t'default'\t\t=> 'no'\n\t\t\t),\n\n\t\t\t'title' => array(\n\t\t\t\t'title'\t\t\t=> __( 'Title', AGW_GATEWAY_NAME ),\n\t\t\t\t'description'\t=> __( 'This controls the title for the payment method the customer sees on the Checkout page.', AGW_GATEWAY_NAME ),\n\t\t\t\t'default'\t\t=> __( 'Credit Card payment', AGW_GATEWAY_NAME ),\n\t\t\t\t'type'\t\t\t=> 'text',\n\t\t\t),\n\n\t\t\t'description' => array(\n\t\t\t\t'title'\t\t\t=> __( 'Description', AGW_GATEWAY_NAME ),\n\t\t\t\t'description'\t=> __( 'Payment method description that the customer will see on the Checkout page.', AGW_GATEWAY_NAME ),\n\t\t\t\t'default'\t\t=> __( 'Pay by credit card via secure service AcquiroPay.com', AGW_GATEWAY_NAME ),\n\t\t\t\t'type'\t\t\t=> 'textarea',\n\t\t\t),\n\n\t\t\t'instructions' => array(\n\t\t\t\t'title'\t\t\t=> __( 'Instructions', AGW_GATEWAY_NAME ),\n\t\t\t\t'description'\t=> __( 'Instructions that will be added to the \"Thank you\" page and emails.', AGW_GATEWAY_NAME ),\n\t\t\t\t'default'\t\t=> __( 'Click \"Continue\" to go to the payment page on AcquiroPay.com', AGW_GATEWAY_NAME ),\n\t\t\t\t'type'\t\t\t=> 'textarea',\n\t\t\t),\n\n\t\t\t'pay_button_title' => array(\n\t\t\t\t'title'\t\t\t=> __( 'Pay Button title', AGW_GATEWAY_NAME ),\n\t\t\t\t'description'\t=> __( 'Text on the button on the Checkout page to go to the external Payment page.', AGW_GATEWAY_NAME ),\n\t\t\t\t'default'\t\t=> __( 'Pay by card', AGW_GATEWAY_NAME ),\n\t\t\t\t'type'\t\t\t=> 'text',\n\t\t\t),\n\n\t\t\t'terms_page_prefix' => array(\n\t\t\t\t'title'\t\t\t=> __( 'Text before Public offer agreement link', AGW_GATEWAY_NAME ),\n\t\t\t\t'description'\t=> __( 'This text with a link to the Public offer agreement placed next to Pay Button on the Checkout page.', AGW_GATEWAY_NAME ),\n\t\t\t\t'default'\t\t=> __( 'I have read and accept the conditions of the', AGW_GATEWAY_NAME ),\n\t\t\t\t'type'\t\t\t=> 'text',\n\t\t\t),\n\n\t\t\t'terms_page_id' => array(\n\t\t\t\t'title'\t\t\t=> __( 'Public offer agreement', AGW_GATEWAY_NAME ),\n\t\t\t\t'description'\t=> __( 'Public offer to conclude with the Seller a contract for the sale of goods remotely. The customer sees a link to this page on the Checkout page.', AGW_GATEWAY_NAME ),\n\t\t\t\t'default'\t\t=> false,\n\t\t\t\t'type'\t\t\t=> 'select',\n\t\t\t\t'options'\t\t=> $term_posts\n\t\t\t),\n\n\t\t\t'product_order_purpose' => array(\n\t\t\t\t'title'\t\t\t=> __( 'Order purpose', AGW_GATEWAY_NAME ),\n\t\t\t\t'description'\t=> __( 'Purpose of a payment in AcquiroPay form. Insert \\'%s\\' to replace by Order ID.', AGW_GATEWAY_NAME ),\n\t\t\t\t'default'\t\t=> __( 'Payment for an Order: %s', AGW_GATEWAY_NAME ),\n\t\t\t\t'type'\t\t\t=> 'text',\n\t\t\t),\n\n\t\t\t'integration_settings_sectionstart' => array(\n\t\t\t\t'title'\t\t\t=> __( 'Integration Settings', AGW_GATEWAY_NAME ),\n\t\t\t\t'description'\t=> __( 'You need to register on <a href=\"https://acquiropay.com/?from=acquiropay-gateway-woocommerce\" target=\"_blank\">AcquiroPay.com</a> and get these parameters from your AcquiroPay account.', AGW_GATEWAY_NAME ),\n\t\t\t\t'type'\t\t\t=> 'title',\n\t\t\t),\n\n\t\t\t'secret_word' => array(\n\t\t\t\t'title'\t\t\t=> __( 'Secret Word', AGW_GATEWAY_NAME ),\n\t\t\t\t'description'\t=> '',\n\t\t\t\t'default'\t\t=> '',\n\t\t\t\t'type'\t\t\t=> 'text',\n\t\t\t),\n\n\t\t\t'merchant_id' => array(\n\t\t\t\t'title'\t\t\t=> __( 'Merchant ID', AGW_GATEWAY_NAME ),\n\t\t\t\t'description'\t=> '',\n\t\t\t\t'default'\t\t=> '',\n\t\t\t\t'type'\t\t\t=> 'text',\n\t\t\t),\n\n\t\t\t'product_id' => array(\n\t\t\t\t'title'\t\t\t=> __( 'Product ID', AGW_GATEWAY_NAME ),\n\t\t\t\t'description'\t=> '',\n\t\t\t\t'default'\t\t=> '',\n\t\t\t\t'type'\t\t\t=> 'text',\n\t\t\t),\n\n\t\t\t'pay_url' => array(\n\t\t\t\t'title'\t\t\t=> __( 'Processing HTTP URL', AGW_GATEWAY_NAME ),\n\t\t\t\t'description'\t=> __( 'AcquiroPay payment processing API URL.', AGW_GATEWAY_NAME ),\n\t\t\t\t'default'\t\t=> 'https://secure.ipsp.com/',\n\t\t\t\t'type'\t\t\t=> 'text',\n\t\t\t),\n\n\t\t\t'check_pay_status_url' => array(\n\t\t\t\t'title'\t\t\t=> __( 'Check Pay HTTP URL', AGW_GATEWAY_NAME ),\n\t\t\t\t'description'\t=> __( 'AcquiroPay payment checking API URL.', AGW_GATEWAY_NAME ),\n\t\t\t\t'default'\t\t=> 'https://gateway.ipsp.com/',\n\t\t\t\t'type'\t\t\t=> 'text',\n\t\t\t),\n\n\t\t\t'technical_settings_sectionstart' => array(\n\t\t\t\t'title'\t\t\t=> __( 'Technical Settings', AGW_GATEWAY_NAME ),\n\t\t\t\t'description'\t=> '',\n\t\t\t\t'type'\t\t\t=> 'title',\n\t\t\t),\n\n\t\t\t'hiding_by_cookie_enabled' => array(\n\t\t\t\t'title'\t\t\t=> __( 'Hide Payment option', AGW_GATEWAY_NAME ),\n\t\t\t\t'label'\t\t\t=> __( 'Hide AcquiroPay Card Payment Option for all customers. This will be useful for safe testing purposes.', AGW_GATEWAY_NAME ),\n\t\t\t\t'description'\t=> '',\n\t\t\t\t'type'\t\t\t=> 'checkbox',\n\t\t\t\t'default'\t\t=> 'yes'\n\t\t\t),\n\n\t\t\t'hiding_cookie_rule' => array(\n\t\t\t\t'title'\t\t\t=> __( 'Show Payment Option if Cookie exists', AGW_GATEWAY_NAME ),\n\t\t\t\t'description'\t=> __( 'Only customers who have added this non-empty cookie to their browser will see AcquiroPay Payment Option. You can add this cookie in your browser inspector by pressing F12 in Chrome for example.', AGW_GATEWAY_NAME ),\n\t\t\t\t'default'\t\t=> $this->id . '_enabled',\n\t\t\t\t'type'\t\t\t=> 'text',\n\t\t\t),\n\n\t\t\t'enable_debug_log' => array(\n\t\t\t\t'title'\t\t\t=> __( 'Enable debug log', AGW_GATEWAY_NAME ),\n\t\t\t\t'label'\t\t\t=> __( 'Send debug info into system debug log file', AGW_GATEWAY_NAME ),\n\t\t\t\t'description'\t=> 'Define WP_DEBUG, WP_DEBUG_LOG, WP_DEBUG_DISPLAY in wp-config.php to see debug info from plugin.',\n\t\t\t\t'type'\t\t\t=> 'checkbox',\n\t\t\t\t'default'\t\t=> 'yes'\n\t\t\t),\n\n\t\t\t'test_total_price_value' => array(\n\t\t\t\t'title'\t\t\t=> __( 'Order Total Test Value', AGW_GATEWAY_NAME ),\n\t\t\t\t'description'\t=> __( 'You can set any non-zero price value for all orders for testing purposes. If field is empty, the real price value will be used.', AGW_GATEWAY_NAME ),\n\t\t\t\t'default'\t\t=> '',\n\t\t\t\t'type'\t\t\t=> 'text',\n\t\t\t),\n\t\t);\n\n\t\t$this->log( 'Form Fields initialized' );\n\t}", "function tower_save_form_data($data) {\n // logic for data validation and saving.\n $post_type = 'tower_' . @$data->get_param('type');\n if (! array_key_exists($post_type, TOWER_CUSTOM_POSTS)) return null;\n\n // backend validation\n $fields = array_merge([\n 'name' => 'title',\n 'rules' => 'required',\n ], TOWER_CUSTOM_POSTS[$post_type]['fields']);\n \n // check if the form has any validation errors\n $validation_errors = tower_form_errors($data, $fields);\n\n $post_id = 0; // id for the new post\n \n if (count($validation_errors) == 0) {\n $post_id = wp_insert_post([\n 'post_type' => $post_type,\n 'post_title' => $data->get_param('title')\n ]);\n if ($post_id > 0) {\n foreach ($fields as $field) {\n update_post_meta(\n $post_id, \n $field['name'], \n sanitize_text_field($data->get_param($field['name']))\n );\n }\n }\n }\n \n echo json_encode([\n 'success' => $post_id > 0,\n 'errors' => $validation_errors,\n ]);\n}", "function wppb_create_registration_forms_cpt(){\r\n $labels = array(\r\n 'name' \t\t\t\t\t=> __( 'Registration Form', 'profile-builder'),\r\n 'singular_name' \t\t=> __( 'Registration Form', 'profile-builder'),\r\n 'add_new' \t\t\t\t=> __( 'Add New', 'profile-builder' ),\r\n 'add_new_item' \t\t\t=> __( 'Add new Registration Form', 'profile-builder' ),\r\n 'edit_item' \t\t\t=> __( 'Edit the Registration Forms', 'profile-builder' ) ,\r\n 'new_item' \t\t\t\t=> __( 'New Registration Form', 'profile-builder' ),\r\n 'all_items' \t\t\t=> __( 'Registration Forms', 'profile-builder' ),\r\n 'view_item' \t\t\t=> __( 'View the Registration Form', 'profile-builder' ),\r\n 'search_items' \t\t\t=> __( 'Search the Registration Forms', 'profile-builder' ),\r\n 'not_found' \t\t\t=> __( 'No Registration Form found', 'profile-builder' ),\r\n 'not_found_in_trash' \t=> __( 'No Registration Forms found in trash', 'profile-builder' ),\r\n 'parent_item_colon' \t=> '',\r\n 'menu_name' \t\t\t=> __( 'Registration Forms', 'profile-builder' )\r\n );\r\n\r\n $args = array(\r\n 'labels' \t\t\t\t=> $labels,\r\n 'public' \t\t\t\t=> false,\r\n 'publicly_queryable' \t=> false,\r\n 'show_ui' \t\t\t\t=> true,\r\n 'query_var' \t=> true,\r\n 'show_in_menu' \t\t\t=> 'profile-builder',\r\n 'has_archive' \t\t\t=> false,\r\n 'hierarchical' \t\t\t=> false,\r\n 'capability_type' \t\t=> 'post',\r\n 'supports' \t\t\t\t=> array( 'title' )\r\n );\r\n\r\n\t/* hide from admin bar for non administrators */\r\n\tif( !current_user_can( 'manage_options' ) )\r\n\t\t$args['show_in_admin_bar'] = false;\r\n\r\n $wppb_addonOptions = get_option('wppb_module_settings');\r\n if( !empty( $wppb_addonOptions['wppb_multipleRegistrationForms'] ) && $wppb_addonOptions['wppb_multipleRegistrationForms'] == 'show' )\r\n register_post_type( 'wppb-rf-cpt', $args );\r\n}", "function form($instance) {\n\n\t\t$defaults = array( \n\t\t\t'title' => __('Contact Form', 'ThemeStockyard'), \n\t\t\t'contact' => '', \n\t\t);\n\t\t$instance = wp_parse_args((array) $instance, $defaults); \n\n\t\tif (!is_plugin_active('contact-form-7/wp-contact-form-7.php')) {\n\t\t\techo __('Sorry, this widget requires the <a href=\"http://wordpress.org/extend/plugins/contact-form-7/\">Contact Form 7</a> plugin to be installed & activated. Please install/activate the plugin before using this widget', 'ThemeStockyard');\n\t\t\treturn false;\n\t\t}\n\t\t\t\n\t\t$post_type = 'wpcf7_contact_form';\n\t\t$args = array(\n\t\t\t'post_type' => $post_type,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby' => 'menu_order',\n\t\t\t'order' => 'ASC',\n\t\t);\n\t\t$contact_forms = get_posts($args);\n\t\tif (empty($contact_forms)) {\n\t\t\techo __('You do not currently have any contact form setup. Please create a contact form before setting up this block', 'ThemeStockyard');\n\t\t\techo '<br/>';\n\t\t\techo '<a href=\"' . esc_url(admin_url()) . '?page=wpcf7\" title=\"'.__('Setup contact form', 'ThemeStockyard').'\">' . __('Setup contact form', 'ThemeStockyard') . '</a>';\n\t\t\treturn false;\n\t\t}\n\n\t\t$form_ids = array();\n\t\tforeach ($contact_forms as $form) {\n\t\t\t$form_ids[$form->ID] = strip_tags($form->post_title);\n\t\t}\n\t\t?>\n\n\t\t<p>\n\t\t\t<label for=\"<?php echo esc_attr($this->get_field_id('title')); ?>\"><?php _e('Title:', 'ThemeStockyard'); ?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo esc_attr($this->get_field_id('title')); ?>\" name=\"<?php echo esc_attr($this->get_field_name('title')); ?>\" value=\"<?php echo esc_attr($instance['title']); ?>\" />\n\t\t</p>\n\n\t\t<p>\n\t\t\t<label for=\"<?php echo esc_attr($this->get_field_id('title')); ?>\"><?php _e('Chose contact Form:', 'ThemeStockyard'); ?></label>\n\t\t\t<select class=\"widefat\" id=\"<?php echo esc_attr($this->get_field_id('contact')); ?>\" name=\"<?php echo esc_attr($this->get_field_name('contact')); ?>\">\n\t\t\t\t<?php\n\t\t\t\tforeach ($form_ids as $form_id => $form_name) {\n\t\t\t\t\techo '<option value=\"' . esc_attr($form_id) . '\"' . selected($instance['contact'], $form_id, false) . '>' . $form_name . \"</option>\\n\";\n\t\t\t\t} \n\t\t\t\t?>\n\t\t\t</select>\n\t\t</p>\n\t<?php\n\t}", "public function meta_box_display_forms() {\n\t?>\n\t\t<p><?php _e( 'Add forms to your Posts or Pages by locating the <strong>Add Form</strong> button in the area above your post/page editor.', 'visual-form-builder-pro' ); ?></p>\n \t<p><?php _e( 'You may also manually insert the shortcode into a post/page or the template tag into a template file.', 'visual-form-builder-pro' ); ?></p>\n \t<p>\n \t\t<?php _e( 'Shortcode', 'visual-form-builder-pro' ); ?>\n \t\t<input value=\"[vfb id='<?php echo (int) $_REQUEST['form']; ?>']\" readonly=\"readonly\" />\n \t</p>\n \t<p>\n \t\t<?php _e( 'Template Tag', 'visual-form-builder-pro' ); ?>\n \t\t<input value=\"&lt;?php vfb_pro( 'id=<?php echo (int) $_REQUEST['form']; ?>' ); ?&gt;\" readonly=\"readonly\"/>\n \t</p>\n\t<?php\n\t}", "function spreker_plugin_shortcode()\r\n {\r\n date_default_timezone_set(\"Europe/Amsterdam\");\r\n global $wpdb; \r\n \r\n if(isset($_POST[\"submit\"]))\r\n {\r\n \r\n $wpdb->query(\r\n $wpdb -> prepare(\"INSERT INTO `login`( `rol`,\r\n `1e_slot`,\r\n `naam`,\r\n `email`,\r\n `adres`,\r\n `onderwerp`,\r\n `omschrijving`,\r\n `wensen`)\r\n VALUES\r\n (2,\r\n '%s',\r\n '%s',\r\n '%s',\r\n '%s',\r\n '%s',\r\n '%s',\r\n '%s')\", \r\n \r\n $_POST[\"id\"],\r\n $_POST[\"naam\"],\r\n $_POST[\"email\"],\r\n $_POST[\"adres\"],\r\n $_POST[\"onderwerp\"],\r\n $_POST[\"omschrijving\"],\r\n $_POST[\"wensen\"]\r\n \r\n )\r\n );\r\n \r\n // header(\"location: agenda\");\r\n var_dump($_POST);\r\n \r\n \r\n }\r\n\r\n ?> \r\n\r\n\r\n \r\n <table>\r\n <form action=\"http://localhost/conferentie/wordpress/spreker-aanmelden/\" method=\"post\">\r\n <tr>\r\n <td>naam:</td><td> <input type=\"text\" name=\"naam\"/></td>\r\n </tr> \r\n <tr>\r\n <td>Email:</td><td> <input type=\"email\" name=\"email\"/></td>\r\n </tr>\r\n <tr>\r\n <td>Adres:</td> <td><input type=\"text\" name=\"adres\"/></td>\r\n </tr>\r\n <tr>\r\n <td>Onderwerp:</td> <td><input type=\"text\" name=\"onderwerp\"/></td>\r\n </tr>\r\n <tr>\r\n <td>Korte omschrijving Onderwerp:</td> <td><textarea name=\"omschrijving\"></textarea></td>\r\n </tr>\r\n <tr>\r\n <td>Wensen:</td> <td><input type=\"checkbox\" name=\"wensen\" value=\"Geen\">Geen</td>\r\n </tr> \r\n <tr>\r\n <td></td> <td><input type=\"checkbox\" name=\"wensen\" value=\"Beamer\">Beamer</td>\r\n </tr>\r\n <tr>\r\n <td></td> <td><input type=\"checkbox\" name=\"wensen\" value=\"Laptop\">Laptop</td>\r\n </tr>\r\n <tr>\r\n <td></td> <td><input type=\"checkbox\" name=\"wensen\" value=\"Aanwijsstok\">Aanwijsstok</td>\r\n </tr> \r\n <tr>\r\n <td></td> <td><input type=\"checkbox\" name=\"wensen\" value=\"Speakers\">Speakers</td>\r\n </tr>\r\n <tr>\r\n <td>1e Keus:</td><td><?php\r\n \r\n $conn = new mysqli('localhost', 'root', '', 'conferentie') \r\n or die ('Cannot connect to db');\r\n\r\n $result = $conn->query(\"select id, dag, zaal, begintijd, eindtijd from slot\");\r\n \r\n echo \"<html>\";\r\n echo \"<body>\";\r\n echo \"<select name='id'>\";\r\n\r\n while ($row = $result->fetch_assoc()) {\r\n\r\n unset($id, $dag, $zaal, $begintijd, $eindtijd);\r\n $id = $row['id'];\r\n $dag = $row['dag']; \r\n $zaal = $row['zaal']; \r\n $begintijd = $row['begintijd']; \r\n $eindtijd = $row['eindtijd']; \r\n echo '<option value=\"'.$id.'\">Dag: '.$dag.' Zaal: '.$zaal.' Begintijd: '.$begintijd.' Eindtijd: '.$eindtijd.' </option>';\r\n \r\n}\r\n\r\n echo \"</select>\";\r\n echo \"</body>\";\r\n echo \"</html>\";\r\n?></td>\r\n </tr>\r\n <td><input type='submit' name='submit' value='Aanmelden'/></td>\r\n </form>\r\n </table>\r\n\r\n <?php\r\n }", "function sc_shortcode_form() {\r\n\tglobal $sc_url;\r\n\t$fields = get_option('sc_form');\r\n\t$settings = get_option('sc_settings');\r\n\r\n\t$form = '';\r\n\t$form .= '<div id=\"sc_form\">';\r\n\t$form .= '<div class=\"mess\"></div>';\r\n\t$form .= '<form method=\"post\" action=\"\" onsubmit=\"return scCheckForm2()\">';\r\n\t\r\n\tif( $fields!='' ): for($i=0; $i<count($fields); $i++):\r\n\t\t\r\n\t\tif( $fields[$i]['req']==1 ){ $mend = 'mendatory '; $ast = '* '; }\r\n\t\telse { $mend = ''; $ast = ''; }\r\n\t\t\r\n\t\tif( $fields[$i]['mail']==1 ) $mail = 'sc_mail';\r\n\t\telse $mail = '';\r\n\t\t\r\n\t\t$lbl = '<label class=\"'. $mend. $mail .'\" for=\"field_'. $i .'_sc\">'. $ast . $fields[$i]['label'] .'</label>';\r\n\t\t$hid = '<input name=\"field_name[]\" value=\"'. $fields[$i]['label'] .'\" type=\"hidden\" style=\"display:none;\" />';\r\n\t\t\r\n\t\tif( $fields[$i]['type']=='textbox' )\r\n\t\t\t$in = '<input class=\"drwr-txtInp-sc\" name=\"field_val[]\" id=\"field_'. $i .'_sc\" type=\"text\" />';\r\n\t\telse\r\n\t\t\t$in = '<textarea class=\"drwr-txtArea-sc\" rows=\"5\" cols=\"5\" name=\"field_val[]\" id=\"field_'. $i .'_sc\"></textarea>';\r\n\t\t\r\n\t\t$form .= \"\\n\\n<p>\".$hid;\r\n\t\t$form .= \"\\n\".$lbl;\r\n\t\t$form .= \"\\n\".$in.\"</p>\";\r\n\t\r\n\tendfor; endif;\r\n\t\r\n\t\r\n\t//add captcha code starts \r\n\tif( $settings['sc_captcha']==1 ){\r\n\t\t\r\n\t\t$form .= '<p><label>Security Code</label>';\r\n\t\t$form .= '<img src=\"'. $sc_url .'/includes/captcha/securimage_show.php?sid='. md5(uniqid(time())) .'\" alt=\"Security Code\" id=\"sc_image_sc\" style=\"float:left\" />';\r\n\t\t\r\n\t\t$form .= '<a href=\"#\" onclick=\"document.getElementById(\\'sc_image_sc\\').src = \\''. $sc_url .'/includes/captcha/securimage_show.php?sid=\\' + Math.random(); return false\"><img src=\"'. $sc_url .'/includes/captcha/images/refresh.png\" alt=\"Reload Image\" title=\"Reload Image\" style=\"float:left;padding-left:10px;\" /></a></p>';\r\n\t\t\r\n\t\t$form .= '<p><label for=\"sc_code_sc\" class=\"mendatory\">* Verify Code</label>';\r\n\t\t$form .= '<input name=\"sc_code\" id=\"sc_code_sc\" type=\"text\" style=\"text-align:center;\" /></p>';\r\n\t\r\n\t}\r\n\t//add captcha code ends\r\n\t\r\n\t\r\n\t\t$form .= '<p><label>*required fields</label><input value=\"Submit\" type=\"submit\" id=\"sc_submit_sc\" /></p>';\r\n\t$form .= '</form>';\r\n\t$form .= '</div>';\r\n\r\n\t$form .= '<div id=\"sc_thanku_sc\" style=\"display:none\"><div class=\"mess\">'. $settings['sc_thanku'] .'</div></div>';\r\n\t$form .= '<div id=\"sc_error_sc\" style=\"display:none\"><div class=\"mess\">'. $settings['sc_error'] .'</div></div>';\r\n\r\n\treturn $form;\r\n}", "public function new_form(){\n $this->vars['page_header'] = __('Create New Service', 'latepoint');\n $this->vars['breadcrumbs'][] = array('label' => __('Create New Service', 'latepoint'), 'link' => false );\n\n $this->vars['category'] = new OsServiceCategoryModel();\n\n if($this->get_return_format() == 'json'){\n $response_html = $this->render($this->views_folder.'new_form', 'none');\n echo wp_send_json(array('status' => 'success', 'message' => $response_html));\n exit();\n }else{\n echo $this->render($this->views_folder . 'new_form', $this->get_layout());\n }\n }", "function form($instance) {\r\n if ( $instance ) {\r\n\t\t\t$title = esc_attr( $instance[ 'title' ] );\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$title = __( '', 'papercuts' );\r\n\t\t} \r\n\r\n\t if ( $instance ) {\r\n\t\t\t$category = esc_attr( $instance[ 'category' ] );\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$category = __( '', 'papercuts' );\r\n\t\t} \r\n\r\n\t\tif ( $instance ) {\r\n\t\t\t$numberposts = esc_attr( $instance[ 'numberposts' ] );\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$numberposts = __( '5', 'papercuts' );\r\n } ?>\r\n<!-- Title -->\r\n<p>\r\n\t<label for=\"<?php echo $this->get_field_id('title'); ?>\">\r\n\t\t<?php _e('Title:', 'papercuts'); ?>\r\n\t</label>\r\n\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id('title'); ?>\" name=\"<?php echo $this->get_field_name('title'); ?>\" type=\"text\" value=\"<?php echo $title; ?>\" />\r\n</p>\r\n<!-- Category -->\r\n<p>\r\n\t<label for=\"<?php echo $this->get_field_id('category'); ?>\">\r\n\t\t<?php _e('Category:', 'papercuts'); ?>\r\n\t</label>\r\n<?php wp_dropdown_categories( array(\r\n 'name' => $this->get_field_name('category'),\r\n 'id' => $this->get_field_id('category'),\r\n 'class' => 'widefat',\r\n 'selected' => $category,\r\n 'show_option_none' => '- not selected -'\r\n) ); ?>\r\n<p style=\"font-size: 10px; color: #999; margin: 0; padding: 0px;\">\r\n\t<?php _e('Select a category of posts.', 'papercuts'); ?>\r\n</p>\r\n</p>\r\n<!-- Number of posts -->\r\n<p>\r\n\t<label for=\"<?php echo $this->get_field_id('numberposts'); ?>\">\r\n\t\t<?php _e('Number of posts:', 'papercuts'); ?>\r\n\t</label>\r\n\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id('numberposts'); ?>\" name=\"<?php echo $this->get_field_name('numberposts'); ?>\" type=\"text\" value=\"<?php echo $numberposts; ?>\" />\r\n<p style=\"font-size: 10px; color: #999; margin: 0; padding: 0px;\">\r\n\t<?php _e('Insert here the number of latest posts from the selected category which you want to display.', 'papercuts'); ?>\r\n</p>\r\n</p>\r\n<?php }", "function padma_post_form($data){\n if(!isset($data['padma_ignore_this_form'])){\n\n $data = apply_filters('padma_merge_options', $data);\n\n\n $response = wp_remote_post( \"https://crm.padm.am/api/v1/form_integration\", array(\n 'method' => 'POST',\n 'httpversion' => '1.0',\n 'blocking' => true,\n 'headers' => array(),\n 'body' => $data,\n 'cookies' => array(),\n 'sslverify' => false\n )\n );\n\n if ( is_wp_error( $response ) ) {\n return $response->get_error_message();\n } else {\n return true;\n }\n }\n}", "public static function wpide_create_new() {\r\n\t\tcheck_admin_referer('plugin-name-action_wpidenonce'); \r\n\t\tif ( !is_super_admin() )\r\n\t\t\twp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site. SORRY').'</p>');\r\n\t\t\r\n\t\t//setup wp_filesystem api\r\n\t\tglobal $wp_filesystem;\r\n $url = wp_nonce_url('admin.php?page=wpide','plugin-name-action_wpidenonce');\r\n $form_fields = null; // for now, but at some point the login info should be passed in here\r\n if (false === ($creds = request_filesystem_credentials($url, FS_METHOD, false, false, $form_fields) ) ) {\r\n // no credentials yet, just produced a form for the user to fill in\r\n return true; // stop the normal page form from displaying\r\n }\r\n\t\tif ( ! WP_Filesystem($creds) ) \r\n\t\t return false;\r\n\t\t\r\n\t $root = apply_filters( 'wpide_filesystem_root', WP_CONTENT_DIR ); \r\n \r\n\t\t//check all required vars are passed\r\n\t\tif (strlen($_POST['path'])>0 && strlen($_POST['type'])>0 && strlen($_POST['file'])>0){\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$filename = sanitize_file_name( $_POST['file'] );\r\n\t\t\t$path = $_POST['path'];\r\n\t\t\t\r\n\t\t\tif ($_POST['type'] == \"directory\"){\r\n\t\t\t\t\r\n\t\t\t\t$write_result = $wp_filesystem->mkdir($root . $path . $filename, FS_CHMOD_DIR);\r\n\t\t\t\t\r\n\t\t\t\tif ($write_result){\r\n\t\t\t\t\tdie(\"1\"); //created\r\n\t\t\t\t}else{\r\n\t\t\t\t\techo \"Problem creating directory\" . $root . $path . $filename;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else if ($_POST['type'] == \"file\"){\r\n\t\t\t\t\r\n //write the file\r\n\t\t\t\t$write_result = $wp_filesystem->put_contents(\r\n\t\t\t\t\t$root . $path . $filename,\r\n\t\t\t\t\t'',\r\n\t\t\t\t\tFS_CHMOD_FILE // predefined mode settings for WP files\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\tif ($write_result){\r\n\t\t\t\t\tdie(\"1\"); //created\r\n\t\t\t\t}else{\r\n\t\t\t\t\techo \"Problem creating file \" . $root . $path . $filename;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//print_r($_POST);\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t}\r\n\t\techo \"0\";\r\n\t\tdie(); // this is required to return a proper result\r\n\t}", "function form($instance)\n\t{\n\t\t/* Set up some default widget settings. */\n\t\t$defaults = array('title' => __('Guild News', 'guildnews'),\n\t\t\t\t'region' => 'eu.battle.net',\n\t\t\t\t'locale' => 'de_DE',\n\t\t\t\t'realm' => 'Blackhand',\n\t\t\t\t'guild' => 'Embargo Agency',\n\t\t\t\t'max' => '5'\n\t\t);\n\n\t\t$instance = wp_parse_args((array) $instance, $defaults); ?>\n\n<!-- Widget Title: Text Input -->\n<p>\n\t<label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php _e('Title:', 'hybrid'); ?>\n\t</label> <input id=\"<?php echo $this->get_field_id( 'title' ); ?>\"\n\t\tname=\"<?php echo $this->get_field_name( 'title' ); ?>\"\n\t\tvalue=\"<?php echo $instance['title']; ?>\" style=\"width: 100%;\" />\n</p>\n\n<!-- Guild Name: Text Input -->\n<p>\n\t<label for=\"<?php echo $this->get_field_id( 'guild' ); ?>\"><?php _e('Guild Name:', 'guildnews'); ?>\n\t</label> <input id=\"<?php echo $this->get_field_id( 'guild' ); ?>\"\n\t\tname=\"<?php echo $this->get_field_name( 'guild' ); ?>\"\n\t\tvalue=\"<?php echo $instance['guild']; ?>\" style=\"width: 100%;\" />\n</p>\n\n<!-- Realm Name: Text Input -->\n<p>\n\t<label for=\"<?php echo $this->get_field_id( 'realm' ); ?>\"><?php _e('Realm Name:', 'guildnews'); ?>\n\t</label> <input id=\"<?php echo $this->get_field_id( 'realm' ); ?>\"\n\t\tname=\"<?php echo $this->get_field_name( 'realm' ); ?>\"\n\t\tvalue=\"<?php echo $instance['realm']; ?>\" style=\"width: 100%;\" />\n</p>\n\n<!-- Region: Select Box -->\n<p>\n\t<label for=\"<?php echo $this->get_field_id( 'region' ); ?>\"><?php _e('Region:', 'guildnews'); ?>\n\t</label> <select id=\"<?php echo $this->get_field_id( 'region' ); ?>\"\n\t\tname=\"<?php echo $this->get_field_name( 'region' ); ?>\"\n\t\tclass=\"widefat\" style=\"width: 100%;\">\n\t\t<option\n\t\t<?php if ( 'eu.battle.net' == $instance['region'] ) echo 'selected=\"selected\"'; ?>>eu.battle.net</option>\n\t\t<option\n\t\t<?php if ( 'us.battle.net' == $instance['region'] ) echo 'selected=\"selected\"'; ?>>us.battle.net</option>\n\t\t<option\n\t\t<?php if ( 'kr.battle.net' == $instance['region'] ) echo 'selected=\"selected\"'; ?>>kr.battle.net</option>\n\t\t<option\n\t\t<?php if ( 'tw.battle.net' == $instance['region'] ) echo 'selected=\"selected\"'; ?>>tw.battle.net</option>\n\t</select>\n</p>\n\n<!-- Locale: Select Box -->\n<p>\n\t<label for=\"<?php echo $this->get_field_id( 'locale' ); ?>\"><?php _e('Locale:', 'guildnews'); ?>\n\t</label> <select id=\"<?php echo $this->get_field_id( 'locale' ); ?>\"\n\t\tname=\"<?php echo $this->get_field_name( 'locale' ); ?>\"\n\t\tclass=\"widefat\" style=\"width: 100%;\">\n\t\t<option\n\t\t<?php if ( 'en_US' == $instance['locale'] ) echo 'selected=\"selected\"'; ?>>en_US</option>\n\t\t<option\n\t\t<?php if ( 'es_MX' == $instance['locale'] ) echo 'selected=\"selected\"'; ?>>es_MX</option>\n\t\t<option\n\t\t<?php if ( 'pt_BR' == $instance['locale'] ) echo 'selected=\"selected\"'; ?>>pt_BR</option>\n\t\t<option\n\t\t<?php if ( 'en_GB' == $instance['locale'] ) echo 'selected=\"selected\"'; ?>>en_GB</option>\n\t\t<option\n\t\t<?php if ( 'es_ES' == $instance['locale'] ) echo 'selected=\"selected\"'; ?>>es_ES</option>\n\t\t<option\n\t\t<?php if ( 'fr_FR' == $instance['locale'] ) echo 'selected=\"selected\"'; ?>>fr_FR</option>\n\t\t<option\n\t\t<?php if ( 'ru_RU' == $instance['locale'] ) echo 'selected=\"selected\"'; ?>>ru_RU</option>\n\t\t<option\n\t\t<?php if ( 'de_DE' == $instance['locale'] ) echo 'selected=\"selected\"'; ?>>de_DE</option>\n\t\t<option\n\t\t<?php if ( 'pt_PT' == $instance['locale'] ) echo 'selected=\"selected\"'; ?>>pt_PT</option>\n\t\t<option\n\t\t<?php if ( 'ko_KR' == $instance['locale'] ) echo 'selected=\"selected\"'; ?>>ko_KR</option>\n\t\t<option\n\t\t<?php if ( 'zh_TW' == $instance['locale'] ) echo 'selected=\"selected\"'; ?>>zh_TW</option>\n\t</select>\n</p>\n\n<!-- Number of News Items: Text Input -->\n<p>\n\t<label for=\"<?php echo $this->get_field_id( 'max' ); ?>\"><?php _e('Number of News Items: (empty for all)', 'guildnews'); ?>\n\t</label> <input id=\"<?php echo $this->get_field_id( 'max' ); ?>\"\n\t\tname=\"<?php echo $this->get_field_name( 'max' ); ?>\"\n\t\tvalue=\"<?php echo $instance['max']; ?>\" style=\"width: 100%;\" />\n</p>\n\n<?php\n\n\t}", "function afap_form_action() {\n\n if (!empty($_POST) && wp_verify_nonce($_POST['afap_form_nonce'], 'afap_form_action')) {\n\n include('inc/cores/save-settings.php');\n\n } else {\n\n die('No script kiddies please!!');\n\n }\n\n }", "function form( $form ) {\n $title =\"\";\n $location =\"\";\n $contactno =\"\";\n $email =\"\";\n\n if(!empty($form))\n {\n $title =$form['title'];\n $location =$form['location'];\n $contactno =$form['contactno'];\n $email =$form['email'];\n\n }\n ?> \n <p>\n <lable>title:</lable>\n <input type=\"text\" value =\"<?php echo $title;?>\" \n name=\"<?php echo $this->get_field_name('title');?>\" \n id=\"<?php echo $this->get_field_id('title');?>\" class=\"widefat\"/>\n <lable>location:</lable>\n <input type=\"text\" value =\"<?php echo $location; ?>\"\n name=\"<?php echo $this->get_field_name('location');?>\" \n id=\"<?php echo $this->get_field_id('location');?>\" class=\"widefat\"/>\n <lable>contactno:</lable>\n <input type=\"text\" value =\"<?php echo $contactno;?>\"\n name=\"<?php echo $this->get_field_name('contactno');?>\" \n id=\"<?php echo $this->get_field_id('contactno');?>\" class=\"widefat\"/>\n <lable>email:</lable>\n <input type=\"text\" value =\"<?php echo $email;?>\"\n name=\"<?php echo $this->get_field_name('email');?>\" \n id=\"<?php echo $this->get_field_id('email');?>\" class=\"widefat\"/>\n </p>\n <?php\n }", "function prepare_form() {\n global $wpdb, $userdata;\n\n $post_id = isset( $_GET['pid'] ) ? intval( $_GET['pid'] ) : 0;\n\n //is editing enabled?\n if ( wpuf_get_option( 'enable_post_edit', 'wpuf_others', 'yes' ) != 'yes' ) {\n return __( 'Post Editing is disabled', 'wpuf' );\n }\n\n $curpost = get_post( $post_id );\n\n if ( !$curpost ) {\n return __( 'Invalid post', 'wpuf' );\n }\n\n //has permission?\n if ( !current_user_can( 'delete_others_posts' ) && ( $userdata->ID != $curpost->post_author ) ) {\n return __( 'You are not allowed to edit', 'wpuf' );\n }\n\n //perform delete attachment action\n if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == \"del\" ) {\n check_admin_referer( 'wpuf_attach_del' );\n $attach_id = intval( $_REQUEST['attach_id'] );\n\n if ( $attach_id ) {\n wp_delete_attachment( $attach_id );\n }\n }\n\n //process post\n if ( isset( $_POST['wpuf_edit_post_submit'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'wpuf-edit-post' ) ) {\n $this->submit_post();\n\n $curpost = get_post( $post_id );\n }\n\n //show post form\n $this->edit_form( $curpost );\n }", "function cp_add_core_fields($form_id) {\r\n\tglobal $wpdb;\r\n\r\n // check to see if any rows already exist for this form. If so, don't insert any data\r\n $wpdb->get_results( $wpdb->prepare( \"SELECT form_id FROM \" . $wpdb->prefix . \"cp_ad_meta WHERE form_id = %s\", $form_id ) );\r\n\r\n // no fields yet so let's add the defaults\r\n if ( $wpdb->num_rows == 0 ) {\r\n\r\n $insert = \"INSERT INTO \" . $wpdb->prefix . \"cp_ad_meta\" .\r\n \" (form_id, field_id, field_req, field_pos) \" .\r\n \"VALUES ('\"\r\n . $wpdb->escape($form_id). \"','\"\r\n . $wpdb->escape('1'). \"','\" // post_title\r\n . $wpdb->escape('1'). \"','\"\r\n . $wpdb->escape('1')\r\n . \"'),\"\r\n . \"('\"\r\n . $wpdb->escape($form_id). \"','\"\r\n . $wpdb->escape('2'). \"','\" // cp_price\r\n . $wpdb->escape('1'). \"','\"\r\n . $wpdb->escape('2')\r\n . \"'),\"\r\n . \"('\"\r\n . $wpdb->escape($form_id). \"','\"\r\n . $wpdb->escape('3'). \"','\" // cp_street\r\n . $wpdb->escape('1'). \"','\"\r\n . $wpdb->escape('3')\r\n . \"'),\"\r\n . \"('\"\r\n . $wpdb->escape($form_id). \"','\"\r\n . $wpdb->escape('4'). \"','\" // cp_city\r\n . $wpdb->escape('1'). \"','\"\r\n . $wpdb->escape('4')\r\n . \"'),\"\r\n . \"('\"\r\n . $wpdb->escape($form_id). \"','\"\r\n . $wpdb->escape('5'). \"','\" // cp_state\r\n . $wpdb->escape('1'). \"','\"\r\n . $wpdb->escape('5')\r\n . \"'),\"\r\n . \"('\"\r\n . $wpdb->escape($form_id). \"','\"\r\n . $wpdb->escape('6'). \"','\" // cp_country\r\n . $wpdb->escape('1'). \"','\"\r\n . $wpdb->escape('6')\r\n . \"'),\"\r\n . \"('\"\r\n . $wpdb->escape($form_id). \"','\"\r\n . $wpdb->escape('7'). \"','\" // cp_zipcode\r\n . $wpdb->escape('1'). \"','\"\r\n . $wpdb->escape('7')\r\n . \"'),\"\r\n . \"('\"\r\n . $wpdb->escape($form_id). \"','\"\r\n . $wpdb->escape('8'). \"','\" // tags_input\r\n . $wpdb->escape('1'). \"','\"\r\n . $wpdb->escape('8')\r\n . \"'),\"\r\n . \"('\"\r\n . $wpdb->escape($form_id). \"','\"\r\n . $wpdb->escape('9'). \"','\" // post_content\r\n . $wpdb->escape('1'). \"','\"\r\n . $wpdb->escape('9')\r\n . \"')\";\r\n\r\n $results = $wpdb->query( $insert );\r\n\r\n }\r\n}", "function buildForm(){\n\t\t# menampilkan form\n\t}", "function show_form( $atts=null, $form=true ) {\n global $wpdb, $isPolitical, $currencySymbol, $eligibility;\n \n $check_security = $this->check_security();\n \n if($check_security!==true) {\n return false;\n exit();\n }\n \n extract( shortcode_atts( array(\n 'amounts' => null,\n 'amount_as_input' => null,\n 'source' => null,\n 'thanks_url' => null,\n 'custom_amt_off' => 'false',\n 'button' => 'Submit',\n 'default_state' => null\n ), $atts ) );\n if(isset($_GET['amounts']) && !empty($_GET['amounts'])) {\n $amounts = $_GET['amounts'];\n }\n \n if(isset($_GET['source'])) {\n $source = $_GET['source'];\n } else if(isset($_GET['refcode'])) {\n $source = $_GET['refcode'];\n }\n \n if($amounts) {\n $amounts = explode(',', $amounts);\n $this->custom_amt_options = array();\n \n foreach($amounts as $amount) {\n $ths_amt = round($amount, 0);\n $ths_amt = (string) $ths_amt;\n $this->custom_amt_options[$ths_amt*100] = '$'.$ths_amt;\n }\n $this->custom_amt_options['custom'] = '<label for=\"custom_dollar_amt\">Other:</label> $<input type=\"text\" %s class=\"amount custom_dollar_amt\" /> <small>('.strtoupper($currencySymbol).')</small>';\n }\n \n $form_fields = '';\n // Loop through and generate the elements\n \n if(isset($source) && !empty($source)) {\n $form_fields .= '<input type=\"hidden\" name=\"Source\" value=\"'.$source.'\" />';\n }\n \n if(isset($this->config_errors) && !empty($this->config_errors)) {\n $form_fields .= $this->config_errors;\n }\n foreach($this->fieldsets as $fieldset_name => $fields) {\n if($isPolitical!=='true' && $fieldset_name=='Employment') {\n continue;\n } else {\n if(isset($thanks_url)) {\n $form_fields .= '<input type=\"hidden\" value=\"'.$thanks_url.'\" id=\"thanks_url\" />';\n }\n $form_fields .= '<fieldset><legend>'.$fieldset_name.'</legend>';\n if(isset($fields['html_intro'])) {\n $form_fields .= $fields['html_intro'];\n unset($fields['html_intro']);\n }\n foreach($fields as $field_key => $field) {\n if(!isset($field['type'])) {\n var_dump($field);\n }\n switch($field['type']) {\n case 'text':\n if(!isset($field['show_pre_div']) || $field['show_pre_div']=='true') {\n $form_fields .= '\n <div class=\"input';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n }\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">This field cannot be left blank.</div>';\n }\n if(isset($field['slug'])) {\n if(!isset($field['show_label']) || $field['show_label']!='false') {\n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>';\n }\n $form_fields .= '<input type=\"text\" ';\n $form_fields .= 'name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\" value=\"';\n if(isset($_POST[$field['slug']])) {\n $form_fields .= $_POST[$field['slug']];\n }\n $form_fields .= '\"';\n } else {\n if(!isset($field['show_label']) || $field['show_label']!='false') {\n $form_fields .= '\n <label for=\"'.$field['id'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>';\n }\n $form_fields .= '<input type=\"text\" ';\n $form_fields .= ' id=\"'.$field['id'].'\" value=\"\"';\n }\n if(!empty($field['label']) && (!isset($field['show_placeholder']) || $field['show_placeholder']=='true')) {\n $form_fields .= ' placeholder=\"'.$field['label'].'\"';\n }\n $form_fields .= ' />';\n if(!isset($field['show_post_div']) || $field['show_post_div']=='true') {\n $form_fields .= '</div>';\n }\n break;\n case 'file':\n $file = true;\n $form_fields .= '\n <div class=\"file';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n if(isset($field['error']) && $field['error']===true && $field['required']=='true') {\n $form_fields .= '<div class=\"errMsg\">You must provide a '.$field['label'].'.</div>';\n } else if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">There was a problem uploading your file.</div>';\n }\n \n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>\n <input type=\"file\" name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\" />\n </div>\n ';\n break;\n case 'hidden':\n $form_fields .= '<input type=\"hidden\" name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\" value=\"';\n if(isset($_POST[$field['slug']])) {\n $form_fields .= $_POST[$field['slug']];\n } else if(isset($field['value'])) {\n $form_fields .= $field['value'];\n }\n $form_fields .= '\" />';\n break;\n case 'password':\n $form_fields .= '\n <div class=\"password ';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">This field cannot be left blank.</div>';\n }\n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>\n <input type=\"password\" name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\" value=\"';\n if(isset($_POST[$field['slug']])) {\n $form_fields .= $_POST[$field['slug']];\n }\n $form_fields .= '\"/>\n </div>\n ';\n break;\n case 'textarea':\n $form_fields .= '\n <div class=\"textarea';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">This field cannot be left blank.</div>';\n }\n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>\n <textarea name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\">';\n if(isset($_POST[$field['slug']])) {\n $form_fields .= $_POST[$field['slug']];\n }\n $form_fields .= '</textarea>\n </div>\n ';\n break;\n case 'checkbox':\n if(isset($field['options']) && !empty($field['options'])) {\n $form_fields .= '<fieldset id=\"ngp_'.$field['slug'].'\" class=\"checkboxgroup';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error\">\n <div class=\"errMsg\">You must check at least one.</div>';\n } else {\n $form_fields .= '\">';\n }\n $form_fields .= '<legend>'.$field['label'];\n if($field['required']=='true') $form_fields .= '<span class=\"required\">*</span>';\n $form_fields .= '</legend>';\n $i = 0;\n foreach($field['options'] as $val) {\n $i++;\n $form_fields .= '<div class=\"checkboxoption\"><input type=\"checkbox\" value=\"'.$val.'\" name=\"'.$field['slug'].'['.$i.']['.$val.']\" id=\"option_'.$i.'_'.$field['slug'].'\" class=\"'.$field['slug'].'\" /> <label for=\"option_'.$i.'_'.$field['slug'].'\">'.$val.'</label></div>'.\"\\r\\n\";\n }\n $form_fields .= '</fieldset>';\n } else {\n $form_fields .= '<div id=\"ngp_'.$field['slug'].'\" class=\"checkbox\">';\n $form_fields .= '<div class=\"checkboxoption\"><input type=\"checkbox\" name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\" class=\"'.$field['slug'].'\" /> <label for=\"'.$field['slug'].'\">'.$field['label'].'</label></div>'.\"\\r\\n\";\n $form_fields .= '</div>';\n }\n break;\n case 'radio':\n if(isset($field['slug'])) {\n $form_fields .= '\n <fieldset id=\"radiogroup_'.$field['slug'].'\" class=\"radiogroup';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n } else {\n $form_fields .= '\n <fieldset id=\"radiogroup_'.$field['id'].'\" class=\"radiogroup';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n }\n $form_fields .= '\"><legend>'.$field['label'];\n if($field['required']=='true') { $form_fields .= '<span class=\"required\">*</span>'; }\n $form_fields .= '</legend>';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">You must select an option.</div>';\n }\n $i = 0;\n if($field['label']=='Amount' && isset($this->custom_amt_options)) {\n $the_options = $this->custom_amt_options;\n } else {\n $the_options = $field['options'];\n }\n \n if(isset($_GET['amt']) && empty($_POST)) {\n if(strpos($_GET['amt'], '.')===false) {\n $get_amt = $_GET['amt'];\n } else {\n $get_amt = $_GET['amt'];\n }\n \n if(array_key_exists($get_amt, $the_options)) {\n $amt = $get_amt;\n } else {\n $custom_amt = $_GET['amt'];\n }\n } else if(isset($_POST['custom_dollar_amt'])) {\n $custom_amt = $_POST['custom_dollar_amt'];\n } else if(isset($field['slug']) && isset($_POST[$field['slug']])) {\n $amt = $_POST[$field['slug']];\n }\n \n foreach($the_options as $val => $labe) {\n $i++;\n if($val=='custom' && $custom_amt_off=='false') {\n $replace = (isset($custom_amt)) ? 'value=\"'.$custom_amt.'\"' : '';\n $form_fields .= '<div class=\"radio custom-donation-amt\">'.sprintf($labe, $replace).'</div>'.\"\\r\\n\";\n } else {\n $form_fields .= '<div class=\"radio\"><input type=\"radio\" value=\"'.$val.'\"';\n if(isset($field['slug'])) {\n $form_fields .= ' name=\"'.$field['slug'].'\"';\n $form_fields .= ' id=\"'.$i.'_'.$field['slug'].'\" class=\"amount '.$field['slug'].'\"';\n } else {\n $form_fields .= ' id=\"'.$i.'_'.$field['id'].'\" class=\"amount '.$field['id'].'\"';\n }\n if(isset($amt) && $amt==$val) {\n $form_fields .= ' checked';\n }\n $form_fields .= '> <label for=\"'.$i.'_';\n if(isset($field['slug'])) {\n $form_fields .= $field['slug'];\n } else {\n $form_fields .= $field['id'];\n }\n $form_fields .= '\">'.$labe.'</label></div>'.\"\\r\\n\";\n }\n }\n $form_fields .= '</fieldset>';\n break;\n case 'select':\n if(!isset($field['show_pre_div']) || $field['show_pre_div']=='true') {\n $form_fields .= '\n <div class=\"input';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n }\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">You must select an option.</div>';\n }\n if(isset($field['slug'])) {\n if(!isset($field['show_label']) || $field['show_label']!='false') {\n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>';\n }\n $form_fields .= '<select name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\">'.\"\\r\\n\";\n } else {\n if(!isset($field['show_label']) || $field['show_label']!='false') {\n $form_fields .= '\n <label for=\"'.$field['id'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>';\n }\n $form_fields .= '<select id=\"'.$field['id'].'\">'.\"\\r\\n\";\n }\n $field_ref = (isset($field['slug'])) ? $field['slug'] : $field['id'];\n if($field_ref!='State' && $field_ref!='cardExpiryMonth' && $field_ref!='cardExpiryYear') {\n $form_fields .= '\n <option>Select an option...</option>\n ';\n }\n foreach($field['options'] as $key => $val) {\n $form_fields .= '<option value=\"'.$key.'\"';\n if(isset($field['slug']) && isset($_POST[$field['slug']]) && $_POST[$field['slug']]==$key) {\n $form_fields .= ' selected=\"selected\"';\n } else if(!empty($default_state) && $default_state==$key) {\n $form_fields .= ' selected=\"selected\"';\n }\n $form_fields .= '>'.$val.'</option>'.\"\\r\\n\";\n }\n $form_fields .= '</select>';\n if(!isset($field['show_post_div']) || $field['show_post_div']=='true') {\n $form_fields .= '</div>';\n }\n break;\n case 'multiselect':\n $form_fields .= '\n <div class=\"multiselect ';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">This field cannot be left blank.</div>';\n }\n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>\n <select multiple name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\">'.\"\\r\\n\";\n foreach($field['options'] as $key => $val) {\n $form_fields .= '<option value=\"'.$key.'\">'.$val.'</option>'.\"\\r\\n\";\n }\n $form_fields .= '\n </select>\n </div>\n ';\n break;\n }\n }\n $form_fields .= '</fieldset>';\n }\n }\n \n $return = '';\n \n if(!empty($form_fields)) {\n $return .= '<div id=\"stripe-msgs\" style=\"display:none;\"></div><form name=\"stripe_payment\" class=\"stripe_payment_submission\" id=\"stripe-payment-form\" action=\"'.$_SERVER['REQUEST_URI'].'\" method=\"post\">';\n \n // if(function_exists('wp_nonce_field')) {\n // $return .= wp_nonce_field('stripe_nonce_field', 'stripe_add', true, false);\n // }\n \n $return .= $form_fields;\n \n $return .= '<div class=\"submit\">\n <input type=\"submit\" value=\"'.$button.'\" />\n </div>\n <div class=\"stripe-payment-form-row-progress\">\n <span class=\"message\"></span>\n </div>';\n if($isPolitical==='true') {\n $return .= str_replace('{{button}}', $button, $eligibility);\n }\n // $return .= '<p class=\"addtl-donation-footer-info\">'.str_replace(\"\\r\\n\", '<br />', str_replace('&lt;i&gt;', '<i>', str_replace('&lt;/i&gt;', '</i>', str_replace('&lt;u&gt;', '<u>', str_replace('&lt;/u&gt;', '</u>', str_replace('&lt;b&gt;', '<b>', str_replace('&lt;/b&gt;', '</b>', get_option('stripe_payments_footer_info')))))))).'</p>';\n $return .= '</form>';\n \n return $return;\n }\n }", "function dm_hubspot_form_shortcode($atts) {\n\textract(shortcode_atts(array(\n\t\t'portal_id' => '219987',\n\t\t'id' => '',\n\t\t'campaign_id' => '',\n\t\t'include_script' => true\n\t), $atts));\n\n\tob_start();\n?>\n\t<?php if ($include_script): ?>\n\t\t<script charset=\"utf-8\" src=\"//js.hubspot.com/forms/current.js\"></script>\n\t<?php endif; ?>\n\t<script>\n\t\tvar formProps = {\n\t\t\tportalId: '<?php echo $portal_id; ?>',\n\t\t\tformId: '<?php echo $id; ?>'\n\t\t};\n\t\t<?php if (!empty($campaign_id)): ?>\n\t\tformProps.sfdcCampaignId = '<?php echo $campaign_id; ?>';\n\t\t<?php endif; ?>\n\t\thbspt.forms.create(formProps);\n\t</script>\n<?php\n\t$output = ob_get_clean();\n\treturn $output;\n}", "public function create()\n {\n\t\t$js = [Module::asset(\"metafields:js/post.js\")];\n\t\tView::share('js_script', $js);\n return view('metafields::backend.create',array(\"title\" => \"Create Metafield\"));\n }", "function mmpm_theme_options_form(){\n\t\t$out = '';\n\t\t$submit_button = mmpm_ntab(7) . '<input type=\"submit\" class=\"button-primary pull-right\" value=\"' . __( 'Save All Changes', MMPM_TEXTDOMAIN_ADMIN ) . '\" />';\n\t\t$theme_meta = mmpm_ntab(7) . '<div>' . mmpm_ntab(8) . '<span class=\"theme_name\">' . __( MMPM_PLUGIN_NAME , MMPM_TEXTDOMAIN_ADMIN ) . '</span>' . ' <small>v' . MMPM_PLUGIN_VERSION . mmpm_ntab(7) . '</small></div>';\n\t\t$out .= mmpm_ntab(1) . '<div class=\"wrap bootstrap\">';\n\t\t$out .= mmpm_ntab(2) . '<div class=\"'. MMPM_PREFIX . '_theme_page\">';\n\t\t$out .= mmpm_ntab(3) . '<form id=\"'. MMPM_PREFIX . '_theme_options_form\" class=\"'. MMPM_PREFIX . '_theme_options_form\" method=\"post\" action=\"options.php\" enctype=\"multipart/form-data\">';\n\t\t$out .= mmpm_ntab(4) . '<div class=\"save_shanges row no_x_margin\">';\n\t\t$out .= mmpm_ntab(5) . '<div class=\"col-xs-12\">';\n\t\t$out .= mmpm_ntab(6) . '<div class=\"float_holder\">';\n\t\t$out .= $submit_button;\n\t\t$out .= $theme_meta;\n\t\t$out .= mmpm_ntab(6) . '</div>';\n\t\t$out .= mmpm_ntab(5) . '</div>';\n\t\t$out .= mmpm_ntab(4) . '</div>';\n//\t\t$out .= mmpm_ntab(4) . '<input type=\"hidden\" name=\"action\" value=\"update\" />';\n\t\t$out .= mmpm_ntab(4) . '<input type=\"hidden\" name=\"' . MMPM_OPTIONS_DB_NAME . '[last_modified]\" value=\"' . ( time() + 60 ) . '\" />';\n\t\tob_start();\n\t\tsettings_fields( 'mmpm_options_group' );\n\t\t$out .= mmpm_ntab(4) . ob_get_contents();\n\t\tob_end_clean();\n\t\t$out .= mmpm_theme_sections_generator();\n\t\t$out .= mmpm_ntab(4) . '<div class=\"save_shanges row no_x_margin\">';\n\t\t$out .= mmpm_ntab(5) . '<div class=\"col-xs-12\">';\n\t\t$out .= mmpm_ntab(6) . '<div class=\"float_holder\">';\n\t\t$out .= $submit_button;\n\t\t$out .= mmpm_ntab(6) . '</div>';\n\t\t$out .= mmpm_ntab(5) . '</div>';\n\t\t$out .= mmpm_ntab(4) . '</div>';\n\t\t$out .= mmpm_ntab(3) . '</form>';\n\t\t$out .= mmpm_ntab(2) . '</div><!-- class=\"'. MMPM_PREFIX . 'theme_page\" -->';\n\t\t$out .= mmpm_ntab(1) . '</div><!-- class=\"wrap\" -->';\n\n\t\techo $out; // general out\n\t}", "protected function form()\n {\n $form = new Form(new ThemePoster());\n\n $form->select('domain_id', __('domain_id'))->options(DomainConfig::getDomainMap())->rules('required');\n $form->radio('type', __('type'))->options(ThemePoster::getTypeMap())->when(1, function (Form $form){\n $form->select('type_id', __('type_id'))->options(array_merge(['0' => '总列表'], Product::getCategoryMap()->toArray()))->rules('required');\n\n })->when(2, function (Form $form){\n $form->select('type_id', __('type_id'))->options(array_merge(['0' => '总列表'], Article::getCategoryMap()))->rules('required');\n\n });\n $form->text('title', __('title'))->rules('required');\n $form->text('alt', __('alt'))->rules('required');\n $form->image('site', '图片尺寸 1600*300')\n ->uniqueName()\n ->rules('required|max:150')->resize(1600, 300);\n $form->url('link', __('link'));\n $form->switch('is_show', __('is_show'));\n\n return $form;\n }", "function display_form( $org ) { ?>\n\n\t\t<form action=\"<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>\" method=\"POST\">\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Organisation name\n\t\t\t\t\t\t<input type=\"text\" name=\"title\" value=\"<?php echo esc_attr( $org->columns['Title'] ); ?>\">\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Telephone\n\t\t\t\t\t\t<input type=\"text\" name=\"telephone\" value=\"<?php echo esc_attr( $org->columns['Telephone'] ); ?>\">\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Telephone alternative number\n\t\t\t\t\t\t<input type=\"text\" name=\"telephonealternative\" value=\"<?php echo esc_attr( $org->columns['TelephoneAlternative'] ); ?>\">\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Email\n\t\t\t\t\t\t<input type=\"email\" name=\"email\" value=\"<?php echo esc_attr( $org->columns['Email'] ); ?>\">\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Website URL\n\t\t\t\t\t\t<input type=\"text\" name=\"website_url\" value=\"<?php echo esc_url( $org->columns['Website_URL'] ); ?>\">\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Address\n\t\t\t\t\t\t<textarea name=\"address\" rows=\"4\" maxlength=\"1000\" style=\"resize:vertical\">NOT USED</textarea>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Location\n\t\t\t\t\t\t<-- ie: parish -->\n\t\t\t\t\t\t<input type=\"text\" name=\"location\" value=\"NOT USED\" disabled>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Town / City\n\t\t\t\t\t\t<input type=\"text\" name=\"cityortown\" value=\"<?php echo esc_attr( $org->columns['CityOrTown'] ); ?>\" disabled>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>County\n\t\t\t\t\t\t<input type=\"text\" name=\"county\" value=\"<?php echo esc_attr( $org->columns['County'] ); ?>\" disabled>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Postcode\n\t\t\t\t\t\t<input type=\"text\" name=\"postcode\" value=\"<?php echo esc_attr( $org->columns['Postcode'] ); ?>\">\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Country\n\t\t\t\t\t\t<input type=\"text\" name=\"country_id\" value=\"<?php echo esc_attr( $org->columns['Country_ID'] ); ?>\">\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Latitude\n\t\t\t\t\t\t<input type=\"text\" name=\"latitude\" value=\"<?php echo esc_attr( $org->columns['Latitude'] ); ?>\" disabled>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Longitude\n\t\t\t\t\t\t<input type=\"text\" name=\"longitude\" value=\"<?php echo esc_attr( $org->columns['Longitude'] ); ?>\" disabled>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Opening Hours\n\t\t\t\t\t\t<textarea name=\"openinghours\" rows=\"4\" maxlength=\"1000\" style=\"resize:vertical\"><?php echo esc_textarea( $org->columns['OpeningHours'] ); ?></textarea>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\n\n\t\t\t\t<?php // Get a list of all the services\n\t\t\t\t$services = $this->get_service_list();\n\n\t\t\t\tif ( ! $services || empty( $services ) ) {\n\t\t\t\t\t// Error retrieving Services\n\t\t\t\t\tconsole_debug( 'There was a problem retrieving the services from the database' );\n\t\t\t\t} else {\n\n\t\t\t\t\t// Outputs the services checkboxes, ticking any that are selected for this organisation\n\t\t\t\t\t// TODO: Need to find out which are selected for this organisation if we're editing it\n\t\t\t\t\t?>\n\t\t\t\t\t<fieldset class=\"services-checkboxes\">\n\t\t\t\t\t\t<legend>Services</legend>\n\n\t\t\t\t\t\t<?php foreach ( $services as $service ) {\n\t\t\t\t\t\t\t$id = $service['ID'];\n\t\t\t\t\t\t\t$title = $service['Title'];\n\n\t\t\t\t\t\t\techo '<input id=\"service-' . $id . '\" type=\"checkbox\" name=\"services[]\" value=\"' . $id . '\"> <label for=\"service-' . $id . '\">' . $title . '</label>';\n\t\t\t\t\t\t} ?>\n\n\t\t\t\t\t</fieldset>\n\n\t\t\t\t<?php } // endif ?>\n\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<label>Other Information\n\t\t\t\t\t\t<textarea name=\"information\" rows=\"4\" maxlength=\"1000\" style=\"resize:vertical\"><?php echo esc_textarea( $org->columns['Information'] ); ?></textarea>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\n\n\t\t\t\t<?php // Hidden field of id. Will be 'null' if a new record.\n\n\t\t\t\tif ( $org->columns['ID'] == null ) {\n\t\t\t\t\t$the_id = 'null';\n\t\t\t\t} else {\n\t\t\t\t\t$the_id = $org->columns['ID'];\n\t\t\t\t}\n\n\t\t\t\techo '<input type=\"hidden\" name=\"id\" value=\"' . esc_attr( $the_id ) . '\" />'; ?>\n\n\t\t\t\t<?php // Set the action handler for wordpress ?>\n\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"add_edit_org\"/>\n\n\n\t\t\t\t<div class=\"medium-6 columns\">\n\t\t\t\t\t<input class=\"button\" type=\"submit\" name=\"submit\" value=\"Save\">\n\t\t\t\t\t<input class=\"button\" type=\"submit\" name=\"submit\" value=\"Cancel\" formnovalidate>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</form>\n\n\t<?php }", "function wppb_multiple_forms_publish_admin_hook(){\r\n\tglobal $post;\r\n\t\r\n\tif ( is_admin() && ( ( $post->post_type == 'wppb-epf-cpt' ) || ( $post->post_type == 'wppb-rf-cpt' ) ) ){\r\n\t\t?>\r\n\t\t<script language=\"javascript\" type=\"text/javascript\">\r\n\t\t\tjQuery(document).ready(function() {\r\n\t\t\t\tjQuery(document).on( 'click', '#publish', function(){\r\n\t\t\t\t\tvar post_title = jQuery( '#title' ).val();\r\n\r\n\t\t\t\t\tif ( jQuery.trim( post_title ) == '' ){\r\n\t\t\t\t\t\talert ( '<?php _e( 'You need to specify the title of the form before creating it', 'profile-builder' ); ?>' );\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tjQuery( '#ajax-loading' ).hide();\r\n\t\t\t\t\t\tjQuery( '.spinner' ).hide();\r\n\t\t\t\t\t\tjQuery( '#publish' ).removeClass( 'button-primary-disabled' );\r\n\t\t\t\t\t\tjQuery( '#save-post' ).removeClass('button-disabled' );\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t</script>\r\n\t\t<?php\r\n\t}\r\n}", "function mongo_node_type_create_form_submit($form, $form_state) {\n $label = $form_state['values']['label'];\n $machine_name = $form_state['values']['name'];\n\n $set = mongo_node_settings();\n $set += mongo_node_type_default_settings($label, $machine_name);\n\n // @todo - redirect to entity type page\n mongo_node_settings_save($set);\n}", "function psc_manage_forms() {\n\tif(isset($_GET['action'])) {\n\t\tswitch($_GET['action']) {\n\t\t\tcase 'save_captcha_info':\n\t\t\t\tif(wp_verify_nonce($_POST['psc_catch_info'], 'psc_nonce_field')) {\n\t\t\t\t\tpsc_save_api_info($_POST);\n\t\t\t\t}\n\t\t\t\tpsc_admin_index();\n\t\t\t\tbreak;\n\t\t\tcase 'edit_form':\n\t\t\t\tif(isset($_GET['id'])) {\n\t\t\t\t\tif(wp_verify_nonce($_POST['psc_save'], 'psc_nonce_field') && $_POST['psc_id']==$_GET['id']) {\n\t\t\t\t\t\tpsc_save_form($_POST);\n\t\t\t\t\t}\n\t\t\t\t\tpsc_edit_form($_GET['id']);\n\t\t\t\t} else {\n\t\t\t\t\techo 'Error.';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'new_form':\n\t\t\t\tif(wp_verify_nonce($_POST['psc_save'], 'psc_nonce_field')) {\n\t\t\t\t\t$id = psc_save_form($_POST);\n\t\t\t\t}\n\t\t\t\tif(isset($id)) {\n\t\t\t\t\tpsc_edit_form($id);\n\t\t\t\t} else {\n\t\t\t\t\tpsc_edit_form();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t} else {\n\t\tpsc_admin_index();\n\t}\n\treturn true;\n}", "function init_form_fields() {\n\t\t\t\n\t\t\t$abs_path = str_replace('/wp-admin', '', getcwd());\n\t\t\n\t\t\t$this->form_fields = array(\n\t\t\t\t'enabled' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Activer/Désactiver:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'checkbox', \n\t\t\t\t\t\t\t\t'label' => __( 'Activer le module de paiement Atos.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => 'yes'\n\t\t\t\t\t\t\t), \n\t\t\t\t'title' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Nom:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Intitulé affiché à l\\'utilisateur lors de la commande.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __( 'Paiement sécurisé par carte bancaire', 'woothemes' )\n\t\t\t\t\t\t\t),\n\t\t\t\t'description' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Description:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'textarea', \n\t\t\t\t\t\t\t\t'description' => __( 'Description affichée à l\\'utilisateur lors de la commande.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Payez en toute sécurité grâce à notre système de paiement Atos.', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'merchant_id' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Identifiant commerçant:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Identifiant commerçant fourni par votre banque. Ex: 014295303911112', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('014295303911112', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'pathfile' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Chemin du fichier pathfile:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Chemin absolu vers le fichier de configuration \"pathfile\" du kit de paiement, sans le / final', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __($abs_path . '/atos/param/pathfile', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'request_file' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Chemin du fichier request:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Chemin absolu vers le fichier exécutable \"request\" du kit de paiement, sans le / final', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __($abs_path . '/atos/bin/request', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'response_file' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Chemin du fichier response:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Chemin absolu vers le fichier exécutable \"response\" du kit de paiement, sans le / final', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __($abs_path . '/atos/bin/response', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'payment_means' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Cartes acceptées:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Moyens de paiement acceptés. Ex pour CB, Visa et Mastercard: CB,2,VISA,2,MASTERCARD,2', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('CB,2,VISA,2,MASTERCARD,2', 'woothemes')\n\t\t\t\t\t\t\t),\n\n\t\t\t\t'currency_code' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Devise:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'select', \n\t\t\t\t\t\t\t\t'description' => __( 'Veuillez sélectionner une devise pour les paiemenents.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => '978',\n\t\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t\t'840' => 'USD',\n\t\t\t\t\t\t\t\t\t'978' => 'EUR',\n\t\t\t\t\t\t\t\t\t'124' => 'CAD',\n\t\t\t\t\t\t\t\t\t'392' => 'JPY',\n\t\t\t\t\t\t\t\t\t'826' => 'GBP',\n\t\t\t\t\t\t\t\t\t'036' => 'AUD' \n\t\t\t\t\t\t\t\t ) \t\t\t\t\t\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\n\t\t\t\t'paybtn' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Texte bouton de paiement:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Texte affiché sur le bouton qui redirige vers le terminal de paiement.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Régler la commande.', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'paymsg' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Message page de paiement:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'textarea', \n\t\t\t\t\t\t\t\t'description' => __( 'Message affiché sur la page de commande validée, avant passage sur le terminal de paiement.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Merci pour votre commande. Veuillez cliquer sur le bouton ci-dessous pour effectuer le règlement.', 'woothemes')\n\t\t\t\t\t\t\t)\n\t\t\t\t/*'payreturn' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Texte bouton retour:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Texte affiché sur le bouton de retour ver la boutique.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Retour', 'woothemes')\n\t\t\t\t\t\t\t)*/\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t);\n\t\t\n\t\t}", "protected function _prepareForm()\n {\n $form = new Varien_Data_Form(array(\n 'id' => 'add_form',\n 'action' => $this->getUrl('*/faq/save', array(\n 'ret' => Mage::registry('ret'),\n 'id' => $this->getRequest()->getParam('id')\n )\n ),\n 'method' => 'post'\n ));\n\n $fieldset = $form->addFieldset('faq_new_question', array(\n 'legend' => $this->__('New Question'),\n 'class' => 'fieldset-wide'\n ));\n\n $fieldset->addField('new_question', 'text', array(\n 'label' => Mage::helper('inchoo_faq')->__('New Question'),\n 'required' => true,\n 'name' => 'question'\n ));\n\n $fieldset->addField('new_answer', 'textarea', array(\n 'label' => Mage::helper('inchoo_faq')->__('Answer'),\n 'required' => false,\n 'name' => 'answer',\n 'style' => 'height:12em;',\n ));\n\n $form->setUseContainer(true);\n// $form->setValues();\n $this->setForm($form);\n\n// echo \"_prepareForm()\";\n\n return parent::_prepareForm();\n\n\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "function form($instance) {\n $defaults = array( 'user_image' => '', 'url' =>'', 'label' =>'', 'desc' =>'', 'twitter_url' =>'', 'facebook_url' =>'', 'insta_url' =>'', 'pint_url' =>'', 'mail_url' =>'');\n $instance = wp_parse_args( (array) $instance, $defaults );\n\n?>\n<div>\n <p><label for=\"<?php echo $this->get_field_id( 'user_image' ); ?>\"><?php _e('User image', 'tcd-w'); ?></label><br /><?php _e('Recommend image size. Width:400px Height:400px.', 'tcd-w'); ?></p>\n <div class=\"widget_media_upload cf cf_media_field hide-if-no-js <?php echo $this->get_field_id('user_image'); ?>\">\n <input type=\"hidden\" value=\"<?php echo $instance['user_image']; ?>\" id=\"<?php echo $this->get_field_id('user_image'); ?>\" name=\"<?php echo $this->get_field_name('user_image'); ?>\" class=\"cf_media_id\">\n <div class=\"preview_field\"><?php if($instance['user_image']){ echo wp_get_attachment_image($instance['user_image'], 'size1'); }; ?></div>\n <div class=\"buttton_area\">\n <input type=\"button\" value=\"<?php _e('Select Image', 'tcd-w'); ?>\" class=\"cfmf-select-img button\">\n <input type=\"button\" value=\"<?php _e('Remove Image', 'tcd-w'); ?>\" class=\"cfmf-delete-img button <?php if(!$instance['user_image']){ echo 'hidden'; }; ?>\">\n </div>\n </div>\n</div>\n<p>\n <label for=\"<?php echo $this->get_field_id('desc'); ?>\"><?php _e('User description', 'tcd-w'); ?></label>\n <textarea class=\"widefat\" id=\"<?php echo $this->get_field_id('desc'); ?>\" name=\"<?php echo $this->get_field_name('desc'); ?>\"><?php echo $instance['desc']; ?></textarea>\n</p>\n<p>\n <label for=\"<?php echo $this->get_field_id('url'); ?>\"><?php _e('Button link url', 'tcd-w'); ?></label>\n <input class=\"widefat\" id=\"<?php echo $this->get_field_id('url'); ?>\" name=\"<?php echo $this->get_field_name('url'); ?>'\" type=\"text\" value=\"<?php echo esc_url($instance['url']); ?>\" />\n</p>\n<p>\n <label for=\"<?php echo $this->get_field_id('name'); ?>\"><?php _e('Button link label', 'tcd-w'); ?></label>\n <input class=\"widefat\" id=\"<?php echo $this->get_field_id('label'); ?>\" name=\"<?php echo $this->get_field_name('label'); ?>'\" type=\"text\" value=\"<?php echo $instance['label']; ?>\" />\n</p>\n<ul>\n <li>\n <label for=\"<?php echo $this->get_field_id('twitter_url'); ?>\"><?php _e('Your Twitter URL', 'tcd-w'); ?></label>\n <input class=\"widefat\" id=\"<?php echo $this->get_field_id('twitter_url'); ?>\" name=\"<?php echo $this->get_field_name('twitter_url'); ?>'\" type=\"text\" value=\"<?php echo esc_url($instance['twitter_url']); ?>\" />\n </li>\n <li>\n <label for=\"<?php echo $this->get_field_id('facebook_url'); ?>\"><?php _e('Your Facebook URL', 'tcd-w'); ?></label>\n <input class=\"widefat\" id=\"<?php echo $this->get_field_id('facebook_url'); ?>\" name=\"<?php echo $this->get_field_name('facebook_url'); ?>'\" type=\"text\" value=\"<?php echo esc_url($instance['facebook_url']); ?>\" />\n </li>\n <li>\n <label for=\"<?php echo $this->get_field_id('insta_url'); ?>\"><?php _e('Your Instagram URL', 'tcd-w'); ?></label>\n <input class=\"widefat\" id=\"<?php echo $this->get_field_id('insta_url'); ?>\" name=\"<?php echo $this->get_field_name('insta_url'); ?>'\" type=\"text\" value=\"<?php echo esc_url($instance['insta_url']); ?>\" />\n </li>\n <li>\n <label for=\"<?php echo $this->get_field_id('pint_url'); ?>\"><?php _e('Your Pinterest URL', 'tcd-w'); ?></label>\n <input class=\"widefat\" id=\"<?php echo $this->get_field_id('pint_url'); ?>\" name=\"<?php echo $this->get_field_name('pint_url'); ?>'\" type=\"text\" value=\"<?php echo esc_url($instance['pint_url']); ?>\" />\n </li>\n <li>\n <label for=\"<?php echo $this->get_field_id('mail_url'); ?>\"><?php _e('Your Contact page URL (You can use mailto:)', 'tcd-w'); ?></label>\n <input class=\"widefat\" id=\"<?php echo $this->get_field_id('mail_url'); ?>\" name=\"<?php echo $this->get_field_name('mail_url'); ?>'\" type=\"text\" value=\"<?php echo esc_url($instance['mail_url']); ?>\" />\n </li>\n</ul>\n<?php\n\n }", "function uultra_new_links_add_form()\r\n\t{\r\n\t\t\r\n\t\t$meta = 'uultra_link_content';\r\n\t\t$html = '<div id=\"#uultra-add-links-box\" class=\"uultra-links-content-edition-box \" title=\"Add New Link\">';\r\n\t\t\r\n\t\t$html .= '<input name=\"uultra-current-selected-widget-to-edit\" id=\"uultra-current-selected-widget-to-edit\" type=\"hidden\" />';\r\n\t\t\r\n\t\t\r\n\t\t$html .= '<table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td width=\"50%\"> '.__(\"Name: \",'xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\"><input name=\"uultra_link_title\" type=\"text\" id=\"uultra_link_title\" /> \r\n\t\t </td>\r\n\t\t </tr>\r\n\t\t <tr>\r\n\t\t\t\t<td width=\"50%\"> '.__(\"Slug: \",'xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\"><input name=\"uultra_link_slug\" type=\"text\" id=\"uultra_link_slug\" /> \r\n\t\t </td>\r\n\t\t </tr>\r\n\t\t <tr>\r\n\t\t\t\t<td width=\"50%\"> '.__('Type:','xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\">\r\n\t\t\t\t<select name=\"uultra_link_type\" id=\"uultra_link_type\" size=\"1\">\r\n\t\t\t\t <option value=\"\" selected=\"selected\">'.__(\"Select Type: \",'xoousers').'</option>\r\n\t\t\t\t <option value=\"1\">'.__(\"Text: \",'xoousers').'</option>\r\n\t\t\t\t <option value=\"2\">Shortcode</option>\r\n\t\t\t\t</select>\r\n\r\n\t\t </td>\r\n\t\t\t </tr>\r\n\t\t\t\t\t \r\n\t\t\t <tr>\r\n\t\t\t\t<td>'.__('Content:','xoousers').'</td>\r\n\t\t\t\t<td>&nbsp;</textarea> \r\n\t\t\t </td>\r\n\t\t\t </tr>\r\n\t\t\t\r\n\t\t\t \r\n\t\t\t</table> '; \t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$html .= '<div class=\"uultra-field-msbox-div-history\" id=\"uultra-msg-history-list\">';\r\n\t\t\r\n\t\t$html .= $this->uultra_get_addlink_html_form($meta, $content);\r\n\t\t\r\n\t\t$html .= '</div>';\t\r\n\t\t\r\n\t\t\r\n\t\t\t \r\n\t\t$html .= ' <p class=\"submit\">\r\n\t\t\t\t\t<input type=\"button\" name=\"submit\" class=\"button uultra-links-add-new-close\" value=\"'.__('Close','xoousers').'\" /> <input type=\"button\" name=\"submit\" class=\"button button-primary uultra-links-add-new-confirm\" value=\"'.__('Submit','xoousers').'\" /> <span id=\"uultra-add-new-links-m-w\" ></span>\r\n\t\t\t\t</p> ';\t\t\r\n\t\t$html .= '</div>';\t\t\r\n\t\t\t\r\n\t\treturn $html;\r\n\t}", "function fusion_element_gravityform() {\nif( class_exists ('GFAPI')) {\n // get list of forms for select form field\n $forms = GFAPI::get_forms();\n $formList = array();\n foreach ($forms as $form ) {\n $formList[ $form['id'] ] = $form['title'];\n };\n\n\n fusion_builder_map( array(\n 'name' => esc_attr__( 'Gravity Form', 'fusion-builder' ),\n 'shortcode' => 'gravityform',\n 'params' => array(\n array(\n 'type' => 'select',\n 'heading' => esc_attr__( 'Select Form', 'fusion-builder' ),\n 'description' => esc_attr__( 'Select the form to use', 'fusion-builder' ),\n 'param_name' => 'id',\n 'value' => $formList ),\n array(\n 'type' => 'radio_button_set',\n 'heading' => esc_attr__( 'Ajax', 'fusion-builder' ),\n 'description' => esc_attr__( 'Enable Ajax for form submissions', 'fusion-builder' ),\n 'param_name' => 'ajax',\n 'value' => array(\n 'true' => esc_attr__( 'Yes', 'fusion-builder' ),\n 'false' => esc_attr__( 'No', 'fusion-builder' ),\n ),\n ),\n array(\n 'type' => 'radio_button_set',\n 'heading' => esc_attr__( 'Title', 'fusion-builder' ),\n 'description' => esc_attr__( 'Show Form Title', 'fusion-builder' ),\n 'param_name' => 'title',\n 'value' => array(\n 'true' => esc_attr__( 'Yes', 'fusion-builder' ),\n 'false' => esc_attr__( 'No', 'fusion-builder' ),\n ),\n ),\n array(\n 'type' => 'radio_button_set',\n 'heading' => esc_attr__( 'Description', 'fusion-builder' ),\n 'description' => esc_attr__( 'Show Form Description', 'fusion-builder' ),\n 'param_name' => 'description',\n 'value' => array(\n 'true' => esc_attr__( 'Yes', 'fusion-builder' ),\n 'false' => esc_attr__( 'No', 'fusion-builder' ),\n ),\n ),\n ),\n ) );\n }\n}", "function wpgnv_display_form() {\n?>\n\t<div style='display: none;' class='row idea-form-row'>\n\t\t<div class='idea sixteen columns alpha omega border-radius-4 box-shadow-5-light'>\n\t\t\t<form method=\"post\" action=\"\" class='idea-form'>\n\t\t\t\t<h1 class='tk-nimbus-sans-condensed'>Add your own idea!</h1>\n\t\t\t\t<p>First, make sure that none of the ideas already submitted contain your idea. You can just fill out the form below to enter your own idea for a MeetUp topic. These topics will be moderated and then added to the list.</p>\n\t\t\t\t<label for=\"title\">TITLE</label>\n\t\t\t\t<textarea placeholder=\"enter your idea here\" type=\"text\" name=\"post-title\"></textarea>\n\t\t\t\t<?php wp_nonce_field( 'wpgnv_new_idea', 'wpgnv_new_idea' ); ?>\n\t\t\t\t<button type=\"submit\">Submit Your Idea</button>\n\t\t\t</form><!-- end .idea-form -->\n\t\t</div><!-- end .sixteen -->\n\t</div>\n<?php\n}", "function beaver_extender_fe_style_editor_build_form() {\n\t\n?>\n\t\t<form action=\"/\" id=\"beaver-extender-fe-style-editor-form\" name=\"beaver-extender-fe-style-editor-form\">\n\t\t\t\n\t\t\t<input type=\"hidden\" name=\"action\" value=\"beaver_extender_fe_style_editor_save\" />\n\t\t\t<input type=\"hidden\" name=\"security\" value=\"<?php echo wp_create_nonce( 'beaver-extender-fe-style-editor' ); ?>\" />\n\t\t\n\t\t\t<div class=\"beaver-extender-fe-style-editor-nav\">\n\t\t\t\t<input id=\"beaver-extender-fe-style-editor-save-button\" type=\"submit\" value=\"<?php _e( 'Save Changes', 'extender' ); ?>\" name=\"Submit\" alt=\"Save Changes\" />\n\t\t\t\t<img class=\"beaver-extender-ajax-save-spinner\" src=\"<?php echo site_url() . '/wp-admin/images/spinner-2x.gif'; ?>\" />\n\t\t\t\t<span class=\"beaver-extender-saved\"></span>\n\t\n\t\t\t\t<span id=\"beaver-extender-fe-style-editor-contract-icon\" class=\"beaver-extender-fe-style-editor-icons dashicons dashicons-editor-contract\"></span>\n\t\t\t\t<span id=\"beaver-extender-fe-style-editor-css-builder-toggle-icon\" class=\"beaver-extender-fe-style-editor-icons dashicons dashicons-admin-customizer\"></span>\n\t\t\t\t<span id=\"beaver-extender-fe-style-editor-search-icon\" class=\"beaver-extender-fe-style-editor-icons dashicons dashicons-search\"></span>\n\t\t\t</div><!-- END .beaver-extender-fe-style-editor-nav -->\n\t\t\t\n\t\t\t<div id=\"beaver-extender-fe-style-editor-container\">\n\t\t\t\t\n\t\t\t\t<textarea data-editor=\"css\" style=\"display:none;\" wrap=\"off\" id=\"beaver-extender-fe-style-editor-output\" class=\"code-builder-output\" name=\"extender[custom_css]\"><?php echo beaver_extender_get_custom_css( 'custom_css' ); ?></textarea>\t\t\t\t\t\n\t\t\t\n\t\t\t</div><!-- END #beaver-extender-fe-style-editor-container -->\n\t\t\n\t\t</form><!-- END #beaver-extender-fe-style-editor-form -->\n<?php\n\t\n}", "function ROMP_enquiry_form_page_shortcode(){\n\n?>\t\t<div class=\"container\">\n\t\t\t\t<div class=\"row\"><div class=\"loading\">Loading&#8230;</div></div>\n\t\t\t\t<form method=\"POST\" onsubmit=\"enquiryPageSubmitFunction()\" id=\"form-enquiry-page\">\n\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t<fieldset id=\"personal_information\">\n\t\t\t\t\t\t\t<legend>Personal Information:</legend>\n\t\t\t\t\t\t\t\t<div class=\"col-12 col-sm-12 col-md-6 col-xl-6\">\n\t\t\t\t\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t\t\t\t \t<select name=\"title\" id=\"title\" class=\"form-control\">\n\t\t\t\t\t\t\t\t\t\t\t<option value=\"Select Title\">Select Title</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value=\"Mr\">Mr</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value=\"Mrs\">Mrs</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value=\"Miss\">Miss</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value=\"Ms\">Ms</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value=\"Dr\">Dr</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value=\"Other\">Other</option>\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t\t\t\t <input type=\"text\" class=\"form-control\" id=\"fname\" name=\"fname\" placeholder=\"Enter First Name\" required>\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t\t\t\t <input type=\"text\" class=\"form-control\" id=\"sname\" name=\"sname\" placeholder=\"Surname\" required>\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\t<div class=\"col-12 col-sm-12 col-md-6 col-xl-6\">\n\t\t\t\t\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t\t\t\t <input type=\"tel\" class=\"form-control\" id=\"landline\" name=\"landline\" placeholder=\"Phone Number\">\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t\t\t\t <input type=\"tel\" class=\"form-control\" id=\"mobile\" name=\"mobile\" placeholder=\"Mobile Number\" required>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t\t\t\t <input type=\"email\" class=\"form-control email\" id=\"email\" name=\"email\" placeholder=\"Email Address\" required>\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</fieldset>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t<fieldset id=\"postcode_section\">\n\t\t\t\t\t\t\t<legend>About Your Property:</legend>\n\t\t\t\t\t\t\t<div class=\"col-12 col-sm-12 col-md-12 col-xl-12\">\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<div class=\"form-group theLabel\">\n\t\t\t\t\t\t\t\t <input type=\"text\" id=\"postcode\" placeholder=\"Postcode\" name=\"postcode\">\n\t\t\t\t\t\t\t\t <span id=\"enquiry_page_lookup_field\"></span>\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\t\n\t\t\t\t\t\t\t<div class=\"col-12 col-sm-12 col-md-6 col-xl-6\">\n\t\t\t\t\t\t\t\t<div class=\"form-group theLabel\">\n\t\t\t\t\t\t\t\t <input type=\"text\" class=\"form-control\" id=\"county\" name=\"county\" placeholder=\"County\" readonly>\n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t<div class=\"form-group theLabel\">\n\t\t\t\t\t\t\t\t <input type=\"text\" class=\"form-control\" id=\"postal_town\" name=\"postal_town\" placeholder=\"Postal Town\" readonly>\n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t\t\t <input type=\"text\" class=\"form-control\" id=\"street_address1\" name=\"street_address1\" placeholder=\"Address Line 1\" readonly>\n\t\t\t\t\t\t\t\t <input type=\"text\" class=\"form-control\" id=\"street_address2\" name=\"street_address2\" placeholder=\"Address Line 2\" readonly>\n\t\t\t\t\t\t\t\t <input type=\"text\" class=\"form-control\" id=\"street_address3\" name=\"street_address3\" placeholder=\"Address Line 3\" readonly>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\n\n\t\t\t\t\t\t\t<div class=\"col-12 col-sm-12 col-md-6 col-xl-6\">\n\t\t\t\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t\t\t <select class=\"form-control\" id=\"property_type\" name=\"property_type\">\n\t\t\t\t\t\t\t\t \t<option value=\"Type of Property\">Type of Property</option>\n\t\t\t\t\t\t\t\t \t<option value=\"Self-Contained Studio\">Self-Contained Studio</option>\n\t\t\t\t\t\t\t\t \t<option value=\"1-Bed Flat\">1-Bed Flat</option>\n\t\t\t\t\t\t\t\t \t<option value=\"2-Bed Flat\">2-Bed Flat</option>\n\t\t\t\t\t\t\t\t \t<option value=\"3-Bed Flat\">3-Bed Flat</option>\n\t\t\t\t\t\t\t\t \t<option value=\"4-Bed Flat\">4-Bed Flat</option>\n\t\t\t\t\t\t\t\t \t<option value=\"1-Bed Terraced\">1-Bed Terraced</option>\n\t\t\t\t\t\t\t\t \t<option value=\"2-Bed Terraced\">2-Bed Terraced</option>\n\t\t\t\t\t\t\t\t \t<option value=\"3-Bed Terraced\">3-Bed Terraced</option>\n\t\t\t\t\t\t\t\t \t<option value=\"4-Bed Terraced\">4-Bed Terraced</option>\n\t\t\t\t\t\t\t\t \t<option value=\"5-Bed Terraced\">5-Bed Terraced</option>\n\t\t\t\t\t\t\t\t \t<option value=\"6-Bed Terraced\">6-Bed Terraced</option>\n\t\t\t\t\t\t\t\t \t<option value=\"1-Bed Semi-Detached\">1-Bed Semi-Detached</option>\n\t\t\t\t\t\t\t\t \t<option value=\"2-Bed Semi-Detached\">2-Bed Semi-Detached</option>\n\t\t\t\t\t\t\t\t \t<option value=\"3-Bed Semi-Detached\">3-Bed Semi-Detached</option>\n\t\t\t\t\t\t\t\t \t<option value=\"4-Bed Semi-Detached\">4-Bed Semi-Detached</option>\n\t\t\t\t\t\t\t\t \t<option value=\"5-Bed Semi-Detached\">5-Bed Semi-Detached</option>\n\t\t\t\t\t\t\t\t \t<option value=\"6-Bed Semi-Detached\">6-Bed Semi-Detached</option>\n\t\t\t\t\t\t\t\t \t<option value=\"1-Bed Detached\">1-Bed Detached</option>\n\t\t\t\t\t\t\t\t \t<option value=\"2-Bed Detached\">2-Bed Detached</option>\n\t\t\t\t\t\t\t\t \t<option value=\"3-Bed Detached\">3-Bed Detached</option>\n\t\t\t\t\t\t\t\t \t<option value=\"4-Bed Detached\">4-Bed Detached</option>\n\t\t\t\t\t\t\t\t \t<option value=\"5-Bed Detached\">5-Bed Detached</option>\n\t\t\t\t\t\t\t\t \t<option value=\"6-Bed Detached\">6-Bed Detached</option>\n\t\t\t\t\t\t\t\t \t<option value=\"1-Bed Apartment\">1-Bed Apartment</option>\n\t\t\t\t\t\t\t\t \t<option value=\"2-Bed Apartment\">2-Bed Apartment</option>\n\t\t\t\t\t\t\t\t \t<option value=\"3-Bed Apartment\">3-Bed Apartment</option>\n\t\t\t\t\t\t\t\t \t<option value=\"4-Bed Apartment\">4-Bed Apartment</option>\n\t\t\t\t\t\t\t\t \t<option value=\"5-Bed Apartment\">5-Bed Apartment</option>\n\t\t\t\t\t\t\t\t \t<option value=\"Land\">Land</option>\n\t\t\t\t\t\t\t\t \t<option value=\"Guest House\">Guest House</option>\n\t\t\t\t\t\t\t\t \t<option value=\"Hotel\">Hotel</option>\n\t\t\t\t\t\t\t\t \t<option value=\"Commercial Property\">Commercial Property</option>\n\t\t\t\t\t\t\t\t </select>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t\t\t <input type=\"text\" class=\"form-control\" id=\"estimated_val\" name=\"estimated_val\" placeholder=\"Enter Estimated Value\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t\t\t <input type=\"text\" class=\"form-control\" id=\"estimated_secured_debts\" name=\"estimated_secured_debts\" placeholder=\"Estimated Secured Debts\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div class=\"col-12 col-sm-12 col-md-12 col-xl-12\">\n\t\t\t\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t\t\t <textarea class=\"form-control\" cols=\"40\" rows=\"10\" id=\"rfs\" name=\"rfs\" placeholder=\"Reason For Selling\"></textarea>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div class=\"col-12 col-sm-12 col-md-12 col-xl-12\">\n\t\t\t\t\t\t\t\t<button type=\"submit\" class=\"btn btn-block btn-primary disabled\" id=\"submitButton\" disabled>Submit</button>\n\t\t\t\t\t\t\t\t<div class=\"alert alert-warning\" role=\"alert\"><strong>Warning!</strong> Email Address Invalid! Please use valid email address!</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</div>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t</div>\n<?php\n\t}", "function wpcf_admin_migration_form()\n{\n global $wpdb;\n $wpcf_types = get_option(WPCF_OPTION_NAME_CUSTOM_TYPES, array());\n $wpcf_taxonomies = get_option(WPCF_OPTION_NAME_CUSTOM_TAXONOMIES, array());\n $wpcf_types_defaults = wpcf_custom_types_default();\n $wpcf_taxonomies_defaults = wpcf_custom_taxonomies_default();\n\n $form = array();\n $form['#form']['callback'] = 'wpcf_admin_migration_form_submit';\n\n $cfui_types = get_option('cpt_custom_post_types', array());\n $cfui_types_migrated = array();\n\n $cfui_taxonomies = get_option('cpt_custom_tax_types', array());\n $cfui_tax_migrated = array();\n\n if (!empty($cfui_types)) {\n $form['types_title'] = array(\n '#type' => 'markup',\n '#markup' => '<h3>' . __('Custom Types UI Post Types', 'wpcf') . '</h3>',\n );\n\n foreach ($cfui_types as $key => $cfui_type) {\n $exists = array_key_exists(sanitize_title($cfui_type['name']),\n $wpcf_types);\n if ($exists) {\n $attributes = array('readonly' => 'readonly', 'disabled' => 'disabled');\n $add = __('(exists)', 'wpcf');\n } else {\n $attributes = array();\n $add = '';\n }\n $slug = $id = sanitize_title($cfui_type['name']);\n $form['types-' . $slug] = array(\n '#type' => 'checkbox',\n '#name' => 'cfui[types][]',\n '#value' => $slug,\n '#title' => !empty($cfui_type['label']) ? $cfui_type['label'] . ' ' . $add : $slug . ' ' . $add,\n '#inline' => true,\n '#after' => '&nbsp;&nbsp;',\n '#default_value' => $exists ? 0 : 1,\n '#attributes' => $attributes,\n );\n }\n }\n\n if (!empty($cfui_taxonomies)) {\n $form['tax_titles'] = array(\n '#type' => 'markup',\n '#markup' => '<h3>' . __('Custom Types UI Taxonomies', 'wpcf') . '</h3>',\n );\n\n foreach ($cfui_taxonomies as $key => $cfui_tax) {\n $title = !empty($cfui_tax['label']) ? $cfui_tax['label'] : $slug;\n $exists = array_key_exists(sanitize_title($cfui_tax['name']),\n $wpcf_taxonomies);\n if ($exists) {\n $attributes = array('readonly' => 'readonly', 'disabled' => 'disabled');\n $add = __('(exists)', 'wpcf');\n } else {\n $attributes = array();\n $add = '';\n }\n $slug = $id = sanitize_title($cfui_tax['name']);\n $form['types-' . $slug] = array(\n '#type' => 'checkbox',\n '#name' => 'cfui[tax][]',\n '#value' => $slug,\n '#title' => $title . ' ' . $add,\n '#inline' => true,\n '#after' => '&nbsp;&nbsp;',\n '#default_value' => $exists ? 0 : 1,\n '#attributes' => $attributes,\n );\n }\n }\n\n if (!empty($cfui_types) || !empty($cfui_taxonomies)) {\n $form['deactivate-cfui'] = array(\n '#type' => 'checkbox',\n '#name' => 'deactivate-cfui',\n '#before' => '<br /><br />',\n '#default_value' => 1,\n '#title' => __('Disable Custom Types UI after importing the configuration (leave this checked to avoid defining custom types twice)', 'wpcf'),\n );\n };\n\n /**\n * Advanced Custom Fields\n */\n if (class_exists('acf') && !class_exists('acf_pro')) {\n $acf_groups = get_posts('post_type=acf&status=publish&numberposts=-1');\n if (!empty($acf_groups)) {\n $wpcf_types = wpcf_admin_fields_get_available_types();\n $wpcf_types_options = array();\n foreach ($wpcf_types as $type => $data) {\n $wpcf_types_options[$type] = array(\n '#title' => $data['title'],\n '#value' => $type,\n );\n }\n $acf_types = array(\n 'text' => 'textfield',\n 'textarea' => 'textarea',\n 'wysiwyg' => 'wysiwyg',\n 'image' => 'image',\n 'file' => 'file',\n 'select' => 'select',\n 'checkbox' => 'checkbox',\n 'radio' => 'radio',\n 'true_false' => 'radio',\n 'page_link' => 'textfield',\n 'post_object' => false,\n 'relationship' => 'textfield',\n 'date_picker' => 'date',\n 'color_picker' => false,\n 'repeater' => false,\n );\n\n if (!empty($acf_groups)) {\n $form['acf_title'] = array(\n '#type' => 'markup',\n '#markup' => '<h3>' . __('Advanced Custom Fields', 'wpcf') . '</h3>',\n );\n }\n\n foreach ($acf_groups as $acf_key => $acf_post) {\n $group_id = $wpdb->get_var(\n $wpdb->prepare(\n \"SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type = %s\",\n $acf_post->post_title,\n TYPES_CUSTOM_FIELD_GROUP_CPT_NAME\n )\n );\n if (empty($group_id)) {\n $add = __('Group will be created', 'wpcf');\n } else {\n $add = __('Group will be updated', 'wpcf');\n }\n $form[$acf_post->ID . '_post'] = array(\n '#type' => 'checkbox',\n '#title' => $acf_post->post_title . ' (' . $add . ')',\n '#value' => $acf_post->ID,\n '#default_value' => 1,\n '#name' => 'acf_posts[migrate_groups][]',\n '#inline' => true,\n '#after' => '<br />',\n '#attributes' => array('onclick' => 'if (jQuery(this).is(\\':checked\\')) { jQuery(this).parent().find(\\'table .checkbox\\').attr(\\'checked\\',\\'checked\\'); } else { jQuery(this).parent().find(\\'table .checkbox\\').removeAttr(\\'checked\\'); }'),\n );\n $form[$acf_post->ID . '_post_title'] = array(\n '#type' => 'hidden',\n '#name' => 'acf_posts[' . $acf_post->ID . '][post_title]',\n '#value' => $acf_post->post_title,\n );\n $form[$acf_post->ID . '_post_content'] = array(\n '#type' => 'hidden',\n '#name' => 'acf_posts[' . $acf_post->ID . '][post_content]',\n '#value' => addslashes($acf_post->post_content),\n );\n $form[$acf_post->ID . '_fields_table'] = array(\n '#type' => 'markup',\n '#markup' => '<table style=\"margin-bottom: 40px;\">',\n );\n $metas = get_post_custom($acf_post->ID);\n $acf_fields = array();\n foreach ($metas as $meta_name => $meta) {\n if (strpos($meta_name, 'field_') === 0) {\n $data = unserialize($meta[0]);\n $exists = wpcf_types_cf_under_control('check_exists',\n $data['name']);\n $outsider = wpcf_types_cf_under_control('check_outsider',\n $data['name']);\n $supported = !empty($acf_types[$data['type']]);\n if (!$supported) {\n $attributes = array('style' => 'margin-left: 20px;', 'readonly' => 'readonly', 'disabled' => 'disabled');\n $add = __('Field conversion not supported by Types', 'wpcf');\n } else if ($exists && !$outsider) {\n $attributes = array('style' => 'margin-left: 20px;', 'readonly' => 'readonly', 'disabled' => 'disabled');\n $add = __('Field with same name is already controlled by Types', 'wpcf');\n } else if ($exists && $outsider) {\n $attributes = array('style' => 'margin-left: 20px;');\n $add = __('Field will be updated', 'wpcf');\n } else {\n $attributes = array('style' => 'margin-left: 20px;');\n $add = __('Field will be created', 'wpcf');\n }\n $form[$acf_post->ID . '_acf_field_' . $meta_name . '_checkbox'] = array(\n '#type' => 'checkbox',\n '#title' => $data['name'] . ' (' . $add . ')',\n '#value' => $meta_name,\n '#default_value' => (($exists && !$outsider) || !$supported) ? 0 : 1,\n '#name' => 'acf_posts[' . $acf_post->ID . '][migrate_fields][]',\n '#inline' => true,\n '#attributes' => $attributes,\n '#before' => '<tr><td>',\n );\n $form[$acf_post->ID . '_acf_field_' . $meta_name . '_details_description'] = array(\n '#type' => 'hidden',\n '#name' => 'acf_posts[' . $acf_post->ID . '][fields][' . $meta_name . '][description]',\n '#value' => esc_attr($data['instructions']),\n '#inline' => true,\n );\n $form[$acf_post->ID . '_acf_field_' . $meta_name . '_details_name'] = array(\n '#type' => 'hidden',\n '#name' => 'acf_posts[' . $acf_post->ID . '][fields][' . $meta_name . '][name]',\n '#value' => esc_attr($data['label']),\n );\n $form[$acf_post->ID . '_acf_field_' . $meta_name . '_details_slug'] = array(\n '#type' => 'hidden',\n '#name' => 'acf_posts[' . $acf_post->ID . '][fields][' . $meta_name . '][slug]',\n '#value' => esc_attr($data['name']),\n );\n // Add options for radios and select\n if (in_array($data['type'], array('radio', 'select'))\n && !empty($data['choices'])) {\n foreach ($data['choices'] as $option_value => $option_title) {\n if (strpos($option_value, ':') !== false) {\n $temp = explode(':', $option_value);\n $option_value = trim($temp[0]);\n $option_title = trim($temp[1]);\n } else if (strpos($option_title, ':') !== false) {\n $temp = explode(':', $option_title);\n $option_value = trim($temp[0]);\n $option_title = trim($temp[1]);\n }\n\n $_key = sanitize_title($option_value);\n\n $form[$acf_post->ID . '_acf_field_' . $meta_name . '_option_' . $_key . '_value'] = array(\n '#type' => 'hidden',\n '#name' => 'acf_posts[' . $acf_post->ID . '][fields][' . $meta_name . '][options][' . $_key . '][value]',\n '#value' => esc_attr($option_value),\n );\n $form[$acf_post->ID . '_acf_field_' . $meta_name . '_option_' . $_key . '_title'] = array(\n '#type' => 'hidden',\n '#name' => 'acf_posts[' . $acf_post->ID . '][fields][' . $meta_name . '][options][' . $_key . '][title]',\n '#value' => esc_attr($option_title),\n );\n }\n if (!empty($data['default_value'])) {\n $form[$acf_post->ID . '_acf_field_' . $meta_name . '_option_default'] = array(\n '#type' => 'hidden',\n '#name' => 'acf_posts[' . $acf_post->ID . '][fields][' . $meta_name . '][options][default]',\n '#value' => esc_attr($data['default_value']),\n );\n }\n }\n if (($exists && !$outsider) || !$supported) {\n $attributes = array('disabled' => 'disabled');\n if ($exists) {\n }\n } else {\n $attributes = array();\n }\n $default_value = isset($acf_types[$data['type']]) && !empty($acf_types[$data['type']]) ? $acf_types[$data['type']] : 'textfield';\n $form[$acf_post->ID . '_acf_field_' . $meta_name . '_details_type'] = array(\n '#type' => 'select',\n '#name' => 'acf_posts[' . $acf_post->ID . '][fields][' . $meta_name . '][type]',\n '#options' => $wpcf_types_options,\n '#default_value' => $default_value,\n '#inline' => true,\n '#attributes' => $attributes,\n '#before' => '</td><td>',\n '#after' => '</td></tr>',\n );\n }\n }\n $acf_groups[$acf_key] = $acf_post;\n $form[$acf_post->ID . '_fields_table_close'] = array(\n '#type' => 'markup',\n '#markup' => '</table>',\n );\n }\n }\n }\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#name' => 'submit',\n '#value' => __('Import custom field settings', 'wpcf'),\n '#attributes' => array('class' => 'button-primary'),\n );\n\n return $form;\n}", "function MYMODULE_my_custom_form(&$form_state) {\n // Add some normal FAPI item.\n $form['title'] = array (\n '#type' => 'textfield',\n '#title' => 'Title',\n '#required' => true,\n '#default_value' => NULL,\n '#maxlength' => 255,\n '#weight' => -5,\n );\n // Add special CCK form items.\n module_load_include('inc', 'content', 'includes/content.node_form');\n // Assume a hypothetical content type called \"article\"\n $type = content_types('article');\n // Go through each of its custom fields and add them to our form.\n foreach ($type['fields'] as $field_name => $field) {\n // If we wanted a specific field, we'd filter it here, by name:\n // if ($field_name == 'field_article_my_custom_field') { }\n // But for this example we're going to add them all.\n $form['#field_info'][$field['field_name']] = $field;\n $form += (array) content_field_form($form, $form_state, $field);\n }\n $form['submit'] = array (\n '#value' => 'Submit',\n '#type' => 'submit',\n );\n return $form;\n}", "function glv_create_tables(){\r\n global $wpdb;\r\n \r\n //el nombre de la tabla, utilizamos el prefijo de wordpress\r\n $table_forms = $wpdb->prefix.'glv_forms'; \r\n\r\n //sql con el statement de la tabla \r\n $glv_form = \"CREATE TABLE \".$table_forms.\"(\r\n for_id int(11) NOT NULL AUTO_INCREMENT,\r\n for_name varchar(100) DEFAULT NULL,\r\n for_value text DEFAULT NULL,\r\n for_date date,\r\n UNIQUE KEY for_id (for_id)\r\n )\";\r\n\r\n //upgrade contiene la función dbDelta la cuál revisará si existe la tabla o no\r\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\r\n \r\n //creamos la tabla\r\n dbDelta($glv_form);\r\n }", "function custom_form_shortcode() {\n ob_start();\n custom_form_callback();\n\twp_enqueue_script( 'form-script', plugin_dir_url( __FILE__ ) . '/form-validation.js', array('jquery'), '0.1', true );\n return ob_get_clean();\n}", "public function save_builder() {\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforminator_validate_ajax( \"forminator_save_builder_fields\" );\n\n\t\t$submitted_data = $this->get_post_data();\n\t\t$form_data = $submitted_data['data'];\n\t\t$form_data = json_decode( stripslashes( $form_data ), true );\n\t\t$fields = array();\n\t\t$notifications = array();\n\t\t$id = isset( $submitted_data['form_id'] ) ? $submitted_data['form_id'] : null;\n\t\t$id = intval( $id );\n\t\t$title = sanitize_text_field( $submitted_data['formName'] );\n\t\t$status = isset( $submitted_data['status'] ) ? sanitize_text_field( $submitted_data['status'] ) : '';\n\t\t$version = isset( $submitted_data['version'] ) ? sanitize_text_field( $submitted_data['version'] ) : '1.0';\n\t\t$action = false;\n\n\t\tif ( is_null( $id ) || $id <= 0 ) {\n\t\t\t$form_model = new Forminator_Custom_Form_Model();\n\t\t\t$action = 'create';\n\n\t\t\tif ( empty( $status ) ) {\n\t\t\t\t$status = Forminator_Custom_Form_Model::STATUS_PUBLISH;\n\t\t\t}\n\t\t} else {\n\t\t\t$form_model = Forminator_Custom_Form_Model::model()->load( $id );\n\t\t\t$action = 'update';\n\n\t\t\tif ( ! is_object( $form_model ) ) {\n\t\t\t\twp_send_json_error( __( \"Form model doesn't exist\", Forminator::DOMAIN ) );\n\t\t\t}\n\n\t\t\tif ( empty( $status ) ) {\n\t\t\t\t$status = $form_model->status;\n\t\t\t}\n\n\t\t\t//we need to empty fields cause we will send new data\n\t\t\t$form_model->clear_fields();\n\t\t}\n\n\t\t$form_model->set_var_in_array( 'name', 'formName', $submitted_data, 'forminator_sanitize_field' );\n\n\t\t// Build the fields\n\t\tif ( isset( $form_data ) ) {\n\t\t\t$fields = $form_data['wrappers'];\n\t\t\tunset( $form_data['wrappers'] );\n\t\t}\n\n\t\tforeach ( $fields as $row ) {\n\t\t\tforeach ( $row['fields'] as $f ) {\n\t\t\t\t$field = new Forminator_Form_Field_Model();\n\t\t\t\t$field->form_id = $row['wrapper_id'];\n\t\t\t\t$field->slug = $f['element_id'];\n\t\t\t\tunset( $f['element_id'] );\n\t\t\t\t$field->import( $f );\n\t\t\t\t$form_model->add_field( $field );\n\t\t\t}\n\t\t}\n\n\t\t// Sanitize settings\n\t\t$settings = forminator_sanitize_field( $form_data['settings'] );\n\n\t\t// Sanitize custom css\n\t\tif ( isset( $form_data['settings']['custom_css'] ) ) {\n\t\t\t$settings['custom_css'] = sanitize_textarea_field( $form_data['settings']['custom_css'] );\n\t\t}\n\n\t\t// Sanitize thank you message\n\t\tif ( isset( $form_data['settings']['thankyou-message'] ) ) {\n\t\t\t$settings['thankyou-message'] = $form_data['settings']['thankyou-message'];\n\t\t}\n\n\t\t// Sanitize user email message\n\t\tif ( isset( $form_data['settings']['user-email-editor'] ) ) {\n\t\t\t$settings['user-email-editor'] = $form_data['settings']['user-email-editor'];\n\t\t}\n\n\t\t// Sanitize admin email message\n\t\tif ( isset( $form_data['settings']['admin-email-editor'] ) ) {\n\t\t\t$settings['admin-email-editor'] = $form_data['settings']['admin-email-editor'];\n\t\t}\n\n\t\tif ( isset( $form_data['notifications'] ) ) {\n\t\t\t$notifications = forminator_sanitize_field( $form_data['notifications'] );\n\n\t\t\t$count = 0;\n\t\t\tforeach( $notifications as $notification ) {\n\t\t\t\tif( isset( $notification['email-editor'] ) ) {\n\t\t\t\t\t$notifications[ $count ]['email-editor'] = $form_data['notifications'][ $count ]['email-editor'];\n\t\t\t\t}\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\n\t\t$form_model->set_var_in_array( 'name', 'formName', $submitted_data );\n\n\t\t// Handle quiz questions\n\t\t$form_model->notifications = $notifications;\n\n\t\t$settings['formName'] = $title;\n\n\t\t$settings['version'] = $version;\n\t\t$form_model->settings = $settings;\n\n\t\t// status\n\t\t$form_model->status = $status;\n\n\t\t// Save data\n\t\t$id = $form_model->save();\n\n\t\t/**\n\t\t * Action called after form saved to database\n\t\t *\n\t\t * @since 1.11\n\t\t *\n\t\t * @param int $id - form id\n\t\t * @param string $title - form title\n\t\t * @param string $status - form status\n\t\t * @param array $fields - form fields\n\t\t * @param array $settings - form settings\n\t\t *\n\t\t */\n\t\tdo_action( 'forminator_custom_form_action_' . $action, $id, $title, $status, $fields, $settings );\n\n\t\t// add privacy settings to global option\n\t\t$override_privacy = false;\n\t\tif ( isset( $settings['enable-submissions-retention'] ) ) {\n\t\t\t$override_privacy = filter_var( $settings['enable-submissions-retention'], FILTER_VALIDATE_BOOLEAN );\n\t\t}\n\t\t$retention_number = null;\n\t\t$retention_unit = null;\n\t\tif ( $override_privacy ) {\n\t\t\t$retention_number = 0;\n\t\t\t$retention_unit = 'days';\n\t\t\tif ( isset( $settings['submissions-retention-number'] ) ) {\n\t\t\t\t$retention_number = (int) $settings['submissions-retention-number'];\n\t\t\t}\n\t\t\tif ( isset( $settings['submissions-retention-unit'] ) ) {\n\t\t\t\t$retention_unit = $settings['submissions-retention-unit'];\n\t\t\t}\n\t\t}\n\n\t\tforminator_update_form_submissions_retention( $id, $retention_number, $retention_unit );\n\n\t\twp_send_json_success( $id );\n\t}", "function photo_reference_import_add_form() {\r\n \r\n global $base_url;\r\n $languageArray = get_languages();\r\n \r\n $adminRenamePath = ((variable_get('rename_admin_path') != NULL) ? variable_get('rename_admin_path_value') : 'admin');\r\n\r\n $form = array('#attributes' => array('enctype' => \"multipart/form-data\", \"class\" => \"ghpForm\"));\r\n\r\n $form['photo_reference_csv'] = array(\r\n '#type' => 'file',\r\n '#title' => t('Upload Photo Other Reference: <span title=\"This field is required.\" class=\"form-required\">*</span>'),\r\n '#description' => t('Allowed file .csv only.').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"'.$base_url.'/'.$adminRenamePath.'/download_sample_csv/photo_reference_content_import\">Download Sample CSV</a>',\r\n '#size' => 20,\r\n );\r\n\r\n $form['submit'] = array('#type' => 'submit',\r\n '#value' => t('Save'),\r\n );\r\n return $form;\r\n}", "public function ajax_create_field() {\n\t\tglobal $wpdb;\n\n\t\t$data = array();\n\t\t$field_options = $field_validation = $parent = $previous = '';\n\n\t\tforeach ( $_REQUEST['data'] as $k ) {\n\t\t\t$data[ $k['name'] ] = $k['value'];\n\t\t}\n\n\t\tcheck_ajax_referer( 'create-field-' . $data['form_id'], 'nonce' );\n\n\t\t$form_id = absint( $data['form_id'] );\n\t\t$field_key = sanitize_title( $_REQUEST['field_type'] );\n\t\t$field_type = strtolower( sanitize_title( $_REQUEST['field_type'] ) );\n\n\t\t$parent = ( isset( $_REQUEST['parent'] ) && $_REQUEST['parent'] > 0 ) ? $_REQUEST['parent'] : 0;\n\t\t$previous = ( isset( $_REQUEST['previous'] ) && $_REQUEST['previous'] > 0 ) ? $_REQUEST['previous'] : 0;\n\n\t\t// If a Page Break, the default name is Next, otherwise use the field type\n\t\t$field_name = ( 'page-break' == $field_type ) ? 'Next' : $_REQUEST['field_type'];\n\n\t\t// Set defaults for validation\n\t\tswitch ( $field_type ) :\n\t\t\tcase 'select' :\n\t\t\tcase 'radio' :\n\t\t\tcase 'checkbox' :\n\t\t\t\t$field_options = serialize( array( 'Option 1', 'Option 2', 'Option 3' ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'email' :\n\t\t\tcase 'url' :\n\t\t\tcase 'phone' :\n\t\t\t\t$field_validation = $field_type;\n\t\t\t\tbreak;\n\n\t\t\tcase 'currency' :\n\t\t\t\t$field_validation = 'number';\n\t\t\t\tbreak;\n\n\t\t\tcase 'number' :\n\t\t\t\t$field_validation = 'digits';\n\t\t\t\tbreak;\n\n\t\t\tcase 'min' :\n\t\t\tcase 'max' :\n\t\t\t\t$field_validation = 'digits';\n\t\t\t\t$field_options = serialize( array( '10' ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'range' :\n\t\t\t\t$field_validation = 'digits';\n\t\t\t\t$field_options = serialize( array( '1', '10' ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'time' :\n\t\t\t\t$field_validation = 'time-12';\n\t\t\t\tbreak;\n\n\t\t\tcase 'file-upload' :\n\t\t\t\t$field_options = serialize( array( 'png|jpe?g|gif' ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'ip-address' :\n\t\t\t\t$field_validation = 'ipv6';\n\t\t\t\tbreak;\n\n\t\t\tcase 'hidden' :\n\t\t\tcase 'custom-field' :\n\t\t\t\t$field_options = serialize( array( '' ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'autocomplete' :\n\t\t\t\t$field_validation = 'auto';\n\t\t\t\t$field_options = serialize( array( 'Option 1', 'Option 2', 'Option 3' ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'name' :\n\t\t\t\t$field_options = serialize( array( 'normal' ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'date' :\n\t\t\t\t$field_options = serialize( array( 'dateFormat' => 'mm/dd/yy' ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'rating' :\n\t\t\t\t$field_options = serialize( array( 'negative' => 'Disagree', 'positive' => 'Agree', 'scale' => '10' ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'likert' :\n\t\t\t\t$field_options = serialize( array( 'rows' => \"Ease of Use\\nPortability\\nOverall\", 'cols' => \"Strongly Disagree\\nDisagree\\nUndecided\\nAgree\\nStrongly Agree\" ) );\n\t\t\t\tbreak;\n\t\tendswitch;\n\n\n\n\t\t// Get fields info\n\t\t$all_fields = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM $this->field_table_name WHERE form_id = %d ORDER BY field_sequence ASC\", $form_id ) );\n\t\t$field_sequence = 0;\n\n\t\t// We only want the fields that FOLLOW our parent or previous item\n\t\tif ( $parent > 0 || $previous > 0 ) {\n\t\t\t$cut_off = ( $previous > 0 ) ? $previous : $parent;\n\n\t\t\tforeach( $all_fields as $field_index => $field ) {\n\t\t\t\tif ( $field->field_id == $cut_off ) {\n\t\t\t\t\t$field_sequence = $field->field_sequence + 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tunset( $all_fields[ $field_index ] );\n\t\t\t}\n\t\t\tarray_shift( $all_fields );\n\n\t\t\t// If the previous had children, we need to remove them so our item is placed correctly\n\t\t\tif ( !$parent && $previous > 0 ) {\n\t\t\t\tforeach( $all_fields as $field_index => $field ) {\n\t\t\t\t\tif ( !$field->field_parent )\n\t\t\t\t\t\tbreak;\n\t\t\t\t\telse {\n\t\t\t\t\t\t$field_sequence = $field->field_sequence + 1;\n\t\t\t\t\t\tunset( $all_fields[ $field_index ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Create the new field's data\n\t\t$newdata = array(\n\t\t\t'form_id' \t\t\t=> absint( $data['form_id'] ),\n\t\t\t'field_key' \t\t=> $field_key,\n\t\t\t'field_name' \t\t=> $field_name,\n\t\t\t'field_type' \t\t=> $field_type,\n\t\t\t'field_options' \t=> $field_options,\n\t\t\t'field_sequence' \t=> $field_sequence,\n\t\t\t'field_validation' \t=> $field_validation,\n\t\t\t'field_parent' \t\t=> $parent\n\t\t);\n\n\t\t// Create the field\n\t\t$wpdb->insert( $this->field_table_name, $newdata );\n\t\t$insert_id = $wpdb->insert_id;\n\n\t\t// VIP fields\n\t\t$vip_fields = array( 'verification', 'secret', 'submit' );\n\n\t\t// Rearrange the fields that follow our new data\n\t\tforeach( $all_fields as $field_index => $field ) {\n\t\t\tif ( !in_array( $field->field_type, $vip_fields ) ) {\n\t\t\t\t$field_sequence++;\n\t\t\t\t// Update each field with it's new sequence and parent ID\n\t\t\t\t$wpdb->update( $this->field_table_name, array( 'field_sequence' => $field_sequence ), array( 'field_id' => $field->field_id ) );\n\t\t\t}\n\t\t}\n\n\t\t// Move the VIPs\n\t\tforeach ( $vip_fields as $update ) {\n\t\t\t$field_sequence++;\n\t\t\t$where = array(\n\t\t\t\t'form_id' \t\t=> absint( $data['form_id'] ),\n\t\t\t\t'field_type' \t=> $update\n\t\t\t);\n\t\t\t$wpdb->update( $this->field_table_name, array( 'field_sequence' => $field_sequence ), $where );\n\n\t\t}\n\n\t\techo $this->field_output( $data['form_id'], $insert_id );\n\n\t\tdie(1);\n\t}", "protected function _Build_Form_Instance() {\r\n parse_str(base64_decode($_POST['form_data']),$output);\r\n // Retrieve the form uuid\r\n $form_uuid = vcff_get_uuid_by_form($output['post_ID']);\r\n // If there is no form type and form id\r\n if (!$output['form_type'] && $output['post_ID']) {\r\n // Get the saved vcff form type\r\n $meta_form_type = get_post_meta($output['post_ID'], 'form_type',true);\r\n } // Otherwise use the passed form type \r\n else { $meta_form_type = $output['form_type']; }\r\n // PREPARE PHASE\r\n $form_prepare_helper = new VCFF_Forms_Helper_Prepare();\r\n // Get the form instance\r\n $form_instance = $form_prepare_helper\r\n ->Get_Form(array(\r\n 'uuid' => $form_uuid,\r\n 'contents' => $output['content'],\r\n 'type' => $meta_form_type,\r\n ));\r\n // If the form instance could not be created\r\n if (!$form_instance) { die('could not create form instance'); }\r\n // POPULATE PHASE\r\n $form_populate_helper = new VCFF_Forms_Helper_Populate();\r\n // Run the populate helper\r\n $form_populate_helper\r\n ->Set_Form_Instance($form_instance)\r\n ->Populate(array(\r\n 'meta_values' => $output\r\n ));\r\n // CALCULATE PHASE\r\n $form_calculate_helper = new VCFF_Forms_Helper_Calculate();\r\n // Initiate the calculate helper\r\n $form_calculate_helper\r\n ->Set_Form_Instance($form_instance)\r\n ->Calculate(array(\r\n 'validation' => false\r\n ));\r\n // Save the form instance\r\n $this->form_instance = $form_instance;\r\n // If an action id was provided\r\n if ($_POST['action_id']) {\r\n // Retrieve the action id\r\n $action_id = $_POST['action_id'];\r\n // Get an empty action \r\n $action_instance = $form_instance\r\n ->Get_Event($action_id); \r\n // If no action instance was returned\r\n if (!$action_instance) {\r\n // Create a new instance helper\r\n $events_helper_instance = new VCFF_Events_Helper_Instance();\r\n // Create an instance instance from the posted data\r\n $this->action_instance = $events_helper_instance\r\n ->Set_Form_Instance($this->form_instance)\r\n ->Build(array());\r\n } // Otherwise load the action instance\r\n else { $this->action_instance = $action_instance; }\r\n } // Otherwise if we are creating a new instance \r\n else {\r\n // Create a new instance helper\r\n $events_helper_instance = new VCFF_Events_Helper_Instance();\r\n // Create an instance instance from the posted data\r\n $this->action_instance = $events_helper_instance\r\n ->Set_Form_Instance($this->form_instance)\r\n ->Build(array());\r\n }\r\n }", "function form( $instance ) {\n $defval = array(\n 'fbpage' => '',\n 'width' => 240,\n 'theme' => 'light',\n 'lang' => ''\n );\n $instance = wp_parse_args( (array) $instance, $defval);\n $fbpage = $instance['fbpage'];\n $width = (int)$instance['width'];\n $theme = $instance['theme'];\n $lang = $instance['lang'];\n\n $languages = array(\n 'en' => 'English',\n 'de' => 'German',\n 'fr' => 'French',\n 'it' => 'Italian',\n 'es' => 'Spanish',\n 'pt' => 'Portuguese',\n 'ru' => 'Russian',\n 'ua' => 'Ukrainian',\n );\n\n?>\n\n <p>\n <!-- <label><?php _e('facebook page', 'fbplus'); ?>:</label> -->\n www.facebook.com/<input type=\"text\" id=\"<?php echo $this->get_field_id('fbpage'); ?>\" name=\"<?php echo $this->get_field_name('fbpage'); ?>\" value=\"<?php echo $fbpage; ?>\" placeholder=\"page name\" autocomplete=\"off\">\n </p>\n\n <p>\n <label><?php _e('width', 'fbplus'); ?>:</label>\n <input type=\"text\" id=\"<?php echo $this->get_field_id('width'); ?>\" name=\"<?php echo $this->get_field_name('width'); ?>\" value=\"<?php echo $width; ?>\" size=\"3\" maxlength=\"3\" autocomplete=\"off\"> px\n </p>\n\n <p>\n <label for=\"<?php echo $this->get_field_id('theme'); ?>\"><?php _e('theme', 'fbplus'); ?>:&nbsp;&nbsp;</label>\n <input id=\"<?php echo $this->get_field_id('radioLight'); ?>\" name=\"<?php echo $this->get_field_name('theme'); ?>\" type=\"radio\" value=\"light\" <?php print (!empty($instance['theme']) && $instance['theme'] == 'light') ? 'checked' : ''; ?> /><label for=\"<?php echo $this->get_field_id('radioLight'); ?>\"><span style=\"padding: 0 4px;\"><?php _e('light', 'fbplus'); ?></span></label>&nbsp;\n <input id=\"<?php echo $this->get_field_id('radioDark'); ?>\" name=\"<?php echo $this->get_field_name('theme'); ?>\" type=\"radio\" value=\"dark\" <?php print (!empty($instance['theme']) && $instance['theme'] == 'dark') ? 'checked' : ''; ?> /><label for=\"<?php echo $this->get_field_id('radioDark'); ?>\"><span style=\"padding: 0 4px;\"><?php _e('dark', 'fbplus'); ?></span></label>&nbsp;\n </p>\n\n <p>\n <label for=\"<?php echo $this->get_field_id('lang'); ?>\"><?php _e('language', 'fbplus'); ?>:</label>\n <select id=\"<?php echo $this->get_field_id('lang'); ?>\" name=\"<?php echo $this->get_field_name('lang'); ?>\">\n <?php foreach($languages as $abbr=>$name): ?>\n <option value=\"<?php print $abbr; ?>\" <?php print (!empty($lang) && $lang == $abbr) ? 'selected' : ''; ?>><?php print $name; ?></option>\n <?php endforeach; ?>\n </select>\n </p>\n\n <p><hr></p>\n\n<?php\n }", "protected function _prepareForm()\r\n {\r\n $form = new Varien_Data_Form(array(\r\n 'id' => 'edit_form',\r\n 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),\r\n 'method' => 'post',\r\n 'enctype' => 'multipart/form-data',\r\n )\r\n );\r\n\r\n $fieldSet = $form->addFieldset('magento_form', array('legend' => $this->helper->__('Webhook information')));\r\n\r\n $fieldSet->addField('code', 'select', array(\r\n 'label' => $this->helper->__('Code'),\r\n 'class' => 'required-entry',\r\n 'name' => 'code',\r\n 'values' => ApiExtension_Magento_Block_Adminhtml_Webhooks_Grid::getAvailableHooks()\r\n ));\r\n\r\n $fieldSet->addField('url', 'text', array(\r\n 'label' => $this->helper->__('Callback URL'),\r\n 'class' => 'required-entry',\r\n 'name' => 'url',\r\n ));\r\n\r\n $fieldSet->addField('description', 'textarea', array(\r\n 'label' => $this->helper->__('Description'),\r\n 'name' => 'description',\r\n ));\r\n\r\n $fieldSet->addField('data', 'textarea', array(\r\n 'label' => $this->helper->__('Data'),\r\n 'name' => 'data',\r\n ));\r\n\r\n $fieldSet->addField('token', 'text', array(\r\n 'label' => $this->helper->__('Token'),\r\n 'name' => 'token',\r\n ));\r\n\r\n $fieldSet->addField('active', 'select', array(\r\n 'label' => $this->helper->__('Active'),\r\n 'values' => ApiExtension_Magento_Block_Adminhtml_Webhooks_Grid::getOptionsForActive(),\r\n 'name' => 'active',\r\n ));\r\n\r\n if ($this->session->getWebhooksData()) {\r\n $form->setValues($this->session->getWebhooksData());\r\n $this->session->setWebhooksData(null);\r\n } elseif (Mage::registry('webhooks_data')) {\r\n $form->setValues(Mage::registry('webhooks_data')->getData());\r\n }\r\n\r\n $form->setUseContainer(true);\r\n $this->setForm($form);\r\n return parent::_prepareForm();\r\n }", "function membersemail_form_capture()\n{\n global $post,$wpdb;\n if(array_key_exists('membersemail_submit_form', $_POST))\n {\n $to = \"[email protected]\";\n $subject = \"Data Inputs - me\";\n $body = '';\n\n $body .= 'Name: '. $_POST['full_name'] . '<br />';\n $body .= 'Email: '. $_POST['email_address'] . '<br />';\n\n wp_mail($to,$subject, $body);\n\n remove_filter('wp_mail_content_type','set_html_content_type');\n\n /* add the submission to the database using the table we created */\n $insertData = $wpdb->get_results(\" INSERT INTO \".$wpdb->prefix.\"form_submit (data) VALUES ('\".$body.\"')\");\n\n\n }\n\n}", "function form($instance){\r\n\t\t?>\r\n\t\t<?php\r\n\t\t\t$defaults = array( 'title'=> __( 'Share This Article' , 'crumble' ), 'code' => '<!-- AddThis Button BEGIN -->\r\n<div class=\"addthis_toolbox addthis_default_style \">\r\n<a class=\"addthis_button_preferred_1\"></a>\r\n<a class=\"addthis_button_preferred_2\"></a>\r\n<a class=\"addthis_button_preferred_3\"></a>\r\n<a class=\"addthis_button_preferred_4\"></a>\r\n<a class=\"addthis_button_compact\"></a>\r\n<a class=\"addthis_counter addthis_bubble_style\"></a>\r\n</div>\r\n<script type=\"text/javascript\" src=\"http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-500144fc331f9af5\"></script>\r\n<!-- AddThis Button END -->' \r\n\t\t\t);\r\n\t\t\t$instance = wp_parse_args((array) $instance, $defaults); \r\n\t\t?>\r\n\r\n\t\t<p>\r\n\t\t\t<label for=\"<?php echo $this->get_field_id('title'); ?>\"><?php _e( 'Title:' , 'crumble' ); ?></label>\r\n\t\t\t<input class=\"widefat\" style=\"width: 210px;\" id=\"<?php echo $this->get_field_id('title'); ?>\" name=\"<?php echo $this->get_field_name('title'); ?>\" value=\"<?php echo $instance['title']; ?>\" />\r\n\t\t</p>\r\n\t\t\r\n\t\t<p>\r\n\t\t\t<label for=\"<?php echo $this->get_field_id('code'); ?>\"><?php _e( 'Paste Your Code From https://www.addthis.com:' , 'crumble' ); ?></label>\r\n\t\t\t<textarea class=\"widefat\" style=\"width: 220px; height: 350px\" id=\"<?php echo $this->get_field_id('code'); ?>\" name=\"<?php echo $this->get_field_name('code'); ?>\"><?php echo $instance['code']; ?></textarea>\r\n\t\t</p>\r\n\t\t\r\n\t\t<?php\r\n\r\n\t}", "function insert_post($advanced = FALSE){\r\n $new_post = new form('new_post');\r\n $new_post->add(new form_text('title', 'Title'));\r\n $new_post->title->set_validators('is_safe_text', 'is_required');\r\n $new_post->title->set_attributes(array('length' => 255, 'size' => 80));\r\n\r\n // run query to get all the navigation items that can have content sent to\r\n $result = $this->reg->db->GetAll('SELECT id, name\r\n FROM system__navigation\r\n WHERE navigation_type != ?', array('direct'));\r\n\r\n // populate pages array for form object\r\n $pages_array = array('' => 'Choose a Page');\r\n foreach($result as $pages){\r\n $pages_array[$pages['id']] = ucwords($pages['name']);\r\n }\r\n\r\n $new_post->add(new form_select('pages', 'Submit to', $pages_array));\r\n $new_post->pages->set_multiplier(1, 'Add Another');\r\n\r\n // show advanced options if enabled\r\n if($advanced){\r\n $new_post->add(new form_hidden('advanced', TRUE));\r\n\r\n // get default option values\r\n $default_options = array();\r\n if($this->reg->config->is_set('post_show_title') && $this->reg->config->get('post_show_title'))\r\n $default_options[] = 'show_title';\r\n if($this->reg->config->is_set('post_show_date') && $this->reg->config->get('post_show_date'))\r\n $default_options[] = 'show_date';\r\n\r\n // create options check boxes\r\n $new_post->add(new form_checkbox('options', 'Options', array('show_title' => 'Show Title', 'show_date' => 'Show Date')));\r\n $new_post->options->set_default($default_options);\r\n\r\n // create rich text editor\r\n $new_post->add(new form_editor_ace('head', 'Hook Into HTML Head', 'html'));\r\n $new_post->head->set_attributes(array('style' => 'height:10em;'));\r\n $new_post->head->set_li_attributes(array('class' => 'form-richtextarea'));\r\n\r\n // create rich text editor\r\n $new_post->add(new form_editor_ace('content', 'Content'));\r\n $new_post->content->set_validators('is_required');\r\n $new_post->content->set_attributes(array('style' => 'height:30em;'));\r\n $new_post->content->set_li_attributes(array('class' => 'form-richtextarea'));\r\n }else{\r\n // create rich text editor\r\n $new_post->add(new form_editor_ckeditor('content', 'Content'));\r\n $new_post->content->set_validators('is_required');\r\n $new_post->content->set_li_attributes(array('class' => 'form-richtextarea'));\r\n }\r\n\r\n $new_post->add(new form_submit('save', 'Save'));\r\n $new_post->add(new form_submit('state', 'Publish'))->set_attributes(array('value' => 1));\r\n\r\n // return the form html\r\n return $new_post->run();\r\n }", "function wck_add_form( $meta = '', $id = '' ){\r\n\t\t\r\n\t\t$post = get_post($id);\r\n\r\n\t\tob_start();\t\t\t\r\n\t\t\tself::create_add_form($this->args['meta_array'], $meta, $post );\r\n\t\t\tdo_action( \"wck_ajax_add_form_{$meta}\", $id );\r\n\t\t$add_form = ob_get_clean();\r\n\t\t\r\n\t\treturn $add_form;\r\n\t}" ]
[ "0.7294936", "0.7294936", "0.72829443", "0.7278019", "0.727152", "0.72694236", "0.70235556", "0.7021878", "0.69762367", "0.69762367", "0.6962989", "0.69510466", "0.6927564", "0.6916286", "0.68897873", "0.6839091", "0.6811371", "0.68060887", "0.67589176", "0.671441", "0.67018", "0.6694213", "0.667934", "0.6664795", "0.66156065", "0.6606531", "0.66030574", "0.65997255", "0.659512", "0.65840924", "0.6580951", "0.6566666", "0.65506077", "0.65503114", "0.6531727", "0.65310687", "0.652472", "0.6520176", "0.64998984", "0.6484293", "0.6478913", "0.64501655", "0.64425343", "0.64363176", "0.64261234", "0.64194804", "0.6410709", "0.6406849", "0.6405073", "0.6396453", "0.6390921", "0.6376362", "0.63717705", "0.6367593", "0.63637435", "0.63609093", "0.6352734", "0.63499737", "0.6347147", "0.63400203", "0.633809", "0.6320973", "0.63168037", "0.6312043", "0.6311626", "0.6310355", "0.63097924", "0.63028526", "0.63014656", "0.62999976", "0.62973124", "0.6297023", "0.6296715", "0.6295361", "0.6290143", "0.62893873", "0.6288552", "0.6285534", "0.6285487", "0.62792885", "0.6278222", "0.6272524", "0.6272073", "0.6271173", "0.62641335", "0.6257244", "0.62535226", "0.6252091", "0.62468857", "0.62432927", "0.62389505", "0.6238089", "0.6237594", "0.62253577", "0.6216872", "0.6216431", "0.62152505", "0.62130785", "0.6212428", "0.620932", "0.62089753" ]
0.0
-1
/ This will save new instances created by the users and updated the title sections
public function update( $new_instance, $old_instance ) { $instance = $old_instance; $new_instance = wp_parse_args( (array) $new_instance, array( 'title' => '' ) ); $instance['title'] = strip_tags($new_instance['title']); return $instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n Title::create(['title'=>'Mr','title_description'=>'Mr']);\n Title::create(['title'=>'Mrs','title_description'=>'Mrs']);\n Title::create(['title'=>'Ms','title_description'=>'Ms']);\n }", "public function create() {\n\t\t$model = new $this->model_class;\n\t\t$model->status = 3;\n\t\t$model->author_id = Session::get('wildfire_user_cookie');\n\t\t$model->url = time();\n\t\tif(Request::get(\"title\")) $model->title = Request::get(\"title\");\n\t\telse $model->title = \"Enter Your Title Here\";\n\t\t$this->redirect_to(\"/admin/content/edit/\".$model->save()->id.\"/\");\n\t}", "protected function afterSave()\n\t{\n\t\tparent::afterSave();\n\t\tif(!$this->status == 1){\n\t\t$title = $this->howtoTitle($this->id);\n\t\t$tags = $this->tagLinks();\n\t\t$title = CHtml::link('Created '.$title , array('/howto/' . $this->id . '/' . $title ) );\n\t\t$shortText = substr($this->content,0,160);\n\t\t$content = $shortText.\"...<br/>Tags:\";\n\t\tforeach($tags as $tag){\n\t\t\t$content .=\" \".$tag.\",\";\n\t\t}\n\t\tAction::newAction($content,$title);\n\t\t}\n\t\t\n\t}", "function saveAllTitles()\n\t{\n\t\tglobal $ilCtrl;\n\t\t\n\t\tilLMObject::saveTitles($this->content_object, ilUtil::stripSlashesArray($_POST[\"title\"]), $_GET[\"transl\"]);\n\t\t\n\t\t$ilCtrl->redirect($this, \"showHierarchy\");\n\t}", "public function save() {\n $db = Db::instance();\n // omit id \n $db_properties = array(\n 'firstName' => $this->firstName,\n 'lastName' => $this->lastName,\n 'description' => $this->description,\n 'user' => $this->user,\n 'password' => $this->password,\n 'image' => $this->image,\n 'gender' => $this->gender,\n 'topic_id' => $this->topic_id,\n 'topic_id1' => $this->topic_id1,\n 'role_id' => $this->role_id,\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function save() {\n $db = Db::instance();\n $db_properties = array(\n 'action' => $this->action,\n 'url_mod' => $this->url_mod,\n 'description' => $this->description,\n 'target_id' => $this->target_id,\n 'target_name' => $this->target_name,\n 'creator_id' => $this->creator_id,\n 'creator_username' => $this->creator_username\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function run()\n {\n Title::insert([\n ['name'=>'Mr','gender'=>'MALE'],\n ['name'=>'Mrs','gender'=>'FEMALE'],\n ['name'=>'Ms','gender'=>'FEMALE'],\n ['name'=>'Miss','gender'=>'FEMALE'],\n ['name'=>'Master','gender'=>'MALE'],\n ['name'=>'Madam','gender'=>'FEMALE'],\n ['name'=>'Maid','gender'=>'FEMALE'],\n ]);\n }", "protected function _postSave()\n {\n $titlePhrase = $this->getExtraData(self::DATA_TITLE);\n if ($titlePhrase !== null) {\n $this->_insertOrUpdateMasterPhrase($this->_getTitlePhraseName($this->get('tab_name_id')), $titlePhrase, '');\n }\n\n $defaults = $this->getExtraData(self::DATA_DEFAULTS);\n if ($defaults !== null) {\n $this->_setDefaultOptions($defaults);\n }\n }", "public function autosave() {\n\t $this->use_layout=false;\n\t $this->use_view=false;\n\t $content = new $this->model_class(Request::get(\"id\"));\n\t if($content->primval) {\n\t $content->update_attributes($_POST[\"cms_content\"]);\n\t echo date(\"H:i:s\");\n\t }else{\n\t throw new WXRoutingException('Tried to save in a non-existing database entry!', \"Page not found\", '404');\n\t }\n\t exit;\n\t}", "public function store()\r\n\t{\r\n\t\t$jsonData = $this->getAll();\r\n\r\n\t $data = array(\r\n\t\t\t'username'=> $this->user->username,\r\n\t\t\t'post'=> $this->post,\r\n\t\t\t'date'=> $this->date,\r\n\t );\r\n\r\n\t\tarray_unshift($jsonData, $data);\r\n\r\n\t\t$this->save($jsonData);\r\n\t}", "public function _syncTitle() {}", "public function save()\n {\n $this->data = array(\n 'pb_name' => \\Input::get('pb_name'),\n 'title' => \\Input::get('title'),\n 'description' => \\Input::get('description'),\n 'template' => \\Input::get('template'),\n 'class_name' => \\Input::get('class_name'),\n 'published' => \\Input::get('published'),\n 'created_by' => \\Auth::user()->id,\n );\n\n return parent::save();\n }", "public function save()\n\t{\n\t\n\t\tif ($this->id == null) throw new Exception(\"Cannot save. id is null\");\n\t\t\n\t\t//store the data in the content column so that our worker will be searchable.\n\t\t$wp_content = \"\";\n\t\t\n\t\tforeach($this->values as $field=>$value)\n\t\t{\n\t\t\tupdate_post_meta($this->id, $field, $value);\n\t\t\t$wp_content .= \"<div>$value</div>\";\n\t\t}\n\t\t\n\t\t//wp_die($wp_content);\n\n\t\t//save the data entry in wp_posts\n\t\tglobal $wpdb;\n\t\t$wpdb->update(\n\t\t\t$wpdb->posts, \n\t\t\tarray(\n\t\t\t\t\"post_content\" => $wp_content,\n\t\t\t\t\"post_title\" => \"{$this->values['lastname']}, {$this->values['firstname']} {$this->values['middlename']}\" \n\t\t\t),\n\t\t\tarray(\"ID\" => $this->id),\n\t\t\tarray(\"%s\"),\n\t\t\tarray(\"%d\")\n\t\t);\n\t\t\n\t\t\n\t}", "public function store()\n {\n $this->validate([\n 'title' => 'required',\n 'body' => 'required',\n ]);\n\n Page::updateOrCreate(['id' => $this->page_id], [\n 'title' => $this->title,\n 'body' => $this->body,\n 'published' => true\n\n ]);\n\n session()->flash('message',\n $this->page_id ? 'Page Updated Successfully.' : 'Page Created Successfully.');\n\n $this->closeModal();\n $this->closeShowModal();\n $this->resetInputFields();\n }", "public function store()\n {\n // validate\n // read more on validation at http://laravel.com/docs/validation\n $rules = array(\n 'title' => 'required',\n 'publisher_id' => 'required|numeric',\n 'time_frame' => 'required',\n 'series_type' => 'required'\n );\n\n $validator = Validator::make(Input::all(), $rules);\n\n // process the login\n if ($validator->fails()) {\n return Redirect::to('titles/create')\n ->withErrors($validator)\n ->withInput(Input::except('password'));\n } else {\n // store\n $title = new Title;\n $title->title = Input::get('title');\n $title->publisher_id = Input::get('publisher_id');\n $title->time_frame = Input::get('time_frame');\n $title->series_type = Input::get('series_type');\n $title->main_issues = Input::get('main_issues');\n $title->annuals = Input::get('annuals');\n $title->specials = Input::get('specials');\n $title->missing_issues = Input::get('missing_issues');\n $title->comments = Input::get('comments');\n $title->is_active = Input::get('is_active') ?: 1;\n $title->is_complete = Input::get('is_complete') ?: 0;\n $title->is_subscribed = Input::get('is_subscribed') ?: 1;\n $title->is_deleted = Input::get('is_deleted') ?: 0;\n\n $title->save();\n\n // redirect\n Session::flash('message', 'Successfully added title!');\n return Redirect::to('titles');\n }\n }", "function save(){\n\t\t// $insert_query = 'INSERT INTO tb_categories';\n\t\t// $insert_query .= ' SET ';\n\t\t// $insert_query .= ' name = \"'.$this->name.'\"';\n\n\t\t// $this->db->query($insert_query);\n\t\t\tif($this->page_id){\n\t\t\t\t$this->update();\n\t\t\t}else{\n\t\t\t\t$this->page_id = $this->db->insert(\n\t\t\t\t\t'tb_pages',\n\t\t\t\t\tarray(\t\t\t\t\t\n\t\t\t\t\t'title' => $this->title,\n\t\t\t\t\t'content' => $this->content)\n\t\t\t\t);\n\t\t\t}\n\t\t}", "function createUsers(){\n\n\t\t\n\t\t\n\t\t$this->copyFrom('POST');\n\t\t$this->save(); // execute\n\t}", "public function run()\n {\n $titles = [\n 'D.' => 'Don',\n 'Dña.' => 'Doña',\n 'Dr.' => 'Doctor',\n 'Dra.' => 'Doctora',\n 'Prof.' => 'Profesor',\n 'Prof.ª' => 'Profesora',\n 'Sr.' => 'Señor',\n 'Sra.' => 'Señora',\n 'Srta.' => 'Señorita',\n ];\n\n foreach ($titles as $short => $long) {\n Title::updateOrCreate(compact('short'), compact('long'));\n }\n }", "public function update( $new_instance, $old_instance ) \n{\n$instance = $old_instance;\n$instance['title'] = strip_tags( $new_instance['title'] );\nreturn $instance;\n}", "public function save()\n {\n $this->validate();\n $this->user->save();\n\n $this->toast('Your information has been updated!', 'success');\n }", "protected function save()\n\t{\n\t\t$this->saveItems();\n\t\t//$this->saveAssignments();\n\t\t//$this->saveRules();\n\t}", "public function saveDetails() \n {\n // Save the author list.\n $this->authorList->setValue('bookId', $this->bookId);\n $this->authorList->save();\n \n // Save the booklanguage list.\n $this->bookLanguageList->setValue('bookId', $this->bookId);\n $this->bookLanguageList->save();\n }", "public function store()\n {\n /*$this->validate([\n 'title' => 'required',\n 'body' => 'required',\n ]);*/\n agenc::updateOrCreate([\n 'name' => $this->name,\n 'code' => $this->code,\n 'phone' => $this->phone,\n 'fax' => $this->fax,\n 'email' => $this->email,\n 'address' => $this->address,\n 'country' => $this->country,\n 'status' => 1,\n ]);\n\n session()->flash('message',\n $this->agency_id ? 'Post Updated Successfully.' : 'Post Created Successfully.');\n\n $this->resetInputFields();\n\n $this->emit('userStore');\n }", "protected function save(){\n $this->getTags();\n foreach ($this->posts as $post){\n $createdPost = Post::create(['habr_id' => $post['postId'],\n 'post' => $post['full'],\n 'unix_time' => $post['time']]);\n $this->attachPostTags($createdPost,$post['tags']);\n }\n }", "public function save()\n {\n $now = new DateTime();\n $this->timestamp = $now->getTimestamp();\n self::setClassAndTable();\n parent::saveModel();\n\n $this->id = parent::getLastID();\n\n // Send notification to watchers\n $post = Post::find([\"id\" => $this->post_id]);\n $owner = $post->user();\n $watchers = $post->watchers();\n foreach ($watchers as $user) {\n $notif = new Notification();\n $notif->user_id_from = $owner->id;\n $notif->user_id_to = $user->id;\n $notif->type = Notification::WATCHLIST_UPDATE;\n $notif->link = \"/posts/view.php?post_id=$post->id\";\n $notif->save();\n }\n }", "function edit_form_after_title()\n {\n }", "function edit_form_after_title()\n {\n }", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'author_id' => $this->author_id,\n 'clothingname' => $this->clothingname,\n 'clothingtype' => $this->clothingtype,\n 'tempmin' => $this->tempmin,\n 'tempmax' => $this->tempmax\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "protected function save_meta() {}", "public function postSave() {}", "public function save()\n {\n $this->validate();\n $user = User::findOrFail($this->userId);\n if(strtolower($this->origName) == strtolower($this->newName)){\n $this->updateName($user);\n return;\n }else{\n $user->info->update(['company_name' => $this->newName]);\n $user->save();\n $this->updateName($user);\n }\n\n\n }", "public function run()\n {\n User::all()->each(function ($item) {\n $slug = SlugService::createSlug(User::class, 'slug', $item->name);\n\n $item->update([\n 'slug' => $slug,\n ]);\n });\n }", "public function run()\n {\n $subs = new Editor();\n $subs->user_id = 6;\n $subs->save();\n\n $subs = new Editor();\n $subs->user_id = 7;\n $subs->save();\n\n }", "public function run()\n {\n $titles = ['漫画', '技術書', 'お気に入り'];\n foreach ($titles as $title) {\n DB::table('shelves')->insert([\n 'title' => $title,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n }\n }", "function save()\r\n {\r\n $GLOBALS['DB']->exec(\"INSERT INTO inventory_items (name) VALUES ('{$this->getName()}')\");\r\n $this->id = $GLOBALS['DB']->lastInsertId();\r\n }", "public function save()\n {\n \tif($this->announcement_id == null)\n \t{\n \t\t$this->db->insert(\"Announcements\", array(\n \t\t\t\t\"title\" => $this->title,\n \t\t\t\t\"content\" => $this->content,\n \t\t\t\"posted_by\" => $this->posted_by\n \t\t));\n \t\t$this->announcement_id = $this->db->insert_id();\n \t}\t\n \telse\n \t{\n \t\t$update_data = array(\n \t\t\t\"title\" => $this->title,\n\t\t\t\t \"content\" => $this->content,\n \t\t\t\"posted_by\" => $this->posted_by\n \t);\n \t\t$this->db->where(\"announcement_id\", $this->announcement_id);\n \t\t$this->db->update(\"Announcements\", $update_data);\n \t}\n }", "public function run()\n {\n $user = User::find(2); //expert\n $user->expert()->create([\n 'mobile' => '01199493929',\n 'is_active' => true,\n 'status' => 'approved',\n 'slug' => str_slug($user->name, '-'),\n 'profile_picture_url' => 'images/expert.jpg',\n 'cost_per_minute' => 10,\n 'bio' => 'This is a short bio',\n 'current_occupation' => 'Engineer',\n ]);\n\n }", "private function PostSaver(){\n if ($this->updateMode){\n $post = Post::find($this->postId);\n } else {\n $post = new Post();\n }\n $post->user_id = Auth::user()->id;\n $post->title = $this->title;\n $post->category_id = (int)$this->categories;\n $post->caption = $this->caption;\n $post->url = $this->imagePath;\n $post->save();\n $post->Tag()->sync($this->tags);\n }", "public function save()\r\n {\r\n \r\n }", "public function save() {\n\t\t\t\n\t\t}", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'username' => $this->username,\n 'password_hash' => $this->password_hash,\n 'email' => $this->email,\n 'first_name' => $this->first_name,\n 'last_name' => $this->last_name,\n 'user_type' => $this->user_type,\n 'bio' => $this->bio,\n 'creation_date' => $this->creation_date,\n 'gender' => $this->gender,\n 'color' => $this->color\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function save() {\n\n $data = array(\n 'name' => $this->getName(),\n 'description' => $this->getDescription(),\n 'metatitle' => $this->getMetatitle(),\n 'metakeywords' => $this->getMetakeywords(),\n 'metadescription' => $this->getMetadescription()\n );\n $data['parent_id'] = 0; // by default it is 0, becouse right now there is no use of parent id in this application\n if (null === ($id = $this->getId())) {\n unset($data['id']);\n $data['status'] = 1;\n return $this->getMapper()->getDbTable()->insert($data);\n } else {\n $data['status'] = $this->getStatus();\n return $this->getMapper()->getDbTable()->update($data, array('id = ?' => $id));\n }\n\n }", "function save() {\n //save the added fields\n }", "protected function _preSave()\r\n {\r\n parent::_preSave();\r\n\r\n if($this->isChanged('custom_title')) {\r\n if (!$this->getOption('admin_edit')) {\r\n $this->custom_title_type = 'user_set';\r\n }\r\n }\r\n }", "public function run()\n {\n \t$expertise = ['Aerobics','Yoga','Meditation','Gym Instructor','Dietician','Nutritionist','Personal Trainer'];\n \tforeach ($expertise as $expert)\n \t{\n $record = \\App\\Models\\Expertise::where(['title' => ucfirst($expert)])->first();\n if(!$record)\n {\n $record = new \\App\\Models\\Expertise();\n }\n \t\t$record->title = ucfirst($expert);\n \t\t$record->created_by = '1';\n \t\t$record->updated_by = '1';\n \t\t$record->save();\n \t}\n }", "function stm_user_registration_save( $user_id ) {\r\n\t$post_title = '';\r\n if ( isset( $_POST['first_name'] ) )\r\n\t\t$post_title = $_POST['first_name'];\r\n\telse{\r\n\t\t$user_info = get_userdata($user_id);\r\n\t\t//$username = $user_info->user_login;\r\n\t\t$first_name = $user_info->first_name;\r\n\t\t$last_name = $user_info->last_name;\r\n\t\t$post_title = $first_name . ' ' . $last_name;\r\n\t}\r\n\r\n\r\n\t$defaults = array(\r\n\t\t\t\t 'post_type' => 'ocbmembers',\r\n\t\t\t\t 'post_title' => $post_title,\r\n\t\t\t\t 'post_content' => 'Replace with your content.',\r\n\t\t\t\t 'post_status' => 'publish'\r\n\t\t\t\t);\r\n\tif($post_id = wp_insert_post( $defaults )) {\r\n\t\t// add to user profile\r\n\t\tadd_post_meta($post_id, '_stm_user_id', $user_id);\r\n\r\n\t\t//add user profile to post\r\n\t\tupdate_user_meta( $user_id, '_stm_profile_post_id', $post_id );\r\n\r\n\t\tupdate_user_meta( $user_id, 'show_admin_bar_front', 'false' );\r\n\r\n\t}\r\n\r\n}", "public function run()\n {\n $atri = new Category_Shareholder();\n $atri->save();\n\n $atri = new Category_Shareholder();\n $atri->save();\n }", "public function save()\n {\n }", "public function save() {}", "public function save() {}", "public function store(StoreTitleRequest $request)\n {\n $this->titles->create($request->only('name','email','phone','cell','fax','bio','published','protected'));\n\n return redirect(route('mylegacy.titles.index'))->with('status','Title has been created.');\n }", "public function save() {}", "function create_new() {\n if($this->table_title != '' ) {\n $this->title = 'New ' . $this->table_title .\n $this->makeForm();\n }\n }", "public function save()\n {\n $this->checkForNecessaryProperties();\n\n $this->update($this->getCurrentId(), $this->data);\n }", "function save() {\n $modified_fields = $this->modified_fields;\n $is_new = $this->isNew();\n\n if($is_new && ($this->getToken() == '')) {\n $this->resetToken();\n } // if\n\n $save = parent::save();\n if($save && !is_error($save)) {\n if($is_new || in_array('email', $modified_fields) || in_array('first_name', $modified_fields) || in_array('last_name', $modified_fields)) {\n $content = $this->getEmail();\n if($this->getFirstName() || $this->getLastName()) {\n $content .= \"\\n\\n\" . trim($this->getFirstName() . ' ' . $this->getLastName());\n } // if\n\n search_index_set($this->getId(), 'User', $content);\n cache_remove_by_pattern('object_assignments_*_rendered');\n } // if\n\n // Role changed?\n if(in_array('role_id', $modified_fields)) {\n clean_user_permissions_cache($this);\n } // if\n } // if\n\n return $save;\n }", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'event_type_id' => $this->event_type_id,\n 'user_1_id' => $this->user_1_id,\n 'user_2_id' => $this->user_2_id,\n 'user_1_name' => $this->user_1_name,\n 'user_2_name' => $this->user_2_name,\n 'product_1_name' => $this->product_1_name,\n 'product_2_name' => $this->product_2_name,\n 'data_1' => $this->data_1,\n 'data_2' => $this->data_2\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function handleRequestEditTitle()\n {\n\n $form = $this->form_factory->create($this->edit_title_type,\n $this->entity,\n ['attr' => ['id' => 'edittitle']]);\n $form->handleRequest($this->request);\n\n $redirect_to = $this->entity->getWpGetReferer();\n\n // Just return if user clicked Cancel\n CommonHelper::isRequestCanceled($form, 'cancel', $redirect_to);\n\n if (!$form->isValid()) {\n $errors = $form->getErrors();\n $this->settings->set('formerror', $errors);\n\n return;\n }\n\n $server_file_name = $this->entity->getServerFileName();\n $new_title = $this->entity->getNewTitle();\n\n if ($this->entity->getNewTitle() !== $this->entity->getTitle()) {\n $this->model->updateTitle($server_file_name, $new_title);\n }\n $redirect_to = $this->entity->getWpGetReferer();\n wp_redirect($redirect_to);\n exit();\n }", "protected function setDocument() \n\t{\n\t\t$isNew = $this->item->id == 0;\n\t\t$document = JFactory::getDocument();\n\t\t$document->setTitle($isNew ? JText::_('COM_HELLOWORLD_HELLOWORLD_CREATING') : JText::_('COM_HELLOWORLD_HELLOWORLD_EDITING'));\n\t\t$document->addScript(JURI::root() . $this->script);\n\t\t$document->addScript(JURI::root() . \"/administrator/components/com_sportsmanagement/views/sportsmanagement/submitbutton.js\");\n\t\tJText::script('COM_HELLOWORLD_HELLOWORLD_ERROR_UNACCEPTABLE');\n\t}", "public function save()\n\t{\n\t\t$args = [\n\t\t\t'post_title' => $this->title,\n\t\t\t'post_content' => $this->desc,\n\t\t\t'post_date' => $this->create_date,\n\t\t];\n\n\t\tif (empty($this->id)) {\n\t\t\t$args['post_type'] = Access::$MACHINE_NAME;\n\t\t\t$args['post_status'] = 'publish';\n\t\t} else {\n\t\t\t$args['ID'] = $this->id;\n\t\t}\n\n\t\tremove_action('save_post', array(get_class($this), 'access_save_meta_box'));\n\t\t$this->id = wp_update_post($args);\n\t\tadd_action('save_post', array(get_class($this), 'access_save_meta_box'));\n\n\t\tupdate_post_meta($this->id,'user',$this->user);\n\t\tupdate_post_meta($this->id,'key',$this->key);\n\t\tupdate_post_meta($this->id,'ips',$this->ips);\n\n\t\treturn $this;\n\t}", "public function run()\n {\n Title::insert([\n [\n 'short' => 'By.',\n 'name' => 'Bayi'\n ],\n [\n 'short' => 'An.',\n 'name' => 'Anak'\n ],\n [\n 'short' => 'Tn.',\n 'name' => 'Tuan'\n ],\n [\n 'short' => 'Ny.',\n 'name' => 'Nyona'\n ],\n [\n 'short' => 'Sdr.',\n 'name' => 'Laki-laki'\n ],\n [\n 'short' => 'Nn.',\n 'name' => 'Nona'\n ],\n [\n 'short' => 'Alm.',\n 'name' => 'Almarhum'\n ],\n ]);\n }", "public function run()\n {\n $sps1 = new Specialist([\n \t'nama'=>\"Specialist 1\",\n \t'isActive'=>1,\n ]);\n $sps1->save();\n\n $sps2 = new Specialist([\n \t'nama'=>\"Specialist 2\",\n \t'isActive'=>1,\n ]);\n $sps2->save();\n \n $sps3 = new Specialist([\n \t'nama'=>\"Specialist 3\",\n \t'isActive'=>1,\n ]);\n $sps3->save();\n }", "public function run()\n {\n $user = \\App\\User::first();\n\n $user->posts()->saveMany(factory(App\\Post::class, 50)->make());\n }", "public function Save()\n {\n $required = array(\n \"title\" => \"Título\",\n \"src\" => \"Imagem\"\n );\n $this->validateData($required);\n parent::Save();\n }", "function storeAndNew() {\n $this->store();\n }", "public function addTitle() {\n\t\tglobal $REQUEST_DATA;\n\n\t\treturn SystemDatabaseManager::getInstance()->runAutoInsert('employee_appraisal_title', \n array('appraisalTitle'), array(trim($REQUEST_DATA['titleName'])) \n );\n\t}", "function editTitle($data) {\n\t\t\t$conn = $this->connect();\n\t\t\t$title = $this->modify(mysqli_real_escape_string($conn, $data['title']));\n\t\t\t$uid = $_SESSION['userid'];\n\t\t\t$pid = $_SESSION['pid'];\n\t\t\tif(empty($title)) {\n\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-zA-Z]+(||_|-|,|:|0-9|\\.| |\\*)?[a-zA-Z0-9,\\.:-_* ]*$/\", $title)) {\n\t\t\t\t\tif($this->length($title, 50, 10)) {\n\t\t\t\t\t\t$result = $this->changepost('newpost', 'post_title', $title, $uid , $pid);\n\t\t\t\t\t\tif($result == true) {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Successfully_Changed\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Failed!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&length=tooBigOrSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&invalid=type\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function setTitle($newTitle) { $this->Title = $newTitle; }", "public function save() {\n if (self::getCategoryById($this->id) == null) {\n // should create\n $sql = \"INSERT INTO category (name) VALUES ('%s') RETURNING id;\";\n $auth_user = User::getUserById(1);\n $sql = sprintf($sql, pg_escape_string($this->name));\n $results = self::$connection->execute($sql);\n $this->id = $results[0][\"id\"];\n } else {\n // should update\n $sql = \"UPDATE category SET name='%s' WHERE id=%d\";\n $sql = sprintf($sql, pg_escape_string($this->name), addslashes($this->id));\n self::$connection->execute($sql);\n }\n }", "public function save()\n {\n if($this->changed) {\n Item::saveNewValues($this->id, $this->name, $this->status);\n } else {\n echo 'Nothing changed!';\n }\n }", "public function update( $new_instance, $old_instance ) {\n$instance = array();\n$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';\nreturn $instance;\n}", "protected function save_meta() {\n\n\t\t// save all data in array\n\t\tupdate_user_meta( $this->user_id, APP_REPORTS_U_DATA_KEY, $this->meta );\n\n\t\t// also save total reports in separate meta for sorting queries\n\t\tupdate_user_meta( $this->user_id, APP_REPORTS_U_TOTAL_KEY, $this->total_reports );\n\t}", "protected function saveUpdate()\n {\n }", "public function presupuestoModificado(){\n $this->iPresupuestoModificado = $this->iPresupuestoInicial;\n $this->save();\n }", "public function create()\n {\n $data = array();\n $data['title'] = $_POST['title'];\n $data['content'] = $_POST['content'];\n $data['time'] = $_POST['time'];\n \n $this->model->create($data);\n header('location:'. URL .'index');\n }", "function plgAfterSave(&$model)\n {\n if(!$this->c->Access->isGuest() || $this->ranAfterSave) return;\n\n $this->ranAfterSave = true; // Run once per request\n\n $data = &$model->data;\n\n $name = $email = '';\n\n $username = Sanitize::getString($data,'username');\n\n $new_user = self::getUser();\n\n if($username == '') {\n\n $username = Sanitize::getString($new_user,'username');\n }\n\n // For guests, keep track of ids of newly submitted forms.\n // Used in media form to allow media submissions and assign them to the same user\n self::setGuestSubmissionsInSession($model);\n\n // Processing for disabled account creation or account creation enabled, but a username was not filled out\n if($username == '')\n {\n switch($model->name) {\n\n case 'Discussion':\n case 'Media':\n case 'Review':\n\n $name = Sanitize::getString($data[$model->name],'name');\n\n $email = Sanitize::getString($data[$model->name],'email');\n break;\n\n case 'Listing':\n\n $name = Sanitize::getString($data,'name');\n\n $email = Sanitize::getString($data,'email');\n break;\n }\n\n self::setUser(0, '', $name, $email);\n }\n else {\n\n $listing_id = $review_id = $discussion_id = $media_id = 0;\n\n $user_id = Sanitize::getInt($data,'user_id');\n\n if($user_id) {\n\n $name = Sanitize::getString($data,'name');\n\n $email = Sanitize::getString($data,'email');\n }\n else {\n\n $user_id = Sanitize::getString($new_user,'user_id');\n\n $name = Sanitize::getString($new_user,'name');\n\n $email = Sanitize::getString($new_user,'email');\n }\n\n switch($model->name)\n {\n case 'Discussion':\n $discussion_id = Sanitize::getInt($data['Discussion'],'discussion_id');\n break;\n\n case 'Listing':\n $listing_id = Sanitize::getInt($data['Listing'],'id');\n break;\n\n case 'Media':\n $media_id = Sanitize::getInt($data['Media'],'media_id');\n break;\n\n case 'Review':\n $review_id = Sanitize::getInt($data['Review'],'id');\n break;\n }\n\n S2App::import('Model','registration','jreviews');\n\n $Registration = ClassRegistry::getClass('RegistrationModel');\n\n $register_data = array(\n 'model'=>$model->name,\n 'Registration'=>array(\n 'session_id'=>session_id(),\n 'user_id'=>$user_id,\n 'name'=>$name,\n 'email'=>$email,\n 'listing_id'=>$listing_id,\n 'review_id'=>$review_id,\n 'discussion_id'=>$discussion_id,\n 'media_id'=>$media_id,\n 'session_time'=>time()\n ));\n\n $Registration->store($register_data);\n\n $user_id == 0 and self::setUser(0, '', $name, $email);\n }\n }", "public function onBeforeWrite()\n {\n $this->Title = $this->getName();\n\n // Generate the ticket code\n if ($this->exists() && empty($this->TicketCode)) {\n $this->TicketCode = $this->generateTicketCode();\n }\n\n parent::onBeforeWrite();\n }", "function save() {\n\n $record = new stdClass;\n $record->username = $this->username;\n $record->firstname = addslashes($this->firstname);\n $record->lastname = addslashes($this->lastname);\n $record->idnumber = $this->idnumber;\n $record->update_flag = $this->update_flag;\n $record->reg_status = $this->reg_status;\n $record->college = $this->college;\n $record->year = $this->year;\n $record->classification = $this->classification;\n $record->keypadid = $this->keypadid;\n $record->ferpa= $this->ferpa;\n $record->anonymous = $this->anonymous;\n $record->degree_candidacy = $this->degree_candidacy;\n\n if ($this->hidden != null) {\n $record->hidden = $this->hidden;\n }\n if ($this->numsections != null) {\n $record->numsections = $this->numsections;\n }\n if ($this->format != null) {\n $record->format= $this->format;\n }\n if ($this->cr_delete != null) {\n $record->cr_delete = $this->cr_delete;\n }\n if ($this->moodleid != null) {\n $record->moodleid = $this->moodleid;\n }\n\n if (!$this->id) {\n\n $this->id = insert_record('block_courseprefs_users', $record, true);\n\n if (!$this->id) {\n throw new Exception('Unable to create new courseprefs user within database');\n }\n\n } else {\n\n $record->id = $this->id;\n\n if (!update_record('block_courseprefs_users', $record)) {\n throw new Exception('Unable to update existing courseprefs user within database');\n }\n }\n }", "public function store(Request $request)\n {\n\n $data = $request->all();\n\n $newPage = new Page;\n\n $newPage->user_id = $data['user_id'];\n\n $newPage->title = $data['title_page'];\n\n $newPage->slug = Str::slug($data['title_page']);\n\n $newPage->description = $data['description_page'];\n\n $newPage->save();\n\n\n $pageId = $newPage->id;\n\n\n $newSection = new Section;\n\n $newSection->page_id = $pageId;\n\n $newSection->title = $data['title_section'];\n\n $newSection->slug = Str::slug($data['title_section']);\n\n $newSection->save();\n\n\n $sectionId = $newSection->id;\n\n\n $newTitle = new Title;\n\n $newTitle->section_id = $sectionId;\n\n $newTitle->title = $data['element_title_title'];\n\n $newTitle->slug = Str::slug($data['element_title_title']);\n\n $newTitle->text = $data['element_text_title'];\n\n $newTitle->save();\n\n\n $newSubtitle = new Subtitle;\n\n $newSubtitle->section_id = $sectionId;\n\n $newSubtitle->title = $data['element_title_subtitle'];\n\n $newSubtitle->slug = Str::slug($data['element_title_subtitle']);\n\n $newSubtitle->text = $data['element_text_subtitle'];\n\n $newSubtitle->save();\n\n\n $newDescription = new Description;\n\n $newDescription->section_id = $sectionId;\n\n $newDescription->title = $data['element_title_description'];\n\n $newDescription->slug = Str::slug($data['element_title_description']);\n\n $newDescription->text = $data['element_text_description'];\n\n $newDescription->save();\n\n\n $newImage = new Image;\n\n $slug = Str::slug($data['element_title_image']);\n\n $newImage->section_id = $sectionId;\n\n $newImage->title = $data['element_title_image'];\n\n $newImage->slug = $slug;\n\n Storage::disk('public')->put('pageImage', $data['image']);\n\n $filename = $data['image']->hashName();\n\n $path = 'http://localhost:8000/storage/pageImage/' . $filename;\n\n $newImage->path = $path;\n\n $newImage->save();\n\n return redirect()->route('admin.pages.index');\n\n }", "public function run()\n {\n //\n $pub=new \\App\\Pub();\n $pub->name = 'Idaho Press-Tribune';\n $pub->color = '004401';\n $pub->site_id=2;\n $pub->save();\n\n $pub=new \\App\\Pub();\n $pub->name = 'Idaho State Journal';\n $pub->color = '931B1D';\n $pub->site_id=3;\n $pub->save();\n\n }", "public function saveUser()\n {\n $connection = \\Yii::$app->db;\n $command = $connection->createCommand()\n ->update('users', [\n 'name' => $this->name,\n 'email' => $this->email,\n ], 'id='.$this->id);\n $command->execute();\n }", "public function run()\n {\n //\n // App\\User::find(2)->questions()->create([\n // 'title' => 'First title question',\n // 'content' => 'First content'\n // ]);\n\n $users = App\\User::all();\n\n $users->each(function ($user){\n $user->questions()->save(\n factory(App\\Question::class)->make()\n ,10);\n });\n }", "public function ifnottitle($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid, $userid){\n $msg = \"INSERT INTO _title_ (_title_name_) VALUES (?)\"; # insert new title\n $stmnt = $con->prepare($msg);\n $stmnt -> bind_param(\"s\", $title);\n if($stmnt->execute()){\n $stmnt->close();\n $msg = \"Select _tID_ FROM _title_ WHERE _title_name_ = ?\"; # select title id\n $stmnt4 = $con->prepare($msg);\n $stmnt4 -> bind_param(\"s\", $title);\n $stmnt4 -> execute();\n $stmnt4 -> bind_result($sid);\n if($stmnt4 -> fetch()){ # move to inserting staff update\n $stmnt4 -> close();\n $this -> insertinto($con, $name, $sname, $surname, $email, $title, $visible, $nid, $nid1, $sid, $userid);\n }\n }\n }", "public function save()\r\n\t{\r\n\t\t// save the parent object and thus the status table\r\n\t\tparent::save();\r\n\t\t// grab the newly inserted status ID\r\n\t\t$id = $this->getID();\r\n\t\t// insert into the link status table, using the same ID\r\n\t\t$extended = array();\r\n\t\t$extended['id'] = $id;\r\n\t\t$extended['URL'] = $this->url;\r\n\t\t$extended['description'] = $this->description;\r\n\t\t$this->registry->getObject('db')->insertRecords( 'statuses_links', $extended );\r\n\t}" ]
[ "0.6061349", "0.5964308", "0.5899348", "0.5862726", "0.5855971", "0.58386457", "0.5832941", "0.5831341", "0.5764068", "0.5760554", "0.575881", "0.5749963", "0.57385254", "0.5720199", "0.5710476", "0.56875086", "0.56846267", "0.56706953", "0.56700563", "0.5668401", "0.56479895", "0.56400764", "0.5635718", "0.5630868", "0.5629239", "0.5626032", "0.5626032", "0.5620473", "0.560766", "0.56053936", "0.55981433", "0.5597285", "0.5597268", "0.5568861", "0.55656636", "0.5562998", "0.556121", "0.5557172", "0.55551267", "0.5552971", "0.55527866", "0.55251956", "0.5524607", "0.5518754", "0.5517258", "0.55138415", "0.5509048", "0.5507374", "0.5505414", "0.5505414", "0.550367", "0.5503349", "0.55006266", "0.549059", "0.5489721", "0.5488688", "0.54800427", "0.54800427", "0.54800427", "0.54800427", "0.54800427", "0.54800427", "0.54800427", "0.54800427", "0.54800427", "0.54800427", "0.54800427", "0.54800427", "0.54800427", "0.54800427", "0.54800427", "0.54800427", "0.54800427", "0.54800427", "0.54554385", "0.5449517", "0.5444238", "0.5435568", "0.5433629", "0.5427149", "0.5426392", "0.54175633", "0.541623", "0.541115", "0.54111296", "0.54110485", "0.54109293", "0.53950745", "0.53909945", "0.53843796", "0.53818864", "0.53715867", "0.53713566", "0.535679", "0.53559566", "0.53556377", "0.53548145", "0.53532636", "0.5351322", "0.5349547", "0.5346464" ]
0.0
-1
$sql = "SELECT COUNT(DISTINCT p.product_id) AS total FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id)";
public function getTotalParts($data = array()) { $sql = "SELECT COUNT(DISTINCT parts_id) AS total FROM " . DB_PREFIX . "parts WHERE status = 1"; if (!empty($data['filter_name'])) { $sql .= " AND title LIKE '" . $this->db->escape($data['filter_name']) . "%'"; } // if (!empty($data['filter_model'])) { // $sql .= " AND p.model LIKE '" . $this->db->escape($data['filter_model']) . "%'"; // } if (isset($data['filter_price']) && !is_null($data['filter_price'])) { $sql .= " AND price LIKE '" . $this->db->escape($data['filter_price']) . "%'"; } if (isset($data['filter_quantity']) && !is_null($data['filter_quantity'])) { $sql .= " AND quantity = '" . (int)$data['filter_quantity'] . "'"; } if (isset($data['filter_status']) && !is_null($data['filter_status'])) { $sql .= " AND status = '" . (int)$data['filter_status'] . "'"; } $query = $this->db->query($sql); return $query->row['total']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getTotalProductCount() {\n Db_Actions::DbSelect(\"SELECT COUNT(id) FROM cscart_products\");\n }", "function oos_total_products_in_category($category_id)\n{\n\n $products_count = 0;\n\n $dbconn =& oosDBGetConn();\n $oostable =& oosDBGetTables();\n\n $productstable = $oostable['products'];\n $products_to_categoriestable = $oostable['products_to_categories'];\n $products = $dbconn->Execute(\"SELECT COUNT(*) AS total FROM $productstable p, $products_to_categoriestable p2c WHERE p.products_id = p2c.products_id AND p.products_status >= '1' AND p2c.categories_id = '\" . intval($category_id) . \"'\");\n\n $products_count += $products->fields['total'];\n\n return $products_count;\n}", "public function CountProByCategory_all() {\n $this->db->select('product.id as pro_id,\n product_category.id as cate_id,\n product_to_category.id_category');\n\n $this->db->join('product_to_category', 'product_to_category.id_product=product.id');\n $this->db->join('product_category', 'product_to_category.id_category=product_category.id');\n\n // $this->db->where('product_to_category.id_category',$id);\n $this->db->order_by('product.id', 'desc');\n $this->db->where('product.lang', $this->language);\n $this->db->group_by('product.id');\n $q = $this->db->get('product');\n return $q->num_rows();\n }", "function count_archived_pro_list(){\n\t\treturn $this->db->select('count(*)','product_list','status = 0');\n\t}", "function countProductsSoldInCategories() {\r\n global $conn;\r\n $select = \"SELECT category, SUM(quantitysold) AS aqs FROM product GROUP BY category;\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}", "function getProductCount($cat_id) {\n $ci = & get_instance();\n $query = $ci->db->get_where(ES_PRODUCTS, array('category_id' => $cat_id));\n return $query->num_rows();\n}", "function countProducts() {\r\n global $tableProducts;\r\n\r\n return countFields($tableProducts);\r\n}", "function count_active_pro_list(){\n\t\treturn $this->db->select('count(*)','product_list','status = 1');\n\t}", "function jml_product() {\n return $this->db->count_all('tb_transactions');\n }", "public function getCountSQL()\n {\n return 'SELECT COUNT(*) FROM product';\n }", "public function CountProByCategory_pd($id) {\n $this->db->select('product.id as pro_id,\n product_category.id as cate_id,\n product_to_category.id_category');\n\n $this->db->join('product_to_category', 'product_to_category.id_product=product.id');\n $this->db->join('product_category', 'product_to_category.id_category=product_category.id');\n\n $this->db->where('product_to_category.id_category', $id);\n $this->db->order_by('product.price_sale', 'desc');\n $this->db->group_by('product.id');\n $q = $this->db->get('product');\n return $q->num_rows();\n }", "public function CountProByCategory_p($id) {\n $this->db->select('product.id as pro_id,\n product_category.id as cate_id,\n product_to_category.id_category');\n\n $this->db->join('product_to_category', 'product_to_category.id_product=product.id');\n $this->db->join('product_category', 'product_to_category.id_category=product_category.id');\n\n $this->db->where('product_to_category.id_category', $id);\n $this->db->order_by('product.price_sale', 'esc');\n $this->db->order_by('product.price', 'esc');\n $this->db->group_by('product.id');\n $q = $this->db->get('product');\n return $q->num_rows();\n }", "function count_new_pro_list(){\n\t\treturn $this->db->select('count(*)','product_list','status = 3');\n\t}", "function total_price_orders($bdd)\n{\n $total_price = $bdd->query(\n '\n SELECT SUM(articles.price*articles_orders.quantity) as total, articles_orders.Orders_id \n FROM articles_orders \n INNER JOIN articles\n ON articles_orders.Articles_id=articles.id\n GROUP BY articles_orders.Orders_id\n '\n );\n return $total_price;\n}", "public function countProduct(){\n return count(Product::all());\n }", "function getCartItemsNumber($userId)\n{\n $con = mysqli_connect(\"localhost\",\"root\",\"\",\"gshop\");\n\n $sql = 'SELECT cartproducts.productId FROM cartproducts JOIN cart ON cart.id = cartproducts.cartId WHERE cart.userId=\"'.$userId.'\"';\n\n\n if($result = mysqli_query($con,$sql))\n {\n $numrow = mysqli_num_rows($result);\n\n return $numrow;\n }\n return mysqli_error($con);\n\n}", "function get_total_all_records($connect)\r\n{\r\n\t$statement = $connect->prepare('\r\n\t\tSELECT * FROM equipment_checkout \r\n\t\tINNER JOIN equipment ON equipment.equip_id = equipment_checkout.equip_id\r\n\t\tWHERE equipment_checkout.empl_id = \"'.$_SESSION['user_id'].'\" \r\n\t');\r\n\t$statement->execute();\r\n\treturn $statement->rowCount();\r\n}", "public function penjualan_product()\n\t{\n\t\t$sql = \"SELECT product_name, SUM(qty) as count FROM detail_order GROUP BY product_name\";\n\n // $queryRec = $this->db->query($sql,array($tanggal,$jam,$daerah,$daerah));\n $queryRec = $this->db->query($sql)->result_array();\n return $queryRec;\n\t}", "public function getProNumRows()\n {\n return $this->db->count_all('products');\n }", "public function product_counter($product_id)\n\t{\t\t\n\t\t$this->db->select('DISTINCT(product_id)'); \n\t $this->db->from('stock_history');\n\t\t\tif(!empty($product_id))\n\t\t\t{$this->db->where('product_id =',$product_id); }\n\t $query=$this->db->get(); \n\t return $query->num_rows();\n\t}", "function countOrderSource($query)\r\n {\r\n $sql = \"SELECT phone_order_orderTypes.title as title, COUNT(*) as broj FROM `phone_order_calls`\r\n\t\t LEFT JOIN phone_order_orderTypes ON phone_order_calls.orderType = phone_order_orderTypes.id\r\n\t\t WHERE {$query}\r\n\t\t GROUP BY phone_order_calls.orderType\";\r\n\r\n $results=$this->conn->fetchAll($sql);\r\n return $results;\r\n }", "function Aulaencuesta_Get_Total_Items_In_table() \n{\n global $DB;\n $sql = \"SELECT count(*) as items FROM mdl_aulaencuesta\";\n return $DB->get_record_sql($sql, null);\n}", "function countAllProduit($db){\n // le count renvoie une ligne de résultat avec le nombre de produit, utiliser la clef primaire permet d'éviter qu'il compte réellement le nombre d'articles: c'est un résultat se trouvant en début du code de la table (dans l'index)\n $req = \"SELECT COUNT(idproduit) AS nbPr\nFROM produits\";\n $recup = mysqli_query($db,$req);\n $out = mysqli_fetch_assoc($recup);\n return $out[\"nbPr\"];\n}", "function getTotalRecord(){\n include \"../model/db_connect.php\";\n $query = \"select* from `product`\";\n $runQuery = mysqli_query($connect, $query);\n $numRows = mysqli_num_rows($runQuery);\n mysqli_close($connect);\n return $numRows;\n }", "public function m_totalPurchaseProduct($data){\n\n $query = $this->db->query(\"SELECT id_compra,numeroOrden,producto,cantidad,productos.almacen FROM compra INNER JOIN productos ON compra.producto = productos.id_producto\n\nWHERE numeroOrden = '\".$data['noOrden'].\"'\");\n\n return $query->result_array();\n\n }", "function totalCategories(){\n global $pdo;\n\n $categorySelect = '\n SELECT count(*) cat_title\n FROM categories\n GROUP BY cat_title \n ';\n\n $request = $pdo->prepare($categorySelect);\n\n if ($request->execute() === false ) {\n print_r( $request->errorInfo() );\n }else {\n $categoryNb = $request->fetchAll(PDO::FETCH_ASSOC);\n return $categoryNb;\n }\n return false;\n}", "public function CountProByCategory($id) {\n $this->db->select('product.id as pro_id,\n product_category.id as cate_id,\n product_to_category.id_category');\n\n $this->db->join('product_to_category', 'product_to_category.id_product=product.id');\n $this->db->join('product_category', 'product_to_category.id_category=product_category.id');\n\n $this->db->where('product_to_category.id_category', $id);\n $this->db->order_by('product.id', 'desc');\n $this->db->group_by('product.id');\n $q = $this->db->get('product');\n return $q->num_rows();\n }", "function similarProductCount()\n {\n if($this->soap)\n return count($this->soap['SimilarProducts']);\n else\n return count($this->similarProducts);\n }", "public function getCountProducts(){\n global $connect;\n $query = $connect->PDO->prepare(\"SELECT count(id) FROM `pagTab`\");\n $query->execute();\n $row = $query->fetchAll();\n return $row;\n }", "public function getCountProduct()\n {\n return $this->product_model->countAll();\n }", "public static function doCountJoinAll(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)\n {\n // we're going to modify criteria, so copy it first\n $criteria = clone $criteria;\n\n // We need to set the primary table name, since in the case that there are no WHERE columns\n // it will be impossible for the BasePeer::createSelectSql() method to determine which\n // tables go into the FROM clause.\n $criteria->setPrimaryTableName(GsGeneriekeProductenPeer::TABLE_NAME);\n\n if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {\n $criteria->setDistinct();\n }\n\n if (!$criteria->hasSelectClause()) {\n GsGeneriekeProductenPeer::addSelectColumns($criteria);\n }\n\n $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count\n\n // Set the correct dbName\n $criteria->setDbName(GsGeneriekeProductenPeer::DATABASE_NAME);\n\n if ($con === null) {\n $con = Propel::getConnection(GsGeneriekeProductenPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n\n $criteria->addJoin(GsGeneriekeProductenPeer::ATCCODE, GsAtcCodesPeer::ATCCODE, $join_behavior);\n\n $criteria->addJoin(GsGeneriekeProductenPeer::NAAMNUMMER_VOLLEDIGE_GPKNAAM, GsNamenPeer::NAAMNUMMER, $join_behavior);\n\n $criteria->addJoin(GsGeneriekeProductenPeer::NAAMNUMMER_GPKSTOFNAAM, GsNamenPeer::NAAMNUMMER, $join_behavior);\n\n $criteria->addMultipleJoin(array(\n array(GsGeneriekeProductenPeer::FARMACEUTISCHE_VORM_THESAURUSNUMMER, GsThesauriTotaalPeer::THESAURUSNUMMER),\n array(GsGeneriekeProductenPeer::FARMACEUTISCHE_VORM_CODE, GsThesauriTotaalPeer::THESAURUS_ITEMNUMMER),\n ), $join_behavior);\n\n $criteria->addMultipleJoin(array(\n array(GsGeneriekeProductenPeer::TOEDIENINGSWEG_THESAURUSNUMMER, GsThesauriTotaalPeer::THESAURUSNUMMER),\n array(GsGeneriekeProductenPeer::TOEDIENINGSWEG_CODE, GsThesauriTotaalPeer::THESAURUS_ITEMNUMMER),\n ), $join_behavior);\n\n $stmt = BasePeer::doCount($criteria, $con);\n\n if ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $count = (int) $row[0];\n } else {\n $count = 0; // no rows returned; we infer that means 0 matches.\n }\n $stmt->closeCursor();\n\n return $count;\n }", "public function getProductCount()\n {\n $count = 0;\n \tforeach ($this->getItems() as $item) {\n \t $count += $item['count'];\n \t}\n \treturn $count;\n }", "function selectAllCategories() {\r\n global $conn;\r\n $select = \"SELECT * FROM product GROUP BY category ORDER BY COUNT(category);\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}", "function count_all($category_id){\n\t\t\t\t\t$sql= 'SELECT COUNT( * ) AS numrows\n\t\t\t\t\tFROM customize_apparel_product\t\t\t\t\t\n\t\t\t\t\tWHERE customize_apparel_product.customize_apparel_category_id = '.$category_id.'';\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$Q = $this-> db-> query($sql);\n\t\t\t\t\treturn $Q->row ()->numrows;\n\t\t\t\t}", "public function CountListadoConEdad($dias,$tipoViaje,$Destino,$edad,$edad2,$edad3,$edad4)\r\n\t{\r\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$count=0;\r\n\t\t\t$recordSett = &$this->conexion->conectarse()->Execute('\r\n\t\t\tSELECT DISTINCT\r\n Productos.Id, Productos.NumeroParte, Productos.Nombre, Productos.Descripcion, Productos.IdMarca, Productos.Idcategoria, \r\n TipoProductoProveedores.IdTipo AS IdtipoProducto, Productos.Caracteristicas, Productos.PrecioUnitario, Productos.IdProveedor, Productos.Modelo, \r\n Productos.Voltaje, Productos.Hertz, Productos.FechaIngreso, Productos.Largo, Productos.Ancho, Productos.Altura, Productos.UMDimencion, Productos.Peso, \r\n Productos.UMPeso, Productos.TipoRecogida, Productos.Comision, Empresas.RazonSocial, Empresas.TipoNacionalidad, \r\n UnidadDimension.Descripcion AS UnidadDimension, UnidadPeso.Descripcion AS UnidadPesos, UnidadPeso.Abreviatura AS ABVPeso, \r\n UnidadDimension.Abreviatura AS ABVDimension, Marcas.Descripcion AS Marca, Productos.Iva, Empresas.IdTipoMonedaImportacion, \r\n Monedas.Descripcion AS NomMoneda, Productos.Arancel, Productos.TipoMoneda, Productos.Link, Categorias.Descripcion AS Categoria, Productos.IdTipoRango, \r\n Productos.DiasIniciales, Productos.DiasFinales, Productos.IdTipoPlan, Productos.CantidadDias, Categorias.EdadFinal, Categorias.EdadInicial, \r\n Categorias.CantidadEdad, Categorias.IdTipoRango AS TipoRangoPoliza, Proveedores.IdManejoMoneda AS TasaCambio, \r\n Empresas.RazonSocial AS Aseguradora\r\nFROM Empresas RIGHT OUTER JOIN\r\n Proveedores ON Empresas.Id = Proveedores.Idempresa INNER JOIN\r\n Productos INNER JOIN\r\n UsuariosGrupos ON Productos.GrupoAsignado = UsuariosGrupos.IdGrupo INNER JOIN\r\n Categorias ON Productos.Idcategoria = Categorias.Id INNER JOIN\r\n TipoProductoProveedores ON Productos.IdTipoProducto = TipoProductoProveedores.Id INNER JOIN\r\n RegionesProducto ON Productos.Id = RegionesProducto.IdProducto ON Empresas.Id = Productos.IdProveedor INNER JOIN\r\n Monedas ON Productos.TipoMoneda = Monedas.Id LEFT OUTER JOIN\r\n UnidadesDeMedida AS UnidadPeso ON Productos.UMPeso = UnidadPeso.Id LEFT OUTER JOIN\r\n UnidadesDeMedida AS UnidadDimension ON Productos.UMDimencion = UnidadDimension.Id LEFT OUTER JOIN\r\n Marcas ON Productos.IdMarca = Marcas.Id\r\n \r\nWHERE \t\t\t((Productos.IdTipoRango = 2 AND '. $dias .' BETWEEN Productos.DiasIniciales AND Productos.DiasFinales OR\r\n Productos.IdTipoRango = 1 AND Productos.CantidadDias = '. $dias .') AND \r\n (Categorias.IdTipoRango = 2 AND '. $edad.' BETWEEN Categorias.EdadInicial AND \r\n Categorias.EdadFinal OR\r\n Categorias.IdTipoRango = 1 AND Categorias.CantidadEdad >= '. $edad.') AND ('. $tipoViaje.' IS NULL OR\r\n TipoProductoProveedores.IdTipo = '. $tipoViaje .') AND (Productos.Activo = 1) AND ('.$Destino.' = -1 OR\r\n RegionesProducto.IdRegion ='.$Destino.')) \r\n OR \r\n ((Productos.IdTipoRango = 2 AND '. $dias .' BETWEEN Productos.DiasIniciales AND Productos.DiasFinales OR\r\n Productos.IdTipoRango = 1 AND Productos.CantidadDias = '. $dias .') AND \r\n (Categorias.IdTipoRango = 2 AND '. $edad2.' BETWEEN Categorias.EdadInicial AND \r\n Categorias.EdadFinal OR\r\n Categorias.IdTipoRango = 1 AND Categorias.CantidadEdad >= '. $edad2.') AND ('. $tipoViaje.' IS NULL OR\r\n TipoProductoProveedores.IdTipo = '. $tipoViaje .') AND (Productos.Activo = 1) AND ('.$Destino.' = -1 OR\r\n RegionesProducto.IdRegion ='.$Destino.'))\r\n OR \r\n ((Productos.IdTipoRango = 2 AND '. $dias .' BETWEEN Productos.DiasIniciales AND Productos.DiasFinales OR\r\n Productos.IdTipoRango = 1 AND Productos.CantidadDias = '. $dias .') AND \r\n (Categorias.IdTipoRango = 2 AND '. $edad3.' BETWEEN Categorias.EdadInicial AND \r\n Categorias.EdadFinal OR\r\n Categorias.IdTipoRango = 1 AND Categorias.CantidadEdad >= '. $edad3.') AND ('. $tipoViaje.' IS NULL OR\r\n TipoProductoProveedores.IdTipo = '. $tipoViaje .') AND (Productos.Activo = 1) AND ('.$Destino.' = -1 OR\r\n RegionesProducto.IdRegion ='.$Destino.')) \r\n OR \r\n ((Productos.IdTipoRango = 2 AND '. $dias .' BETWEEN Productos.DiasIniciales AND Productos.DiasFinales OR\r\n Productos.IdTipoRango = 1 AND Productos.CantidadDias = '. $dias .') AND \r\n (Categorias.IdTipoRango = 2 AND '. $edad4.' BETWEEN Categorias.EdadInicial AND \r\n Categorias.EdadFinal OR\r\n Categorias.IdTipoRango = 1 AND Categorias.CantidadEdad >= '. $edad4.') AND ('. $tipoViaje.' IS NULL OR\r\n TipoProductoProveedores.IdTipo = '. $tipoViaje .') AND (Productos.Activo = 1) AND ('.$Destino.' = -1 OR\r\n RegionesProducto.IdRegion ='.$Destino.'))\r\n ORDER BY PrecioUnitario');\r\n\r\n\t\twhile (!$recordSett->EOF) {\r\n\t\t\t\t$count++;\r\n\t\t\t\t$recordSett->MoveNext();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $count;\r\n\t\t}\r\n\t\tcatch (Exception $e)\r\n\t\t{\r\n\t\t\techo 'Caught exception: ', $e->getMessage(), \"\\n\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function product_counter($product_id,$date)\n\t{\t\t\n\t\t\t$this->db->select(\"\n\t\t\t\ta.product_name,\n\t\t\t\ta.unit,\n\t\t\t\ta.product_id,\n\t\t\t\ta.price,\n\t\t\t\ta.supplier_price,\n\t\t\t\ta.product_model,\n\t\t\t\tc.category_name,\n\t\t\t\tsum(b.quantity) as totalPurchaseQnty,\n\t\t\t\te.purchase_date as purchase_date,\n\t\t\t\te.purchase_id,\n\t\t\t\tf.unit_name\n\t\t\t\");\n\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('product_purchase_details b','b.product_id = a.product_id','left');\n\t\t$this->db->join('product_category c' ,'c.category_id = a.category_id');\n\t\t$this->db->join('product_purchase e','e.purchase_id = b.purchase_id');\n\t\t$this->db->join('unit f','f.unit_id = a.unit','left');\n\t\t$this->db->join('variant g','g.variant_id = b.variant_id','left');\n\t\t$this->db->join('store_set h','h.store_id = b.store_id');\n\t\t$this->db->where('b.store_id !=',null);\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_name','asc');\n\n\t\tif(empty($product_id))\n\t\t{\n\t\t\t$this->db->where(array('a.status'=>1));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//Single product information \n\t\t\t$this->db->where(array('a.status'=>1,'e.purchase_date <= ' => $date,'a.product_id'=>$product_id));\t\n\t\t}\n\t\t$query = $this->db->get();\n\t\treturn $query->num_rows();\n\t}", "public function CountProByCategory2($timkiem_nangcao) {\n $q = $this->db->query(\"SELECT `product`.`id` as pro_id, `product_category`.`id` as cate_id, `product_to_category`.`id_category` FROM (`product`) JOIN `product_to_category` ON `product_to_category`.`id_product`=`product`.`id` JOIN `product_category` ON `product_to_category`.`id_category`=`product_category`.`id` WHERE $timkiem_nangcao GROUP BY `product`.`id`\");\n\n //echo $this->db->last_query();\n return $q->num_rows();\n }", "public function CountProByLocation($alias) {\n\n $cate = $this->getFirstRowWhere('tinhthanh', array('alias' => $alias));\n\n $q = $this->db->select('product.id as pro_id,product.location,product.price as pro_price,\n product.price_sale as pro_price_sale, product.name as pro_name,product.category_id,\n product.alias as pro_alias,product.image as pro_img,\n tinhthanh.region_id as cate_id, tinhthanh.region_name as cate_name, tinhthanh.alias as cate_alias,')\n ->join('tinhthanh', 'tinhthanh.region_id=product.location', 'left')\n ->where('tinhthanh.region_id', $cate->region_id)\n ->group_by('product.id')\n ->get('product');\n return $q->num_rows();\n }", "function allposts_count_Detail($nopo)\n { \n $query = $this->db->query(\"select a.fc_id,a.fc_branch,a.fc_nopo,a.fc_stock,b.fv_stock,CONCAT(b.fv_size,' | ',b.fv_warna) as variant,c.fv_satuan,rupiah(a.fn_price) as price,a.fn_qty,c.fn_uom,(a.fn_qty * c.fn_uom) as konversi,rupiah(a.fn_total) as total from td_po a LEFT OUTER JOIN v_variant b ON b.fc_stock=a.fc_stock AND b.fc_variant=a.fc_variant LEFT OUTER JOIN v_uom c ON c.fc_uom=a.fc_satuan WHERE a.fc_nopo='\".$nopo.\"'\");\n return $query->num_rows(); \n }", "public function count() {\n\n // query to count all product records\n $query = \"SELECT count(*) FROM $this->table_name\";\n\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n\n // execute query\n $stmt->execute();\n\n // get row value\n $rows = $stmt->fetch(PDO::FETCH_NUM);\n\n // return count\n return $rows[0];\n }", "function get_all_data_prov(){\n return $this->db->query(\"\n SELECT *, a.nama, a.propinsiid,\n (select count(propinsiid) as jum from tbl_propinsi_kota where propinsiid=a.propinsiid) as jumlah_kota\n FROM tbl_propinsi a\n LEFT JOIN tbl_propinsi_kota b ON a.propinsiid = b.propinsiid\n GROUP BY a.propinsiid\n \")->result();\n }", "function total_rowskhusus2($q = NULL) {\n $this->db->like('id_persediaan', $q);\n $this->db->or_like('id_puskesmas', $q);\n $this->db->from($this->table);\n return $this->db->count_all_results();\n }", "function count_all_kids($cat_id){\n\t\t\t\t\t$sql= 'SELECT COUNT( * ) AS numrows\n\t\t\t\t\tFROM product\n\t\t\t\t\tJOIN product_people ON product_people.product_id = product.product_id\n\t\t\t\t\tWHERE product.product_type_id = '.$cat_id.'\n\t\t\t\t\tAND product_people.people_cat_id =\"3\"';\n\t\t\t\t\t\n\t\t\t\t\t$Q = $this-> db-> query($sql);\n\t\t\t\t\treturn $Q->row ()->numrows;\n\t\t\t\t}", "function count_search_product_result($conditions_array=array()){\n\t\t$this->db->where($conditions_array);\n\t\t$this->db->like('product', $this->input->post('search_text'));\n\t\t$this->db->or_like('description', $this->input->post('search_text'));\n\t\treturn $this->db->count_all_results('red_support_product as rsp');\n\t}", "public function countProduit(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"count\"));\n\t\t\t\t\t }", "function getTotalProductsAvailable() {\r\n global $conn;\r\n $select = \"SELECT SUM(quantityavailable) AS sqa FROM product;\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}", "public function getTotalProducts()\n {\n $resource = $this->_productFactory->create()->getResource();\n \n $connection = $resource->getConnection();\n $select = $connection->select();\n $select->from(\n $resource->getTable('catalog_product_entity'),\n ['total_product' => 'count( entity_id )']\n )->where(\n 'vendor_id = :vendor_id'\n );\n $bind = ['vendor_id' => $this->getVendor()->getId()];\n \n $total = $connection->fetchOne($select, $bind);\n return $total;\n }", "function countAllProducts($id){\n\t\t$result = $this->CategoriesProduct->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'CategoriesProduct.category_id' => $id\n\t\t\t),\n\t\t\t'contain' => array()\n\t\t));\n\n\t\treturn $result;\n\t}", "function get_all_tamanhos_produtos_count()\n {\n $this->db->from('tamanhos_produtos');\n\n return $this->db->count_all_results();\n }", "function productListingCount($searchText = '')\n {\n $this->db->select('BaseTbl.*');\n $this->db->from('tbl_products as BaseTbl');\n\t\tif(!empty($searchText)) {\n $likeCriteria = \"(BaseTbl.name LIKE '%\".$searchText.\"%')\";\n $this->db->where($likeCriteria);\n }\n $query = $this->db->get();\n \n return count($query->result());\n }", "function join_product_table(){\n global $db;\n $sql =\" SELECT p.id,p.name,p.keywords,p.quantity,p.url,p.buy_price,p.sale_price,p.media_id,p.date,c.name\";\n $sql .=\" AS categorie,m.file_name AS image\";\n $sql .=\" FROM products p\";\n $sql .=\" LEFT JOIN categories c ON c.id = p.categorie_id\";\n $sql .=\" LEFT JOIN media m ON m.id = p.media_id\";\n $sql .=\" ORDER BY p.id ASC\";\n return find_by_sql($sql);\n\n }", "function selectProducts() {\n\n\tglobal $db;\n\n\tglobal $result;\n\n\t$query = \"SELECT * FROM products \";\n\t$query .= \"LEFT JOIN sub_category ON products.p_sub_id = sub_category.sub_id\";\n\n\t$result = mysqli_query($db, $query);\n\n\tconfirmQuery($result);\n}", "public function getTotal()\n {\n //$query=$this->db->get('warehouse');\n $result = $this->db->query('SELECT COUNT(DISTINCT(i.id)) as item,SUM( w.qty) AS qty, SUM( w.qty * i.purchase_price) AS purchase, SUM( i.sales_price * w.qty) AS retail, SUM( i.sales_price * w.qty) - SUM( i.purchase_price * w.qty) AS profit\n FROM warehouse w\n INNER JOIN item i ON w.item_id=i.id');\n return $result->result(); \n }", "function count_by_id($table){\n global $db;\n if(tableExists($table))\n {\n $sql = \"SELECT COUNT(id) AS total FROM \".$db->escape($table);\n $result = $db->query($sql);\n return($db->fetch_assoc($result));\n }\n}", "public function ProductCount()\n {\n return Products::count();\n }", "public static function doCountJoinToedieningswegOmschrijving(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)\n {\n // we're going to modify criteria, so copy it first\n $criteria = clone $criteria;\n\n // We need to set the primary table name, since in the case that there are no WHERE columns\n // it will be impossible for the BasePeer::createSelectSql() method to determine which\n // tables go into the FROM clause.\n $criteria->setPrimaryTableName(GsGeneriekeProductenPeer::TABLE_NAME);\n\n if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {\n $criteria->setDistinct();\n }\n\n if (!$criteria->hasSelectClause()) {\n GsGeneriekeProductenPeer::addSelectColumns($criteria);\n }\n\n $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count\n\n // Set the correct dbName\n $criteria->setDbName(GsGeneriekeProductenPeer::DATABASE_NAME);\n\n if ($con === null) {\n $con = Propel::getConnection(GsGeneriekeProductenPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n\n $criteria->addMultipleJoin(array(\n array(GsGeneriekeProductenPeer::TOEDIENINGSWEG_THESAURUSNUMMER, GsThesauriTotaalPeer::THESAURUSNUMMER),\n array(GsGeneriekeProductenPeer::TOEDIENINGSWEG_CODE, GsThesauriTotaalPeer::THESAURUS_ITEMNUMMER),\n ), $join_behavior);\n\n $stmt = BasePeer::doCount($criteria, $con);\n\n if ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $count = (int) $row[0];\n } else {\n $count = 0; // no rows returned; we infer that means 0 matches.\n }\n $stmt->closeCursor();\n\n return $count;\n }", "public function getTotalProducts($data = array()) {\n$sql = \"SELECT COUNT(DISTINCT p.product_id) AS total FROM \" . DB_PREFIX . \"product p LEFT JOIN \" . DB_PREFIX . \"product_description pd ON (p.product_id = pd.product_id) LEFT JOIN \" . DB_PREFIX . \"product_to_category ptc ON ( p.product_id = ptc.product_id)\";\n\t\t$sql .= \" WHERE pd.language_id = '\" . (int)$this->config->get('config_language_id') . \"' AND p.product_tp ='TE'\";\n//echo $sql;exit;\n\t\tif (!empty($data['filter_name'])) {\n\t\t\t$sql .= \" AND pd.name LIKE '\" . $this->db->escape($data['filter_name']) . \"%'\";\n\t\t}\n\n\t\tif (!empty($data['filter_model'])) {\n\t\t\t$sql .= \" AND p.model LIKE '\" . $this->db->escape($data['filter_model']) . \"%'\";\n\t\t}\n\n\t\tif (isset($data['filter_price']) && !is_null($data['filter_price'])) {\n\t\t\t$sql .= \" AND p.price LIKE '\" . $this->db->escape($data['filter_price']) . \"%'\";\n\t\t}\n\n\t\tif (isset($data['filter_quantity']) && !is_null($data['filter_quantity'])) {\n\t\t\t$sql .= \" AND p.quantity = '\" . (int)$data['filter_quantity'] . \"'\";\n\t\t}\n \n \n \n /*Custom add */ \n if (isset($data['filter_category']) && !is_null($data['filter_category'])) {\n\t\t\t$sql .= \" AND ptc.category_id = '\" . (int)$data['filter_category'] . \"'\";\n\t\t}\n \n\n\n\n\t\tif (isset($data['filter_status']) && !is_null($data['filter_status'])) {\n\t\t\t$sql .= \" AND p.status = '\" . (int)$data['filter_status'] . \"'\";\n\t\t}\n \n if (isset($data['filter_family']) && !is_null($data['filter_family'])) {\n\t\t\t$sql .= \" AND p.family = '\" . (int)$data['filter_family'] . \"'\";\n\t\t}\n\n\t\tif (isset($data['filter_image']) && !is_null($data['filter_image'])) {\n\t\t\tif ($data['filter_image'] == 1) {\n\t\t\t\t$sql .= \" AND (p.image IS NOT NULL AND p.image <> '' AND p.image <> 'no_image.png')\";\n\t\t\t} else {\n\t\t\t\t$sql .= \" AND (p.image IS NULL OR p.image = '' OR p.image = 'no_image.png')\";\n\t\t\t}\n\t\t}\n//echo $sql;exit;\n\t\t$query = $this->db->query($sql);\n\n\t\treturn $query->row['total'];\n\t}", "function get_sum_purchases($order_id){\r\n\tglobal $dbc;\r\n\t\r\n\t$query = 'SELECT COUNT(*) AS total '.\r\n\t\t\t 'FROM order_merch_item '.\r\n\t\t\t 'WHERE order_id = \\''. $order_id .'\\' '.\r\n\t\t\t 'AND purch_merch_id IS NOT NULL ;';\r\n\t\r\n\t$result = mysqli_query($dbc, $query);\r\n\tif(!$result){\r\n\t\tdie('Error - '. mysqli_errno($dbc));\r\n\t}\r\n\telse{\r\n\t\t$row = mysqli_fetch_object($result);\r\n\t\treturn $row->total;\r\n\t}\r\n\t\r\n}", "public static function select_product_count_by_category_id($category_id=null)\n {\n try {\n $query = new Query;\n if($category_id != null)\n {\n $count = $query->select('COUNT(*) as count')->from('core_products')->where(\"category_id = $category_id\")->andWhere(\"product_status = 1\")->andWhere(['>=','core_products.product_expires_on',date(\"Y-m-d H:i:s\")])->All();\n return $count[0]['count'];\n \n }else\n {\n $query = new Query;\n $pending_products_count = $query->select('COUNT(*) as count')->from('core_products')\n ->where(\"product_status = 0\")\n //->andWhere(['>=','core_products.product_expires_on',date(\"Y-m-d H:i:s\")])\n ->All();//pending products count \n $total_count['pending_products_count'] = $pending_products_count[0]['count'];\n\n $query = new Query;\n $count = $query->select('COUNT(*) as count')->from('core_products')\n //->where(\"product_status = 1\")\n //->andWhere(['>=','core_products.product_expires_on',date(\"Y-m-d H:i:s\")])\n ->All();\n $total_count['total_products_count'] = $count[0]['count'];\n return $total_count;\n }\n \n \n \n } catch (ErrorException $e) {\n Yii::warning($e->getMessage());\n }\n \n \n }", "public function get_rows(){ return $count = count($this->prod_id); }", "function count_all_women($cat_id){\n\t\t\t\t\t$sql= 'SELECT COUNT( * ) AS numrows\n\t\t\t\t\tFROM product\n\t\t\t\t\tJOIN product_people ON product_people.product_id = product.product_id\n\t\t\t\t\tWHERE product.product_type_id = '.$cat_id.'\n\t\t\t\t\tAND product_people.people_cat_id =\"1\"';\n\t\t\t\t\t\n\t\t\t\t\t$Q = $this-> db-> query($sql);\n\t\t\t\t\treturn $Q->row ()->numrows;\n\t\t\t\t}", "function prodname()\r\n {\r\n //left join oc_product as op on opd.product_id=op.product_id \");\r\n\r\n //return $query->rows; \r\n \r\n $query = $this->db->query(\"SELECT product_id,model,sku FROM `oc_product` WHERE `status`='1'\");\r\n \r\n return $query->rows;\r\n }", "public static function doCountJoinAllExceptToedieningswegOmschrijving(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)\n {\n // we're going to modify criteria, so copy it first\n $criteria = clone $criteria;\n\n // We need to set the primary table name, since in the case that there are no WHERE columns\n // it will be impossible for the BasePeer::createSelectSql() method to determine which\n // tables go into the FROM clause.\n $criteria->setPrimaryTableName(GsGeneriekeProductenPeer::TABLE_NAME);\n\n if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {\n $criteria->setDistinct();\n }\n\n if (!$criteria->hasSelectClause()) {\n GsGeneriekeProductenPeer::addSelectColumns($criteria);\n }\n\n $criteria->clearOrderByColumns(); // ORDER BY should not affect count\n\n // Set the correct dbName\n $criteria->setDbName(GsGeneriekeProductenPeer::DATABASE_NAME);\n\n if ($con === null) {\n $con = Propel::getConnection(GsGeneriekeProductenPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n\n $criteria->addJoin(GsGeneriekeProductenPeer::ATCCODE, GsAtcCodesPeer::ATCCODE, $join_behavior);\n\n $criteria->addJoin(GsGeneriekeProductenPeer::NAAMNUMMER_VOLLEDIGE_GPKNAAM, GsNamenPeer::NAAMNUMMER, $join_behavior);\n\n $criteria->addJoin(GsGeneriekeProductenPeer::NAAMNUMMER_GPKSTOFNAAM, GsNamenPeer::NAAMNUMMER, $join_behavior);\n\n $stmt = BasePeer::doCount($criteria, $con);\n\n if ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $count = (int) $row[0];\n } else {\n $count = 0; // no rows returned; we infer that means 0 matches.\n }\n $stmt->closeCursor();\n\n return $count;\n }", "function get_entradas_general_list_count()\n\t{\n\t\t$u = new Entrada();\n\t\t$sql=\"select count(distinct(e.pr_facturas_id)) as total from entradas as e left join cproveedores as pr on pr.id=e.cproveedores_id left join pr_facturas as prf on prf.id=e.pr_facturas_id left join espacios_fisicos as ef on ef.id=e.espacios_fisicos_id left join estatus_general as eg on eg.id=e.estatus_general_id where e.estatus_general_id=1 and ctipo_entrada=1\";\n\t\t//Buscar en la base de datos\n\t\t$u->query($sql);\n\t\tif($u->c_rows == 1){\n\t\t\treturn $u->total;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function getTotalProductsSold() {\r\n global $conn;\r\n $select = \"SELECT SUM(quantitysold) AS sqs FROM product;\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}", "public static function doCountJoinStofnaam(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)\n {\n // we're going to modify criteria, so copy it first\n $criteria = clone $criteria;\n\n // We need to set the primary table name, since in the case that there are no WHERE columns\n // it will be impossible for the BasePeer::createSelectSql() method to determine which\n // tables go into the FROM clause.\n $criteria->setPrimaryTableName(GsGeneriekeProductenPeer::TABLE_NAME);\n\n if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {\n $criteria->setDistinct();\n }\n\n if (!$criteria->hasSelectClause()) {\n GsGeneriekeProductenPeer::addSelectColumns($criteria);\n }\n\n $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count\n\n // Set the correct dbName\n $criteria->setDbName(GsGeneriekeProductenPeer::DATABASE_NAME);\n\n if ($con === null) {\n $con = Propel::getConnection(GsGeneriekeProductenPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n\n $criteria->addJoin(GsGeneriekeProductenPeer::NAAMNUMMER_GPKSTOFNAAM, GsNamenPeer::NAAMNUMMER, $join_behavior);\n\n $stmt = BasePeer::doCount($criteria, $con);\n\n if ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $count = (int) $row[0];\n } else {\n $count = 0; // no rows returned; we infer that means 0 matches.\n }\n $stmt->closeCursor();\n\n return $count;\n }", "function br_redova($nesto) {\n\n\tglobal $db;\n\n\t$komanda = \"SELECT 'id', COUNT(*) FROM $nesto\";\n\t$result = mysql_query($komanda, $db);\n\techo mysql_num_rows ($result);\n\n}", "public static function doCountJoinAll(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)\n {\n // we're going to modify criteria, so copy it first\n $criteria = clone $criteria;\n\n // We need to set the primary table name, since in the case that there are no WHERE columns\n // it will be impossible for the BasePeer::createSelectSql() method to determine which\n // tables go into the FROM clause.\n $criteria->setPrimaryTableName(GsSupplementaireProductenHistoriePeer::TABLE_NAME);\n\n if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {\n $criteria->setDistinct();\n }\n\n if (!$criteria->hasSelectClause()) {\n GsSupplementaireProductenHistoriePeer::addSelectColumns($criteria);\n }\n\n $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count\n\n // Set the correct dbName\n $criteria->setDbName(GsSupplementaireProductenHistoriePeer::DATABASE_NAME);\n\n if ($con === null) {\n $con = Propel::getConnection(GsSupplementaireProductenHistoriePeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n\n $criteria->addJoin(GsSupplementaireProductenHistoriePeer::ZINDEX_NUMMER, GsArtikelenPeer::ZINUMMER, $join_behavior);\n\n $criteria->addMultipleJoin(array(\n array(GsSupplementaireProductenHistoriePeer::THESAURUS_NUMMER_SOORT_SUPPLEMENTAIR_PRODUCT, GsThesauriTotaalPeer::THESAURUSNUMMER),\n array(GsSupplementaireProductenHistoriePeer::SOORT_SUPPLEMENTAIR_PRODUCT, GsThesauriTotaalPeer::THESAURUS_ITEMNUMMER),\n ), $join_behavior);\n\n $stmt = BasePeer::doCount($criteria, $con);\n\n if ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $count = (int) $row[0];\n } else {\n $count = 0; // no rows returned; we infer that means 0 matches.\n }\n $stmt->closeCursor();\n\n return $count;\n }", "function get_all_data_kecamatan(){\n return $this->db->query(\"\n SELECT *, a.nama, a.propinsiid,\n (select count(propinsiid) as jum from tbl_propinsi_kota where propinsiid=a.propinsiid) as jumlah_kota\n FROM tbl_propinsi a\n LEFT JOIN tbl_propinsi_kota b ON a.propinsiid = b.propinsiid\n \")->result();\n }", "function get_all_data_kecamatan(){\n return $this->db->query(\"\n SELECT *, a.nama, a.propinsiid,\n (select count(propinsiid) as jum from tbl_propinsi_kota where propinsiid=a.propinsiid) as jumlah_kota\n FROM tbl_propinsi a\n LEFT JOIN tbl_propinsi_kota b ON a.propinsiid = b.propinsiid\n \")->result();\n }", "public static function getTotalSearchResultsCount() {\n\n $category_dress_type_id = isset($_POST['product_type']) ? $_POST['product_type'] : '';\n $search_term = $_POST['search_term'];\n\n if (isset($_POST['model_type'])) {\n $model_type = $_POST['model_type'];\n switch ($model_type) {\n case \"girl\":\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260\");\n Db_Actions::DbSelect(\"SELECT product_id FROM cscart_product_descriptions WHERE product LIKE '%\" . $search_term . \"%'\");\n break;\n case \"boy\":\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=261\");\n\n break;\n }\n }\n $products_count = Db_Actions::DbGetResults();\n if (!isset($products_count->empty_result)) {\n foreach ($products_count as $count) {\n echo ceil($count->totalprds / 9);\n }\n }\n else {\n echo 0;\n }\n }", "function countCategories($db_link) {\n\t$query = \"SELECT COUNT(*) FROM categories\";\n\n\t$result = queryDatabase($query, $db_link);\n\n\t$number = retrieveUsingResult($result, $db_link);\n\t\n\treturn $number['COUNT(*)'];\n}", "public function count_lists(){\n $cart_result = @mysqli_query($this->dbc, \"SELECT SUM(state='draft') as draft, SUM(article_type='news' and state='published') as news, SUM(article_type='guidance' and state='published') as guidance from `news_advice`\") or die(\"Couldn't ViewSql page USERS lists()\");\n $this->num_rows = mysqli_num_rows($cart_result);\n while ($row = mysqli_fetch_assoc($cart_result)) {\n $this->draft = $row[\"draft\"];\n $this->news = $row[\"news\"];\n $this->guidance = $row[\"guidance\"];\n }// end while\n mysqli_close($this->dbc);\n }", "function countProductsInCategories() {\r\n global $conn;\r\n $select = \"SELECT category, COUNT(category) as cc, MAX(image) as img from product GROUP BY category\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}", "function count_products()\n\t{\t\n\t\tif(!$this->validate())\n\t\t\treturn false;\n\n\t\tif(empty($this->keywords_to_search_for))\n\t\t\t$this->set_keywords_from_search_query();\n\t\t\t\t\t\n\t\t$keyword_filter \t= $this->build_keyword_sql_filter($this->keywords_to_search_for);\n\t\t\n\t\t$category_filter \t= $this->build_category_sql_filter($this->in_category_id);\n\t\t\n\t\tif(empty($keyword_filter))\t\n\t\t{\n\t\t\t$this->total_number_of_search_results = 0;\n\t\t\t\n\t\t\treturn $this->total_number_of_search_results;\n\t\t}\n\t\t\t\n\t\t//Find the total number of search results\n\t\t$count_search_results_sql = '\n\t\t\t\tSELECT COUNT(*) ' .\n\t\t\t\t'FROM (SELECT DISTINCT product.id FROM product ' .\n\t\t\t\t'\tINNER JOIN product_keyword ON product_keyword.product_id = product.id ' .\n\t\t\t\t'\tINNER JOIN keyword ON product_keyword.keyword_id = keyword.id ' .\n\t\t\t\t'WHERE ('.$keyword_filter.') '.$category_filter . ' AND product.is_active = 1 ' . \n\t\t\t\t'GROUP BY product.id) AS product_count';\n\t\t\n\t\t$this->total_number_of_search_results = $this->_db->get_first_cell($count_search_results_sql);\n\t\n\t\treturn $this->total_number_of_search_results;\n\t}", "function consec_productobyID($id) {\n $sql = \"\n SELECT\n COUNT(idusuario)\n FROM vendedor\n WHERE idusuario=?;\";\n //$sql = $this->db->query($sql, array($id));\n \n //return $sql->simple_query(); //->total_cortes;\n }", "public function modelTotalRecord(){\n\t\t\t$total = DB::rowCount(\"select id from products\");\n\t\t\treturn $total;\n\t\t}", "public static function doCountJoinAllExceptGsArtikelen(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)\n {\n // we're going to modify criteria, so copy it first\n $criteria = clone $criteria;\n\n // We need to set the primary table name, since in the case that there are no WHERE columns\n // it will be impossible for the BasePeer::createSelectSql() method to determine which\n // tables go into the FROM clause.\n $criteria->setPrimaryTableName(GsSupplementaireProductenHistoriePeer::TABLE_NAME);\n\n if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {\n $criteria->setDistinct();\n }\n\n if (!$criteria->hasSelectClause()) {\n GsSupplementaireProductenHistoriePeer::addSelectColumns($criteria);\n }\n\n $criteria->clearOrderByColumns(); // ORDER BY should not affect count\n\n // Set the correct dbName\n $criteria->setDbName(GsSupplementaireProductenHistoriePeer::DATABASE_NAME);\n\n if ($con === null) {\n $con = Propel::getConnection(GsSupplementaireProductenHistoriePeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n\n $criteria->addMultipleJoin(array(\n array(GsSupplementaireProductenHistoriePeer::THESAURUS_NUMMER_SOORT_SUPPLEMENTAIR_PRODUCT, GsThesauriTotaalPeer::THESAURUSNUMMER),\n array(GsSupplementaireProductenHistoriePeer::SOORT_SUPPLEMENTAIR_PRODUCT, GsThesauriTotaalPeer::THESAURUS_ITEMNUMMER),\n ), $join_behavior);\n\n $stmt = BasePeer::doCount($criteria, $con);\n\n if ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $count = (int) $row[0];\n } else {\n $count = 0; // no rows returned; we infer that means 0 matches.\n }\n $stmt->closeCursor();\n\n return $count;\n }", "function count_all_kids_Girl($cat_id){\n\t\t\t\t\t$sql= 'SELECT COUNT( * ) AS numrows\n\t\t\t\t\tFROM product\n\t\t\t\t\tJOIN product_people ON product_people.product_id = product.product_id\n\t\t\t\t\tWHERE product.product_type_id = '.$cat_id.'\n\t\t\t\t\tAND product_people.people_cat_id =\"4\"';\n\t\t\t\t\t\n\t\t\t\t\t$Q = $this-> db-> query($sql);\n\t\t\t\t\treturn $Q->row ()->numrows;\n\t\t\t\t}", "public function inventario_tatalProductos(){ \t\n\n\t\t\t$resultado = array();\n\t\t\t\n\t\t\t$query = \"Select count(idProducto) as cantidadProductos from tb_productos \";\n\t\t\t\n\t\t\t$conexion = parent::conexionCliente();\n\t\t\t\n\t\t\tif($res = $conexion->query($query)){\n\t \n\t /* obtener un array asociativo */\n\t while ($filas = $res->fetch_assoc()) {\n\t $resultado = $filas;\n\t }\n\t \n\t /* liberar el conjunto de resultados */\n\t $res->free();\n\t \n\t }\n\t\n\t return $resultado['cantidadProductos'];\t\t\t\n\t\t\t\n\t\t\t\n }", "public function totalreatingandreview($productid){\n\t\t$this->db->where('ProductId', $productid);\n\t\t$this->db->select('Id');\n\t\t$query=$this->db->get('tbl_review');\n\t\techo $query->num_rows();\n\t}", "function getNPOrderCount(){\n $dbobj = DB::connect();\n $sql = \"SELECT count(order_id) FROM tbl_newspaper_order\";\n $result = $dbobj->query($sql);\n if($dbobj->errno){\n echo(\"SQL Error : \" .$dbobj->error);\n exit;\n }\n $rec = $result->fetch_array();\n echo ($rec[0]);\n\n $dbobj->close();\n}", "function count_by_id($table){\n global $db;\n if(tableExists($table))\n {\n $sql = \"SELECT COUNT(id) AS total FROM \".$db->escape($table);\n $sql_result = $db->query($sql);\n return $db->fetch_assoc($sql_result);\n }\n else\n return NULL;\n}", "function get_totalkelas1(){\n $this->db->select('*')\n ->from('v_kelas1');\n return $this->db->count_all_results();\n }", "public static function doCountJoinAllExceptFarmaceutischeVormOmschrijving(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)\n {\n // we're going to modify criteria, so copy it first\n $criteria = clone $criteria;\n\n // We need to set the primary table name, since in the case that there are no WHERE columns\n // it will be impossible for the BasePeer::createSelectSql() method to determine which\n // tables go into the FROM clause.\n $criteria->setPrimaryTableName(GsGeneriekeProductenPeer::TABLE_NAME);\n\n if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {\n $criteria->setDistinct();\n }\n\n if (!$criteria->hasSelectClause()) {\n GsGeneriekeProductenPeer::addSelectColumns($criteria);\n }\n\n $criteria->clearOrderByColumns(); // ORDER BY should not affect count\n\n // Set the correct dbName\n $criteria->setDbName(GsGeneriekeProductenPeer::DATABASE_NAME);\n\n if ($con === null) {\n $con = Propel::getConnection(GsGeneriekeProductenPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n\n $criteria->addJoin(GsGeneriekeProductenPeer::ATCCODE, GsAtcCodesPeer::ATCCODE, $join_behavior);\n\n $criteria->addJoin(GsGeneriekeProductenPeer::NAAMNUMMER_VOLLEDIGE_GPKNAAM, GsNamenPeer::NAAMNUMMER, $join_behavior);\n\n $criteria->addJoin(GsGeneriekeProductenPeer::NAAMNUMMER_GPKSTOFNAAM, GsNamenPeer::NAAMNUMMER, $join_behavior);\n\n $stmt = BasePeer::doCount($criteria, $con);\n\n if ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $count = (int) $row[0];\n } else {\n $count = 0; // no rows returned; we infer that means 0 matches.\n }\n $stmt->closeCursor();\n\n return $count;\n }", "function count_rating($product_id,$connect) {\r\n $output = 0;\r\n $query = \"SELECT AVG(rating) as rating FROM rating WHERE product_id = '$product_id'\";\r\n $statement = $connect->prepare($query);\r\n $statement->execute();\r\n $result = $statement->fetchAll();\r\n $total_row = $statement->rowCount();\r\n if($total_row > 0) {\r\n foreach ($result as $row) {\r\n $output = round($row['rating']);\r\n }\r\n }\r\n return $output;\r\n }", "public function countProdukByCategory($id_category){\n $this->db->where(array('deleted_at' => null, 'status' => 1));\n $this->db->where('id_category', $id_category);\n $this->db->from($this->product);\n return $this->db->count_all_results();\n }", "public static function doCountJoinGsArtikelen(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)\n {\n // we're going to modify criteria, so copy it first\n $criteria = clone $criteria;\n\n // We need to set the primary table name, since in the case that there are no WHERE columns\n // it will be impossible for the BasePeer::createSelectSql() method to determine which\n // tables go into the FROM clause.\n $criteria->setPrimaryTableName(GsSupplementaireProductenHistoriePeer::TABLE_NAME);\n\n if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {\n $criteria->setDistinct();\n }\n\n if (!$criteria->hasSelectClause()) {\n GsSupplementaireProductenHistoriePeer::addSelectColumns($criteria);\n }\n\n $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count\n\n // Set the correct dbName\n $criteria->setDbName(GsSupplementaireProductenHistoriePeer::DATABASE_NAME);\n\n if ($con === null) {\n $con = Propel::getConnection(GsSupplementaireProductenHistoriePeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n\n $criteria->addJoin(GsSupplementaireProductenHistoriePeer::ZINDEX_NUMMER, GsArtikelenPeer::ZINUMMER, $join_behavior);\n\n $stmt = BasePeer::doCount($criteria, $con);\n\n if ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $count = (int) $row[0];\n } else {\n $count = 0; // no rows returned; we infer that means 0 matches.\n }\n $stmt->closeCursor();\n\n return $count;\n }", "public function record_count() {\n $count = $this->db->count_all('product');\n return $count;\n }", "function get_purchased_count( $conds = array() )\n\t{\n\t\t\n\t\t$this->db->select('rt_products.*, count(rt_transactions_counts.product_id) as t_count'); \n \t\t$this->db->from('rt_products');\n \t\t$this->db->join('rt_transactions_counts', 'rt_products.id = rt_transactions_counts.product_id');\n \t\t$this->db->where('rt_products.status',1);\n \t\t$this->db->where('rt_products.shop_id',$conds['shop_id']);\n \t\t$this->db->limit(5);\n \t\t$this->db->group_by('rt_transactions_counts.product_id');\n \t\t$this->db->order_by(\"t_count\", \"DESC\");\n\t\treturn $this->db->get();\n\t\t // print_r($this->db->last_query());die;\n\t}", "public function NumOfProducts()\n {\n return Product::all()->count();\n }", "public function action_catalog_products_cout()\n {\n echo '<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">';\n echo '<tr><td width=\"120px\">Catalog Name</td><td width=\"100px\">在架产品数量</td><td width=\"100px\">下架产品数量</td></tr>';\n $catalogs = DB::select('id')->from('products_category')->where('visibility', '=', 1)->where('on_menu', '=', 1)->execute('slave');\n foreach($catalogs as $cata)\n {\n $catalog = Catalog::instance($cata['id']);\n $posterity_ids = $catalog->posterity();\n $posterity_ids[] = $cata['id'];\n $posterity_sql = implode(',', $posterity_ids);\n\n $sql = 'SELECT count(distinct products.id) as num FROM products LEFT JOIN catalog_products ON catalog_products.product_id=products.id \n WHERE catalog_products.catalog_id IN (' . $posterity_sql . ') AND products.site_id =1 AND products.visibility = 1';\n\n $onsale_count = DB::query(Database::SELECT, $sql . ' AND status = 1')->execute('slave')->get('num');\n $offsale_count = DB::query(Database::SELECT, $sql . ' AND status = 0')->execute('slave')->get('num');\n\n echo '<tr><td>' . $catalog->get('name') . '</td><td>' . $onsale_count . '</td><td>' . $offsale_count . '</td></tr>';\n }\n echo '</table>';\n }", "private function _calculateTotalsOut()\n {\n $prodSql = new SqlStatement();\n $prodSql->select()\n ->distinct()\n ->from(array('p' => 'product'), array('p.*'));\n \n if ($this->subCategory) \n {\n $prodSql->innerJoin(array('p2c' => 'product_to_category'), 'p.product_id = p2c.product_id')\n ->innerJoin(array('cp' => 'category_path'), 'cp.category_id = p2c.category_id')\n ->where('cp.path_id = ?', array($this->subCategory));\n }\n elseif ($this->topCategory) \n {\n $prodSql->innerJoin(array('p2c' => 'product_to_category'), 'p.product_id = p2c.product_id')\n ->where('p2c.category_id = ?', array($this->topCategory));\n }\n \n $searchConditions = $this->_prepareSearchConditions();\n if (count($searchConditions)) {\n $prodSql->innerJoin(array('pd' => 'product_description'), 'pd.product_id = p.product_id')\n ->multipleWhere($searchConditions, 'OR');\n }\n \n if ($this->conditions->price) {\n $prodSql->leftJoin(array('pd2' => 'product_discount'), 'pd2.product_id = p.product_id', array('discount' => 'MIN(pd2.price)'))\n ->leftJoin(array('ps' => 'product_special'), 'ps.product_id = p.product_id', array('special' => 'MIN(ps.price)'))\n ->where(\"(pd2.product_id IS NULL OR (\n pd2.quantity = '1'\n AND (pd2.date_start = '0000-00-00' OR pd2.date_start < NOW())\n AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())\n AND pd2.customer_group_id = '{$this->customerGroupId}') )\")\n ->where(\"(ps.product_id IS NULL OR (\n (ps.date_end = '0000-00-00' OR ps.date_end > NOW())\n AND (ps.date_start = '0000-00-00' OR ps.date_start < NOW())\n AND ps.customer_group_id = '{$this->customerGroupId}' ) )\")\n ->group(array('p.product_id'));\n \n if ($this->config->get('config_tax')) {\n $prodSql->select(array('fixed_tax', 'percent_tax'))\n ->leftJoin(array('tr1' => $this->subquery->fixedTax), 'tr1.tax_class_id = p.tax_class_id')\n ->leftJoin(array('tr2' => $this->subquery->percentTax), 'tr2.tax_class_id = p.tax_class_id');\n } else {\n $prodSql->select(array('fixed_tax' => '0', 'percent_tax' => '0'));\n }\n if ($this->conditions->price->min) {\n $prodSql->having(\"{$this->subquery->actualPrice} >= ?\", array($this->conditions->price->min));\n }\n if ($this->conditions->price->max) {\n $prodSql->having(\"{$this->subquery->actualPrice} <= ?\", array($this->conditions->price->max));\n }\n }\n \n if ($this->conditions->rating) {\n $prodSql->innerJoin(array('r1' => 'review'), 'r1.product_id = p.product_id', array('total' => 'AVG(rating)'))\n ->where(\"r1.status = '1'\")\n ->having('ROUND(total) IN ('. implode(',', $this->conditions->rating[0]) . ')')\n ->group(array('p.product_id'));\n } \n\n if ($this->conditions->price || $this->conditions->rating) {\n $exclude = new SqlStatement();\n $exclude->select()->from(array('p' => self::RESULTS_TABLE));\n if ($this->conditions->price) {\n if ($this->conditions->price->min) {\n $exclude->where(\"{$this->subquery->actualPrice} >= ?\", array($this->conditions->price->min));\n }\n if ($this->conditions->price->max) {\n $exclude->where(\"{$this->subquery->actualPrice} <= ?\", array($this->conditions->price->max));\n }\n }\n\n if ($this->conditions->rating) {\n $exclude->where('ROUND(total) IN ('. implode(',', $this->conditions->rating[0]) . ')');\n }\n } else {\n $exclude = self::RESULTS_TABLE;\n }\n \n \n $inStock = (int)self::$IN_STOCK_STATUS;\n \n $sql = new SqlStatement();\n $sql->select(array(\n 'id' => \"af.group_id\", \n 'val' => \"IF (af.type = 'STOCK_STATUS' AND p.quantity > 0, {$inStock}, af.value)\", \n 'type' => 'af.type',\n ))\n ->from(array('af' => self::FILTERS_TABLE))\n ->innerJoin(array('p' => $prodSql), 'af.product_id = p.product_id')\n ->innerJoin(array('p2s' => 'product_to_store'), 'p.product_id = p2s.product_id')\n ->leftJoin(array('exclude' => $exclude), 'af.product_id = exclude.product_id')\n ->where('exclude.product_id IS NULL')\n ->where('p2s.store_id = ?', (int)$this->config->get('config_store_id'))\n ->where(\"p.status = '1'\")\n ->where('p.date_available <= NOW()')\n ->group(array('af.product_id', 'af.type', 'af.group_id', 'af.value'));\n \n if (count($this->aggregate)) {\n $con = array();\n foreach ($this->aggregate as $type => $group) {\n foreach ($group as $groupId => $values) {\n $a = strtolower(substr($type, 0, 1)) . $groupId;\n $sql->innerJoin(array($a => self::FILTERS_TABLE), 'p.product_id = ' . $a . '.product_id')\n ->where($a . '.type = ?', array($type))\n ->where($a . '.group_id = ?', array($groupId));\n // the following mess in conditions is caused by a need \n // of handling the correct stock status \"In stock\".\n if ($type !== 'STOCK_STATUS') {\n $where = \"$a.value IN (\" . implode(', ', $values) . \")\";\n } else {\n $where = array();\n foreach ($values as $val) {\n $where[] = \"($a.value = {$val}\" . ($val != $inStock ? ' AND p.quantity = 0' : ' OR p.quantity > 0') . \")\";\n }\n $where = \"(\" . implode(' OR ', $where) . \")\";\n }\n $sql->where(\"({$where} OR af.aggregate_filter_id = $a.aggregate_filter_id)\");\n }\n $con[] = \"(af.type = '$type' AND af.group_id IN (\" . implode(',', array_keys($group)) . \"))\";\n }\n $sql->multipleWhere($con);\n }\n \n \n if ( self::$HIDE_OUT_OF_STOCK ) {\n $sql->leftJoin(array('pov' => 'product_option_value'), 'af.product_id = pov.product_id AND af.value = pov.option_value_id AND af.type = \"OPTION\"')\n ->leftJoin(array('pov1' => 'product_option_value'), 'p.product_id = pov1.product_id');\n $vals = array();\n if (isset($this->aggregate['OPTION'])) {\n foreach ($this->aggregate['OPTION'] as $values) {\n $vals = array_merge($vals, $values);\n }\n }\n $or = array(\n '(pov1.quantity IS NULL AND p.quantity > 0)',\n 'pov.quantity > 0'\n );\n if (count($vals)) {\n $or[] = '(pov1.quantity > 0 AND pov1.option_value_id IN (' . implode(',', $vals) . '))';\n } else {\n $or[] = '(pov1.quantity > 0 AND af.type != \"OPTION\")';\n }\n $sql->where('(' . implode(' OR ', $or) . ')');\n }\n \n $groupSql = new SqlStatement();\n $groupSql->select(array('id', 'val', 'c' => 'COUNT(*)', 'type'))\n ->from(array('tt' => $sql))\n ->group(array('type', 'id', 'val'));\n \n $res = $this->db->query($groupSql);\n\n return $res->rows;\n }", "function getCountSQL()\n{\n global $User;\n $listFilterSQL = $User->getListFilterSQL($this->moduleID);\n if(empty($this->countSQL)){\n if(empty($this->fromSQL)){\n $SQL = 'SELECT COUNT(*) FROM ('. $this->listSQL . $listFilterSQL . ') as row_count';\n } else {\n $SQL = 'SELECT Count(*) ' . $this->fromSQL . $listFilterSQL;\n }\n } else {\n $SQL = $this->countSQL . $listFilterSQL;\n }\n return $SQL;\n}", "function create_list_count_query($where) {\r\n\t\t$q = parent::create_list_count_query($where);\r\n\t\t$q = preg_replace ('/select\\s+count\\(\\*\\)\\s+c/i', \"SELECT COUNT(DISTINCT `$this->table_name`.id) c\", $q);\r\n $q = preg_replace(\"/GROUP\\s+BY\\s+`$this->table_name`.id\\s*$/i\", '', $q);\r\n\t\treturn $q;\r\n\t}", "function total_rowskhusus($q = NULL) {\n $this->db->like('id_persediaan', $q);\n $this->db->or_like('id_puskesmas', $q);\n $this->db->or_like('kode', $q);\n $this->db->or_like('stok_awal', $q);\n $this->db->from($this->table);\n return $this->db->count_all_results();\n }", "public function get_products()\r\n {\r\n if($this->db->count_all($this->_table)==0) return false;\r\n \r\n //lay danh sach cac san pham trong bang comment\r\n $this->db->distinct('product_id');\r\n $this->db->select('product_id');\r\n $this->db->order_by('product_id','asc');\r\n $pro_id = $this->db->get($this->_table)->result_array();\r\n \r\n //dem so comment cho moi san pham\r\n $this->db->order_by('product_id','asc');\r\n $this->db->group_by('product_id');\r\n $this->db->select('count(comment_id) as count');\r\n $pro_count = $this->db->get($this->_table)->result_array();\r\n \r\n foreach($pro_id as $value)\r\n {\r\n $key[] = $value['product_id'];\r\n }\r\n foreach($pro_count as $value)\r\n {\r\n $num[] = $value['count'];\r\n }\r\n //tao mang co key la product_id value la so comment va tra ve mang nay \r\n return array_combine($key, $num);\r\n }", "function allposts_count_Detail()\n { \n $query = $this->db->query(\"select a.fc_id,a.fc_branch,a.fc_nopo,a.fc_stock,b.fv_stock,CONCAT(b.fv_size,' | ',b.fv_warna) as variant,c.fv_satuan,rupiah(a.fn_price) as price,a.fn_qty,c.fn_uom,(a.fn_qty * c.fn_uom) as konversi,rupiah(a.fn_total) as total from td_po a LEFT OUTER JOIN v_variant b ON b.fc_stock=a.fc_stock AND b.fc_variant=a.fc_variant LEFT OUTER JOIN v_uom c ON c.fc_uom=a.fc_satuan WHERE a.fc_branch='\".$this->session->userdata('branch').\"' and a.fc_nopo='\".$this->session->userdata('userid').\"'\");\n return $query->num_rows(); \n }", "public function getProductCount()\n {\n return count($this->products);\n }", "function get_product_count_from_transaction( $conds = array() )\n\t{\n\t\n\t\t$sql = \"SELECT SUM(`qty`) as total FROM `rt_transactions_detail` WHERE `transactions_header_id` = '\" . $conds['trans_header_id'] . \"'\";\n\n\n\t\t$query = $this->db->query($sql);\n\n\t\treturn $query;\n\t\t\n\t}", "function count_all() {\n $this->db->from('offices');\n $this->db->join('offices_info', 'offices.office_id = offices_info.officeID', 'left');\n $this->db->where('offices.deleted', 0);\n return $this->db->count_all_results();\n }" ]
[ "0.6860065", "0.64586604", "0.6401342", "0.6273664", "0.6234657", "0.6221779", "0.618001", "0.61699814", "0.6071429", "0.6009098", "0.59950674", "0.59825134", "0.59689444", "0.5936221", "0.5932146", "0.5905799", "0.58970314", "0.58534", "0.58518595", "0.581405", "0.5784323", "0.57826126", "0.5779942", "0.5774589", "0.5765581", "0.5760216", "0.57596344", "0.57578385", "0.57558095", "0.5739215", "0.57360816", "0.57226956", "0.5699689", "0.5699324", "0.56863296", "0.56817025", "0.56696373", "0.566555", "0.5662216", "0.5658574", "0.562779", "0.5620718", "0.56138164", "0.56131667", "0.5611385", "0.5592361", "0.5588817", "0.558512", "0.55782926", "0.55678135", "0.55512714", "0.5534577", "0.55301356", "0.55209315", "0.55171824", "0.55113643", "0.5508289", "0.55078214", "0.55036277", "0.5502527", "0.54875207", "0.5485715", "0.5481134", "0.5480733", "0.5474533", "0.54530936", "0.5452011", "0.5450531", "0.5449254", "0.5449254", "0.5447913", "0.54259324", "0.54170275", "0.5415491", "0.541444", "0.54134154", "0.54065377", "0.5391705", "0.5389726", "0.5378313", "0.5375572", "0.53613526", "0.5358997", "0.5358871", "0.53489757", "0.5347265", "0.5346637", "0.53446245", "0.5341159", "0.53392905", "0.533791", "0.53362876", "0.53356415", "0.5328887", "0.53246504", "0.53202206", "0.53038496", "0.5297754", "0.52964634", "0.52945405", "0.52855045" ]
0.0
-1
$sql= "SELECT ep.parent_product_id,p.model FROM `".DB_PREFIX."extend_to_product` ep left join product p on p.product_id = ep.parent_product_id WHERE ep.product_id = '" . (int)$product_id . "'";
public function getProductParent($product_id = 0){ $sql = "SELECT product_id as parent_product_id, model FROM `".DB_PREFIX."product` where product_id = '" . (int)$product_id . "'"; $query = $this->db->query($sql); return $query->rows; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function join_product_table(){\n global $db;\n $sql =\" SELECT p.id,p.name,p.keywords,p.quantity,p.url,p.buy_price,p.sale_price,p.media_id,p.date,c.name\";\n $sql .=\" AS categorie,m.file_name AS image\";\n $sql .=\" FROM products p\";\n $sql .=\" LEFT JOIN categories c ON c.id = p.categorie_id\";\n $sql .=\" LEFT JOIN media m ON m.id = p.media_id\";\n $sql .=\" ORDER BY p.id ASC\";\n return find_by_sql($sql);\n\n }", "public function listProductsPack($params)\n{\n // $prdId = $this->db->real_escape_string($params);\n // $qry = \"SELECT pr.prd_id, pr.prd_sku, pr.prd_name, pr.prd_price, pk.prd_parent \n // FROM ctt_products_packages AS pk\n // INNER JOIN ctt_products AS pr ON pr.prd_id = pk.prd_id\n // WHERE pk.prd_parent = $prdId AND prd_status =1;\";\n // return $this->db->query($qry);\n}", "function prodname()\r\n {\r\n //left join oc_product as op on opd.product_id=op.product_id \");\r\n\r\n //return $query->rows; \r\n \r\n $query = $this->db->query(\"SELECT product_id,model,sku FROM `oc_product` WHERE `status`='1'\");\r\n \r\n return $query->rows;\r\n }", "function getProducts($product_id){\n\t\t$this->db->select('product_id,product_code');\n\t\t$this->db->where('product_id',$product_id);\n\t\t$query = $this->db->get($this->tableName);\n\t\t$row = $query->row();\n\t\t$this->db->where('isdeleted',0);\n\t\t$this->db->where('parent_code_id',$row->product_code);\n\t\t$query = $this->db->get($this->tblProducts);\n\t\treturn $query->result();\n\t}", "function selectProducts() {\n\n\tglobal $db;\n\n\tglobal $result;\n\n\t$query = \"SELECT * FROM products \";\n\t$query .= \"LEFT JOIN sub_category ON products.p_sub_id = sub_category.sub_id\";\n\n\t$result = mysqli_query($db, $query);\n\n\tconfirmQuery($result);\n}", "function getallproducts($warehouseid){\n \n $result = $this->db->query(\"SELECT a.*, \n b.id AS productid, b.`name` AS productname, b.`main_image` AS productimage, \n b.`price` AS product_price, b.`tax` AS product_tax, b.`description` AS product_description, b.`move_product_id` AS productuniqueid_forimages,\n c.`name` AS cat_name, c.`image` AS cat_image, d.`name` AS subcat_name, d.`image` AS subcat_image\n FROM warehouse_products a LEFT JOIN products b ON a.product=b.`id` LEFT JOIN category c ON b.`category_id` = c.`category_id` LEFT JOIN category d \n ON b.`sub_category_id` = d.`category_id` WHERE a.`warehouse` = \".$warehouseid.\" ORDER BY c.`name`, d.`name`\")->result();\n return $result;\n \n }", "public function find($id = 0)\n {\n\n $sql = 'SELECT products.id , product_name, categories.category_name, product_sku FROM `products`\n INNER JOIN product_properties_values on product_properties_values.id_product = products.id\n INNER JOIN categories on categories.id = product_properties_values.property_value\n WHERE products.id = ?';\n\n $sqlData = [(int)$id];\n $app = Application::instance();\n $product['header'] = $this->catalog = $app->db()->getArrayBySqlQuery($sql,$sqlData);\n\n /*$sql = 'SELECT products.product_name, products.product_price, products.product_sku FROM products\n WHERE products.id_parent_product ='. (int)$id\n ;*/\n\n\n $sql = 'SET @SQL = NULL';\n $app->db()->getArrayBySqlQuery($sql);\n $sql = 'SELECT\n GROUP_CONCAT(DISTINCT\n CONCAT(\\'GROUP_CONCAT(IF(pr.product_property_name = \\\"\\', pr.`product_property_name`, \\'\\\", pp.property_value, NULL)) AS \\', pr.`product_property_name`)\n ) INTO @SQL\n FROM product_properties AS pr';\n $app->db()->getArrayBySqlQuery($sql);\n $sql = 'SET @SQL = CONCAT(\\'SELECT p .*, \\', @SQL, \\'\n FROM products AS p\n LEFT JOIN product_properties_values AS pp ON (p.id = pp.id_product)\n LEFT JOIN product_properties AS pr ON (pr.id = pp.id_property)\n WHERE p.id_parent_product =' . (int)$id . '\n AND deleted is NULL\n GROUP BY p.id ;\\')';\n $app->db()->getArrayBySqlQuery($sql);\n $sql = 'PREPARE stmt FROM @SQL';\n $app->db()->getArrayBySqlQuery($sql);\n $sql = 'EXECUTE stmt';\n $product['list'] = $app->db()->getArrayBySqlQuery($sql);\n $sql = 'DEALLOCATE PREPARE stmt';\n $app->db()->getArrayBySqlQuery($sql);\n\n foreach ($product['list'] as $key => $good) {\n $product['list'][$key]['Photo'] = explode(',', $product['list'][$key]['Photo']);\n }\n\n\n $this->product = $product;\n\n\n return $this->product;\n }", "function tep_subproducts_parent($products_id) {\n\t$product_sub_product_query = tep_db_query(\"select products_parent_id from \" . TABLE_PRODUCTS . \" p where p.products_id = '\" . (int)$products_id . \"'\");\n\t$product_sub_product = tep_db_fetch_array($product_sub_product_query);\n\tif ($product_sub_product['products_parent_id'] > 0){\n\t\treturn $product_sub_product['products_parent_id'];\n\t} else {\n\t\treturn false;\n\t}\n}", "public function listProductsRelated($params)\n{\n $type = $this->db->real_escape_string($params['type']);\n $prdId = $this->db->real_escape_string($params['prdId']);\n\n if ($type == 'K'){\n $qry = \"SELECT pr.*, sc.sbc_name, ct.cat_name \n FROM ctt_products AS pr\n INNER JOIN ctt_subcategories AS sc ON sc.sbc_id = pr.sbc_id\n INNER JOIN ctt_categories AS ct ON ct.cat_id = sc.cat_id\n WHERE prd_id = $prdId AND pr.prd_status = 1 AND sc.sbc_status = 1 AND ct.cat_status = 1\n UNION\n SELECT pr.*, sc.sbc_name, ct.cat_name \n FROM ctt_products_packages AS pk\n INNER JOIN ctt_products AS pr ON pr.prd_id = pk.prd_id\n INNER JOIN ctt_subcategories AS sc ON sc.sbc_id = pr.sbc_id\n INNER JOIN ctt_categories AS ct ON ct.cat_id = sc.cat_id\n WHERE pk.prd_parent = $prdId AND pr.prd_status = 1 AND sc.sbc_status = 1 AND ct.cat_status = 1;\";\n return $this->db->query($qry);\n // cambio ac.prd_id por prd_parent\n } else if($type == 'P') {\n $qry = \"SELECT pr.*, sc.sbc_name, ct.cat_name \n FROM ctt_products AS pr\n INNER JOIN ctt_subcategories AS sc ON sc.sbc_id = pr.sbc_id\n INNER JOIN ctt_categories AS ct ON ct.cat_id = sc.cat_id\n WHERE prd_id = $prdId AND pr.prd_status = 1 AND sc.sbc_status = 1 AND ct.cat_status = 1\n UNION\n SELECT pr.*, sc.sbc_name, ct.cat_name \n FROM ctt_accesories AS ac\n INNER JOIN ctt_products AS pr ON pr.prd_id = ac.prd_parent \n INNER JOIN ctt_subcategories AS sc ON sc.sbc_id = pr.sbc_id\n INNER JOIN ctt_categories AS ct ON ct.cat_id = sc.cat_id\n WHERE ac.prd_parent = $prdId AND pr.prd_status = 1 AND sc.sbc_status = 1 AND ct.cat_status = 1;\";\n return $this->db->query($qry);\n\n } else {\n $qry = \"SELECT * FROM ctt_products WHERE prd_id = $prdId\";\n return $this->db->query($qry);\n }\n}", "public static function select_product_by_id($data)\n {\n \n try{\n $product_id=$data['product_id'];\n $productquery = new Query;\n $productdata = $productquery->select(['core_products.*','core_product_categories.category_name','core_product_sub_categories.sub_category_name', 'core_product_models.model_name','core_product_categories.metric','core_product_images.*'])\n ->from('core_products')\n ->leftJoin('core_product_categories', 'core_product_categories.category_id=core_products.category_id')\n ->leftJoin('core_product_sub_categories', 'core_product_sub_categories.sub_category_id=core_products.sub_category_id')\n ->leftJoin('core_product_models', 'core_product_models.model_id=core_products.model_id')\n ->innerJoin('core_product_images', 'core_product_images.product_id=core_products.product_id')\n ->orderBy(['core_products.product_id' => SORT_DESC])\n ->groupBy(['core_products.product_id'])\n ->limit(1)\n ->where(\"core_products.product_id = $product_id\")\n ->all();\n $product = (object)$productdata[0];\n $imagequery = new Query;\n $productimages = $imagequery->select(['*'])\n ->from('core_product_images')\n ->where(\"product_id = $product_id\")\n ->all();\n \n $tax_details = new Query;\n $tax_ids= explode(',',$product->life_tax_details);\n $tax_regions = $tax_details->select(['region_name'])\n ->from('core_regions')\n ->where(['region_id' => $tax_ids])\n ->all();\n $life_tax_details='';\n foreach($tax_regions as $index=>$region_name)\n {\n if($index==0)\n $life_tax_details = $region_name['region_name'];\n else\n $life_tax_details .= ', '.$region_name['region_name'];\n }\n $common_value = \"Not Available\";\n //variable to dispaly product title\n $product_title = $product->equipment_title.' <span><i class=\"fa fa-check-circle\"></i> In Stock</span>';\n \n //variable to display product navigation\n $product_navs ='<li role=\"presentation\" class=\"active\"><a href=\"#cranedetails\" aria-controls=\"details\" role=\"tab\" data-toggle=\"tab\">Details</a></li>\n <li role=\"presentation\"><a href=\"#craneimages\" aria-controls=\"craneimages\" role=\"tab\" data-toggle=\"tab\">Images</a></li>';\n $loadchartcount = 0;\n foreach($productimages as $index=>$image)\n {\n $image = (object)$image;\n if($image->image_type == 2) $loadchartcount++; \n }\n \n if($product->category_id ==1)\n $product_navs .='<li role=\"presentation\"><a href=\"#loadcharts\" aria-controls=\"loadcharts\" role=\"tab\" data-toggle=\"tab\">Load Charts</a></li>';\n $price_type = ''; $place_holder_price_type = '';\n if(@$product->price_type == 1)\n {\n @$price_type = \"Daily\"; \n $place_holder_price_type ='Days';\n }\n else if(@$product->price_type == 2)\n {\n @$price_type = \"Monthly\"; \n $place_holder_price_type ='Months';\n }\n \n //variable to display product details\n $product_details ='<div role=\"tabpanel\" class=\"tab-pane active\" id=\"cranedetails\">\n <div class=\"b-t-b-grey flex\">\n <img width=\"209px\" height=\"194px\" src=\"'.$product->image_url.'\" alt=\"\">\n <p>'.$product->description.'</p>\n </div>\n <div class=\"col-md-6\">\n <ul class=\"cranedtlslist\">\n <li><strong>Code: </strong> '.$product->manual_product_code.'</li>';\n if($product->product_type == 0)\n {\n if($product->hire_price == -1)\n $product_details .= '<li data-toggle=\"popover\" data-trigger=\"hover\" data-content=\"PRICE ON REQUEST\" onmouseover=\"mousepopover();\"><strong>Hire Price: </strong> <strong><i class=\"fa fa-rupee\"></i></strong> PRICE ON REQUEST/'.$price_type.'</li>'; \n else\n $product_details .= '<li><strong>Hire Price: </strong> <strong><i class=\"fa fa-rupee\"></i></strong> '.$product->hire_price.'/'.$price_type.'</li>'; \n }\n else if($product->product_type == 1)\n {\n if($product->sale_price == -1)\n $product_details .= '<li data-toggle=\"popover\" data-trigger=\"hover\" data-content=\"PRICE ON REQUEST\" onmouseover=\"mousepopover();\"><strong>Sale Price: </strong> <strong><i class=\"fa fa-rupee\"></i></strong> PRICE ON REQUEST </li>'; \n else\n $product_details .= '<li ><strong>Sale Price: </strong> <strong><i class=\"fa fa-rupee\"></i></strong> '.$product->sale_price.'</li>'; \n }\n else if($product->product_type == 2)\n {\n if($product->hire_price == -1)\n $product_details .= '<li data-toggle=\"popover\" data-trigger=\"hover\" data-content=\"PRICE ON REQUEST\" onmouseover=\"mousepopover();\"><strong>Hire Price: </strong> <strong><i class=\"fa fa-rupee\"></i></strong> PRICE ON REQUEST/'.$price_type.'</li>'; \n else\n $product_details .= '<li><strong>Hire Price: </strong> <strong><i class=\"fa fa-rupee\"></i></strong> '.$product->hire_price.'/'.$price_type.'</li>'; \n \n \n if($product->sale_price == -1)\n $product_details .= '<li data-toggle=\"popover\" data-trigger=\"hover\" data-content=\"PRICE ON REQUEST\" onmouseover=\"mousepopover();\"><strong>Sale Price: </strong> <strong><i class=\"fa fa-rupee\"></i></strong> PRICE ON REQUEST </li>'; \n else\n $product_details .= '<li ><strong>Sale Price: </strong> <strong><i class=\"fa fa-rupee\"></i></strong> '.$product->sale_price.'</li>'; \n }\n \n \n $product_details .= '<li><strong>Capacity: </strong> '.$product->capacity.'</li>';\n $product_details .= '<li><strong>Category: </strong> '.$product->category_name.'</li>';\n $product_details .= '<li><strong>Sub category: </strong> '.$product->sub_category_name.'</li>';\n \n \n /*if($product->model_name != '')\n {\n $product_details .= '<li ><strong>Model: </strong>'.$product->model_name.'</li>'; \n }\n if($product->model_other != '')\n {\n $product_details .= '<li ><strong>Model Other: </strong> '.$product->model_other.'</li>'; \n }*/\n\tif($product->model_name != '' && $product->model_name != 'Custom')\n {\n $product_details .= '<li ><strong>Model: </strong>'.$product->model_name.'</li>'; \n }\n if($product->model_other != '')\n {\n //$product_details .= '<li ><strong>Model Other: </strong> '.$product->model_other.'</li>'; \n $product_details .= '<li ><strong>Model: </strong> '.$product->model_other.'</li>'; \n }\n if($product->current_location != '')\n {\n $pos = strrpos( $product->current_location, ',');\n if ($pos > 0) { // try to find the second one\n $npath = substr($product->current_location, 0, $pos);\n $npos = strrpos($npath, ',');\n if ($npos !== false) {\n $currentlocation = substr($product->current_location, $npos+1);\n } \n else {\n $currentlocation =$product->current_location;\n \n }\n }\n $product_details .= '<li ><strong>Location: </strong>'.$currentlocation.'</li>'; \n }\n \n $product_details .= '</ul></div><div class=\"col-md-6\">\n <ul class=\"cranedtlslist\">';\n if($product->category_id == '1')\n {\n if($product->fly_jib)\n $product_details .= '<li ><strong>Fly jib:</strong> '.$product->fly_jib.' meters</li>';\n else\n $product_details .= '<li ><strong>Fly jib:</strong> '.$common_value.'</li>';\n }\n \n if($product->category_id == '1')\n {\n if($product->luffing_jib)\n $product_details .= '<li ><strong>Luffing jib:</strong>'.$product->luffing_jib.' meters</li>'; \n else\n $product_details .= '<li ><strong>Luffing jib:</strong> '.$common_value.'</li>';\n \n }\n if($product->category_id == '1' || $product->category_id == '2')\n {\n if($product->registered_number)\n $product_details .= '<li ><strong>Registered Number:</strong> '.$product->registered_number.'</li>'; \n else\n $product_details .= '<li ><strong>Registered Number:</strong> '.$common_value.'</li>'; \n }\n \n if($life_tax_details)\n $product_details .= '<li ><strong>Life Tax Details:</strong> '.$life_tax_details.'</li>'; \n else\n $product_details .= '<li ><strong>Life Tax Details:</strong> '.$common_value.'</li>'; \n \n if($product->condition != '')\n {\n $product_details .= '<li ><strong>Condition:</strong> '.$product->condition.'</li>'; \n }\n if($product->category_id == '3')\n {\n if($product->bucket_capacity)\n $product_details .= '<li ><strong>Bucket Capacity:</strong> '.$product->bucket_capacity.' Cubic Metres</li>'; \n else\n $product_details .= '<li ><strong>Bucket Capacity:</strong> '.$common_value.'</li>'; \n }\n if($product->manufacture_year != '')\n {\n if($product->manufacture_year)\n $product_details .= '<li ><strong>Manufacture year:</strong> '.$product->manufacture_year.'</li>'; \n else\n $product_details .= '<li ><strong>Manufacture year:</strong> '.$common_value.'</li>'; \n }\n if($product->category_id == '1')\n {\n if($product->boom_length)\n $product_details .= '<li ><strong>Boom Length:</strong> '.$product->boom_length.' meters</li>'; \n else\n $product_details .= '<li ><strong>Boom Length:</strong> '.$common_value.'</li>'; \n }\n if($product->category_id == '5')\n {\n if($product->kelly_length)\n $product_details .= '<li ><strong>Kelly Length: </strong>'.$product->kelly_length.' meters</li>'; \n else\n $product_details .= '<li ><strong>Kelly Length: </strong>'.$common_value.'</li>'; \n } \n if($product->category_id == '3')\n {\n if($product->arm_length)\n $product_details .= '<li ><strong>Arm Length: </strong>'.$product->arm_length.' meters</li>'; \n else\n $product_details .= '<li ><strong>Arm Length: </strong>'.$common_value.'</li>'; \n }\n if($product->category_id == '2')\n {\n if($product->numberof_axles)\n $product_details .= '<li ><strong>Number of axles: </strong> '.$product->numberof_axles.'</li>'; \n else\n $product_details .= '<li ><strong>Number of axles: </strong> '.$common_value.'</li>'; \n }\n \n if($product->dimensions && $product->dimensions!= '0x0x0')\n $product_details .= '<li ><strong>Dimensions: </strong> '.$product->dimensions .'</li>'; \n else\n $product_details .= '<li ><strong>Dimensions: </strong> '.$common_value.'</li>'; \n \n $product_details .='</ul></div></div>';\n \n $gallery_thumb = '';$gallery = '';$load_charts_thumb = '';$load_charts=''; $i=0; $j=0;\n foreach($productimages as $index=>$image)\n {\n $image = (object)$image;\n if($image->image_type == 1)\n {\n \n if($i==0) $active= 'active'; else $active = '';\n $gallery_thumb .='<li><a class=\"thumbnail\" id=\"carousel-selector-'.$i.'\"><img width=\"100px\" height=\"74px\" src=\"'.$image->image_url.'\"></a></li>';\n $gallery .= '<div class=\"item '.$active.'\" data-slide-number=\"'.$i.'\"><img src=\"'.$image->image_url.'\"></div>';\n $i++; \n }\n else if($image->image_type == 2)\n {\n \n if($j==0) $active= 'active'; else $active = '';\n $load_charts_thumb .='<li><a class=\"thumbnail\" id=\"carousel-selector-'.$j.'\"><img width=\"100px\" height=\"74px\" src=\"'.$image->image_url.'\"></a></li>';\n $load_charts .= '<div class=\"item '.$active.'\" data-slide-number=\"'.$j.'\"><img src=\"'.$image->image_url.'\"></div>';\n $j++;\n }\n \n \n }\n //variable to display images slider\n $image_block ='<div role=\"tabpanel\" class=\"tab-pane\" id=\"craneimages\">\n <div class=\"col-sm-2\" id=\"slider-thumbs\">\n <!-- Bottom switcher of slider -->\n <ul class=\"hide-bullets\">'.$gallery_thumb.'</ul>\n </div>\n <div class=\"col-sm-10\">\n <div class=\"col-xs-12\" id=\"slider\">\n <!-- Top part of the slider -->\n <div class=\"row\">\n <div class=\"col-sm-12\" id=\"carousel-bounding-box\">\n <div class=\"carousel slide\" id=\"myCarousel\">\n <!-- Carousel items -->\n <div class=\"carousel-inner\">'.$gallery.'</div>\n <!-- Carousel nav -->\n <a class=\"left carousel-control\" href=\"#myCarousel\" role=\"button\" data-slide=\"prev\">\n <span class=\"glyphicon glyphicon-chevron-left\"></span>\n </a>\n <a class=\"right carousel-control\" href=\"#myCarousel\" role=\"button\" data-slide=\"next\">\n <span class=\"glyphicon glyphicon-chevron-right\"></span>\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>';\n //variable to display load charts if exists.\n if($loadchartcount >0)\n {\n $product_load_charts ='<div role=\"tabpanel\" class=\"tab-pane\" id=\"loadcharts\">\n <div class=\"col-sm-2\" id=\"slider-thumbs\">\n <!-- Bottom switcher of slider -->\n <ul class=\"hide-bullets\">'.$load_charts_thumb.'</ul>\n </div>\n <div class=\"col-sm-10\">\n <div class=\"col-xs-12\" id=\"slider\">\n <!-- Top part of the slider -->\n <div class=\"row\">\n <div class=\"col-sm-12\" id=\"carousel-bounding-box\">\n <div class=\"carousel slide\" id=\"load_chart_carousel\">\n <!-- Carousel items -->\n <div class=\"carousel-inner\">'.$load_charts.'</div>\n <!-- Carousel nav -->\n <a class=\"left carousel-control\" href=\"#load_chart_carousel\" role=\"button\" data-slide=\"prev\">\n <span class=\"glyphicon glyphicon-chevron-left\"></span>\n </a>\n <a class=\"right carousel-control\" href=\"#load_chart_carousel\" role=\"button\" data-slide=\"next\">\n <span class=\"glyphicon glyphicon-chevron-right\"></span>\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div><div class=\"clearfix\"></div>';\n }\n else\n {\n $product_load_charts ='<div role=\"tabpanel\" class=\"tab-pane\" id=\"loadcharts\">\n <center><h4>Load Charts Not Available</h4></center>\n </div><div class=\"clearfix\"></div>';\n }\n \n //condition to check which button to display \n if(Yii::$app->user->id != $product->user_id)\n {\n\t if($product->product_type == 0)\n \t$hirenowbutton = '<button type=\"button\" class=\"btn btn-bei\" onclick=\"order_now('.$product->product_id.',0);\">Hire Now</button>';\n else if($product->product_type == 1)\n \t$hirenowbutton = '<button type=\"button\" class=\"btn btn-bei\" onclick=\"order_now('.$product->product_id.',1);\">Buy Now</button>';\n else if($product->product_type == 2)\n \t$hirenowbutton = '<button type=\"button\" class=\"btn btn-bei\" onclick=\"order_now('.$product->product_id.',2);\">Hire / Buy</button>';\n }\n else\n {\n $hirenowbutton = '';\n }\n $data['title'] = $product_title;\n $data['navs'] = $product_navs;\n $data['details'] = $product_details;\n $data['images'] = $image_block;\n $data['load_charts'] = $product_load_charts;\n $data['hire_now_button'] = $hirenowbutton;\n $data['price_type'] = $place_holder_price_type;\n return $data;\n \n }catch (ErrorException $ex) {\n Yii::warning($ex->getMessage());\n }\n \n \n \n }", "public function getProduct0()\n {\n return $this->hasOne(Products::className(), ['id' => 'product']);\n }", "function get_product($catalog_id)\r\n {\r\n $query = \"select product.* , \r\n image.image_name from product\r\n left join image \r\n on image.image_id = product.product_image\r\n where product.catalog_name = '\".$catalog_id.\"' \r\n ORDER BY product.product_id DESC \";\r\n \r\n \r\n // echo $query;\r\n $result = $this->getResult($query);\r\n if ($result)\r\n { $total_product = 1; ?>\r\n <div class=\"row no-space\">\r\n <div class=\"span9 \">\r\n <div class=\"carousel jcarousel \" id=\"myCarousel\">\r\n <div class=\"carousel-inner\">\r\n <div class=\"item active\">\r\n <div class=\"row\">\r\n \r\n <?php while($product = mysql_fetch_object($result)): ?>\r\n \r\n <div class=\"span2\">\r\n <div class=\"product-menu-list\">\r\n <a class=\"product-menu-list-btn\" href=\"<?php echo $product->product_id; ?>\">\r\n <img src=\"<?php echo FONTEND_IMAGE_PATH.$product->image_name ;?>\" alt=\"\">\r\n <div><p><?php echo $product->product_name; ?></p></div>\r\n </a>\r\n </div>\r\n </div>\r\n \r\n <?php \r\n $total_product++;\r\n endwhile; ?>\r\n <!-- <div class=\"span2\">\r\n <div class=\"product-menu-list\">\r\n <a href=\"\"><img src=\"img/product/38635.jpg\" alt=\"\">\r\n <div><p>text</p></div>\r\n </a>\r\n </div>\r\n </div> -->\r\n \r\n\r\n </div> <!-- end row -->\r\n </div> <!-- end item --> \r\n </div> <!-- end carousel-inner -->\r\n <?php if($total_product > 5): ?>\r\n <a class=\"carousel-control left\" href=\"#myCarousel\" data-slide=\"prev\">&lsaquo;</a>\r\n <a class=\"carousel-control right\" href=\"#myCarousel\" data-slide=\"next\">&rsaquo;</a>\r\n <? endif; ?>\r\n </div> <!-- end carousel jcarousel -->\r\n\r\n </div>\r\n </div> \r\n <?php \r\n \r\n }\r\n \r\n \r\n }", "public function getSingleProduct($id){\r\n\r\n\t$query = \"SELECT p.*,c.catName,b.brandName\r\nFROM tbl_product as p,tbl_category as c, tbl_brand as b\r\nWHERE p.catId = c.catId AND p.brandId = b.brandId AND p.productId = '$id'\";\r\n\t$result = $this->db->select($query);\r\n\treturn $result;\r\n}", "function relatedProductsSearch($product_type_id, $product_id)\n\t\t\t\t{\n\t\t\t\t$sql= 'SELECT product. *\n\t\t\t\tFROM product\n\t\t\t\tWHERE product.product_type_id = '.$product_type_id.'\n\t\t\t\tAND product.product_id != '.$product_id.'\n\t\t\t\tORDER BY product.product_id DESC';\n\t\t\t\t\n\t\t\t\t$Q = $this-> db-> query($sql);\n\t\t\t\tforeach ($Q-> result_array() as $row){\n\t\t\t\t}\n\t\t\t\treturn $Q;\n\t\t\t\t}", "function find_all_sale(){\n global $db;\n $sql = \"SELECT s.id,s.qty,s.price,s.date,p.name\";\n $sql .= \" FROM sales s\";\n $sql .= \" LEFT JOIN products p ON s.product_id = p.id\";\n $sql .= \" ORDER BY s.date DESC\";\n return find_by_sql($sql);\n }", "public function products(){\n return $this->hasMany(InvoiceProduct::class);\n //->leftJoin('invoice_product','products.id','invoice_product.product_id');\n //return $this->belongsToMany(Product::class);\n }", "function get_numeracion_by_producto($id,$p_num)\n{\n\t$ef = new Producto_numeracion();\n $sql=\"select p.id as cproducto_id,p.descripcion as tag, pn.numero_mm as talla, pn.id as \n numeracion_id\n from\n cproductos as p\n join cproductos_numeracion as pn\n on pn.cproducto_id=p.id\n where\n p.id='$id'\n and\n pn.id='$p_num'\n and\n p.estatus_general_id='1'\";\n\t//Buscar en la base de datos\n\t//$ef->where('cproducto_id', $id)->where('estatus_general_id',1)->order_by('numero_mm')->ge\n\n\t\n $ef->query($sql);\n if($ef->c_rows>0){\n\t\treturn $ef;\n\t} else {\n\t\treturn FALSE;\n\t}\n}", "public function get_branch_products($branch_id)\n {\n // LEFT JOIN branch_products bp ON (p.product_id = bp.product_id)\n // WHERE branch_id=$branch_id\n // GROUP BY p.product_id \"); \n\n $query = $this->db->query(\" SELECT p.product_id, p.name AS product_name,p.price AS default_price,p.product_code AS productcode,bp.*,`pc`.`name` AS catName FROM product p LEFT JOIN branch_products bp ON (p.product_id = bp.product_id) LEFT JOIN branch b ON b.branch_id = bp.branch_id\n LEFT JOIN product_category pc ON pc.product_category_id = p.product_category_id WHERE bp.branch_id=$branch_id AND b.brand_id=(SELECT brand_id FROM branch b WHERE branch_id=$branch_id) GROUP BY p.product_id \");\n\n $result = $query->result_array();\n\n //$query = $this->db->get_where('branch_products', array('branch_products_id' => $id));\n // $rows = $query->num_rows();\n // echo 'ROWS:'.$rows;die;\n //$result = $query->result_array();\n // $str = $this->db->last_query();\n // echo $str;\n\n // $totalRows = $query->num_rows();\n\n // if( $totalRows > 0 )\n // {\n // $result = $query->result_array();\n // }\n // else\n // {\n // $query = $this->db->query(\" SELECT p.product_id, p.name AS product_name,p.price AS default_price,p.product_code AS productcode,bp.*,NULL AS is_available FROM product p\n // LEFT JOIN branch_products bp ON (p.product_id = bp.product_id)\n // GROUP BY p.product_id \"); \n // $result = $query->result_array(); \n // }\n\n return $result; \n }", "function relatedProducts($people_cat_id, $product_type_id, $product_id)\n\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t$sql= 'SELECT product. *\n\t\t\t\tFROM product\n\t\t\t\tJOIN product_people ON product_people.product_id = product.product_id\n\t\t\t\tWHERE product.product_type_id = '.$people_cat_id.'\n\t\t\t\tAND product_people.people_cat_id = '.$product_type_id.'\n\t\t\t\tAND product.product_id != '.$product_id.'\n\t\t\t\tORDER BY product.product_id DESC';\n\t\t\t\t\n\t\t\t\t$Q = $this-> db-> query($sql);\n\t\t\t\tforeach ($Q-> result_array() as $row){\n\t\t\t\t}\n\t\t\t\treturn $Q;\n\t\t\t\t\n\t\t\t\t}", "public function cpJoin() {\n $sql=\"select packages.packageName, prices.id, prices.price, products.productName, products.cid, prices.productID, prices.areaID, prices.packageID \"\n . \"from prices\"\n . \" inner join packages on packages.packageID=prices.packageID\"\n . \" inner join products on prices.productID=products.productID where products.cid='9'\";\n $sth=$this->dbh->prepare($sql);\n \n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n}", "function allproducts_get()\n\t{\n\t\t$is_exists=$this->user_model->get_joins('products',array('is_product'=>'Y'),'',array('catg_id','child_id','prod_detail','description','size','unit','mrp'));\n\t\t//print_r($is_exists);exit('u');\n\t\tif(!empty($is_exists))\n\t\t{\n\t\t\t$this->response(array('status'=>'true','message'=>$is_exists));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response(array('status'=>'false','message'=>'No Product Found'),REST_Controller::HTTP_BAD_REQUEST);\n\t\t}\n\t}", "function getallproducts1($warehouseid){\n \n\n $products = $this->db->query(\"SELECT a.*, \n b.id AS productid, \n b.`name` AS productname, \n b.`main_image` AS productimage, \n b.`price` AS product_price, \n b.`tax` AS product_tax, \n b.`description` AS product_description, \n b.`move_product_id` AS productuniqueid_forimages,\n c.`name` AS cat_name, \n c.`image` AS cat_image, \n c.`category_id` AS category_id,\n d.`category_id` AS subcategory_id,\n d.`name` AS subcat_name, \n d.`image` AS subcat_image,\n d.`parent_id` AS parent_id,\n d.`shared_category` AS shared_category \n FROM warehouse_products a \n LEFT JOIN products b ON a.product=b.`id` \n LEFT JOIN category c ON b.`category_id` = c.`category_id` \n LEFT JOIN category d \n ON b.`sub_category_id` = d.`category_id` \n WHERE a.`warehouse` = \".$warehouseid.\" \n ORDER BY c.`name`, d.`name`\")->result();\n \n $sharedproducts=array();\n foreach($products as $product){\n if($product->shared_category !=null)\n array_push($sharedproducts, $product);\n }\n \n \n if(sizeof($products)>0){\n \n $this->db->query(\"TRUNCATE TABLE `tb_filteredproducts`\");\n \n foreach($products as $row) {\n $categoryimage=$row->cat_image;\n $imageheight=\"\";\n $imagewidth=\"\";\n if(strlen($categoryimage)>0){\n list($width, $height, $type, $attr) = getimagesize(\"https://mcflydelivery.com/public/uploads/category/thumbnail/\".$categoryimage);\n $imageheight=$height;\n $imagewidth=$width;\n }\n \n $query = \"INSERT INTO `tb_filteredproducts` set \n `id` = '\".$row->id.\"',\n `warehouse` = '\".$row->warehouse.\"',\n `product` = '\".$row->product.\"',\n `quantity` = '\".$row->quantity.\"',\n `min_capacity` = '\".$row->min_capacity.\"',\n `max_capacity` = '\".$row->max_capacity.\"',\n `avail_qty` = '\".$row->avail_qty.\"',\n `created_at` = '\".$row->created_at.\"',\n `updated_at` = '\".$row->updated_at.\"',\n `productid` = '\".$row->productid.\"',\n `productname` = '\".str_replace(\"'\",\"\",$row->productname).\"',\n `productimage` = '\".$row->productimage.\"',\n `product_price` = '\".$row->product_price.\"',\n `product_tax` = '\".$row->product_tax.\"',\n `product_description` = '\".$row->product_description.\"',\n `productuniqueid_forimages` = '\".$row->productuniqueid_forimages.\"',\n `cat_name` = '\".$row->cat_name.\"',\n `cat_image` = '\".$row->cat_image.\"',\n `cat_imageheight` = '\".$imageheight.\"',\n `cat_imagewidth` = '\".$imagewidth.\"',\n `category_id` = '\".$row->category_id.\"',\n `subcat_name` = '\".$row->subcat_name.\"',\n `subcategory_id` = '\".$row->subcategory_id.\"',\n `subcat_image` = '\".$row->subcat_image.\"',\n `parent_id` = '\".$row->parent_id.\"',\n `shared_category` = '\".$row->shared_category.\"';\";\n \n $this->db->query($query);\n \n }\n \n foreach($sharedproducts as $shared_product){ // for one shared product\n $sharedcategory_array= array();\n $sharedcategory_array=explode(\",\",$shared_product->shared_category);\n // print_r($shared_product);\n foreach($sharedcategory_array as $oneshared_category){\n if($oneshared_category !=$shared_product->category_id){ // if the shared category id item is not same with table id(current setted category id)\n // echo $oneshared_category;\n \n $selected_category_objectarray_from_categorytable = $this->db->where('category_id', $oneshared_category)->get('category')->result();\n \n if(sizeof($selected_category_objectarray_from_categorytable)>0){ // if the shared category is not deleted from category table\n $selected_category_object_from_categorytable=$selected_category_objectarray_from_categorytable[0];\n \n $categoryimage=$selected_category_object_from_categorytable->image;\n $imageheight=\"\";\n $imagewidth=\"\";\n if(strlen($categoryimage)>0){\n list($width, $height, $type, $attr) = getimagesize(\"https://mcflydelivery.com/public/uploads/category/thumbnail/\".$categoryimage);\n $imageheight=$height;\n $imagewidth=$width;\n }\n \n $query = \"INSERT INTO `tb_filteredproducts` set \n `id` = '\".$shared_product->id.\"',\n `warehouse` = '\".$shared_product->warehouse.\"',\n `product` = '\".$shared_product->product.\"',\n `quantity` = '\".$shared_product->quantity.\"',\n `min_capacity` = '\".$shared_product->min_capacity.\"',\n `max_capacity` = '\".$shared_product->max_capacity.\"',\n `avail_qty` = '\".$shared_product->avail_qty.\"',\n `created_at` = '\".$shared_product->created_at.\"',\n `updated_at` = '\".$shared_product->updated_at.\"',\n `productid` = '\".$shared_product->productid.\"',\n `productname` = '\".str_replace(\"'\",\"\",$shared_product->productname).\"',\n `productimage` = '\".$shared_product->productimage.\"',\n `product_price` = '\".$shared_product->product_price.\"',\n `product_tax` = '\".$shared_product->product_tax.\"',\n `product_description` = '\".$shared_product->product_description.\"',\n `productuniqueid_forimages` = '\".$shared_product->productuniqueid_forimages.\"',\n `cat_name` = '\".$selected_category_object_from_categorytable->name.\"',\n `cat_image` = '\".$selected_category_object_from_categorytable->image.\"',\n `cat_imageheight` = '\".$imageheight.\"',\n `cat_imagewidth` = '\".$imagewidth.\"',\n `category_id` = '\".$selected_category_object_from_categorytable->category_id.\"',\n `subcat_name` = '\".$shared_product->subcat_name.\"',\n `subcategory_id` = '\".$shared_product->subcategory_id.\"',\n `subcat_image` = '\".$shared_product->subcat_image.\"',\n `parent_id` = '\".$shared_product->parent_id.\"',\n `shared_category` = '\".$shared_product->shared_category.\"';\";\n \n $this->db->query($query);\n \n \n }\n }\n }\n } \n \n } \n \n \n $result = $this->db->query(\"SELECT * FROM `tb_filteredproducts` ORDER BY cat_name, subcat_name\")->result();\n return $result;\n }", "public function getJobp($id=''){\t\t\n $this->db->select(\"jobspreview.*,package.name as package_name,package.price as package_price,industry.name as industry_name\");\n $this->db->join(\"package\",\"jobspreview.package_id=package.id\",\"left\"); \n $this->db->join(\"industry\",\"jobspreview.industry_id=industry.id\",\"left\"); \n $this->db->where(\"jobspreview.id\",$id); \n $result = $this->db->get('jobspreview')->result();\n //echo $this->db->last_query(); die(); \n return $result;\t\t\n}", "function get_lowcat($product_id)\n {\n \t\t $database =& JFactory::getDBO();\n \t\t //najde kategoriu druhej alebo mensej urovne viac menej nahodne\n \t\t $sql = \"SELECT #__vm_category.category_id FROM #__vm_product_category_xref, #__vm_category, #__vm_category_xref WHERE #__vm_category_xref.category_child_id=#__vm_product_category_xref.category_id AND #__vm_category.category_publish='Y' AND #__vm_category.category_id=#__vm_category_xref.category_child_id and #__vm_category_xref.category_parent_id <> 0 AND #__vm_product_category_xref.product_id = '\".$product_id.\"' \";\n \t \n\t\t\t$database->setQuery($sql);\n\t\t\t\n\t\t\t//$res = $database->loadResult();\n\t\t\t$resA = $database->loadAssocList();\n\t\t\tif (!empty($resA))\n\t\t\t{\n\t\t\tforeach ($resA as $res)\n\t\t\t{\n\t\t\t \n\t\t\t {\n\t\t\t $arr = array();\n\t\t\t $cats = $this->build_cats($res['category_id'], $arr);\n\t\t\t //$x = end($cats);\n\t\t\t //var_dump($x);\n\t\t\t if (!empty($cats))\n\t\t\t // if (end($cats)!='262') IF YOU USE A CATEGORY SUCH AS LATEST PRODUCTS\n\t\t\t {\n\t\t\t //var_dump($res['category_id']); die();\n\t\t\t return $res['category_id'];\n\t\t\t }\n\t\t\t }\n\t\t\t}\n\t\t\t//echo $product_id.'...cat...'.$res['category_id']; die();\n\t\t\t// nechame novinky ak inde nie je\n\t\t\treturn $res['category_id'];\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif (!isset($res) || ($res==false))\n\t\t\t{\n\t\t\t // ak podkategoria neexistuje, najde top kategoriu\n\t\t\t \t$sql = \"SELECT #__vm_category.category_id FROM #__vm_product_category_xref, #__vm_category, #__vm_category_xref WHERE #__vm_category_xref.category_child_id=#__vm_product_category_xref.category_id AND #__vm_category.category_publish='Y' AND #__vm_category.category_id=#__vm_category_xref.category_child_id AND #__vm_product_category_xref.product_id = '$product_id' LIMIT 0,1\";\n\t\t\t \t$database->setQuery($sql);\n\t\t\t\t$res = $database->loadResult();\n\t\t\t\treturn $res;\n\t\t\t}\n\n\t\t\treturn 0;\n\n }", "function getparent(){\r\n\tglobal $con;\r\n\t$getAll = $con->prepare(\"SELECT * FROM categories WHERE parent = 0 ORDER BY ID ASC\");\r\n\t$getAll->execute();\t\r\n\t$parent = $getAll->fetchAll();\r\n\treturn $parent;\r\n}", "public function product1(){\r\n\t\t$sql =\"SELECT * FROM `products`,`manufactures`,`protypes` WHERE manufactures.manu_ID = products.manu_ID AND protypes.type_ID = products.type_ID\";\r\n\t\t$result = self::$conn->query($sql);\r\n\t\treturn $this->getData($result);\r\n\t}", "function get_child_product($entity_id)\n\t{\n\t\t$relTable = Mage::getSingleton('core/resource')->getTableName('catalog_product_relation');\n\t\t$sql = \"SELECT child_id FROM `\" . $relTable . \"`\n\t\t\t\t\t\tWHERE parent_id = '\" . (int) $entity_id . \"'\";\n\t\t$prods = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($sql);\n\t\tif ($prods) {\n\t\t\treturn $prods;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function listadoProductos(){\n\n$sql = \"select idProducto,desc_Prod,presentacion,tipoProd,stock,m.nomMarca,c.nomCategoria,estadoProd from producto as p inner join Categoria as c ON c.idCategoria=p.idCategoria inner join Marca as m ON m.idMarca=p.idMarca where estadoProd=1 order by desc_Prod asc\";\n\t\n\n\n\t\treturn Yii::app()->db->createCommand($sql)->queryAll();\n\t}", "protected function productsAll()\n\t{\n\t\t$this->adapter->joinLeftCategoryFlat();\n\t\t$this->adapter->joinTaxonomy();\n\t\t$this->adapter->joinParentCategory();\t\t\t\t\t\t\n\t}", "function load_category($parent)\n{\n$sql=\"SELECT * from yr14_category where parentid='\".$parent.\"' order by id\";\n$result=mysql_query($sql);\nif(!$result || mysql_num_rows($result)<=0)\nreturn 0;\nelse\nreturn $result;\n}", "public function related_products($product_id)\n\t{\n\t\t//retrieve all users\n\t\t$this->db->from('product, category, brand');\n\t\t$this->db->select('product.*, category.category_name, brand.brand_name');\n\t\t$this->db->where('product.category_id = category.category_id AND product.brand_id = brand.brand_id AND product.category_id = (SELECT category_id FROM product WHERE product_id = '.$product_id.') AND product.product_id != '.$product_id);\n\t\t$query = $this->db->get('', 10);\n\t\t\n\t\treturn $query;\n\t}", "function ngGetProducts()\n\t{\n\t\t$sql = \"SELECT p.*, b.branch_name as branch_name \n\t\tFROM products p \n\t\tLEFT JOIN branches b ON p.branch_id = b.id\n\t\tWHERE p.status_id != \". DELETE . \";\";\n\n\t\t$result = $this->db->query($sql);\n\t\t$response = $result->result();\n\t\techo json_encode($response);\n\t}", "function find_recent_product_added($limit){\n global $db;\n $sql = \" SELECT p.id,p.name,p.keywords,p.sale_price,p.media_id,c.name AS categorie,\";\n $sql .= \"m.file_name AS image FROM products p\";\n $sql .= \" LEFT JOIN categories c ON c.id = p.categorie_id\";\n $sql .= \" LEFT JOIN media m ON m.id = p.media_id\";\n $sql .= \" ORDER BY p.id DESC LIMIT \".$db->escape((int)$limit);\n return find_by_sql($sql);\n }", "public function getAllProduct(){\n\t\t//query for get all data from tbl_product combinning with tbl_category(catName) and tbl_brand(brandName) using INNER JOIN\n\t\t$sql = \"SELECT tbl_product.*, tbl_category.catName, tbl_brand.brandName\n\t\t\t\tFROM tbl_product\n\t\t\t\tINNER JOIN tbl_category\n\t\t\t\tON tbl_product.catId = tbl_category.catId\n\t\t\t\tINNER JOIN tbl_brand\n\t\t\t\tON tbl_product.brandId = tbl_brand.brandId\n\t\t\t\tORDER BY tbl_product.pid DESC \";\n\t\t//Same Query using Alias(giving a temporary name to a table or Column)\n\t\t/*$sql = \"SELECT p.*, c.catName, b.brandName\n\t\t\t\tFROM tbl_product AS p, tbl_category AS c, tbl_brand AS b\n\t\t\t\tWHERE p.catId = c.catId AND p.brandId = b.brandId\n\t\t\t\tORDER BY p.pid DESC \";*/\n\t\t$result = $this->db->select($sql);\n\t\tif ($result) {\n\t\t\treturn $result;\n\t\t}else{\n\t\t\t$msg = \"<span class='error'>Product not found !.</span>\";\n\t\t\treturn $msg;\n\t\t}\n\t}", "function getProductsNotInProjects($id_project = null){\n global $db;\n\n /*$sql = \"SELECT * FROM products WHERE id NOT IN (SELECT id_product FROM v_projects_products WHERE id_project = $id_project) ORDER BY partno\";\n //Basic::EventLog(\"Product->getProductsNotInProjects: \".$sql);\n $res =& $db->query($sql);\n return $res;*/\n /*$conn = oci_connect('wip', 'CamLine4gdl', 'mestq');\n if (!$conn) {\n $e = oci_error();\n trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);\n }\n \n $sql = \"SELECT DISTINCT(product_definition) FROM t_wip_job\";\n Basic::EventLog(\"Product->getProductsNotInProjects: \".$frtchi);\n $res = oci_parse($conn, $sql);\n oci_execute($res);*/\n \n \n \n return $res;\n }", "public function allProducts()\r\n {\r\n // left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n // left join mshop_media as mm on mm.id = mpl.refid\r\n // left JOIN mshop_price as mpri on mpri.id = mpl.refid\r\n // where mpl.pos = 0 and mpl.domain in ('media','price')\";\r\n $qry1 = \"select mp.id as product_id, mp.code as product_code, mp.label as product_name, mm.preview as image_url from mshop_product as mp \r\n left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n left join mshop_media as mm on mm.id = mpl.refid\r\n where mpl.pos = 0 and mpl.domain in ('media')\";\r\n $qry2 = \"select mp.id as product_id, mp.label as product_name, mpri.value as product_price from mshop_product as mp \r\n left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n left JOIN mshop_price as mpri on mpri.id = mpl.refid\r\n where mpl.pos = 0 and mpl.domain in ('price')\";\r\n $products1 = DB::select($qry1);\r\n $products2 = DB::select($qry2); \r\n $i = 0;\r\n foreach($products1 as $products) {\r\n foreach($products2 as $product) {\r\n if($product->product_id === $products->product_id) {\r\n $products1[$i]->product_price = $product->product_price;\r\n }\r\n }\r\n $i++;\r\n }\r\n return $products1;\r\n }", "function getProductsModel() {\n\t\t\n\t\t$sel_models = tep_db_query(\"SELECT products_model FROM products ORDER BY products_model DESC\");\n\t\t$models[] = '000';\n\t\twhile($models_arr = tep_db_fetch_array($sel_models)) {\t\t\t\t\n\t\t\t\n\t\t\t//if($models_arr['products_model']==\"\" || ) {\n\t\t\t\t//$models[] = '000'; \n\t\t\t//} else {\n\t\t\t\t$procode = explode(\"-\",$models_arr['products_model']); \n\t\t\t\tif($procode[0]<1 || $procode[0]==\"\") { $procode[0] = '000'; }\n\t\t\t\t$models[] = $procode[0]; \n\t\t\t//}\t\t\n\t\t\t\n\t\t}\n\t\t\t\t\t\t\n\t\treturn array_unique($models);\n\t\t\n\t}", "function fetch_sales_product_list($date){\n \t\t$this->db->select('products.PRODUCT, products_to_sell.QUANTITY, products_to_sell.ID, products_to_sell.DATE_ADDED');\n \t\t$this->db->from('products_to_sell');\n \t\t$this->db->join('products', 'products_to_sell.PRODUCT_ID=products.PRODUCT_ID', 'left');\n \t\t$this->db->where('products_to_sell.DATE_ADDED', $date);\n \t\t$query=$this->db->get();\n \t\tif($query->num_rows()>0){\n \t\t\treturn $query->result();\n \t\t}\n \t\telse{\n \t\t\treturn false;\n \t\t}\n \t}", "function ierg4210_prod_fetchOne() {\n // DB manipulation\n global $db;\n $db = ierg4210_DB();\n $pid = (int)$_REQUEST['pid'];\n $q = $db->prepare(\"SELECT * FROM products WHERE pid = $pid;\");\n if ($q->execute())\n return $q->fetchAll();\n}", "public function product_list()\n\t{\n\t\t$query=$this->db->select('\n\t\t\t\t\ta.product_id,a.product_name,a.price,a.image_thumb,a.variants,a.product_model,\n\t\t\t\t\tc.category_name,c.category_id\n\t\t\t\t')\n\n\t\t\t\t->from('product_information a')\n\t\t\t\t->join('product_category c','c.category_id = a.category_id','left')\n\t\t\t\t->group_by('a.product_id')\n\t\t\t\t->order_by('a.product_name','asc')\n\t\t\t\t->get();\n\n\t\tif ($query->num_rows() > 0) {\n\t\t \treturn $query->result();\t\n\t\t}\n\t\treturn false;\n\t}", "public function getId0()\n {\n return $this->hasOne(Product::className(), ['category_id' => 'id']);\n }", "function getProduct($product_id)\n{\n $var = getDataArray(\"select * from Product_with_catogory WHERE product_id =\" . $product_id);\n if (count($var) > 0)\n return $var[0];\n else\n return null;\n}", "public function consultaOfertas(){\n //join Tabla2 T2 ON T1.PK = T2.FK\n \n //select * from Tabla1 T1, Tabla2 T2\n //WHERE T!.PK = T2.FK\n \n \n \n //$this->db->select(\"*\"); \n //$this->db->from(\"productos\");//nombrebase\n //$this->db->join(\"carrera\",\"alumno.idCarrera = carrera.idCarrera\");\n \n //$sql = $this->db->get();\n //return $sql->result();\n }", "public function full_product_detail($id)\n\t{\n\t\t$full=$this->db->query(\"SELECT products.* ,categories.cat_name FROM products INNER JOIN `categories` ON products.cat_id=categories.cat_id where products.pr_id='\".$id.\"'\");\n\t\t\tif($full->num_rows()>0)\n\t\t{\n\t\t\treturn $full;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\n\t}", "function getProductInc()\n {\n $productInc = \"SELECT * from productincrements\";\n $productIncresult = $this->ds->select($productInc); \n //print_r($productIncresult);\n return $productIncresult;\n }", "public function parentmenus() {\n $this->db->where('menuparentid', \" \"); \n $this->db->order_by('serialid', \"asc\");\n $query = $this->db->get('menu');\n return $query->result();\n }", "public function getProducts_old($data = array()) {\n //echo \"<pre>\";print_r($data);exit;\n $sql = \"SELECT * FROM \" . DB_PREFIX . \"product p LEFT JOIN \" . DB_PREFIX . \"product_description pd ON (p.product_id = pd.product_id) LEFT JOIN \" . DB_PREFIX . \"product_to_category ptc ON ( p.product_id = ptc.product_id) WHERE p.product_tp ='TE' AND pd.language_id = '\" . (int)$this->config->get('config_language_id') . \"'\";\n \n \n//echo $sql;exit;\n\t\tif (!empty($data['filter_name'])) {\n\t\t\t$sql .= \" AND pd.name LIKE '\" . $this->db->escape($data['filter_name']) . \"%'\";\n\t\t}\n\n\t\tif (!empty($data['filter_model'])) {\n\t\t\t$sql .= \" AND p.model LIKE '\" . $this->db->escape($data['filter_model']) . \"%'\";\n\t\t}\n\n\t\tif (isset($data['filter_price']) && !is_null($data['filter_price'])) {\n\t\t\t$sql .= \" AND p.price LIKE '\" . $this->db->escape($data['filter_price']) . \"%'\";\n\t\t}\n\n\t\tif (isset($data['filter_quantity']) && !is_null($data['filter_quantity'])) {\n\t\t\t$sql .= \" AND p.quantity = '\" . (int)$data['filter_quantity'] . \"'\";\n\t\t}\n \n \n /*custom add for filter in autocomplayte category*/\n /*Custom add */ \n if (isset($data['filter_category_id']) && !is_null($data['filter_category_id'])) {\n\t\t\t$sql .= \" AND ptc.category_id = '\" . (int)$data['filter_category_id'] . \"'\";\n\t\t}\n \n \n\n\t\tif (isset($data['filter_status']) && !is_null($data['filter_status'])) {\n\t\t\t$sql .= \" AND p.status = '\" . (int)$data['filter_status'] . \"'\";\n\t\t}\n \n if (isset($data['filter_family']) && !is_null($data['filter_family'])) {\n\t\t\t$sql .= \" AND p.family = '\" . (int)$data['filter_family'] . \"'\";\n\t\t}\n\n \n\t\tif (isset($data['filter_image']) && !is_null($data['filter_image'])) {\n\t\t\tif ($data['filter_image'] == 1) {\n\t\t\t\t$sql .= \" AND (p.image IS NOT NULL AND p.image <> '' AND p.image <> 'no_image.png')\";\n\t\t\t} else {\n\t\t\t\t$sql .= \" AND (p.image IS NULL OR p.image = '' OR p.image = 'no_image.png')\";\n\t\t\t}\n\t\t}\n\n\t\t$sql .= \" GROUP BY p.product_id\";\n\n\t\t$sort_data = array(\n\t\t\t'pd.name',\n\t\t\t'p.model',\n\t\t\t'p.price',\n\t\t\t'p.quantity',\n\t\t\t'p.status',\n 'p.family',\n\t\t\t'p.sort_order'\n\t\t);\n\n\t\tif (isset($data['sort']) && in_array($data['sort'], $sort_data)) {\n\t\t\t$sql .= \" ORDER BY \" . $data['sort'];\n\t\t} else {\n\t\t\t$sql .= \" ORDER BY pd.name\";\n\t\t}\n\n\t\tif (isset($data['order']) && ($data['order'] == 'DESC')) {\n\t\t\t$sql .= \" DESC\";\n\t\t} else {\n\t\t\t$sql .= \" ASC\";\n\t\t}\n\n\t\tif (isset($data['start']) || isset($data['limit'])) {\n\t\t\tif ($data['start'] < 0) {\n\t\t\t\t$data['start'] = 0;\n\t\t\t}\n\n\t\t\tif ($data['limit'] < 1) {\n\t\t\t\t$data['limit'] = 20;\n\t\t\t}\n\n\t\t\t$sql .= \" LIMIT \" . (int)$data['start'] . \",\" . (int)$data['limit'];\n\t\t}\n \n\t\t$query_tp = $this->db->query($sql);\n \n\t\treturn $query_tp->rows;\n\t}", "public function producto_tralado_por_id($id_producto,$id_ingreso){\n $conectar= parent::conexion();\n $sql=\"select p.modelo,p.marca,p.medidas,p.color,e.id_producto,e.id_ingreso,e.categoriaub,e.stock from producto as p inner join existencias as e on p.id_producto=e.id_producto and e.id_producto=? and id_ingreso=?\";\n $sql=$conectar->prepare($sql);\n $sql->bindValue(1, $id_producto);\n $sql->bindValue(2, $id_ingreso);\n $sql->execute();\n return $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "public function get_add_product(){\n\n $this->db->select(\"pid,pname,product_category,product_price,product_description,product_image,uid,product_status\"); \n $this->db->from('products');\n\n $query = $this->db->get();\n \n return $query->result();\n \n }", "function getRelatedProdsById($pId){\n\t\t$query = \"SELECT GROUP_CONCAT(DISTINCT relatedto_id ORDER BY relatedto_id ASC SEPARATOR ',') AS prodRelated, GROUP_CONCAT(DISTINCT relatedto_offerid ORDER BY relatedto_offerid ASC SEPARATOR ',') AS offerRelated FROM product_related WHERE `relatedfrom_id`=$pId\";\n\t\t//$data = mysql_query($query);\n\t\t//print_r($data);\n\t\t$result = $this->selectQueryForAssoc($query);\n\t\treturn $result;\t\n\t}", "public function getProductoByPedido($id){\n // $sql = \"SELECT * FROM productos WHERE id IN \" \n // . \"(SELECT producto_id FROM lineas_pedidos WHERE pedido_id={$id})\";\n\n $sql = \"SELECT pr.*,lp.unidades FROM productos pr \" \n . \"INNER JOIN lineas_pedidos lp ON pr.id = lp.producto_id \" \n . \"WHERE lp.pedido_id={$id}\"; \n\n $productos = $this->db->query($sql);\n \n return $productos;\n \n\n }", "public function getAllProduct(){\n $this->db->select('p.id,p.title,p.image,c.category');\n $this->db->from('product p, category c');\n $this->db->where('p.status','t');\n $this->db->where('p.category_id=c.id');\n $this->db->order_by(\"id\", \"desc\");\n $query = $this->db->get();\n return $query->result(); \n }", "public function fetch_products() {\n $this->db->select('product.id,product.name,product.price,product.status,(SELECT product_images.image_name FROM product_images WHERE product_images.product_id = product.id ORDER BY id ASC LIMIT 1) AS pr_img');\n $this->db->from('product');\n $this->db->where('is_featured', '1');\n $r = $this->db->get();\n\n return $r->result_array();\n }", "function get_prodi($id_prodi)\n {\n // return $this->db->get_where('prodi',array('id_prodi'=>$id_prodi))->row_array();\n\n $this->db->select ( '\n prodi.*, \n jurusan.id_jurusan as id_jurusan, \n jurusan.nama_jurusan\n ' );\n $this->db->join('jurusan', 'jurusan.id_jurusan = prodi.fk_id_jurusan');\n\n $query = $this->db->get_where('prodi', array('prodi.id_prodi' => $id_prodi));\n \n return $query->row();\n }", "public function FindOneSubMenuProducts() {\n $SQL = \"Select menus.MenuId , menus.Product ,submenus.MainMenu, (Select Sum(Quantity) from productcolors where Product = menus.Product) as Quantity , submenus.Image , submenus.SubMenuId , mainmenus.MainMenuId, mainmenus.Name as MainMenuName , submenus.Name as SubMenuName ,suppermenus.SupperMenuId , suppermenus.MainMenu as SPMainMenu, suppermenus.SubMenu as SPSubMenu, suppermenus.Title as SPTitle , suppermenus.Name as SPName From `menus` Inner Join mainmenus On menus.MainMenu = mainmenus.MainMenuId Inner Join submenus On menus.SubMenu = submenus.SubMenuId Inner Join suppermenus On menus.SupperMenu = suppermenus.SupperMenuId where menus.SubMenu = \" . $this->SubMenu .\" ORDER BY Quantity =0, menus.Product DESC\";\n $db = new DataAccess();\n $results = $db->executeSelect($SQL);\n $menus = array();\n $i = 0;\n while ($row = mysqli_fetch_array($results)) {\n $menus[$i] = $row['Product'];\n $i++;\n }\n return $menus;\n }", "public function getNewProduct(){\n\t\t$sql = \"SELECT * FROM tbl_product ORDER BY pid DESC LIMIT 4\";\n\t\t$result = $this->db->select($sql);\n\t\treturn $result;\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}", "protected function getListQuery()\r\n {\r\n //Create a new JDatabaseQuery object.\r\n $db = $this->getDbo();\r\n $query = $db->getQuery(true);\r\n $user = JFactory::getUser();\r\n // Variable sent from price rule or bundle dynamic items in order to display only\r\n // the selected product type in the product modal window (ie: normal or bundle).\r\n $dynamicItemType = JFactory::getApplication()->input->get->get('dynamic_item_type', '', 'string');\r\n $layout = JFactory::getApplication()->input->get->get('layout', '', 'string');\r\n $and = '';\r\n\r\n // Select the required fields from the table.\r\n $query->select($this->getState('list.select', 'p.id,p.name,p.alias,p.created,p.published,p.catid,p.hits,p.access,'.\r\n\t\t\t\t 'cm.ordering,p.created_by,p.checked_out,p.checked_out_time,p.language,'.\r\n\t\t\t\t 'pv.var_id,pv.base_price,pv.price_with_tax,p.type,pv.stock,pv.name AS variant_name,'.\r\n\t\t\t\t 'pv.ordering AS var_ordering,pv.stock_subtract'))\r\n\t ->from('#__ketshop_product AS p');\r\n\r\n if($layout != 'modal') {\r\n // Gets only the basic variant of the product.\r\n $and = 'AND pv.ordering=1';\r\n }\r\n\r\n $query->join('LEFT', '#__ketshop_product_variant AS pv ON pv.prod_id=p.id '.$and);\r\n\r\n // Get the creator name.\r\n $query->select('us.name AS creator')\r\n\t ->join('LEFT', '#__users AS us ON us.id = p.created_by');\r\n\r\n // Join over the users for the checked out user.\r\n $query->select('uc.name AS editor')\r\n\t ->join('LEFT', '#__users AS uc ON uc.id=p.checked_out');\r\n\r\n // Join over the categories.\r\n $query->select('ca.title AS category_title')\r\n\t ->join('LEFT', '#__categories AS ca ON ca.id = p.catid');\r\n\r\n // Join over the language\r\n $query->select('lg.title AS language_title')\r\n\t ->join('LEFT', $db->quoteName('#__languages').' AS lg ON lg.lang_code = p.language');\r\n\r\n // Join over the asset groups.\r\n $query->select('al.title AS access_level')\r\n\t ->join('LEFT', '#__viewlevels AS al ON al.id = p.access');\r\n\r\n // Filter by category.\r\n $categoryId = $this->getState('filter.category_id');\r\n if(is_numeric($categoryId)) {\r\n // Gets the products from the category mapping table.\r\n $query->join('INNER', '#__ketshop_product_cat_map AS cm ON cm.product_id=p.id AND cm.cat_id='.(int)$categoryId);\r\n }\r\n elseif(is_array($categoryId)) {\r\n $categoryId = ArrayHelper::toInteger($categoryId);\r\n $categoryId = implode(',', $categoryId);\r\n // Gets the products from the category mapping table.\r\n $query->join('INNER', '#__ketshop_product_cat_map AS cm ON cm.product_id=p.id AND cm.cat_id IN('.$categoryId.')');\r\n }\r\n else {\r\n // Gets the ordering value from the category mapping table.\r\n $query->join('LEFT', '#__ketshop_product_cat_map AS cm ON cm.product_id=p.id AND cm.cat_id=p.catid');\r\n }\r\n\r\n // Filter by title search.\r\n $search = $this->getState('filter.search');\r\n if(!empty($search)) {\r\n if(stripos($search, 'id:') === 0) {\r\n\t$query->where('p.id = '.(int) substr($search, 3));\r\n }\r\n else {\r\n\t$search = $db->Quote('%'.$db->escape($search, true).'%');\r\n\t$query->where('(p.name LIKE '.$search.')');\r\n }\r\n }\r\n\r\n // Filter by access level.\r\n $access = $this->getState('filter.access');\r\n\r\n if(is_numeric($access)) {\r\n $query->where('p.access='.(int) $access);\r\n }\r\n elseif (is_array($access)) {\r\n $access = ArrayHelper::toInteger($access);\r\n $access = implode(',', $access);\r\n $query->where('p.access IN ('.$access.')');\r\n }\r\n\r\n // Filter by access level on categories.\r\n if(!$user->authorise('core.admin')) {\r\n $groups = implode(',', $user->getAuthorisedViewLevels());\r\n $query->where('p.access IN ('.$groups.')');\r\n $query->where('ca.access IN ('.$groups.')');\r\n }\r\n\r\n // Filter by publication state.\r\n $published = $this->getState('filter.published');\r\n if(is_numeric($published)) {\r\n $query->where('p.published='.(int)$published);\r\n }\r\n elseif($published === '') {\r\n $query->where('(p.published IN (0, 1))');\r\n }\r\n\r\n // Filter by creator.\r\n $userId = $this->getState('filter.user_id');\r\n\r\n if(is_numeric($userId)) {\r\n $type = $this->getState('filter.user_id.include', true) ? '= ' : '<>';\r\n $query->where('p.created_by'.$type.(int) $userId);\r\n }\r\n elseif(is_array($userId)) {\r\n $userId = ArrayHelper::toInteger($userId);\r\n $userId = implode(',', $userId);\r\n $query->where('p.created_by IN ('.$userId.')');\r\n }\r\n\r\n // Filter by language.\r\n if($language = $this->getState('filter.language')) {\r\n $query->where('p.language = '.$db->quote($language));\r\n }\r\n\r\n // Filter by product type.\r\n if($productType = $this->getState('filter.product_type')) {\r\n $query->where('p.type= '.$db->quote($productType));\r\n }\r\n\r\n // Filter by a single or group of tags.\r\n $hasTag = false;\r\n $tagId = $this->getState('filter.tag');\r\n\r\n if(is_numeric($tagId)) {\r\n $hasTag = true;\r\n $query->where($db->quoteName('tagmap.tag_id').' = '.(int)$tagId);\r\n }\r\n elseif(is_array($tagId)) {\r\n $tagId = ArrayHelper::toInteger($tagId);\r\n $tagId = implode(',', $tagId);\r\n\r\n if(!empty($tagId)) {\r\n\t$hasTag = true;\r\n\t$query->where($db->quoteName('tagmap.tag_id').' IN ('.$tagId.')');\r\n }\r\n }\r\n\r\n if($hasTag) {\r\n $query->join('LEFT', $db->quoteName('#__contentitem_tag_map', 'tagmap').\r\n\t\t ' ON '.$db->quoteName('tagmap.content_item_id').' = '.$db->quoteName('p.id').\r\n\t\t ' AND '.$db->quoteName('tagmap.type_alias').' = '.$db->quote('com_noteproduct.note'));\r\n }\r\n\r\n // Add the list to the sort.\r\n $orderCol = $this->state->get('list.ordering', 'p.name');\r\n $orderDirn = $this->state->get('list.direction'); // asc or desc\r\n\r\n $query->order($db->escape($orderCol.' '.$orderDirn));\r\n\r\n if($dynamicItemType) {\r\n // Displays only the required product type (ie: normal or bundle).\r\n $query->where('p.type='.$db->Quote(JFactory::getApplication()->input->get->get('product_type', '', 'string')));\r\n // Displays the product variants in order.\r\n $query->order('p.id, pv.ordering');\r\n // Shows only the published products.\r\n $query->where('p.published=1');\r\n // To prevent duplicates when filtering with multiple selection lists.\r\n $query->group('pv.var_id, p.id');\r\n }\r\n else {\r\n // To prevent duplicates when filtering with multiple selection lists.\r\n $query->group('p.id');\r\n }\r\n\r\n return $query;\r\n }", "function getProdId($product){\r\n require '../../model/dbconnect.php';\r\n $prod = $db->quote($product);\r\n $rows_prod = $db->query(\"SELECT id FROM product WHERE name = $prod\");\r\n if ($rows_prod) {\r\n foreach($rows_prod as $row)\r\n return $row['id'];\r\n }\r\n }", "public function showProduct(){\n\n\n $showquery = \"SELECT p.*,c.catName,b.brandName FROM forproduct as p,\n forcat as c,forbrand as b \n WHERE p.productCat = c.catID AND p.productBrand = b.brandId \n order by p.productId DESC\";\n\n\n \t$showres = $this->db->select($showquery);\n \tif($showres)\n \treturn $showres;\n\t \t}", "function tep_get_products_sale_code($product_id) {\n\t$product_query = tep_db_query(\"select products_model from \".TABLE_PRODUCTS.\" where products_id =\".(int)$product_id );\n\tif (tep_db_num_rows($product_query)) {\n\t\t$product = tep_db_fetch_array($product_query);\n\t\treturn $product['products_model'];\n\t} else {\n\t\treturn false;\n\t}\n}", "function getProductInfo($pid) {\r\n global $conn;\r\n $select = \"SELECT * FROM product WHERE productid=\" . $pid . \";\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}", "public function get_adminstaff_FilteredProductsSide($parentid,$subcatid,$selectsublist,$selectgender,$description,$weight,$minprice,$maxprice,$uid)\n\t{\n\t\t\n\t\t$parentid = trim($parentid);\n\t\t$subcatid = trim($subcatid); \n\t\t$selectsublist = trim($selectsublist);\n\t\t$selectgender = trim($selectgender);\n\t\t$description = trim($description);\n\t\t$weight = trim($weight);\n\t\t$minprice = trim($minprice);\n\t\t$maxprice = trim($maxprice);\n\t\t $uid1 = trim($uid);\n\t\t$existsdata = $this->db->query(\"SELECT * from tb_admin_cart where userid='$uid1'\")->row_array();\n\t\tif(empty($existsdata))\n\t\t{\n\t\t\t$sql1=\"SELECT * from tb_products where ProductStatus=1\";\n\t\t\tif(!empty($parentid))\n\t\t\t{\n\t\t\t\t$sql1.=\" AND ParentCategory='$parentid'\";\n\t\t\t}\n\t\t\tif(!empty($subcatid))\n\t\t\t{\n\t\t\t\t$sql1.=\" AND SubCategory='$subcatid'\";\n\t\t\t}\n\t\t\tif(!empty($selectsublist))\n\t\t\t{\n\t\t\t\t$sql1.=\" AND SubCategoryList='$selectsublist'\";\n\t\t\t}\n\t\t\tif(!empty($selectgender))\n\t\t\t{\n\t\t\t\t$sql1.=\" AND gender1='$selectgender'\";\n\t\t\t}\n\t\t\tif(!empty($description))\n\t\t\t{\n\t\t\t\t$sql1.=\" AND productdescription like '%$description'\";\n\t\t\t}\n\t\t\tif(!empty($weight))\n\t\t\t{\n\t\t\t\t$sql1.=\" AND grw='$weight'\";\n\t\t\t}\n\t\t\tif(!empty($minprice))\n\t\t\t{\n\t\t\t\t$sql1.=\" AND totalprice>='$minprice'\";\n\t\t\t}\n\t\t\tif(!empty($maxprice))\n\t\t\t{\n\t\t\t\t$sql1.=\" AND totalprice<='$maxprice'\";\n\t\t\t}\t\t\t\n\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sql1=\"SELECT t1.* FROM tb_products as t1 WHERE t1.ProductId not IN (SELECT t2.products FROM tb_admin_cart as t2 WHERE t2.userid='$uid1') \";\n\t\t\n\t\t//$sql1 =\"select * from tb_products where ProductStatus=1\";\n\t\tif(!empty($parentid))\n\t\t{\n\t\t\t$sql1.=\" AND ParentCategory='$parentid'\";\n\t\t}\n\t\tif(!empty($subcatid))\n\t\t{\n\t\t\t$sql1.=\" AND SubCategory='$subcatid'\";\n\t\t}\n\t\tif(!empty($selectsublist))\n\t\t{\n\t\t\t$sql1.=\" AND SubCategoryList='$selectsublist'\";\n\t\t}\n\t\tif(!empty($selectgender))\n\t\t{\n\t\t\t$sql1.=\" AND gender1='$selectgender'\";\n\t\t}\n\t\tif(!empty($description))\n\t\t{\n\t\t\t$sql1.=\" AND productdescription like '%$description'\";\n\t\t}\n\t\tif(!empty($weight))\n\t\t{\n\t\t\t$sql1.=\" AND grw='$weight'\";\n\t\t}\n\t\tif(!empty($minprice))\n\t\t{\n\t\t\t$sql1.=\" AND totalprice>='$minprice'\";\n\t\t}\n\t\tif(!empty($maxprice))\n\t\t{\n\t\t\t$sql1.=\" AND totalprice<='$maxprice'\";\n\t\t}\n\t\t}\n\t\t\n\t\t$result = $this->db->query($sql1)->result_array();\n \n\t\treturn array('getFilterProducts'=>$result); \n \n \n\t}", "public function getProductos(){\n\t\t$this->db->select(\"p.*, m.nombre as marca, c.nombre as categoria,s.id_stock as id_stock, s.stock_minimo as stock_minimo, s.stock_actual as stock_actual ,pre.valor as valor,pre.codigo as codigo, pr.nombre as presentacion, pre.precio_compra as compra,pre.precio_venta as venta\");\n\t\t$this->db->from(\"productos p\");\n\t\t$this->db->join(\"marcas m\", \"p.id_marca = m.id_marca\");\n\t\t$this->db->join(\"categoria c\", \"p.id_categoria = c.id_categoria\");\n\t\t$this->db->join(\"stock s\", \"p.id_stock = s.id_stock\");\n\t\t$this->db->join(\"presentaciones_producto pre\", \"p.id_producto = pre.id_producto\");\n\t\t$this->db->join(\"presentacion pr\", \"pr.id_presentacion = pre.id_presentacion\");\n\t\t$this->db->where(\"p.estado\",1);\n\t\t$this->db->where(\"pre.equivalencia\",1);\n\t\t$this->db->order_by(\"categoria\");\n\t\t$resultados = $this->db->get();\n\t\treturn $resultados->result();\n\t}", "public function listIdproducforproductsale($id){\n try{\n $sql = \"Select * from product p inner join productforsale p2 on p.id_product = p2.id_product where p2.id_productforsale = ?\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute([$id]);\n\n $result = $stm->fetch();\n $result = $result->id_product;\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), 'Inventory|listProductprice');\n $result = 0;\n }\n\n return $result;\n }", "public function getSkuHierarchyElements ()\n{\n\n// $sql = \"select t1.id as sku_hierarchy_element_by_id,t1.element_name,t1.element_code,t1.element_description,t1.element_category_id,t1.parent_element_id,\n// t2.id as parent_layer_id,t3.id,t3.layer_name as element_category,\n// (Select b.element_name from tbld_sku_hierarchy_elements as b where t2.id = b.id)\n// as parent_element_name from tbld_sku_hierarchy_elements\n// as t1 left join tbld_sku_hierarchy_elements as t2 on t2.id = t1.parent_element_id\n// left join tbld_sku_hierarchy as t3 on t2.element_category_id = t3.id \";\n $sql = \"SELECT t1.*,t1.id as sku_hierarchy_element_by_id,t2.layer_name as element_category,t3.element_name as parent_element_name FROM `tbld_sku_hierarchy_elements` as t1\n left join `tbld_sku_hierarchy` as t2 on t1.element_category_id=t2.id\n left join `tbld_sku_hierarchy_elements` as t3 on t1.parent_element_id=t3.id\";\n $query = $this->db->query( $sql )->result_array();\n\n return $query;\n\n}", "public function obtenerProductoxId($idProducto){\n\t\t\n\t\t\n\t\t$sql=\"select * From Producto where idProducto=\".$idProducto;\n\t\t\n\n\t\treturn Yii::app()->db->createCommand($sql)->queryAll();\n\t}", "public function loadProductList()\n {\n $selectQuery = $this->DBH->query(\"SELECT pr_name, pr_id, pcat_name, psub_name, sup_name FROM product JOIN product_subcategory ON psub_id = pr_subcategory JOIN product_category ON psub_category = pcat_id JOIN supplier ON pr_supplier = sup_id\");\n\n echo \"<table class=\\\"information\\\">\";\n echo \"<tr>\";\n echo \"<th>#</th>\";\n echo \"<th>Název produktu</th>\";\n echo \"<th>Název kategorie</th>\";\n echo \"<th>Název podkategorie</th>\";\n echo \"<th>Název dodavatele</th>\";\n echo \"<th></th>\";\n echo \"<th></th>\";\n echo \"</tr>\";\n\n $i = 1;\n while($r = mysql_fetch_assoc($selectQuery))\n {\n ?>\n\n <tr>\n <td><?php echo $i;?></td>\n <td><?php echo $this->FILTER->prepareText($r[\"pr_name\"]);?></td>\n <td><?php echo $this->FILTER->prepareText($r[\"pcat_name\"]);?></td>\n <td><?php echo $this->FILTER->prepareText($r[\"psub_name\"]);?></td>\n <td><?php echo $this->FILTER->prepareTExt($r[\"sup_name\"]);?></td>\n <td class=\"buttons\"><form method=\"post\" action=\"\"><input type=\"hidden\" name=\"deleteProduct\" value=\"<?php echo $this->FILTER->prepareInputForSQL($r[\"pr_id\"]); ?>\"><input onclick=\"return confirm('Opravdu chcete smazat tento produkt?');\" type=\"submit\" value=\"Smazat\" class=\"button\"></form></td>\n <td class=\"buttons\"><a href=\"Admin.php?action=Show&amp;edittype=product&amp;edit=<?php echo $this->FILTER->prepareText($r[\"pr_id\"]); ?>\">Editovat</a></td>\n </tr>\n\n <?php\n $i++;\n }\n\n echo \"</table>\";\n\n }", "public function get_products()\r\n {\r\n if($this->db->count_all($this->_table)==0) return false;\r\n \r\n //lay danh sach cac san pham trong bang comment\r\n $this->db->distinct('product_id');\r\n $this->db->select('product_id');\r\n $this->db->order_by('product_id','asc');\r\n $pro_id = $this->db->get($this->_table)->result_array();\r\n \r\n //dem so comment cho moi san pham\r\n $this->db->order_by('product_id','asc');\r\n $this->db->group_by('product_id');\r\n $this->db->select('count(comment_id) as count');\r\n $pro_count = $this->db->get($this->_table)->result_array();\r\n \r\n foreach($pro_id as $value)\r\n {\r\n $key[] = $value['product_id'];\r\n }\r\n foreach($pro_count as $value)\r\n {\r\n $num[] = $value['count'];\r\n }\r\n //tao mang co key la product_id value la so comment va tra ve mang nay \r\n return array_combine($key, $num);\r\n }", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "function sql_leftJoin(){\n\t\t$dbconnection = $this->db_connect();\n\t\tif($dbconnection !=1)\n\t\t{\n\t\t\t$result=\"MySql Connection Error\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//LIST OF SELECTIONS\n\t\t\t//INSTEAD of a listOfFields I need a listOfSelections like \"db.tbl_1.fld_1\"\n\t\t\t// a_selections = array(\"db.tbl_1.fld_1\",\"db.tbl_1.fld_2\",\"db.tbl_2.fld_1\");\n\t\t\t\n\t\t\tif($this->a_fields !=\" \"){\n\t\t\t\t$a_selections = $this->arraySELECTIONS($this->db,$this->table,$this->a_fields);\n\t\t\t}else{\n\t\t\t\t$a_selections = $this->db.\".\".$this->table.\" \";\n\t\t\t}\n\t\t\t\n\t\t\tif($this->a_fields2 !=\" \"){\n\t\t\t\t$a_selections2 = $this->arraySELECTIONS($this->db2,$this->table2,$this->a_fields2);\n\t\t\t}else{\n\t\t\t\t$a_selections2 = $this->db2.\".\".$this->table2.\" *\";\n\t\t\t}\n\t\t\t\n \t\t\t$listOfSelections = $this->arrayFieldsToList($a_selections);\n\t\t\t$listOfSelections2 = $this->arrayFieldsToList($a_selections2);\n\t\t\t\n \t\t\t$sql = mysql_query(\"SELECT \".$listOfSelections.\",\".$listOfSelections2.\" FROM \".$this->db.\".\".$this->table.\" LEFT JOIN \".$this->db2.\".\".$this->table2.\" ON \".$this->db.\".\".$this->table.\".\".$this->relation.\" = \".$this->db2.\".\".$this->table2.\".\".$this->relation2.\"\");\n\t\t\t\n \t\t\t //echo(\"SELECT \".$listOfSelections.\",\".$listOfSelections2.\" FROM \".$this->db.\".\".$this->table.\" LEFT JOIN \".$this->db2.\".\".$this->table2.\" ON \".$this->db.\".\".$this->table.\".\".$this->relation.\" = \".$this->db2.\".\".$this->table2.\".\".$this->relation2.\"\");\n \t\t\t\tif (mysql_num_rows($sql) > 0) \n\t\t\t \t{\n\t\t\t \twhile ($row = mysql_fetch_assoc($sql)) \n\t\t\t \t{\n\t\t\t \t$a_data[]=$row ;\n\t\t\t \t}\n\t\t \t\t$result= $a_data;\t\n\t\t\t\t}else{\n\t\t\t\t\t$result=\"NO DATA AVAILABLE\";\n\t\t\t\t}\n\t\t}\n\t\treturn $result;\n\t\n\t}", "public function getAllProducts()\n {\n\n $query = $this->db->get_where('products', array('pro_status' => 1));\n return $query->result();\n }", "public function get_sub_products_by_products($loose_oil_id)\n\t{\n\t\t$this->db->from('product');\n\t\t$this->db->where('loose_oil_id',$loose_oil_id);\n\t\t$this->db->where('status',1);\n\t\t$res=$this->db->get();\n\t\treturn $res->result_array();\n\t}", "public function getProducts(){\r\n\t\t$query = \"Select * from products\";\r\n\t\treturn $GLOBALS['dbObj']->dbQuery($query);\r\n\t}", "public function get_base_mkprodid_by_mkid($mkid){\n $query = '\n SELECT \n ps.prodi_nama,\n ps.prodi_kode,\n mp.`mkkprod_id`,\n mp.`mkkprod_porsi_kelas`,\n mkk.`mkkur_pred_jml_peminat`,\n (\n SELECT SUM(mpv.mkkprod_porsi_kelas)\n FROM mkkur_prodi mpv\n WHERE mpv.mkkprod_mkkur_id = mp.`mkkprod_mkkur_id`\n AND mpv.`mkkprod_related_id` IS NULL\n GROUP BY mkkprod_mkkur_id\n ) AS t,\n mkkprod_porsi_kelas * (mkk.`mkkur_pred_jml_peminat` DIV\n (\n SELECT SUM(mpv.mkkprod_porsi_kelas)\n FROM mkkur_prodi mpv\n WHERE mpv.mkkprod_mkkur_id = mp.`mkkprod_mkkur_id`\n AND mpv.`mkkprod_related_id` IS NULL\n GROUP BY mkkprod_mkkur_id\n )) AS jml_porsi, \n mkk.`mkkur_pred_jml_peminat` MOD\n (\n SELECT SUM(mpv.mkkprod_porsi_kelas)\n FROM mkkur_prodi mpv\n WHERE mpv.mkkprod_mkkur_id = mp.`mkkprod_mkkur_id`\n AND mpv.`mkkprod_related_id` IS NULL\n GROUP BY mkkprod_mkkur_id\n ) AS sisa\n FROM program_studi ps\n LEFT JOIN mkkur_prodi mp ON ps.prodi_id = mp.mkkprod_prodi_id\n LEFT JOIN mata_kuliah_kurikulum mkk ON mp.`mkkprod_mkkur_id` = mkk.`mkkur_id`\n WHERE mp.mkkprod_mkkur_id = \"'.$mkid.'\"\n AND mp.`mkkprod_related_id` IS NULL \n AND mp.`mkkprod_porsi_kelas` <> 0\n ';\n\n $ret = $this->db->query($query);\n $ret = $ret->result_array();\n\n return $ret;\n }", "protected function _getSqlBase() {\n $sql = $this->getModel()->getTableName().' '.$this->getModel()->getAlias() .\" \n LEFT JOIN \".$this->_getPagamento()->getModel()->getTableName().\" pagto_pedido ON ( cv_pagto_lanc.id_pagto_pedido = pagto_pedido.id ) \n LEFT JOIN \".$this->_getLancamento()->getModel()->getTableName().\" lancamento ON ( cv_pagto_lanc.id_lancamento = lancamento.id ) \"; \n return $sql;\n }", "function particularproductlist($id)\n\t{\n\t\t$getParproduct=\"SELECT * from product_category where ptdcatgry_id = $id\";\n\t\t$product_data=$this->get_results( $getParproduct );\n\t\treturn $product_data;\n\t}", "function product_novendor()\n\t{\n\t\tglobal $log;\n\t\t$log->debug(\"Entering product_novendor() method ...\");\n\t\t$query = \"SELECT ec_products.productname, ec_products.deleted\n\t\t\tFROM ec_products\n\t\t\tWHERE ec_products.deleted = 0\n\t\t\tAND ec_products.vendor_id is NULL\";\n\t\t$result=$this->db->query($query);\n\t\t$log->debug(\"Exiting product_novendor method ...\");\n\t\treturn $this->db->num_rows($result);\n\t}", "protected function loadParentId(){return 0;}", "public function product()\n {\n \t// belongsTo(RelatedModel, foreignKey = p_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Product','p_id','p_id');\n }", "public function getProductbyId($id)\n {\n $this->db->select('*');\n $this->db->where('id', $id);\n $this->db->from($this->product); \n return $this->db->get();\n }", "public function Products_cate_home() {\n $this->db->select('product.id as pro_id,product.alias as pro_alias,product_category.alias,\n product.price,product.price_sale,product.name,product.image,product.category_id,product_category.id,\n product_category.home, product_category.name as cate_name');\n $this->db->join('product_category', 'product.category_id=product_category.id');\n $this->db->where('product.home', '1');\n $this->db->limit(12);\n $this->db->order_by('id', 'random');\n $q = $this->db->get('product');\n return $q->result();\n }", "function lista_tamanhos_produto($id)\n {\n #return $this->db->get_where('tamanhos_produtos',array('produtoID'=>$id))->row_array();\n $this->db->select('*'); \n #$this->db->from('tamanhos_produtos');\n $this->db->where('produtoID',$id);\n $this->db->order_by('idT', 'desc');\n $this->db->join('produtos','tamanhos_produtos.produtoID = produtos.idP');\n $this->db->join('cores','tamanhos_produtos.corID = cores.id');\n $this->db->join('tamanhos','tamanhos_produtos.tamanhoID = tamanhos.id');\n return $this->db->get('tamanhos_produtos')->result_array();\n \n }", "function select_idxmenu(){\n $query = $this->db->query(\"\n select title, file_path\n from sys_menu \n where is_parent = 0 order by id\n \");\n return $query;\n }", "function query() {\n $q = new EntityFieldQuery();\n $q->entityCondition('entity_type', 'commerce_product');\n $q->fieldCondition($this->options['flag_field'], 'value', 1);\n $results = $q->execute();\n\n $product_ids = array();\n foreach (reset($results) as $product) {\n $product_ids[] = (int)$product->product_id;\n }\n // Get the allowed products from the current user.\n $user_product_ids = array();\n $user = user_load($GLOBALS['user']->uid);\n if ($user->uid > 0) {\n // Fetch the ids from the current user.\n $products = field_get_items('user', $user, $this->options['user_authorized_products_field']);\n foreach ($products as $product) {\n $user_product_ids[] = (int)$product['target_id'];\n }\n }\n $exclude_ids = array_diff($product_ids, $user_product_ids);\n if (count($exclude_ids) > 0) {\n $this->query->add_where(2, $this->options['node_products_table'] . '.' . $this->options['node_products_column'], $exclude_ids, 'NOT IN');\n }\n }", "function _get_product_stock($product_id = 0)\r\n {\r\n return @$this->db->query(\"select sum(available_qty) as t from t_stock_info where product_id = ? and available_qty >= 0 \",$product_id)->row()->t;\r\n }", "public function getAllOrderProductTable()\n {\n $statusComplete = false;\n try {\n // run your code here\n $sql = \"SELECT * FROM `pish_hikashop_order_product`\".\n \" WHERE `order_id` = \".$this->last_id.\";\"; //have error\n \n \n $result = $this->conn->query($sql);\n if ($result) {\n $rowcount = $result->num_rows;\n if ($rowcount > 0) {\n $dev_array = array();\n for ($i = 0; $i < $result->num_rows; $i++) {\n $row = $result->fetch_assoc();\n $dev_array[$i] = $row;\n }\n \n $message = '';\n //create message for send\n foreach($dev_array as $key => $value){\n $message .='تعداد ';\n $message .= $value['order_product_quantity'].' ';\n $message .='نام محصول: ';\n $message .= $value['order_product_name'];\n $message .= ' <br>';\n \n }\n $this->messageProducts = $message;\n\n return true;\n } else {\n $statusComplete = false;\n }\n } else {\n $statusComplete = false;\n return false;\n \n }\n } catch (exception $e) {\n //code to handle the exception\n return false;\n }\n return $statusComplete;\n }", "function get_follow_up_product($id)\n {\n return $this->db->get_where('follow_up_product',array('id'=>$id))->row_array();\n }", "public function readone(){\n $query = \"SELECT\n p.prod_id as product_id, p.price, p.image,g.name as guitar_name,\n g.type as guitar_type, g.no_of_strings as strings\n FROM\n \" . $this->parent_tbl . \" p\n LEFT JOIN\n $this->guitar_tbl g\n ON g.prod_id = p.prod_id WHERE p.prod_id = ?\n LIMIT 0,1\";\n\n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n\n // sanitize\n $this->product_id=htmlspecialchars(strip_tags($this->product_id));\n\n // bind product id value\n $stmt->bindParam(1, $this->product_id);\n\n // execute query\n \\Database::execute($stmt);\n\n // get row values\n $row = $stmt->fetch(\\PDO::FETCH_ASSOC);\n\n // assign retrieved row value to object properties\n $this->guitar_name = $row['guitar_name'];\n $this->product_price = $row['price'];\n $this->product_image = $row['image'];\n\n }", "function mount_query($date){\n\n$query = \"SELECT product_quantity.quantity, product.price FROM table_order, product, product_quantity\nWHERE product.product_id = table_order.product_id\n\tAND product_quantity.pq_id = table_order.pq_id\n\tAND product_quantity.product_id = table_order.product_id\n\tAND table_order.order_date =\".$date.\";\";\n\nreturn $query;\n}", "public function getProductById($id){\n $query = $this->db->get_where('product',array('id' => $id));\n return $query->row(); \n }", "public static function getProductByid($id){\n $sql = \"SELECT products.*, category.cat_name from products inner join category on products.cat_id=category.cat_id where pro_id=\".$id;\n return runQuery($sql);\n }", "public function product_get_by_id($id)\n {\n\n $query = \"SELECT p.*, c.status as categoryStatus\n \t FROM \" . $this->db_table_prefix . \"products p\n LEFT JOIN \" . $this->db_table_prefix . \"categories c ON p.cat_id = c.id \n \t WHERE p.id = \".$id.\" and p.status=1\";\n\t\t\t\t \n\n $result = $this->commonDatabaseAction($query);\n // print_r($this->rowCount); exit;\n \n// if (mysql_num_rows($result) > 0)\n if ($this->rowCount > 0)\n {\n //print_r($this->sqlAssoc); exit;\n return $this->sqlAssoc;\n }\n else\n {\n return null;\n }\n }", "function GetProducts(){\n $query = $this->db->prepare(\"SELECT `p`.`id` as `id_producto`, `p`.`nombre` as `nombre_producto`, `p`.`descripcion` as `desc_producto`, `p`.`precio` as `precio`, `p`.`stock` as `stock`, `c`.`nombre` as `nombre_categoria` FROM producto p INNER JOIN categoria c ON `p`.`id_categoria`=`c`.`id`\");\n $query->execute();\n return $query->fetchAll(PDO::FETCH_OBJ);\n }", "public function all_products()\n\t{\n\t\t$this->db->where('product_status = 1');\n\t\t$query = $this->db->get('product');\n\t\t\n\t\treturn $query;\n\t}", "function list_actividades_componente($com_id){\n $sql = 'select p.prod_id,p.com_id,p.prod_producto,p.prod_ppto,p.indi_id,p.prod_indicador,p.prod_linea_base, p.prod_meta,p.prod_fuente_verificacion,p.prod_unidades,p.prod_ponderacion,p.estado,p.prod_mod,\n p.prod_resultado,p.acc_id,p.prod_cod, p.prod_observacion,p.mt_id,p.or_id,i.indi_descripcion,\n ore.or_id,ore.or_codigo,og.og_id,og.og_codigo, ae.acc_id,ae.acc_codigo,oe.obj_codigo,a.*\n from _productos p\n Inner Join indicador as i On i.indi_id=p.indi_id\n \n Inner Join objetivos_regionales as ore On ore.or_id=p.or_id\n\n Inner Join objetivo_programado_mensual as opm On ore.pog_id=opm.pog_id\n Inner Join objetivo_gestion as og On og.og_id=opm.og_id\n Inner Join _acciones_estrategicas as ae On ae.acc_id=og.acc_id\n Inner Join _objetivos_estrategicos as oe On oe.obj_id=ae.obj_id\n\n Inner Join _actividades as a On a.prod_id=p.prod_id\n \n where p.com_id='.$com_id.' and p.estado!=\\'3\\'\n order by p.prod_cod, oe.obj_codigo, ae.ae asc'; \n $query = $this->db->query($sql);\n return $query->result_array();\n }", "public function product(){\n return $this->hasMany('App\\Product','id_type','id');\n // 1: duong dan den model san pham , 2: khoa ngoai cua loai san pham voi san pham , 3 : khoa chinh cua loai san pham\n }", "function get_subkon($id='') {\r\n\t\tif ($id !== '') {\r\n\t\t\t$condition = \"msub_id = \".$id;\r\n\t\t} else {\r\n\t\t\t$condition = \"msub_isdel = 0\";\r\n\t\t}\r\n\t\t\t$this->db->select(\"*\");\r\n\t\t\t$this->db->from(\"apj_master.ms_subkon\");\r\n\t\t\t//$this->db->join(\"ms_skope\", \"skp_id = psk_skp_id\", \"left\");\r\n\t\t\t$this->db->where($condition);\r\n\t\t\t$this->db->order_by('msub_nama_subkon');\r\n\t\t\t//$this->db->limit(1);\r\n\t\t\t\r\n\t\t\t$query = $this->db->get();\r\n\t\t\tif($query->num_rows() > 0) {\r\n\t\t\t\treturn $query->result();\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t}", "public function all()\r\n {\r\n // left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n // left join mshop_media as mm on mm.id = mpl.refid\r\n // left JOIN mshop_price as mpri on mpri.id = mpl.refid\r\n // where mpl.pos = 0 and mpl.domain in ('media','price')\";\r\n /*$qry1 = \"select mp.id as product_id, mp.code as product_code, mp.label as product_name, mm.preview as image_url from mshop_product as mp \r\n left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n left join mshop_media as mm on mm.id = mpl.refid\r\n where mpl.pos = 0 and mpl.domain in ('media')\";\r\n $qry2 = \"select mp.id as product_id, mp.label as product_name, mpri.value as product_price from mshop_product as mp \r\n left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n left JOIN mshop_price as mpri on mpri.id = mpl.refid\r\n where mpl.pos = 0 and mpl.domain in ('price')\";\r\n $products1 = DB::select($qry1);\r\n $products2 = DB::select($qry2); \r\n $i = 0;\r\n foreach($products1 as $products) {\r\n foreach($products2 as $product) {\r\n if($product->product_id === $products->product_id) {\r\n $products1[$i]->product_price = $product->product_price;\r\n }\r\n }\r\n $i++;\r\n }\r\n \r\n return $products1;*/\r\n }", "public function getProductInfoDetail($id){\r\n \t$db=$this->getAdapter();\r\n \t$sql = \"SELECT p.pro_id,p.cate_id,p.stock_type,p.item_name,p.item_code,p.price_per_qty,p.brand_id,\r\n \tp.photo,p.is_avaliable,p.remark,c.Name,branch_namekh As branch_name\r\n \tFROM ln_ins_product AS p\r\n \tINNER JOIN ln_ins_category AS c ON c.CategoryID=p.cate_id\r\n \tINNER JOIN tb_branch AS b ON b.branch_id=p.brand_id\r\n \tWHERE p.pro_id=\".$id.\" LIMIT 1\";\r\n \t$rows = $db->fetchRow($sql);\r\n \treturn ($rows);\r\n }" ]
[ "0.66640514", "0.6497889", "0.64591616", "0.6380273", "0.63108003", "0.60890007", "0.60820985", "0.6040566", "0.6034275", "0.59665245", "0.5910264", "0.5884655", "0.58806074", "0.5864363", "0.5824354", "0.57905424", "0.5744224", "0.5731357", "0.57016665", "0.57014763", "0.5701297", "0.56909305", "0.5677437", "0.5638829", "0.56287557", "0.56262916", "0.5617763", "0.5603081", "0.5600525", "0.5587859", "0.55533373", "0.5523514", "0.55223274", "0.5515924", "0.5499656", "0.5485851", "0.5482302", "0.5475407", "0.5472949", "0.54685724", "0.54601413", "0.5453339", "0.5449815", "0.54374146", "0.54339606", "0.54329705", "0.5425792", "0.54160726", "0.5415238", "0.53986794", "0.5398381", "0.53898335", "0.5387", "0.5379051", "0.53771806", "0.53744304", "0.53681934", "0.536258", "0.53624034", "0.5360458", "0.53601724", "0.53520995", "0.5339445", "0.53300893", "0.5324008", "0.53186476", "0.53046775", "0.52998763", "0.5299755", "0.5296881", "0.52954364", "0.5292319", "0.5289922", "0.52846605", "0.5267978", "0.5266124", "0.52629566", "0.52603674", "0.5254766", "0.5249272", "0.52453905", "0.5244675", "0.5244559", "0.52435946", "0.5241417", "0.5237673", "0.52355355", "0.5235456", "0.5227535", "0.52267665", "0.52256805", "0.52109176", "0.52080566", "0.52071935", "0.5204478", "0.52035534", "0.5203228", "0.52029234", "0.5199187", "0.5193952" ]
0.65871334
1
Adds a link tag, with the various attributes set as specified
public function render($rel, $href, $hreflang = '', $media = '', $sizes = '', $type = '') { $attributes = array(); $attributes['rel'] = $rel; $attributes['href'] = $href; if($hreflang) { $attributes['hreflang'] = $hreflang; } if($media) { $attributes['media'] = $media; } if($sizes){ $attributes['sizes'] = $sizes; } if($type) { $attributes['type'] = $type; } $tagAttributes = ''; foreach($attributes as $attribute => $value) { $tagAttributes .= " $attribute=\"$value\""; } $linkTag = "<link" . $tagAttributes . " >"; $this->addPageHeader($linkTag, md5($rel . ':' . $href )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addLink(string $name, array $attributes);", "public function add_link($rel, $href, $attributes = array())\n {\n }", "public function testLinkWithAribtraryAttributes() {\n\t\t$this->_useMock();\n\n\t\t$options = array('id' => 'something', 'htmlAttributes' => array('arbitrary' => 'value', 'batman' => 'robin'));\n\t\t$result = $this->Js->link('test link', '/posts/view/1', $options);\n\t\t$expected = array(\n\t\t\t'a' => array('id' => $options['id'], 'href' => '/posts/view/1', 'arbitrary' => 'value',\n\t\t\t\t'batman' => 'robin'),\n\t\t\t'test link',\n\t\t\t'/a'\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t}", "public function set_link($link) \n\t{\n\t\tif($this->version == RSS2 || $this->version == RSS1)\n\t\t{\n\t\t\t$this->add_element('link', $link);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->add_element('link','',array('href'=>$link));\n\t\t\t$this->add_element('id', zajlib_feed::uuid($link,'urn:uuid:'));\n\t\t} \n\t\t\n\t}", "public function add_link($url, $title, $sort_order=NULL, $attributes=array()) {\n $args = func_get_args();\n \t$filter_pass = DynamicMenu_Filter::apply_filters('add_link', $args);\n if (!$filter_pass) {\n return $this;\n }\n $attributes = array_merge($this->attributes, $attributes);\n $anchor = Html::anchor($url, $title, $attributes);\n $key = self::slugify($title);\n $this->links[$key] = array(\n 'html' => $anchor,\n 'title' => $title,\n 'sort_order' => (int) $sort_order,\n );\n return $this;\n }", "function addLink($label, $link) \n {\n $xmlObject = new XMLObject( XMLObject_Menu::NODE_ITEM );\n $xmlObject->addElement( XMLObject_Menu::ITEM_TYPE, XMLObject_Menu::ITEM_TYPE_LINK);\n $xmlObject->addElement(XMLObject_Menu::ITEM_TYPE_LINK_LABEL, $label);\n $xmlObject->addElement(XMLObject_Menu::ITEM_TYPE_LINK_LINK, $link);\n \n $this->addXmlObject( $xmlObject );\n \n }", "function alink($title=null,$url=null,$attributes=[], $secure=null,$escape=false) \n\t{\n\t\treturn app('html')->alink($title,$url,$attributes,$secure,$escape);\n\t}", "function linktag($destination, $content, $class='', $style='', $id='', $extra='', $title_alt='')\n\t{\n\t\t$content = ($this->entitize_content) ? htmlentities('' . $content) : $content;\n\t\t$extra .= ' href=\"' . $destination . '\"';\n\t\t$extra .= ($title_alt == '' ? '' : ' alt=\"' . $title_alt . '\" title=\"' . $title_alt . '\"');\n\t\treturn $this->tag('a', $content, $class, $style, $id, $extra);\n\t}", "public function setLink($link);", "protected function pakHrefAttr(): string\n {\n return \"href='{$this->link}'\";\n }", "public function makeLinkButton() {}", "function link($text,$url = '#',$attribute = array()){ \r\n\t\t$attribute = $this->convertStringAtt($attribute);\r\n\t\tif($url){\r\n\t\t\tpreg_match(\"/([^\\?]+)?(\\?)?(.+)?/\", $url, $reg);\r\n\t\t\tif(isset($reg[3])){\r\n\t\t\t\tpreg_match_all(\"/&(amp;)?([^&]+)/\",\"&\".$reg[3], $exp);\r\n\t\r\n\t\t\t\tfor ($i=0;$i<count($exp[2]);$i++){\r\n\t\t\t\t\t$var = explode(\"=\",$exp[2][$i]);\r\n\t\t\t\t\t$exp[2][$i] = $var[0].\"=\".urlencode(isset($var[1]) ? $var[1] : '');\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\t$reg[3] = implode(\"&\",$exp[2]);\r\n\t\t\t}else{\r\n\t\t\t\t$reg[3] = '';\r\n\t\t\t}\r\n\t\t\t$stat = '';\r\n\t\t\tif(isset($attribute['state'])){\r\n\t\t\t\tif($attribute['state'] == \"*\"){\r\n\t\t\t\t\t$ex = array();\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$ex = explode(\",\",$attribute['state']);\r\n\t\t\t\t}\r\n\t\t\t\t$stat = $GLOBALS['BASIC_URL']->serialize($ex);\r\n\t\t\t\tunset($attribute['state']);\r\n\t\t\t}\r\n\t\t\t$tmp = $stat.$reg[3];\r\n\t\t\t$attribute['href'] = $reg[1].($tmp ? '?' : '').$tmp;\r\n\t\t\tif(isset($attribute['path'])){\r\n\t\t\t\t$tmp = $GLOBALS['BASIC']->pathFile(\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t$GLOBALS['BASIC']->ini_get('root_virtual'),\r\n\t\t\t\t\t\t$attribute['href']\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\r\n\t\t\t\t$attribute['href'] = $tmp[0].$tmp[1];\r\n\t\t\t\tunset($attribute['path']);\r\n\t\t\t}\r\n\t\t\t$attribute['href'] = $GLOBALS['BASIC_URL']->link($attribute['href']);\r\n\t\t}else{\r\n\t\t\t$attribute['href'] = '#';\r\n\t\t}\r\n\t\treturn $this->createTag('a',$attribute,$text);\r\n\t}", "protected function addLinks()\n {\n }", "function makeLink($label, $link, $ATagParams = ''){\n\t\tif(is_array($this->conf['typolink.']))\n\t\t\t$myConf = $this->conf['typolink.'];\n\t\t$myConf['parameter'] = $link;\n\t\tif($ATagParams) {\n\t\t\t$myConf['ATagParams'] = $ATagParams;\n\t\t}\n\t\treturn $this->cObj->typoLink($label, $myConf);\n }", "function addLink(& $story, & $pageElement) {\t\t\n\t\t$storyElement =& $this->_document->createElement('link');\n\t\t$pageElement->appendChild($storyElement);\n\t\t\n\t\t$this->addCommonProporties($story, $storyElement);\n\t\t\n \t\t// description\n\t\t$shorttext =& $this->_document->createElement('description');\n\t\t$storyElement->appendChild($shorttext);\n\t\t$shorttext->appendChild($this->_document->createTextNode(htmlspecialchars($story->getField('shorttext'))));\n \t\t\n \t\t// file\n\t\t$longertext =& $this->_document->createElement('url');\n\t\t$storyElement->appendChild($longertext);\n\t\t$longertext->appendChild($this->_document->createTextNode(htmlspecialchars($story->getField(\"url\"))));\n\t\t\n\t\t$this->addStoryProporties($story, $storyElement);\n\t}", "public static function anchor($url,$text,$attributes = null) {\r\n\t\treturn \"<a href='\".Configuration::getURLPath().\"/\".$url.\"' \".$attributes.\">\".$text.\"</a>\";\r\n\t}", "public function addLink($link, $updated_at)\n {\n $link_object = new CustomObject;\n $link_object->link = $link;\n $link_object->updated_at = $updated_at;\n\n $this->links[] = $link_object;\n }", "function edit_tag_link($link = '', $before = '', $after = '', $tag = \\null)\n {\n }", "public function addLink($href, $text){\n $this->links[] = array(\"href\" => $href, \"text\" => $text);\n }", "function initialize () {\n $this->set_openingtag(\"\");\n\t $this->set_closingtag(\"<LINK[attributes]/>\");\n }", "public function linkTag($src = \"\", $link_text = NULL, $options = NULL)\n {\n $src = ($src != \"\") ? $src : \"javascript:void(0)\";\n $pt_str = isset($options) ? $this->options2str($options) : '';\n return '<a href=\"' . $src . '\" ' . $pt_str . '>' . $link_text . '</a>';\n }", "private function linkToObject($name = 'Click Here', $link = '#', array $atts = array())\n\t{\n\t\tLog::debug(sprintf('Creating navigation link to %s (%s)', $name, $link));\n\n\t\treturn new ListItem(new Anchor(trim(ucwords($name)), null, array(), array_merge(array('href' => $link, 'title' => trim(ucwords($name))), $atts)));\n\t}", "function nav_menu_link_attributes( $attr ) {\n\n\t$attr['class'] = 'menu__link';\n\n\treturn $attr;\n}", "function HTMLLink ($params) {\n $val = $params['value'];\n unset($params['value']);\n $str = '';\n foreach ($params as $k=>$v) {\n $str .= \" {$k}=\\\"{$v}\\\"\";\n }\n return \"<a {$str} >{$val}</a>\";\n }", "function start_anchor($link, $tabs = 0, $nl = false)\n{\n /**\n * Starting Anchor tag.\n *\n * Args:\n * $link (int): the link of the Anchor\n * $tabs (int): number of tabs for indentation, default is 0\n * $nl (bool): print NewLine in the end ? default is 'false'.\n */\n start_tag('a', Tab($tabs), $nl, \"href='\" . $link . \"'\") ;\n}", "protected function linkAdd() { return \"\"; }", "function initialize () {\n $this->set_openingtag(\"<A[attributes]>\");\n\t$this->set_closingtag(\"</A>\");\n }", "public function renderLinkAttributeFields() {}", "public function renderLinkAttributeFields() {}", "public function addLink(Link $l)\n\t{\n\t\t$this->collLinks[] = $l;\n\t\t$l->setMm($this);\n\t}", "public function setLink($link) {\n\t\t$this->addChannelTag('link', $link);\n\t}", "function jslinktag($content=false, $onclick='', $onmouseover='', $onmouseout='', $class='', $style='', $id='', $extra='', $title_alt='', $img=false)\n\t{\n\t\t$content = ($this->entitize_content) ? htmlentities('' . $content) : $content;\n\t\t$extra .= ($onclick != '' ? ' onclick=\"' . $onclick . '\"' : '');\n\t\t$extra .= ($onmouseover != '' ? ' onmouseover=\"' . $onmouseover . '\"' : '');\n\t\t$extra .= ($onmouseout != '' ? ' onmouseout=\"' . $onmouseout . '\"' : '');\n\t\t$extra .= ($title_alt == '' ? '' : ' alt=\"' . $title_alt . '\" title=\"' . $title_alt . '\"');\n\t\t$content = ($content == false && (!(empty($img)))) ? '<img src=\"' . $img . '\" />' : $content;\n\t\treturn $this->tag('a', $content, $class, $style, $id, $extra);\n\t}", "public function attr() {\n\n\t\t\t\t$attr = [\n\t\t\t\t\t'class' => 'fusion-one-page-text-link',\n\t\t\t\t];\n\n\t\t\t\tif ( $this->args['class'] ) {\n\t\t\t\t\t$attr['class'] .= ' ' . $this->args['class'];\n\t\t\t\t}\n\n\t\t\t\tif ( $this->args['id'] ) {\n\t\t\t\t\t$attr['id'] = $this->args['id'];\n\t\t\t\t}\n\n\t\t\t\t$attr['href'] = $this->args['link'];\n\n\t\t\t\treturn $attr;\n\n\t\t\t}", "public function addLink(AdminLink $link, string $desiredHeading = null): MenuWidget;", "function createItemLink($itemid, $extra = '') {\n return createLink('item', array('itemid' => $itemid, 'extra' => $extra) );\n}", "public function add_links($links)\n {\n }", "function link_to($url, $title = null, $attributes = [], $secure = null)\n {\n return app('html')->link($url, $title, $attributes, $secure);\n }", "public function appendHyperlink(?string $href = null, mixed $content = null, ?string $target = null): A;", "function caEditorLink($po_request, $ps_content, $ps_classname, $ps_table, $pn_id, $pa_additional_parameters=null, $pa_attributes=null, $pa_options=null) {\n\t\tif (!($vs_url = caEditorUrl($po_request, $ps_table, $pn_id, false, $pa_additional_parameters, $pa_options))) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t$vs_tag = \"<a href='\".$vs_url.\"'\";\n\t\t\n\t\tif ($ps_classname) { $vs_tag .= \" class='$ps_classname'\"; }\n\t\tif (is_array($pa_attributes)) {\n\t\t\tforeach($pa_attributes as $vs_attribute => $vs_value) {\n\t\t\t\t$vs_tag .= \" $vs_attribute='\".htmlspecialchars($vs_value, ENT_QUOTES, 'UTF-8').\"'\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$vs_tag .= '>'.$ps_content.'</a>';\n\t\t\n\t\treturn $vs_tag;\n\t}", "public function asLink()\n {\n $label = $this->title ?: $this->value;\n return '<a href=\"' . $this->href .'\" title=\"' . $label . '\">' . $label . '</a>';\n }", "function setLink($link) {\r\n $this->_link = $link;\r\n }", "function setLink($link) {\r\n $this->_link = $link;\r\n }", "function link_to($url, $title = null, $attributes = [], $secure = null, $escape = true)\n {\n return app('html')->link($url, $title, $attributes, $secure, $escape);\n }", "function addPageNavLink(& $link, & $parentElement) {\n\t\t$linkElement =& $this->_document->createElement('navlink');\n\t\t$parentElement->appendChild($linkElement);\n\t\t\n\t\t$this->addCommonProporties($link, $linkElement);\n\t\t\n\t\t// url\n\t\t$url =& $this->_document->createElement('url');\n\t\t$linkElement->appendChild($url);\n\t\t$url->appendChild($this->_document->createTextNode(htmlspecialchars($link->getField('url'))));\n\t\t\n\t\tif ($link->getField('location') == 'right')\n\t\t\t$linkElement->setAttribute('location', 'right');\n\t\telse\n\t\t\t$linkElement->setAttribute('location', 'left');\n\t}", "private function generateLink( DOMNode $root, ezcFeedLinkElement $dataNode )\n {\n $elementTag = $this->xml->createElement( 'link' );\n $root->appendChild( $elementTag );\n\n $elements = array( 'href', 'rel', 'type', 'hreflang', 'title', 'length' );\n if ( !isset( $dataNode->href ) )\n {\n $parentNode = ( $root->nodeName === 'entry' ) ? '/feed' : '';\n $parentNode = ( $root->nodeName === 'source' ) ? '/feed/entry' : $parentNode;\n\n throw new ezcFeedRequiredMetaDataMissingException( \"{$parentNode}/{$root->nodeName}/link/@href\" );\n }\n\n foreach ( $elements as $attribute )\n {\n if ( isset( $dataNode->$attribute ) )\n {\n $this->addAttribute( $elementTag, $attribute, $dataNode->$attribute );\n }\n }\n }", "public function link($link,$title = null)\r\n {\r\n $title = $title ?? $link;\r\n return $this->element('a',$title)->attribute('href',$link);\r\n }", "public function addAnchor ($href, $text, $id = NULL, $class = NULL, $attributes = array ())\n\t{\n\t\t$id = (empty($id) ? '' : ' id=\"' . $id . '\"');\n\t\t$class = (empty($class) ? '' : ' class=\"' . $class . '\"');\n\n\t\t$html = \"<a href=\\\"$href\\\"\" . $id . $class . \"\";\n\t\tif ($attributes) {\n\t\t\t$html .= $this -> addAttributes($attributes);\n\t\t}\n\t\t$html .= \">$text</a>\";\n\n\t\treturn $html;\n\t}", "public function setLink($link){\n\t\t$this->link = $link;\n\t}", "static function a($link, $text, $id = Null, $class = Null)\n {\n return '<a'.self::_id($id).self::_class($class).' href=\"'. $link.'\" title=\"'.$text.'\" >'.$text.'</a>';\n }", "protected function setAddButton($link, $name) {\n return '<p class=\"add\"><a href=\"'.$this->url->getAdminPage().$link.'\">Добавить '.$name.'</a></p>';\n }", "public function addLink($doc, $tag = null) {\n\t\tif($doc instanceof \\RiakLink) {\n\t\t\t$new_link = $doc;\n\t\t} else if($doc instanceof \\Ripple\\Document) {\n\t\t\t$new_link = new \\RiakLink($doc->bucket()->name, $doc->key(), $tag);\n\t\t}\n\t\t$this->_links[] = $new_link;\n\t\treturn $this;\n\t}", "function links_add_target($content, $target = '_blank', $tags = array('a'))\n {\n }", "public function linkAttributes()\n {\n return ['icon' => 'fa fa-code-fork'];\n }", "static public function a($href = '', $title = '', $target = \"_self\", $misc = '', $newline = true)\n {\n global $config;\n if(empty($title)) $title = $href;\n $newline = $newline ? \"\\n\" : '';\n /* if page has onlybody param then add this param in all link. the param hide header and footer. */\n if(strpos($href, 'onlybody=yes') === false and isset($_GET['onlybody']) and $_GET['onlybody'] == 'yes')\n {\n $onlybody = $config->requestType == 'PATH_INFO' ? \"?onlybody=yes\" : \"&onlybody=yes\";\n $href .= $onlybody;\n }\n if($target == '_self') return \"<a href='$href' $misc>$title</a>$newline\";\n return \"<a href='$href' target='$target' $misc>$title</a>$newline\";\n }", "private function is_link_attribute($tag, $attr)\n {\n return ($tag == 'a' || $tag == 'area') && $attr == 'href';\n }", "function olink($destination='', $class='', $style='', $id='', $extra='')\n\t{\n\t\t$extra = ($extra == '' ? 'href=\"' . $destination . '\"' : $extra . ' href=\"' . $destination . '\"');\n\t\treturn $this->otag('a', $class, $style, $id, $extra);\n\t}", "function link_to(string $url, ?string $title = null, array $attributes = [], ?bool $secure = null, bool $escape = true): Htmlable\n {\n return \\app('html')->link($url, $title, $attributes, $secure, $escape);\n }", "public function addLinks(\\google\\tracing\\v1\\Span\\Link $value){\n return $this->_add(9, $value);\n }", "public function setLink($link){\n $this->link = $link;\n return $this;\n }", "public static function link($url, $title = null, $attributes = array(), $https = null) {\n\t\t$url = URL::to($url, $https);\n\n\t\tif (is_null($title)) $title = $url;\n\n\t\treturn '<a href=\"'.$url.'\"'.static::attributes($attributes).'>'.static::entities($title).'</a>';\n\t}", "public function link($link) {\n\t\t$this->link = $link;\n\t\treturn $this;\n\t}", "function Link($id,$title,$url,$description,$category_id,$on_homepage)\n\t{\n\t\tparent::Resource($id,RESOURCE_LINK);\n\t\t$this->title = $title;\n\t\t$this->url = $url;\n\t\t$this->description = $description;\t\n\t\t$this->category_id = $category_id;\n\t\t$this->on_homepage = $on_homepage;\n\t}", "public function addUserLink($link = array()) {\n foreach( $link as $name => $href ) {\n $this->user_links[$name] = $href;\n }\n }", "public function generate_links($attr)\n\t{\n\t\t$source = \"http://www.marketingvillas.com/links_rev.php\";\n\t\t$source .= '?exc='.str_replace('uat.','www.',$_SERVER['SERVER_NAME']);\n\t\t\n\t\tif($attr['heading'] != '')\n\t\t\t$source .= '&heading='.$attr['heading'];\n\t\t\n\t\tif($attr['uriheading'] != '')\n\t\t\t$source .= '&url_heading='.$attr['uriheading'];\n\t\telse\n\t\t\t$source .= '&url_heading=h2';\n\t\t\n\t\tif($attr['what'] != '')\n\t\t\t$source .= '&what='.urlencode($attr['what']);\n\t\t\n\t\t$meme = $this->ret(ltrim($attr['sublocation']));\n\t\t$source .= '&location='.$meme['location'];\n\t\t$source .= '&area='.$meme['area'];\n\t\t//echo $source;\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $source);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t$output = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\treturn $output;\n\t}", "public function addLink($url, $rel, array $params = array())\r\r\n {\r\r\n $values = array(\"<{$url}>\", \"rel=\\\"{$rel}\\\"\");\r\r\n\r\r\n foreach ($params as $k => $v) {\r\r\n $values[] = \"{$k}=\\\"{$v}\\\"\";\r\r\n }\r\r\n\r\r\n return $this->add(implode('; ', $values));\r\r\n }", "function format_link($p_label, $p_action, $p_arg = array(), $p_class = '', $p_style = '', $p_prop = ''){\n\treturn $t_link = '<a class=\"' . $p_class . '\" style=\"' . $p_style . '\" href=\"' . format_href($p_action, $p_arg) . '\" ' . $p_prop . '>' . $p_label . '</a>';\n}", "protected function generateLinks()\n {\n if ( ! is_null($this->links) ) {\n foreach ( $this->links as $link ) {\n $this->addLine('<url>');\n $this->addLine('<loc>');\n $this->addLine($this->helpers->url(\n $link->link,\n $this->protocol,\n $this->host\n ));\n $this->addLine('</loc>');\n $this->addLine('<lastmod>' . date_format($link->updated_at, 'Y-m-d') . '</lastmod>');\n $this->addLine('</url>');\n }\n }\n }", "function crb_create_anchor($value, $link, $classes = '', $target = '_self') {\n\tif ( empty($link) || empty($link) ) {\n\t\treturn;\n\t}\n\n\tif ( $classes ) {\n\t\tif ( is_array($classes) ) {\n\t\t\t$classes = implode(' ', $classes);\n\t\t}\n\n\t\t$classes = 'class=\"' . $classes . '\"';\n\t}\n\n\tob_start();\n\t?>\n\n\t<a href=\"<?php echo $link; ?>\" target=\"<?php echo $target; ?>\" <?php echo $classes; ?>><?php\n\t\techo $value;\n\t?></a>\n\n\t<?php\n\treturn ob_get_clean();\n}", "function setLinks($link) \n {\n $this->links = $link;\n }", "function link() {\n $this->title = \"link\";\n }", "public function setLink(string $link): void\n {\n $this->link = $link;\n }", "public static function headLink($href, $attrs = '')\n {\n if (is_array($attrs)) {\n $attrs = Tag::getAttrs($attrs);\n }\n\n self::$_headLinks[] = array('href' => $href, 'attrs' => $attrs);\n }", "function _make_clickable_rel_attr($url)\n {\n }", "public static function linkShortcode($atts = [], $content = '', $tag = ''){\n // normalize attribute keys, lowercase\n $atts = array_change_key_case((array)$atts, CASE_LOWER);\n // override default attributes with user attributes\n $parsed_atts = shortcode_atts([\n 'id' => null,\n 'caption' => 'official_name_1'\n ], $atts, $tag);\n\n // get the ID from shortcode atts\n $id = $parsed_atts['id'];\n if (!$id) return '<a href=\"#\">[incorrect ID]</a>';\n\n // find card in database\n $card = get_post($id);\n // make sure POST is a 'travelcard'\n if (!$card || $card->post_type !== 'travelcard') return '<a href=\"#\">[not found]</a>';\n // retrieve meta for card\n $meta = get_post_meta($card->ID);\n\n // set caption\n $caption = $parsed_atts['caption'];\n if (preg_match('/^official\\_name\\_[0-5]$/', $caption)) {\n $caption = $caption ? $meta[$caption] : null;\n $caption = $caption ? $caption[0] : $card->post_title;\n }\n\n // set url\n $url = $meta['deep_link_2'];\n $url = $url ? $url[0] : '#';\n \n // build HTML\n $url = self::createRedirectUrl($url, $id);\n return '<a href=\"' . $url . '\" class=\"ege-cards-link\">' . $caption . '</a>';\n }", "public function set_link($link){\n\t\t$this->set_channel_element('link', $link);\n\t}", "public static function linkField($text,$url='#',$option=array()) {\n $option['href']=$url;\n \t\treturn self::htmltag('a',$option,$text);\n\t}", "function link_tag(\n $href = '',\n string $rel = 'stylesheet',\n string $type = 'text/css',\n string $title = '',\n string $media = '',\n bool $indexPage = false,\n string $hreflang = ''\n ): string {\n $attributes = [];\n // extract fields if needed\n if (is_array($href)) {\n $rel = $href['rel'] ?? $rel;\n $type = $href['type'] ?? $type;\n $title = $href['title'] ?? $title;\n $media = $href['media'] ?? $media;\n $hreflang = $href['hreflang'] ?? '';\n $indexPage = $href['indexPage'] ?? $indexPage;\n $href = $href['href'] ?? '';\n }\n\n if (! preg_match('#^([a-z]+:)?//#i', $href)) {\n $attributes['href'] = $indexPage ? site_url($href) : slash_item('baseURL') . $href;\n } else {\n $attributes['href'] = $href;\n }\n\n if ($hreflang !== '') {\n $attributes['hreflang'] = $hreflang;\n }\n\n $attributes['rel'] = $rel;\n\n if ($type !== '' && $rel !== 'canonical' && $hreflang === '' && ! ($rel === 'alternate' && $media !== '')) {\n $attributes['type'] = $type;\n }\n\n if ($media !== '') {\n $attributes['media'] = $media;\n }\n\n if ($title !== '') {\n $attributes['title'] = $title;\n }\n\n return '<link' . stringify_attributes($attributes) . _solidus() . '>';\n }", "public static function linkButton($label = '', $link = '', $misc = '')\n {\n global $config;\n /* if page has onlybody param then add this param in all link. the param hide header and footer. */\n if(strpos($link, 'onlybody=') === false and isset($_GET['onlybody']) and $_GET['onlybody'] == 'yes')\n {\n $onlybody = $config->requestType == 'PATH_INFO' ? \"?onlybody=yes\" : \"&onlybody=yes\";\n $link .= $onlybody;\n }\n return \" <input type='button' value='$label' class='button-c' $misc onclick='location.href=\\\"$link\\\"' /> \";\n }", "function addSectionNavLink(& $link, & $parentElement) {\n\t\t$linkElement =& $this->_document->createElement('navlink');\n\t\t$parentElement->appendChild($linkElement);\n\t\t\n\t\t$this->addCommonProporties($link, $linkElement);\n\t\t\n\t\t// url\n\t\t$url =& $this->_document->createElement('url');\n\t\t$linkElement->appendChild($url);\n\t\t$url->appendChild($this->_document->createTextNode(htmlspecialchars($link->getField('url'))));\n\t}", "function add_links($link,$domain = null) {\n $parameters = array(\n 'method' => __FUNCTION__,\n 'link' => json_encode($link)\n );\n \n if(!is_null($domain))\n $parameters['domain'] = $domain;\n \n return $this->get_data($parameters);\n }", "function anchor_li($uri = '', $title = '', $attributes = '', $li_attributes = '') {\r\n $return = '<li ' . $li_attributes . '>';\r\n $return .= anchor($uri, $title, $attributes);\r\n $return .= '</li>';\r\n return $return;\r\n}", "public function href($link, $language) {\r\n\t\techo \"<a title='$language' href='$link'>$language</a>\";\r\n\t}", "public function addLink($link)\n {\n $db = new db(self::db_links);\n $db->addLink($link);\n }", "function addPageRSS(& $link, & $parentElement) {\n\t\t$linkElement =& $this->_document->createElement('pageRSS');\n\t\t$parentElement->appendChild($linkElement);\n\t\t\n\t\t$this->addCommonProporties($link, $linkElement);\n\t\t\n\t\t// url\n\t\t$url =& $this->_document->createElement('url');\n\t\t$linkElement->appendChild($url);\n\t\t$url->appendChild($this->_document->createTextNode(htmlspecialchars($link->getField('url'))));\n\t\t\n\t\t$url->setAttribute('maxItems', $link->getField(\"archiveby\"));\n\t\t\n\t\tif ($link->getField('location') == 'right')\n\t\t\t$linkElement->setAttribute('location', 'right');\n\t\telse\n\t\t\t$linkElement->setAttribute('location', 'left');\n\t}", "public function add_doc_link($rel,$type,$title,$link)\n \t{\n \t\t$this->links[$title]=array($rel,$type,$title,$link);\n \t}", "public function link(string $name, array $params = [], array $options = []): string;", "public static function addnew(Link $link)\n {\n $ID=$user->ID;\n $PhysicalAddress=$Link->PhysicalAddress;\n $FriendlyAddress=$Link->FriendlyAddress;\n date_default_timezone_set(\"Africa/Cairo\");\n $today = date(\"Y-m-d H:i:s\");\n DB::add(\"links\",\"PhysicalAddress,FriendlyAddress,CreatedDateTime,LastUpdatedDateTime,IsDeleted\",\"'$PhysicalAddress','$FriendlyAddress','$today','$today',0\");\n \n \n // $conn->close();\n //header(\"Location:AddLink.php\");\n }", "function setUrlLink(){\n if( $this->id == 0 ) return;\n $url = $this->aFields[\"url\"]->toString();\n if( $url == \"\" ) return;\n $url = strip_tags( preg_replace( \"/[\\\"']/\", \"\", $url ) );\n if( !$this->aFields[\"url\"]->editable ) $this->aFields[\"url\"]->display = false;\n $this->aFields[\"url_link\"]->display = true;\n $this->aFields[\"url_link\"]->value = \"<a href=\\\"\".$url.\"\\\">\".$url.\"</a>\";\n }", "public function generateLink($params)\n {\n }", "function addLink($link){\r\n if(!$this->isURLExistingInLinkArry($link->getURL())){\r\n $this->crawlPage($link);\r\n }\r\n \r\n }", "public function setLink($link)\n {\n $this->setChannelElement('link', $link);\n }", "public function setHasLinkAttribute($has_link)\n {\n $this->attributes['has_link'] = $has_link == 1 || $has_link === 'true' || $has_link === true ? true : false;\n }", "protected function getWpraLinkAttrsFunction()\n {\n $name = 'wpra_link_attrs';\n $options = [\n 'is_safe' => ['html'],\n ];\n\n return new TwigFunction($name, function ($url, $options, $className = '') {\n return ' ' . $this->prepareLinkAttrs($url, $options, $className);\n }, $options);\n }", "public function allowLinks($requiredAttributes = array(), $defaultAttributes = array(), $autoLinks = true)\n {\n $this->jevix->cfgAllowTags('a');\n\n $requiredAttributes = is_array($requiredAttributes) ? $requiredAttributes : array($requiredAttributes);\n if (!in_array('href', $requiredAttributes)) {\n $requiredAttributes[] = 'href';\n }\n $this->jevix->cfgSetTagParamsRequired('a', $requiredAttributes);\n\n if (count($defaultAttributes)) {\n $this->jevix->cfgSetTagParamsAutoAdd('a', $defaultAttributes);\n }\n\n $this->jevix->cfgSetAutoLinkMode($autoLinks);\n }", "public function setLink(?string $link)\n {\n $this->link = $link;\n\n return $this;\n }", "function setLink(&$link)\n {\n $this->_link = $link;\n }", "public function renderTagAnchor($result);", "public function add(string $key, Link $item)\n {\n $this->links[$key] = $item;\n }", "public function render_button_links( $atts ) {\n $id = $atts['id'];\n $context['headline'] = get_post_meta( $id, 'yali_button_links_headline', true );\n $context['links'] = get_post_meta( $id, 'yali_button_links_repeat_group', true );\n\n if ( $context['links'] ) {\n\n foreach ($context['links'] as &$button) {\n $button['yali_button_link']['url'] = $this->filter_link($button['yali_button_link']['url']);\n }\n unset($button);\n }\n\n return Twig::render( 'content_blocks/button-links.twig', $context );\n }", "function links_add_base_url($content, $base, $attrs = array('src', 'href'))\n {\n }", "public function link($link)\n\t{\n\t\t$this->link = $link;\n\n\t\treturn $this;\n\t}" ]
[ "0.78147113", "0.73676896", "0.70746964", "0.6600127", "0.653899", "0.65304023", "0.64074624", "0.63698447", "0.63344836", "0.6329779", "0.63083506", "0.63038796", "0.6288869", "0.6260752", "0.62083524", "0.6161715", "0.61461914", "0.6123604", "0.6086899", "0.6024088", "0.60207736", "0.6008255", "0.60031945", "0.5999622", "0.5996315", "0.5992419", "0.59715337", "0.5967396", "0.5967396", "0.59581655", "0.59572065", "0.5955236", "0.5909848", "0.5897885", "0.58791023", "0.5872607", "0.5871465", "0.58679473", "0.58652043", "0.5864363", "0.5844566", "0.5844566", "0.5844189", "0.57993966", "0.5798079", "0.57920915", "0.57896066", "0.5789034", "0.5772866", "0.575308", "0.5748163", "0.5746454", "0.5722772", "0.57142043", "0.57039255", "0.5693356", "0.56672025", "0.5661789", "0.5660353", "0.5653454", "0.5645154", "0.56439495", "0.56349987", "0.5634126", "0.5629132", "0.5625599", "0.56181395", "0.5617202", "0.56080204", "0.5603422", "0.56016326", "0.5596758", "0.55946076", "0.5589316", "0.5580154", "0.55788267", "0.5576467", "0.55750364", "0.55741584", "0.5573711", "0.55667454", "0.5560937", "0.55599815", "0.5559747", "0.55594605", "0.55518854", "0.5548805", "0.55485696", "0.5528155", "0.5522593", "0.551772", "0.55082875", "0.5501775", "0.5500624", "0.5497765", "0.5494642", "0.5493764", "0.54915357", "0.5484208", "0.5474685", "0.54705185" ]
0.0
-1
/ SELECT tc.nome, tv.valor_final, tp.nome FROM `tb_venda` tv INNER JOIN tb_itens_vendas ti ON (ti.id_venda = tv.id_venda) INNER JOIN tb_cliente tc ON (tv.cliente = tc.id_cliente) INNER JOIN tb_produto tp ON (ti.id_produto = tp.id_produto)
public function transformaDadosDoBancoEmObjeto($dadosDoBanco) { $venda = new Venda(); $venda->setIdVenda($dadosDoBanco['id_venda']); $venda->setCliente($dadosDoBanco['cliente']); $venda->setValorFinal($dadosDoBanco['valor_final']); $venda->setValorTotal($dadosDoBanco['valor_total']); $venda->setDesconto($dadosDoBanco['desconto']); $venda->setQuantVendida($dadosDoBanco['quantidade']); $venda->setProduto($dadosDoBanco['produto']); //$venda = new Venda(); return $venda; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cargarDatosVotante($idactual){\n $sql=\"SELECT correovotante,nombrevotante,apellidovotante FROM votante WHERE idvotante=$idactual;\";\n\t\t\treturn $sql;\n }", "public function get_datos_pac_rec_ini($sucursal,$id_usuario){\n\n $conectar= parent::conexion();\n\t \n\t $sql= \"select v.id_ventas,v.sucursal,v.subtotal,v.numero_venta,p.nombres,p.telefono,p.id_paciente,v.tipo_pago,v.vendedor from ventas as v join pacientes as p where p.id_paciente=v.id_paciente and v.sucursal=? and v.id_usuario=? order by id_ventas DESC limit 1;\";\n\n $sql=$conectar->prepare($sql);\n $sql->bindValue(1, $sucursal);\n $sql->bindValue(2, $id_usuario);\n $sql->execute();\n\n return $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n\n}", "public function getNominaEtau($id,$idg)\n { \n $result=$this->adapter->query('select distinct c.idNom, c.id, a.idCon, \n case a.cCosEmp when 0 then a.idCcos\n when 1 then b.idCcos End as idCcos, \n case a.horasCal when 0 then 0 \n when 1 then (c.dias*'.$this->horasDias.') End as horas, 1, \n case when g.valor=2 then \n case when g.tipo = 1 then a.valor else 0 End\t\t\t\t \n when g.valor=1 then 0 \n End as dev, \n case when g.valor=2 then \n case when g.tipo = 2 then a.valor else 0 End\t\t\t\t \n when g.valor=1 then 0 \n\t\tEnd as ded, h.formula, c.dias, g.tipo\n , b.id as idEmp , g.idFor , a.diasLab, c.diasVac, a.vaca,\n case when ii.codigo is null then \"\" else ii.codigo end as nitTer \n from n_tip_auto_i a inner join a_empleados b on a.idTauto=b.idTau\n inner join n_nomina_e c on b.id=c.idEmp \n inner join n_nomina d on d.id=c.idNom\n inner join n_tip_auto_tn e on e.idTnom=d.idTnom \n inner join n_tip_calendario f on f.id=d.idCal\n inner join n_conceptos g on g.id=a.idCon \n inner join n_formulas h on h.id=g.idFor \n left join n_terceros_s i on i.id = g.idTer \n left join n_terceros ii on ii.id = i.idTer \n WHERE not exists (SELECT null from n_nomina_e_d \n where c.id=idInom and a.idCon=idConc and a.idCcos=idCcos and tipo=1 ) \n and d.estado=0 and b.idGrup='.$idg.' and c.idNom='.$id,Adapter::QUERY_MODE_EXECUTE);\n $datos=$result->toArray();\n return $datos; \n }", "public function getNominaEtau2($id,$idg)\n { \n $result=$this->adapter->query('select distinct c.idNom, c.id, a.idCon, \n case a.cCosEmp when 0 then a.idCcos\n when 1 then b.idCcos End as idCcos, \n case a.horasCal when 0 then 0 \n when 1 then (c.dias*'.$this->horasDias.') End as horas, 1, \n case when g.valor=2 then \n case when g.tipo = 1 then a.valor else 0 End\t\t\t\t \n when g.valor=1 then 0 \n End as dev, \n case when g.valor=2 then \n case when g.tipo = 2 then a.valor else 0 End\t\t\t\t \n when g.valor=1 then 0 \n\t\tEnd as ded, h.formula, c.dias, g.tipo , b.id as idEmp , g.idFor , a.diasLab, c.diasVac, a.vaca, \n case when ii.codigo is null then \"\" else ii.codigo end as nitTer \n from n_tip_auto_i a inner join a_empleados b on a.idTauto=b.idTau2\n inner join n_nomina_e c on b.id=c.idEmp \n inner join n_nomina d on d.id=c.idNom\n inner join n_tip_auto_tn e on e.idTnom=d.idTnom \n inner join n_tip_calendario f on f.id=d.idCal\n inner join n_conceptos g on g.id=a.idCon\n inner join n_formulas h on h.id=g.idFor\n left join n_terceros_s i on i.id = g.idTer \n left join n_terceros ii on ii.id = i.idTer \n WHERE not exists (SELECT null from n_nomina_e_d \n where c.id=idInom and a.idCon=idConc and a.idCcos=idCcos and tipo=1 ) \n and d.estado=0 and b.idGrup='.$idg.' and c.idNom='.$id,Adapter::QUERY_MODE_EXECUTE);\n $datos=$result->toArray();\n return $datos; \n }", "function consultarenviodetallesCedula (){\n\t\t$x = $this->pdo->prepare('SELECT En.empresa,En.telefono,En.fechaEnvio,Cl.cedula FROM enviodetalles EN INNER JOIN cliente Cl ON En.cedulaCliente = Cl.cedula');\n\t\t$x->execute();\n\t\treturn $x->fetchALL(PDO::FETCH_OBJ);\n\t}", "function listar_valores($tipo, $id){\n $contratista = \"\";\n $contratante = \"\";\n \n // Si viene algun dato y es contratista\n if ($tipo == \"contratista\" && $id != \"\") {\n $contratista = \"AND c.Fk_Id_Terceros = {$id}\";\n }\n \n // Si viene algun dato y es contratista\n if ($tipo == \"contratante\" && $id != \"\") {\n $contratista = \"AND c.Fk_Id_Terceros_Contratante = {$id}\";\n }\n\n $sql =\n \"SELECT\n c.Pk_Id_Contrato,\n c.Numero,\n c.Objeto,\n tc.Nombre AS Contratante,\n tbl_terceros.Nombre AS Contratista,\n c.Fecha_Inicial,\n c.Fecha_Vencimiento,\n c.Plazo AS Plazo_Inicial,\n c.Valor_Inicial,\n (\n SELECT\n ifnull(SUM(contratos_pagos.Valor_Pago), 0)\n FROM\n contratos\n LEFT JOIN contratos_pagos ON contratos_pagos.Fk_Id_Contratos = contratos.Pk_Id_Contrato\n WHERE\n contratos.Pk_Id_Contrato = c.Pk_Id_Contrato\n GROUP BY\n contratos.Pk_Id_Contrato\n ) AS Pagado,\n (\n SELECT\n IFNULL(SUM(adiciones.Plazo), 0)\n FROM\n contratos_adiciones AS adiciones\n WHERE\n adiciones.Fk_Id_Contrato = c.Pk_Id_Contrato\n ) AS Plazo_Adiciones,\n (\n SELECT\n IFNULL(\n SUM(contratos_adiciones.Valor),\n 0\n )\n FROM\n contratos_adiciones\n WHERE\n contratos_adiciones.Fk_Id_Contrato = c.Pk_Id_Contrato\n ) AS Valor_Adiciones,\n tbl_estados.Estado,\n tcc.Nombre AS CentroCosto\n FROM\n contratos AS c\n LEFT JOIN tbl_terceros ON c.Fk_Id_Terceros = tbl_terceros.Pk_Id_Terceros\n LEFT JOIN tbl_estados ON c.Fk_Id_Estado = tbl_estados.Pk_Id_Estado\n LEFT JOIN tbl_terceros AS tc ON c.Fk_Id_Terceros_Contratante = tc.Pk_Id_Terceros\n INNER JOIN tbl_terceros AS tcc ON tcc.Pk_Id_Terceros = c.Fk_Id_Terceros_CentrodeCostos\n WHERE c.Fk_Id_Proyecto = {$this->session->userdata('Fk_Id_Proyecto')}\n {$contratista}\n ORDER BY\n c.Fk_Id_Estado ASC,\n c.Fecha_Inicial DESC\";\n\n //Se retorna la consulta\n return $this->db->query($sql)->result();\n }", "public function VentasPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT clientes.codcliente, clientes.cedcliente, clientes.nomcliente, clientes.tlfcliente, clientes.direccliente, clientes.emailcliente, ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente as cliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.totalpago2, ventas.tipopagove, ventas.formapagove, ventas.montopagado, ventas.montodevuelto, ventas.fechaventa, ventas.fechavencecredito, ventas.statusventa, ventas.delivery, ventas.repartidor, ventas.observaciones, mediospagos.mediopago, salas.nombresala, mesas.codmesa, mesas.nombremesa, usuarios.nombres, cajas.nrocaja, abonoscreditos.codventa as cod, abonoscreditos.fechaabono, SUM(montoabono) AS abonototal FROM (ventas LEFT JOIN clientes ON clientes.codcliente = ventas.codcliente) LEFT JOIN mesas ON ventas.codmesa = mesas.codmesa LEFT JOIN salas ON mesas.codsala = salas.codsala LEFT JOIN mediospagos ON ventas.formapagove = mediospagos.codmediopago LEFT JOIN abonoscreditos ON ventas.codventa = abonoscreditos.codventa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN usuarios ON ventas.codigo = usuarios.codigo WHERE ventas.codventa =? GROUP BY cod\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function getNominaEtau4($id,$idg)\n { \n $result=$this->adapter->query('select distinct c.idNom, c.id, a.idCon, \n case a.cCosEmp when 0 then a.idCcos\n when 1 then b.idCcos End as idCcos, \n case a.horasCal when 0 then 0 \n when 1 then (c.dias*'.$this->horasDias.') End as horas, 1, \n case when g.valor=2 then \n case when g.tipo = 1 then a.valor else 0 End\t\t\t\t \n when g.valor=1 then 0 \n End as dev, \n case when g.valor=2 then \n case when g.tipo = 2 then a.valor else 0 End\t\t\t\t \n when g.valor=1 then 0 \n\t\tEnd as ded, h.formula, c.dias, g.tipo , b.id as idEmp , g.idFor , a.diasLab, c.diasVac, a.vaca,\n case when ii.codigo is null then \"\" else ii.codigo end as nitTer \n from n_tip_auto_i a inner join a_empleados b on a.idTauto=b.idTau4 \n inner join n_nomina_e c on b.id=c.idEmp \n inner join n_nomina d on d.id=c.idNom\n inner join n_tip_auto_tn e on e.idTnom=d.idTnom \n inner join n_tip_calendario f on f.id=d.idCal\n inner join n_conceptos g on g.id=a.idCon\n inner join n_formulas h on h.id=g.idFor\n left join n_terceros_s i on i.id = g.idTer \n left join n_terceros ii on ii.id = i.idTer \n WHERE not exists (SELECT null from n_nomina_e_d \n where c.id=idInom and a.idCon=idConc and a.idCcos=idCcos and tipo=1 ) \n and d.estado=0 and b.idGrup='.$idg.' and c.idNom='.$id,Adapter::QUERY_MODE_EXECUTE);\n $datos=$result->toArray();\n return $datos; \n }", "function get_reptransban_ventas($fecha1, $fecha2, $usuario_id)\r {\r if($usuario_id == 0){\r $cadusuario = \"\";\r }else{\r $cadusuario = \" and v.usuario_id = \".$usuario_id.\" \";\r }\r $egresos = $this->db->query(\"\r select \r concat(v.venta_fecha, ' ', v.venta_hora) as fecha, concat('Venta(TRANS. BANCARIA) N°: ', v.venta_id, ', ', if(f.factura_numero>0, concat('Fact.: ',f.factura_numero, ', '),''), 'Cliente: ', c.cliente_nombre) as detalle,\r v.venta_total as ingreso, 0 as egreso,\r 0 as utilidad, 22 as tipo\r from\r venta v\r left join cliente c on v.cliente_id = c.cliente_id\r left join factura f on v.venta_id = f.venta_id\r where\r date(v.venta_fecha) >= '\".$fecha1.\"'\r and date(v.venta_fecha) <= '\".$fecha2.\"'\r and v.forma_id = 3\r \".$cadusuario.\" \r order by v.venta_fecha desc, v.venta_hora desc\r \")->result_array();\r \r return $egresos;\r }", "public function getNominaEtau3($id,$idg)\n { \n $result=$this->adapter->query('select distinct c.idNom, c.id, a.idCon, \n case a.cCosEmp when 0 then a.idCcos\n when 1 then b.idCcos End as idCcos, \n case a.horasCal when 0 then 0 \n when 1 then (c.dias*'.$this->horasDias.') End as horas, 1, \n case when g.valor=2 then \n case when g.tipo = 1 then a.valor else 0 End\t\t\t\t \n when g.valor=1 then 0 \n End as dev, \n case when g.valor=2 then \n case when g.tipo = 2 then a.valor else 0 End\t\t\t\t \n when g.valor=1 then 0 \n\t\tEnd as ded, h.formula, c.dias, g.tipo , b.id as idEmp , g.idFor , a.diasLab, c.diasVac, a.vaca, \n case when ii.codigo is null then \"\" else ii.codigo end as nitTer \n from n_tip_auto_i a inner join a_empleados b on a.idTauto=b.idTau3\n inner join n_nomina_e c on b.id=c.idEmp \n inner join n_nomina d on d.id=c.idNom\n inner join n_tip_auto_tn e on e.idTnom=d.idTnom \n inner join n_tip_calendario f on f.id=d.idCal\n inner join n_conceptos g on g.id=a.idCon\n inner join n_formulas h on h.id=g.idFor\n left join n_terceros_s i on i.id = g.idTer \n left join n_terceros ii on ii.id = i.idTer \n WHERE not exists (SELECT null from n_nomina_e_d \n where c.id=idInom and a.idCon=idConc and a.idCcos=idCcos and tipo=1 ) \n and d.estado=0 and b.idGrup='.$idg.' and c.idNom='.$id,Adapter::QUERY_MODE_EXECUTE);\n $datos=$result->toArray();\n return $datos; \n }", "public function getNominaEeua($id)\n { \n $result=$this->adapter->query('select distinct c.idNom, c.id, a.idCon, f.formula,c.dias,e.tipo,a.idEmp, \n case a.cCosEmp when 0 then a.idCcos\n when 1 then g.idCcos End as idCcos, # Centros de costos\n case a.horasCal when 0 then 0 \n when 1 then (c.dias*8) End as horas, 1, # Horas desrrollo\n case when e.valor=2 then \n case when e.tipo = 1 then a.valor else 0 End \n when e.valor=1 then 0 \n End as dev, # Devengado\n ( case when e.valor=2 then \n case when e.tipo = 2 then a.valor else 0 End \n when e.valor=1 then 0\n End ) / cal.valor as ded , # Deducido \n e.idFor, c.diasVac, hh.codigo as nitTer, c.diasVac \nfrom n_emp_conc a \ninner join n_nomina_e c on a.idEmp=c.idEmp \ninner join n_nomina d on d.id=c.idNom\ninner join n_conceptos e on e.id=a.idCon\ninner join n_formulas f on f.id=e.idFor\ninner join a_empleados g on g.id=c.idEmp\nleft join n_terceros_s h on h.id = e.idTer \nleft join n_terceros hh on hh.id = h.idTer \ninner join n_tip_calendario cal on cal.id = d.idCal \nWHERE not exists (SELECT null from n_nomina_e_d \nwhere c.id=idInom and a.idCon=idConc and a.idCcos=idCcos and tipo=2 )\nand d.estado=0 and c.idNom='.$id.' and c.actVac = 0 ',Adapter::QUERY_MODE_EXECUTE);\n $datos=$result->toArray();\n return $datos; \n }", "function get_repcheque_ventas($fecha1, $fecha2, $usuario_id)\r {\r if($usuario_id == 0){\r $cadusuario = \"\";\r }else{\r $cadusuario = \" and v.usuario_id = \".$usuario_id.\" \";\r }\r $egresos = $this->db->query(\"\r select \r concat(v.venta_fecha, ' ', v.venta_hora) as fecha, concat('Venta(CHEQUE) N°: ', v.venta_id, ', ', if(f.factura_numero>0, concat('Fact.: ',f.factura_numero, ', '),''), 'Cliente: ', c.cliente_nombre) as detalle,\r v.venta_total as ingreso, 0 as egreso,\r 0 as utilidad, 22 as tipo\r from\r venta v\r left join cliente c on v.cliente_id = c.cliente_id\r left join factura f on v.venta_id = f.venta_id\r where\r date(v.venta_fecha) >= '\".$fecha1.\"'\r and date(v.venta_fecha) <= '\".$fecha2.\"'\r and v.forma_id = 5\r \".$cadusuario.\" \r order by v.venta_fecha desc, v.venta_hora desc\r \")->result_array();\r \r return $egresos;\r }", "public function retornarVenta()\n {\n\t $this->db->select('V.idVenta,C.razonSocial,C.nit,V.total,DATE(V.fechaRegistro) as fechaRegistro');\n\t $this->db->from('venta V ');\n\t $this->db->join('cliente C','V.idCliente = C.idCliente');\n\t $this->db->order_by(\"fechaRegistro\",\"desc\"); \n\t $this->db->where('V.estado',1);\n\t return $this->db->get();\n\t \n }", "function get_info_ordenes(){\n $this->db->select('OC.id_OrdenCompra,OC.fecha,OC.id_provee,OC.requisicion,OC.total,Pr.razon');\n $this->db->from('OrdenCompra AS OC');\n $this->db->join('Proveedores AS Pr', 'OC.id_provee = Pr.id_provee');\n $query=$this->db->get();\n return $query->result();\n }", "function listar_producto_vendido(){\n\t\t$sql=\"SELECT SUM(cantidad_det) AS TotalVentas, claves_pro, categoria_pro, producto_det, detal_pro, mayor_pro, id_pro, id_pro AS directorio_image FROM producto, detalle_pedido WHERE producto_det=id_pro GROUP BY producto_det ORDER BY SUM(cantidad_det) DESC LIMIT 0 , 5\";\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$aux=\"\";\n\t\t\t$id_buscar=$resultado['id_pro'];\n\t\t\t$sql2=\"SELECT directorio_image FROM imagen WHERE galeria_image='$id_buscar'\";\n\t\t\t$buscar=mysql_query($sql2)\tor die(mysql_error());\n\t\t\t$resultados=mysql_fetch_array($buscar);\n\t\t\t$resultado['directorio_image']=$resultados['directorio_image'];\n\t\t\t$this->mensaje=\"si\";\n\t\t\t$resultado['detal_pro']=$this->convertir_moneda($resultado['detal_pro']);\n\t\t\t$resultado['mayor_pro']=$this->convertir_moneda($resultado['mayor_pro']);\n\t\t\t\n\t\t\t$cat=$resultado['categoria_pro'];\n\t\t\t$sql2=\"SELECT * FROM categoria WHERE id_cat='$cat'\";\n\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t$resultado2 = mysql_fetch_array($consulta2);\n\t\t\t$aux=$this->modificar_url($resultado2['claves_cat']);\n\t\t\t$resultado['url']=$aux.\"_\".$this->modificar_url($resultado['claves_pro']);\n\t\t\t\t\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "static public function mdlRangoFechasVentas($tabla, $fechaInicial, $fechaFinal){\n\n\t\tif($fechaInicial == null){\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT * FROM $tabla ORDER BY id ASC\");\n\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\t\n\n\n\t\t}else if($fechaInicial == $fechaFinal){\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT fecha_salida, round(sum(cantidad*precio_venta),2) AS totalvta FROM $tabla WHERE fecha_salida like '%$fechaFinal%'\");\n\n\t\t\t$stmt -> bindParam(\":fecha_salida\", $fechaFinal, PDO::PARAM_STR);\n\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\n\n\t\t}else{\n\n\t\t\t$fechaActual = new DateTime();\n\t\t\t$fechaActual ->add(new DateInterval(\"P1D\"));\n\t\t\t$fechaActualMasUno = $fechaActual->format(\"Y-m-d\");\n\n\t\t\t$fechaFinal2 = new DateTime($fechaFinal);\n\t\t\t$fechaFinal2 ->add(new DateInterval(\"P1D\"));\n\t\t\t$fechaFinalMasUno = $fechaFinal2->format(\"Y-m-d\");\n\n\t\t\tif($fechaFinalMasUno == $fechaActualMasUno){\n\n\t\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT `fecha_salida`, round(SUM(IF(`es_promo` = 0, `cantidad`*`precio_venta`,0)),2) AS sinpromo, round(SUM(IF(`es_promo` = 1, `precio_venta`,0)),2) AS promo FROM $tabla WHERE fecha_salida BETWEEN '$fechaInicial' AND '$fechaFinalMasUno' GROUP BY fecha_salida\");\n\n\t\t\t\t//$stmt = Conexion::conectar()->prepare(\"SELECT fecha_salida, round(sum(cantidad*precio_venta),2) AS totalvta FROM $tabla WHERE fecha_salida BETWEEN '$fechaInicial' AND '$fechaFinalMasUno' GROUP BY fecha_salida\");\n\n\t\t\t\t//SELECT `fecha_salida`, round(SUM(IF(`es_promo` = 0, `cantidad`*`precio_venta`,0)),2) AS sinpromo, round(SUM(IF(`es_promo` = 1, `precio_venta`,0)),2) AS promo FROM hist_salidas WHERE fecha_salida BETWEEN '2019-08-01' AND '2019-12-27' GROUP BY fecha_salida\n\n\t\t\t}else{\n\n\t\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT `fecha_salida`, SUM(IF(`es_promo` = 0, `cantidad`*`precio_venta`,0)) AS sinpromo, SUM(IF(`es_promo` = 1, `precio_venta`,0)) AS promo FROM $tabla WHERE fecha_salida BETWEEN '$fechaInicial' AND '$fechaFinal' GROUP BY fecha_salida \");\n\n\t\t\t\t//$stmt = Conexion::conectar()->prepare(\"SELECT fecha_salida, round(sum(cantidad*precio_venta),2) AS totalvta FROM $tabla WHERE fecha_salida BETWEEN '$fechaInicial' AND '$fechaFinal' GROUP BY fecha_salida\");\n\n\t\t\t}\n\t\t\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\n\n\t\t}\n\n\t}", "function get_reptotal_ventas($fecha1, $fecha2, $usuario_id)\r {\r if($usuario_id == 0){\r $cadusuario = \"\";\r }else{\r $cadusuario = \" and i.usuario_id = \".$usuario_id.\" \";\r }\r $ingresos = $this->db->query(\"\r select\r SUM(d.detalleven_total) as total\r from\r\r venta v, detalle_venta d, producto p\r\r where\r\r date(v.venta_fecha) >= '\".$fecha1.\"'\r and date(v.venta_fecha) <= '\".$fecha2.\"'\r and v.forma_id = 1\r and v.venta_id = d.venta_id\r and d.producto_id = p.producto_id \r \".$cadusuario.\" \r order by v.venta_fecha desc, v.venta_hora desc\r \")->row_array();\r \r return $ingresos['total'];\r }", "public function mostrarDados(){\n\t\t$sql = \"SELECT cliente.cod_cliente, cliente.nome_cliente, categoria.cod_categoria, categoria.desc_categoria, servico.cod_servico, servico.desc_servico, servico.foto\t\n\t\t\t\tFROM cliente INNER JOIN (categoria INNER JOIN servico ON categoria.cod_categoria = servico.cod_categoria) ON cliente.cod_cliente = servico.cod_cliente\n\t\t\t\twhere cod_servico = '$this->cod_servico'\";\n\t\t$qry= self:: executarSQL($sql);\n\t\t$linha = self::listar($qry);\n\t\t\n\t\t$this-> cod_servico = $linha['cod_servico'];\n\t\t$this-> cod_categoria = $linha['cod_categoria'];\n\t\t$this-> desc_categoria = $linha['desc_categoria'];\n\t\t$this-> cod_cliente = $linha['cod_cliente'];\n\t\t$this-> nome_cliente = $linha['nome_cliente'];\n\t\t$this-> desc_servico = $linha['desc_servico'];\n\t\t$this-> foto = $linha['foto'];\n\t}", "function rel_cliente_ag(){\r\n\t\t$db = banco();\r\n\t\t\r\n\t\t$query =\"SELECT user.cod, user.name, user.cpf, cliente.fone, especialidade.nom_espec, consulta.dt_consul, consulta.aprovado, consulta.presente\r\n\t\t\t\tFROM user, cliente, consulta, especialidade\r\n\t\t\t\tWHERE user.cod = cliente.cod_clien AND\r\n\t\t\t\t\t user.cod = consulta.cod_clien AND\r\n\t\t\t\t\t consulta.cd_esp = especialidade.cod_espec\r\n\t\t\t\t\t \r\n\t\t\t\t\";\r\n\t\t$row = $db->query($query);\r\n\t\t$db->close();\r\n\t\treturn $row;\t\r\n\t}", "function get_reptarjcredito_ventas($fecha1, $fecha2, $usuario_id)\r {\r if($usuario_id == 0){\r $cadusuario = \"\";\r }else{\r $cadusuario = \" and v.usuario_id = \".$usuario_id.\" \";\r }\r $egresos = $this->db->query(\"\r select \r concat(v.venta_fecha, ' ', v.venta_hora) as fecha, concat('Venta(TARJ. CREDITO) N°: ', v.venta_id, ', ', if(f.factura_numero>0, concat('Fact.: ',f.factura_numero, ', '),''), 'Cliente: ', c.cliente_nombre) as detalle,\r v.venta_total as ingreso, 0 as egreso,\r 0 as utilidad, 22 as tipo\r from\r venta v\r left join cliente c on v.cliente_id = c.cliente_id\r left join factura f on v.venta_id = f.venta_id\r where\r date(v.venta_fecha) >= '\".$fecha1.\"'\r and date(v.venta_fecha) <= '\".$fecha2.\"'\r and v.forma_id = 4\r \".$cadusuario.\" \r order by v.venta_fecha desc, v.venta_hora desc\r \")->result_array();\r \r return $egresos;\r }", "function ventasBrutas($fi, $ff){\n $data2=array();\n $this->query= \"SELECT * FROM CLIE03 WHERE TIPO_EMPRESA = 'M'\";\n $rs=$this->EjecutaQuerySimple();\n while($tsarray=ibase_fetch_object($rs)){\n $data[]=$tsarray;\n }\n $facutras = 0;\n foreach ($data as $clie) {\n $cliente = $clie->CLAVE;\n\n $this->query=\"SELECT CLAVE, nombre,\n (select iif( (sum(importe)is null or sum(importe) = 0), 0 , sum(importe) / 1.16) as fact from cuen_m03 where fecha_apli between '$fi' and '$ff' and tipo_mov = 'C' and num_cpto = 1 and trim(cve_clie) = trim('$cliente') ) as Facturas,\n (select iif( (sum(importe)is null or sum(importe) = 0), 0 , sum(importe) / 1.16) as ncs from cuen_det03 where fecha_apli between '$fi' and '$ff' and tipo_mov = 'C' and num_cpto =16 and trim(cve_clie) = trim('$cliente') ) as imptNC, \n (select iif( (sum(importe)is null or sum(importe) = 0), 0 , sum(importe) / 1.16) as cnp from cuen_det03 where fecha_apli between '$fi' and '$ff' and tipo_mov = 'A' and num_cpto >= 23 and trim(cve_clie) = trim('$cliente')) as AbonosNoPagos\n from Clie03\n where trim(clave) = trim('$cliente')\";\n //echo $this->query.'<p>';\n\n \n $rs2=$this->EjecutaQuerySimple();\n while($tsarray= ibase_fetch_object($rs2)){\n $data2[]=$tsarray;\n }\n }\n\n\n\n return $data2;\n }", "public function get_detalle_aros_rec_ini($numero_venta){\n $conectar=parent::conexion();\n parent::set_names();\n\n $sql=\"select p.marca,p.color,p.modelo,p.categoria,d.id_producto,d.numero_venta from producto as p join detalle_ventas as d where p.id_producto=d.id_producto and d.numero_venta=? and categoria='aros';\";\n $sql=$conectar->prepare($sql);\n $sql->bindValue(1,$numero_venta);\n $sql->execute();\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\n}", "function consulta2(){\n$sql1= \"SELECT id_producto, nombre_marca, Nombre_modelo, nombre_division, nombre_categoria\nFROM producto P\nJOIN marca M ON M.id_marca = P.id_marca\nJOIN modelo MO ON MO.id_modelo = P.id_modelo\nJOIN division D ON D.id_division = P.id_division\nJOIN categoria C ON C.id_categoria = P.id_categoria\nWHERE id_producto=\".$valor.\"\";//$res[id_producto]\n$rs1= mysql_query($sql1);\n$res1 = mysql_fetch_array($rs1);\n}", "public function read_alltiendas(){\r\n $sql=\"select p.id_proveedor, p.nombre_establecimiento, p.direccion_fisica, p.direccion_web,\r\n p.descripcion_tienda, p.id_usuario\r\n from proveedor p\r\n INNER JOIN usuario u on p.id_usuario = u.id_usuario\";\r\n $resul=mysqli_query($this->con(),$sql);\r\n while($row=mysqli_fetch_assoc($resul)){\r\n $this->proveedores[]=$row;\r\n }\r\n return $this->proveedores;\r\n\r\n }", "public function ventaMayor($idcliente,$get_tcambio){\n //$sql=\"SELECT ocCab.idordenventa,ocCab.importeordencobro,CASE ovCab.IdMoneda WHEN 2 THEN ocCab.importeordencobro*\".$get_tcambio.\" WHEN 1 THEN ocCab.importeordencobro END AS total\n //FROM wc_ordenventa ovCab,wc_ordencobro ocCab\n //WHERE ovCab.idcliente=\".$idcliente.\"\n //AND ovCab.idordenventa=ocCab.idordenventa\n //AND ovCab.vbcreditos=1\n //AND ovCab.vbventas=1\n //AND ovCab.vbcobranzas=1\n //AND ovCab.estado=1\n //ORDER BY ocCab.idordenventa,ocCab.idordencobro ASC\";\n // $array_ventaMayor = $this->scriptArrayCompleto($sql);\n // $idordenventa=-1;\n // for ($i = 0; $i < count($array_ventaMayor); $i++) {\n // if($idordenventa!=$array_ventaMayor[$i]['idordenventa']){\n // $cadena[]=$array_ventaMayor[$i]['total'];\n // }\n // $idordenventa=$array_ventaMayor[$i]['idordenventa'];\n // }\n // $totalmayor=max($cadena);\n //\n // end como nacio la venta\n\n //start como esta actualmente esta la venta -- angel lo indico en el modulo vista global\n $sql=\"SELECT ovCab.idordenventa,CASE ovCab.IdMoneda WHEN 2 THEN SUM(ogCab.importegasto)*\".$get_tcambio.\" WHEN 1 THEN SUM(ogCab.importegasto) END AS total\n FROM wc_ordenventa ovCab,wc_ordengasto ogCab\n WHERE ovCab.idcliente=\".$idcliente.\"\n AND ovCab.idordenventa=ogCab.idordenventa\n AND ovCab.vbcreditos=1\n AND ovCab.vbventas=1\n AND ovCab.vbcobranzas=1\n AND ovCab.estado=1\n AND ogCab.estado=1\n GROUP BY ovCab.idordenventa ORDER BY total DESC;\";\n $array_ventaMayor = $this->scriptArrayCompleto($sql);\n //end como termino la venta\n return $array_ventaMayor[0]['total'];\n }", "public function producto_tralado_por_id($id_producto,$id_ingreso){\n $conectar= parent::conexion();\n $sql=\"select p.modelo,p.marca,p.medidas,p.color,e.id_producto,e.id_ingreso,e.categoriaub,e.stock from producto as p inner join existencias as e on p.id_producto=e.id_producto and e.id_producto=? and id_ingreso=?\";\n $sql=$conectar->prepare($sql);\n $sql->bindValue(1, $id_producto);\n $sql->bindValue(2, $id_ingreso);\n $sql->execute();\n return $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "public function getMensalidadesVencidas($strContratos, $maiorDataRescisao) {\r\n\r\n $sql = \"\r\n SELECT distinct \r\n CASE \r\n WHEN titnfloid IS NOT NULL THEN\r\n (\r\n SELECT\r\n nflno_numero || '/' || nflserie AS nota\r\n FROM\r\n nota_fiscal\r\n WHERE\r\n nfloid = titnfloid\r\n )\r\n ELSE\r\n CASE\r\n WHEN titno_cheque IS NOT NULL THEN\r\n titno_cheque || '/CH'\r\n WHEN titno_cartao IS NOT NULL AND titno_cartao <> '' THEN\r\n 'CARTÃO'\r\n WHEN titnota_promissoria IS NOT NULL THEN\r\n titnota_promissoria || '/NP'\r\n WHEN titno_avulso IS NOT NULL THEN\r\n titno_avulso || '/AV'\r\n END\r\n END AS nota,\r\n to_char(titdt_vencimento, 'dd/mm/yyyy') AS titdt_vencimento,\r\n titvl_titulo,\r\n titdt_vencimento AS VCT\r\n FROM\r\n clientes\r\n JOIN titulo ON titclioid = clioid\r\n JOIN contrato ON conclioid = clioid\r\n JOIN nota_fiscal on nfloid = titnfloid\r\n JOIN nota_fiscal_item on nfino_numero = nflno_numero and nfiserie = nflserie AND connumero = nficonoid\r\n WHERE \r\n connumero IN ($strContratos)\r\n AND \r\n nfldt_cancelamento is null \r\n AND \r\n titdt_pagamento IS NULL\r\n AND \r\n titdt_cancelamento IS NULL\r\n AND (\r\n titformacobranca = 51\r\n AND titdt_credito IS NOT NULL\r\n OR (titdt_credito IS NULL)\r\n )\r\n AND titnao_cobravel IS NOT TRUE\r\n AND ( \r\n ( \r\n Extract (YEAR FROM titdt_vencimento) < Extract ( YEAR FROM '$maiorDataRescisao' :: DATE) \r\n ) OR ( \r\n Extract (YEAR FROM titdt_vencimento) = Extract ( YEAR FROM '$maiorDataRescisao' :: DATE)\r\n AND \r\n Extract (MONTH FROM titdt_vencimento) < Extract ( MONTH FROM '$maiorDataRescisao' :: DATE) \r\n )\r\n )\r\n ORDER BY\r\n VCT\";\r\n\r\n $result = $this->_fetchAll(pg_query($this->_adapter, $sql));\r\n\r\n return $result; \r\n }", "function selectConciertosEspera(){\n $c = conectar();\n $select = \"select CONCIERTO.FECHA as FECHA, CONCIERTO.HORA as HORA, LOCALES.UBICACION as UBICACION, GENERO.NOMBRE as GENERO, USUARIOS.NOMBRE as NOMBRE, CIUDAD.NOMBRE as CIUDAD, CONCIERTO.ID_CONCIERTO as ID from CONCIERTO \n inner join LOCALES on CONCIERTO.ID_LOCAL = LOCALES.ID_LOCAL\n inner join USUARIOS on LOCALES.ID_USUARIO = USUARIOS.ID_USUARIO\n inner join CIUDAD on USUARIOS.ID_CIUDAD = CIUDAD.ID_CIUDAD\n inner join GENERO on CONCIERTO.ID_GENERO = GENERO.ID_GENERO where CONCIERTO.ESTADO=0 order by CONCIERTO.FECHA,CONCIERTO.HORA\";\n $resultado = mysqli_query($c, $select);\n desconectar($c);\n return $resultado;\n\n}", "function get_repcredito_ventas($fecha1, $fecha2, $usuario_id)\r {\r if($usuario_id == 0){\r $cadusuario = \"\";\r }else{\r $cadusuario = \" and v.usuario_id = \".$usuario_id.\" \";\r }\r $egresos = $this->db->query(\"\r select \r concat(v.venta_fecha, ' ', v.venta_hora) as fecha, concat('Venta(CREDITO) N°: ', v.venta_id, ', ', if(f.factura_numero>0, concat('Fact.: ',f.factura_numero, ', '),''), 'Cliente: ', c.cliente_nombre, ', Total: ', v.venta_total, ', a cuenta: ', cr.credito_cuotainicial, ', Saldo: ', cr.credito_monto) as detalle,\r cr.credito_cuotainicial as ingreso, 0 as egreso,\r 0 as utilidad, 22 as tipo\r from\r venta v\r left join cliente c on v.cliente_id = c.cliente_id\r left join credito cr on v.venta_id = cr.venta_id\r left join factura f on v.venta_id = f.venta_id\r where\r date(v.venta_fecha) >= '\".$fecha1.\"'\r and date(v.venta_fecha) <= '\".$fecha2.\"'\r and v.tipotrans_id = 2 \r \".$cadusuario.\" \r order by v.venta_fecha desc, v.venta_hora desc\r \")->result_array();\r \r return $egresos;\r }", "public function get_ventas_consulta($id_paciente){\n\t$conectar= parent::conexion();\n\tparent::set_names();\n \n\t$sql=\"select*from ventas where id_paciente=?;\";\n\t$sql=$conectar->prepare($sql);\n\t$sql->bindValue(1,$id_paciente);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "public function pagadaall(){\n$sql = $this->db->query(\"SELECT pago_factura.*, facturas.id_factura FROM pago_factura INNER JOIN facturas ON pago_factura.factura_id = facturas.id\");\nreturn $sql;\n}", "public function obtenerT($v){\n try\n { \n $query=\"SELECT tbevidencias.user, tbevidencias.id, tbevidencias.text, tbevidencias.start_date, tbevidencias.duration, tbevidencias.progress,tbevidencias.parent, \n tbevidencias.ponderado_programado,tbevidencias.notas,tbevidencias.status FROM gantt_evidencias tbevidencias WHERE tbevidencias.id_evidencias=\".$v['id_evidencia'];\n $db= AccesoDB::getInstancia();\n $lista=$db->executeQuery($query);\n \n return $lista;\n \n } catch (Exception $ex) {\n throw $ex;\n return false;\n }\n }", "function getDetalle($db,$idpedido) {\n $idpedido = mysqli_real_escape_string($db, $idpedido);\n //Trae el detalle de un pedido\n $query = \"SELECT c.idproducto, c.cantidad, c.precio, c.subtotal, p.nombre, p.foto \n FROM carrito c INNER JOIN productos p ON c.idproducto = p.id WHERE c.idpedido = \".$idpedido;\n //echo $query;\n\n return mysqli_query($db, $query);\n}", "function get_entradas_proveedor_list($id) {\n\t\t$u = new Entrada();\n\t\t$sql=\"select distinct on (e.pr_facturas_id) e.pr_facturas_id, e.id as id1, date(e.fecha) fecha, prf.monto_total as importe_factura, pr.razon_social as proveedor,prf.folio_factura, prf.pr_pedido_id, ef.tag as espacio_fisico, eg.tag as estatuse, e.lote_id, cel.tag as estatus_traspaso \".\n\t\t\t\t\"from entradas as e \".\n\t\t\t\t\"left join cproveedores as pr on pr.id=e.cproveedores_id \".\n\t\t\t\t\"left join pr_facturas as prf on prf.id=e.pr_facturas_id \".\n\t\t\t\t\"left join espacios_fisicos as ef on ef.id=e.espacios_fisicos_id \".\n\t\t\t\t\"left join estatus_general as eg on eg.id=e.estatus_general_id \".\n\t\t\t\t\"left join lotes_pr_facturas as lf on lf.pr_factura_id=prf.id \".\n\t\t\t\t\"left join cestatus_lotes as cel on cel.id=lf.cestatus_lote_id \".\n\t\t\t\t\"where e.estatus_general_id=1 and ctipo_entrada=1 and e.cproveedores_id='$id'\".\n\t\t\t\t\"group by e.pr_facturas_id, e.id, e.fecha, importe_factura, pr.razon_social, prf.folio_factura, prf.pr_pedido_id, ef.tag, eg.tag, e.pr_facturas_id, e.cproveedores_id,e.lote_id, cel.tag \".\n\t\t\t\t\"order by e.pr_facturas_id desc,e.fecha desc\";\n\n\t\t//Buscar en la base de datos\n\t\t$u->query($sql);\n\t\tif($u->c_rows > 0){\n\t\t\treturn $u;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public static function valor($id){ \n\n $consultas = DB::table('control_tramites')\n ->where('control_tramites.numero_escritura', '=', $id )\n ->select('control_tramites.*')\n ->get(); \n\n $kinegrama;\n\n foreach($consultas as $consulta){\n $kinegrama = $consulta->kinegrama_id;\n }\n\n $consult = DB::table('kinegramas')\n ->where('kinegramas.id', '=', $kinegrama )\n ->select('kinegramas.*')\n ->get(); \n\n if ( $consultas->isEmpty()) {\n \n\n \n }\n else{\n\n return DB::table('control_tramites')\n ->Join('clientes', 'control_tramites.cliente_id', '=', 'clientes.id')\n ->Join('tipos_tramites', 'control_tramites.tramite_id', '=', 'tipos_tramites.id')\n ->where('control_tramites.numero_escritura', '=', $id) \n ->select( 'control_tramites.*','clientes.nombre','clientes.apellido_paterno','clientes.apellido_materno','tipos_tramites.tramite')\n ->get(); \n }\n\n\n \n\n \n\n }", "function mostrar_producto_cotizacion($producto, $temporada, $plan){\n\t\t\t$sql=\"SELECT * FROM producto, temporadas2, habitaciones2 WHERE id_pro='$producto' AND temporadas2.id_alojamiento='$producto' AND temporadas2.id='$temporada' AND temporadas2.id=habitaciones2.id_temporada AND habitaciones2.id='$plan'\";\n\t\t\t\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\t$resultado = mysql_fetch_array($consulta);\n\t\t\t$resultado['fecha_inicio']=$this->convertir_fecha($resultado['fecha_inicio']);\n\t\t\t$resultado['fecha_fin']=$this->convertir_fecha($resultado['fecha_fin']);\n\t\t\t$resultado['precio']=$this->mostrar_precio($resultado['precio']);\n\t\t\tif($resultado['maxAdultos']==NULL)\n\t\t\t\t$resultado['maxAdultos']=4;\n\t\t\t$this->listado[]=$resultado;\n\t}", "function consulta_registro_ventas_imprimir($w_anio, $w_mes, $w_anexo) {\n $sql = \"SELECT\n prosic_comprobante.codigo_comprobante\n , prosic_comprobante.emision_comprobante\n , prosic_comprobante.pago_comprobante\n , prosic_tipo_comprobante.sunat_tipo_comprobante\n , prosic_comprobante.serie_comprobante\n , prosic_comprobante.anio_dua_comprobante\n , prosic_comprobante.nro_comprobante\n , prosic_tipo_documento.sunat_tipo_documento\n , prosic_anexo.codigo_anexo\n , SUBSTRING(prosic_anexo.descripcion_anexo,1,20)\n , prosic_comprobante.afecto_comprobante\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.igv_comprobante\n , prosic_comprobante.total_comprobante \t\n , prosic_comprobante.id_operacion\n , prosic_comprobante.no_gravadas_igv\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.isc_comprobante\n , prosic_comprobante.otros_tributos\n , prosic_comprobante.total_comprobante\n , prosic_comprobante.tipo_cambio_comprobante\n , prosic_tipo_comprobante.nombre_tipo_comprobante\n , prosic_comprobante.id_moneda\n FROM\n prosic_comprobante\n INNER JOIN prosic_anexo ON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n INNER JOIN prosic_tipo_comprobante ON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n INNER JOIN prosic_tipo_documento ON (prosic_anexo.id_tipo_documento = prosic_tipo_documento.id_tipo_documento)\n WHERE prosic_comprobante.id_subdiario=2\";\n if ($w_anio != '')$sql.=\" AND prosic_comprobante.id_anio=\" . $w_anio;\n if ($w_mes != '')$sql.=\" AND prosic_comprobante.id_mes=\" . $w_mes;\n if ($w_anexo != '')$sql.=\" AND prosic_comprobante.id_anexo='\" . $w_anexo . \"'\";\n $sql.=\" ORDER BY prosic_tipo_comprobante.sunat_tipo_comprobante,CAST(prosic_comprobante.codigo_comprobante AS UNSIGNED)\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "function sviRezultati() {\n\t\t$mysqli = new mysqli(\"localhost\", \"root\", \"\", \"kviz\");\n\t\t$q = 'SELECT * FROM tabela t join korisnik k on t.korisnikID = k.korisnikID order by t.brojPoena desc';\n\t\t$this ->result = $mysqli->query($q);\n\t\t$mysqli->close();\n\t}", "public function get_datos_ventas_cobros_contado($fecha,$sucursal){\n\t$conectar= parent::conexion();\n\tparent::set_names();\n \n\t$fecha_corte = $fecha.\"%\";\n\t$sql=\"select c.n_factura,c.fecha_ingreso,c.n_recibo,c.paciente,u.usuario,c.total_factura,c.forma_cobro,c.monto_cobrado,c.saldo_credito,c.abonos_realizados from\ncorte_diario as c inner join usuarios as u on u.id_usuario=c.id_usuario where c.fecha_ingreso like ? and c.abonos_realizados='0' and c.tipo_venta='Contado' AND tipo_ingreso='Venta' and (sucursal_venta=? or sucursal_cobro=?);\";\n\t$sql=$conectar->prepare($sql);\n\t$sql->bindValue(1,$fecha_corte);\n\t$sql->bindValue(2,$sucursal);\n\t$sql->bindValue(3,$sucursal);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "function listarServicios()\n\t{\n\t\treturn \"select servicios.servicio_id,servicios.nombre_servicio, servicios.estado_servicio, servicios.descripcion, servicios.fecha_creacion,\n trabajadores.nombre,\nsucursales.nombre_sucursal\nfrom trabajadores, servicios,sucursales where servicios.trabajador_id = trabajadores.trabajador_id \nand servicios.estado_servicio = 1 \nand servicios.sucursal_id = sucursales.sucursal_id\";\n\t}", "public function consulta_tienda_cart(){\n\n $this->que_dba=\"SELECT * FROM tienda t, inventario i, temp_pedido tp\n\t\t\tWHERE t.cod_tie=i.tienda_cod_tie\n\t\t\tAND i.cod_inv=tp.inventario_cod_inv\n\t\t\tAND tp.usuario_cod_usu='\".$_SESSION['cod_usu'].\"'\n\t\t\tGROUP BY raz_tie;\"; \n\t\t\t \n\t\treturn $this->ejecutar();\n\t}", "function buscar_comprobante_doc_venta($id_cuenta, $id_anexo, $id_serie, $id_numero ) {\n $sql = \"SELECT\n\t\t\t\t\t prosic_plan_contable.id_plan_contable\n\t\t\t\t\t, prosic_plan_contable.cuenta_plan_contable\n\t\t\t\t\t, prosic_anexo.codigo_anexo\n\t\t\t\t\t, prosic_anexo.descripcion_anexo\n\t\t\t\t\t, prosic_detalle_comprobante.id_tipo_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.ser_doc_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.nro_doc_comprobante\n\t\t\t\t\t, prosic_moneda.id_moneda\n\t\t\t\t\t, prosic_detalle_comprobante.fecha_doc_comprobante\n\t\t\t\t\t, prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\t\t, sum(if(prosic_moneda.id_moneda=1,prosic_detalle_comprobante.importe_soles,prosic_detalle_comprobante.importe_dolares*prosic_tipo_cambio.venta_financiero)*if(prosic_detalle_comprobante.cargar_abonar='A',1,-1)) as importe_soles\n\t\t\t\t\t, sum(if(prosic_moneda.id_moneda=1,prosic_detalle_comprobante.importe_soles*prosic_tipo_cambio.venta_financiero,prosic_detalle_comprobante.importe_dolares)*if(prosic_detalle_comprobante.cargar_abonar='A',1,-1)) as importe_dolares\n\t\t\t\tFROM prosic_detalle_comprobante\n\t\t\t\tINNER JOIN prosic_plan_contable ON prosic_detalle_comprobante.id_plan_contable=prosic_plan_contable.id_plan_contable\n\t\t\t\tINNER JOIN prosic_anexo ON prosic_detalle_comprobante.id_anexo = prosic_anexo.id_anexo\n\t\t\t\tINNER JOIN prosic_moneda ON prosic_detalle_comprobante.id_moneda = prosic_moneda.id_moneda\n\t\t\t\tLEFT JOIN prosic_tipo_cambio ON prosic_detalle_comprobante.fecha_doc_comprobante=prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\tWHERE 1=1 \";\n\t\t\t\tif ($id_cuenta != '')$sql.=\" AND prosic_plan_contable.cuenta_plan_contable LIKE '%\" . $id_cuenta . \"%'\";\n if ($id_anexo != '')$sql.=\" AND prosic_anexo.codigo_anexo LIKE '%\" . $id_anexo . \"%'\";\n if ($id_numero != '')$sql.=\" AND prosic_detalle_comprobante.nro_doc_comprobante LIKE '%\" . $id_numero . \"%'\";\n\t\t\t$sql.=\" group by prosic_plan_contable.id_plan_contable\n\t\t\t\t\t, prosic_plan_contable.cuenta_plan_contable\n\t\t\t\t\t, prosic_anexo.codigo_anexo\n\t\t\t\t\t, prosic_anexo.descripcion_anexo\n\t\t\t\t\t, prosic_detalle_comprobante.id_tipo_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.ser_doc_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.nro_doc_comprobante\n\t\t\t\t\t, prosic_moneda.id_moneda\n\t\t\t\t\t, prosic_detalle_comprobante.fecha_doc_comprobante\n\t\t\t\t\t, prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\t\thaving importe_soles>0\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "public function consultaOfertas(){\n //join Tabla2 T2 ON T1.PK = T2.FK\n \n //select * from Tabla1 T1, Tabla2 T2\n //WHERE T!.PK = T2.FK\n \n \n \n //$this->db->select(\"*\"); \n //$this->db->from(\"productos\");//nombrebase\n //$this->db->join(\"carrera\",\"alumno.idCarrera = carrera.idCarrera\");\n \n //$sql = $this->db->get();\n //return $sql->result();\n }", "public function obtenerRegistroFaltantesCompraScot()\n {\n\n $sql = $this->getAdapter()->select()->from(array('ai' => 'anuncio_impreso'),\n array('id_cac' => 'cac.id', 'id_compra' => 'c.id', 'adecsys_code' => 'cac.adecsys_code',\n 'medPub' => 'cac.medio_publicacion'))\n ->joinInner(array('c' => 'compra'), 'c.id = ai.id_compra', null)\n ->joinInner(array('t' => 'tarifa'), 't.id = c.id_tarifa', null)\n ->joinInner(array('p' => 'producto'), 't.id_producto = p.id', null)\n ->joinInner(array('cac' => 'compra_adecsys_codigo'),\n 'cac.id_compra = c.id', null)\n ->where('p.tipo = ?', self::TIPO_PREFERENCIAL)\n ->where('c.estado = ?', self::ESTADO_PAGADO)\n ->where('c.id_tarifa <> ?', Application_Model_Tarifa::GRATUITA)\n ->where('year(c.fh_confirmacion) >= ?', date('Y'))\n ->where('cac.medio_publicacion <> ?',\n Application_Model_CompraAdecsysCodigo::MEDIO_PUB_TALAN_COMBO)\n ->where('(cac.adecsys_code is not null and cac.adecsys_code <> 0 and cac.adecsys_code not like ?)',\n '%Informix%')\n ->where('(cod_scot_aptitus IS NULL AND cod_scot_talan IS NULL)')\n ->where('ai.cod_scot_aptitus is null')\n ->where('c.medio_pago in (?)',\n array(self::FORMA_PAGO_VISA, self::FORMA_PAGO_PAGO_EFECTIVO,\n self::FORMA_PAGO_MASTER_CARD, self::FORMA_PAGO_CREDITO))\n ->where('DATEDIFF(CURDATE(),c.fh_confirmacion) <= ?', 10)\n ->where('t.meses is null')\n //->where('c.id = ?', $id)\n ->order('c.id desc');\n\n return $this->getAdapter()->fetchAll($sql);\n }", "public function getDetalles()\n {\n $sql = \"select z.id,z.nombre, z.identificacion, z.estado_excluido, y.descripcion, w.categoria , (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'aeo'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as 'aeo' ,\n (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'alim'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as alim,\n (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'pare'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as pare\n from appexamenisw2.estudiantes z, appexamenisw2.beneficios y, appexamenisw2.categorias w,\n appexamenisw2.beneficio__estudiantes v\n where z.id = v.estudiante_id\n and y.id = v.beneficio_id\n and w.id = y.categoria_id\n group by z.id,z.nombre, z.identificacion, z.id, z.estado_excluido, y.descripcion,w.categoria\n order by z.id;\";\n\n $arrayDetalles = DB::connection('mysql')->select($sql);\n $ab = array();\n $ab = $arrayDetalles;\n foreach($ab as $t){\n $t->aeo = Crypt::decrypt($t->aeo);\n $t->alim = Crypt::decrypt($t->alim);\n $t->pare = Crypt::decrypt($t->pare);\n //$t->categoria = Crypt::decrypt($t->categoria);\n //$t->monto = Crypt::decrypt($t->monto);\n //return $t->monto;\n }\n return json_encode($ab);\n }", "public function readValoraciones(){\n $sql='SELECT valoracion, producto.nombre as producto, cliente.nombre as cliente FROM cliente, producto, valoraciones WHERE producto.idProducto=valoraciones.idProducto AND cliente.idCliente=valoraciones.idCliente and producto.idProducto = ?';\n $params=array($this->id);\n return Database::getRows($sql, $params);\n }", "static public function mdlMostrarDetalleVentas1($item1, $item2, $valor1, $valor2){\r\n\r\n\r\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT * FROM productos \r\n\t\t\t\t\t\t\t\t\t\t\tINNER JOIN detalle_carrito ON productos.id=detalle_carrito.id_producto\r\n\t\t\t\t\t\t\t\t\t\t\tINNER JOIN carrito ON detalle_carrito.id_carrito=carrito.id_carrito \r\n\t\t\t\t\t\t\t\t\t\t\tINNER JOIN usuarios ON usuarios.id=carrito.id_usuario\r\n\t\t\t\t\t\t\t\t\t\t\tWHERE $item1 = :$item1 AND $item2=:$item2\");\r\n\r\n\t\t\t$stmt -> bindParam(\":\".$item1, $valor1, PDO::PARAM_STR);\r\n\t\t\t$stmt -> bindParam(\":\".$item2, $valor2, PDO::PARAM_STR);\r\n\r\n\t\t\t$stmt -> execute();\r\n\r\n\t\t\treturn $stmt -> fetchAll();\r\n\r\n\t\t$stmt->close();\r\n\t\t$stmt = null;\r\n\r\n\t\t}", "public function getCprestamosS($id,$idEmp)\n { \n $result=$this->adapter->query('select distinct a.id, a.idEmp,0 as dias,0 as horas, 0 as formula, f.tipo, h.idCcos,\n e.idConE as idCon, f.idFor, cc.id as idPres, 1 as cuota, \n\t\t\t\t case when j.id >0 then ( (cc.valCuota / i.valor ) * ( a.dias + j.diasCal ) ) else \n\t\t\t\t cc.valCuota end as valor, \n\t\t\t\t cc.cuotas, cc.valCuota, \n case when kk.codigo is null then \"\" else kk.codigo end as nitTer,\n case when np.valor is null then 0 else np.valor end as valorPresN \n\t\t\t\t from n_nomina_e a \n inner join n_nomina b on b.id=a.idNom\n inner join n_prestamos c on c.idEmp=a.idEmp \n inner join n_prestamos_tn cc on cc.idPres = c.id and cc.idTnom = c.idTnom \n inner join n_tip_prestamo e on e.id=c.idTpres\n inner join n_conceptos f on f.id=e.idConE \n inner join n_formulas g on g.id=f.idFor \n inner join a_empleados h on h.id=a.idEmp \n inner join n_tip_calendario i on i.id = b.idCal \n\t left join n_vacaciones j on j.id=a.idVac\n left join n_terceros_s k on k.id = f.idTer\n \t\t left join n_terceros kk on kk.id = k.idTer \n left join n_nomina_pres np on np.idPres = cc.id and np.fechaI = b.fechaI and np.fechaF = b.fechaF and np.estado=0 # Buscar cambios en nomina activa con el prestamo\n where a.idNom='.$id.' and c.estado=1 and a.idEmp='.$idEmp.\" and ( cc.pagado + cc.saldoIni ) < cc.valor group by c.id\" ,Adapter::QUERY_MODE_EXECUTE);\n $datos=$result->toArray();\n return $datos; \n }", "function requestDadosProduto($produto_id)\n {\n\n $conn = new db_conect();\n //Inserir visualizacao\n $conn->visualizacaoProduto($produto_id);\n\n $query = 'SELECT \n produto.nome AS produto, \n produto.preco, \n qntd_disponivel,\n qntd_min_vendida, \n categoria,\n tipo_venda,\n data_producao,\n data_validade,\n descricao,\n cliente.nome AS vendedor,\n cliente.num_vendas AS vendas_vendedor,\n cliente.avaliacao AS vendedor_avaliacao,\n cliente.cidade,\n cliente.estado,\n produto.data_cadastro AS data_anuncio, \n produto.avaliacao AS avaliacao_produto, \n produto.num_vendas AS num_vendas_produto, \n produto.num_visualizacao AS visualizacoes,\n caminho_foto AS foto \n FROM produto \n INNER JOIN cliente ON cliente.cpf = produto.produtor_fk\n INNER JOIN img_produto ON img_produto.produto_fk = produto.codigo \n WHERE \n produto.codigo = ' . $produto_id . '\n AND \n caminho_foto = (SELECT caminho_foto FROM img_produto WHERE produto_fk = codigo LIMIT 1);';\n\n $result = $conn->selectCustom($query);\n return $result;\n }", "function get_servicios_join($id)\n {\n $id = $this->session->id;\n $this->db->select('u.id as id_trabajador, u.nombre, u.apellido_paterno, s.id, s.titulo, s.detalles, s.fecha, s.total');\n $this->db->from('usuario as u');\n $this->db->join('servicio as s', 's.id_trabajador = u.id', 'inner');\n $this->db->where('id_cliente', $id);\n $this->db->order_by('s.fecha','DESC');\n $query = $this->db->get();\n return $query->result();\n }", "public function select($otros_votos);", "public function listaVentas()\n {\n $conexion = conexion::conectar();\n $sql = \"SELECT * FROM movimientos WHERE compra_venta ='v' order by id_producto asc;\";\n $stmt = $conexion->prepare($sql);\n $stmt->execute();\n $array = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $stmt = null;\n return $array;\n }", "function get_entradas_marcas_list($id) {\n\t\t$u = new Entrada();\n\t\t$sql=\"select distinct on (e.pr_facturas_id) e.pr_facturas_id, e.id as id1, date(e.fecha) fecha, prf.monto_total as importe_factura, pr.razon_social as proveedor,prf.folio_factura, prf.pr_pedido_id, ef.tag as espacio_fisico, eg.tag as estatus,e.lote_id, cel.tag as estatus_traspaso \".\n\t\t\t\t\"from entradas as e \".\n\t\t\t\t\"left join cproveedores as pr on pr.id=e.cproveedores_id \".\n\t\t\t\t\"left join pr_facturas as prf on prf.id=e.pr_facturas_id \".\n\t\t\t\t\"left join espacios_fisicos as ef on ef.id=e.espacios_fisicos_id \".\n\t\t\t\t\"left join estatus_general as eg on eg.id=e.estatus_general_id \".\n\t\t\t\t\"left join lotes_pr_facturas as lf on lf.pr_factura_id=prf.id \".\n\t\t\t\t\"left join cestatus_lotes as cel on cel.id=lf.cestatus_lote_id \".\n\t\t\t\t\"where e.estatus_general_id=1 and ctipo_entrada=1 and prf.cmarca_id='$id'\".\n\t\t\t\t\"group by e.pr_facturas_id, e.id, e.fecha, importe_factura, pr.razon_social, prf.folio_factura, prf.pr_pedido_id, ef.tag, eg.tag, e.pr_facturas_id, e.cproveedores_id, e.lote_id , cel.tag \".\n\t\t\t\t\"order by e.pr_facturas_id desc,e.fecha desc\";\n\n\t\t//Buscar en la base de datos\n\t\t$u->query($sql);\n\t\tif($u->c_rows > 0){\n\t\t\treturn $u;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function listarVendedores($conexao){\r\n $dados = $conexao->query('SELECT * FROM vendedor');\r\n return $listaVendedores = $dados->fetchAll(PDO::FETCH_OBJ); \r\n}", "public static function MdlMostrarVehiculos($tabla, $item, $valor)\n\t{\n\n\t\tif ($item != null) {\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT * FROM $tabla WHERE $item = :$item\");\n\n\t\t\t$stmt->bindParam(\":\" . $item, $valor, PDO::PARAM_STR);\n\n\t\t\t$stmt->execute();\n\n\t\t\treturn $stmt->fetch();\n\t\t} else {\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT * FROM $tabla as veh \n\t\t\tINNER JOIN \n\t\t\tcliente as cli \n\t\t\tWHERE veh.id_c = cli.id_c;\n\t\t\t\n\t\t\t\");\n\n\t\t\t$stmt->execute();\n\n\t\t\treturn $stmt->fetchAll();\n\t\t}\n\n\t\t$stmt->close();\n\n\t\t$stmt = null;\n\t}", "function cargar_data_registro_venta($nombre_anio='', $nombre_mes='', $nrocomprobante='', $limit='') {\n $sql = \"SELECT\n prosic_comprobante.id_comprobante\n , prosic_comprobante.codigo_comprobante\n , prosic_comprobante.emision_comprobante\n , prosic_comprobante.total_comprobante\n , prosic_comprobante.status_comprobante\n , prosic_anexo.codigo_anexo\n , prosic_subdiario.id_subdiario\n , prosic_subdiario.codigo_subdiario\n , prosic_subdiario.nombre_subdiario\n , prosic_anio.nombre_anio\n , prosic_mes.nombre_mes\n , prosic_tipo_comprobante.codigo_tipo_comprobante\n , prosic_tipo_comprobante.nombre_tipo_comprobante\n ,prosic_comprobante.nro_comprobante\n ,prosic_moneda.codigo_moneda\n FROM\n prosic_comprobante\n INNER JOIN prosic_anexo\n ON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n INNER JOIN prosic_mes\n ON (prosic_comprobante.id_mes = prosic_mes.id_mes)\n INNER JOIN prosic_anio\n ON (prosic_comprobante.id_anio = prosic_anio.id_anio)\n INNER JOIN prosic_subdiario\n ON (prosic_comprobante.id_subdiario = prosic_subdiario.id_subdiario)\n INNER JOIN prosic_tipo_comprobante\n ON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n INNER JOIN prosic_plan_contable\n ON (prosic_comprobante.id_plan_contable = prosic_plan_contable.id_plan_contable)\n INNER JOIN prosic_moneda\n ON (prosic_comprobante.id_moneda= prosic_moneda.id_moneda)\n\t\t\tWHERE prosic_comprobante.id_subdiario=2 \";\n if ($nombre_anio != ''\n )$sql.=\" AND prosic_anio.nombre_anio='\" . $nombre_anio . \"'\";\n if ($nombre_mes != ''\n )$sql.=\" AND prosic_mes.nombre_mes='\" . $nombre_mes . \"'\";\n if ($nrocomprobante != ''\n )$sql.=\" AND prosic_comprobante.nro_comprobante like'%\" . $nrocomprobante . \"%' \";\n if ($limit != ''\n )$sql.=$limit;\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "function fechas_entregas($id_licitacion){\r\n global $bgcolor3,$html_root;\r\n\r\n $sql=\" select * from (\r\n select id_subir,nro_orden,vence_oc from\r\n subido_lic_oc where id_licitacion=$id_licitacion and tipo_muestras=0\r\n ) as sl\r\n left join\r\n (\r\n select sum(cantidad*precio) as total,id_subir from renglones_oc\r\n group by id_subir\r\n ) as total\r\n using (id_subir)\r\n order by vence_oc ASC\r\n \";\r\n $res=sql($sql) or fin_pagina();\r\n\r\n $sql=\"select simbolo from licitacion join moneda using(id_moneda)\r\n where id_licitacion=$id_licitacion\";\r\n $moneda=sql($sql) or fin_pagina();\r\n\r\n if ($res->recordcount()>0) {\r\n //es que hay ordenes\r\n\r\n ?>\r\n <table width=100% align=center border=1 cellpading=0 cellspacing=0 bordercolor='<?=$bgcolor3?>'>\r\n <tr>\r\n <td colspan=4 align=Center><b>Ordenes de Compra</b></td>\r\n </tr>\r\n <tr>\r\n <td width=40% align=center><b>Orden de Compra</b></td>\r\n <td align=center><b>Fecha de Entrega</b></td>\r\n <td>&nbsp;</td>\r\n <td align=center><b>Montos</b></td>\r\n </tr>\r\n <?\r\n for($i=1;$i<=$res->recordcount();$i++){\r\n $id_subir=$res->fields[\"id_subir\"];\r\n $link=encode_link(\"../../lib/archivo_orden_de_compra.php\",array(\"id_subir\"=>$id_subir,\"solo_lectura\"=>1));\r\n $fechas_entregas=fechas_entregas_oc($id_subir);\r\n ?>\r\n <tr>\r\n <a href=<?=$link?> target=\"_blank\">\r\n <td align=left >\r\n <font color='blue'>\r\n <?=$res->fields[\"nro_orden\"]?>\r\n </font>\r\n </td>\r\n <td align=center><?=fechas_entregas_oc($id_subir)?></td>\r\n <td align=center><?=$moneda->fields[\"simbolo\"]?></td>\r\n <td align=right><?=formato_money($res->fields[\"total\"])?></td>\r\n </a>\r\n\r\n </tr>\r\n <?\r\n $cont++;\r\n $res->movenext();\r\n\r\n } // del for\r\n ?>\r\n </table>\r\n <?\r\n}\r\n\r\n}", "function get_listado_votos($id_acta)\n\t{\n $sql = \"SELECT t_l.id_nro_lista, \n t_l.nombre,\n t_v.cant_votos as votos\n FROM voto_lista_cdirectivo t_v\n INNER JOIN lista_cdirectivo t_l ON (t_l.id_nro_lista = t_v.id_lista)\n WHERE t_v.id_acta = $id_acta ORDER BY t_l.id_nro_lista\";\n \n return toba::db('gu_kena')->consultar($sql);\n\t}", "static public function mdlRangoVentas2($tabla,$fechaInicial,$fechaFinal,$item,$valor){\n\t\tif($fechaInicial == null){\n\t\t\t$sql = \"SELECT * FROM $tabla WHERE $item =:item ORDER BY id DESC\";\n\t\t\t$pdo= Conexion::conectar()->prepare($sql);\n\t\t\t$pdo->execute([\n\t\t\t\t'item' => $valor\n\t\t\t]);\n\n\t\t\treturn $pdo -> fetchAll();\n\t\t\t\n\t\t}else if($fechaInicial == $fechaFinal){\n\t\t\t$sql = \"SELECT * FROM $tabla WHERE $item =:item AND sell_date like '%$fechaFinal%'\";\n\t\t\t$pdo= Conexion::conectar()->prepare($sql);\n\t\t\t$pdo->execute([\n\t\t\t\t'item' => $valor\n\t\t\t]);\n\n\t\t\treturn $pdo -> fetchAll();\n\t\t}else{\n\t\t\t$fechaActual = new DateTime();\n\t\t\t$fechaActual ->add(new DateInterval(\"P1D\"));\n\t\t\t$fechaActualMasUno = $fechaActual ->format(\"Y-m-d\");\n\t\t\t$fechaFinal2 = new DateTime($fechaFinal);\n\t\t\t$fechaFinal2 ->add(new DateInterval(\"P1D\"));\n\t\t\t$fechaFinalMasUno = $fechaFinal2 ->format(\"Y-m-d\");\n\t\t\t$sql = \"SELECT * FROM $tabla WHERE $item =:item AND sell_date BETWEEN '$fechaInicial' AND '$fechaFinalMasUno'\";\n\t\t\t$pdo= Conexion::conectar()->prepare($sql);\n\t\t\t$pdo->execute([\n\t\t\t\t'item' => $valor\n\t\t\t]);\n\n\t\t\treturn $pdo -> fetchAll();\n\t\t}\n\t\t\n\n\t\t$pdo -> close();\n\t\t$pdo = null;\n\t\t}", "function listar_proveedores(){\n\t\t$sql=\"\n\tSELECT\n\t\tcp.IDPROVEEDOR IDPROV, cp.NOMBREFISCAL, cp.NOMBRECOMERCIAL, \n\t\tcp.IDTIPODOCUMENTO, cp.IDDOCUMENTO, cp.EMAIL1, cp.EMAIL2, cp.EMAIL3,\n\t\tcp.BRSCH, csb.RAMO, cp.FDGRV, cp.ZTERM, cp.MWSKZ, cp.PARVO, cp.PAVIP,\n\t\tcp.ACTIVO,cp.INTERNO,\n\t\tcp.ARREVALRANKING,\n\t\tcp.CDE,\n\t\tcp.SKILL,\n\t\tcp.EVALFIDELIDAD,\n\t\tcp.EVALINFRAESTRUCTURA,\n\t\tcp.EVALSATISFACCION,\n\t\tcp.IDMONEDA,\n\t\tYEAR(cp.FECHAINICIOACTIVIDADES) ANIO,\n\t\tMONTH(cp.FECHAINICIOACTIVIDADES) MES, \n\t\tDAY(cp.FECHAINICIOACTIVIDADES) DIA,\n\t\tcpu.*,\n\t\tcpt.*\n\tFROM\n\t$this->catalogo.catalogo_proveedor cp\n\t\tLEFT JOIN $this->catalogo.catalogo_proveedor_ubigeo cpu ON cp.IDPROVEEDOR=cpu.IDPROVEEDOR \n\t\tLEFT JOIN $this->catalogo.catalogo_sap_brsch csb ON cp.BRSCH = csb.BRSCH\t\n\t\tLEFT JOIN $this->catalogo.catalogo_proveedor_telefono cpt ON cp.IDPROVEEDOR = cpt.IDPROVEEDOR AND cpt.PRIORIDAD=1\n\t\n\t\t\";\n\n\t$result =$this->query($sql);\n\treturn $result;\n\t}", "static public function mdlMostraPedidosTablas($valor){\n\n\t\tif($valor != null){\n\n\t\t\t$sql=\"SELECT\n\t\t\t\t\t\tt.id,\n\t\t\t\t\t\tt.codigo,\n\t\t\t\t\t\tc.codigo AS cod_cli,\n\t\t\t\t\t\tc.nombre,\n\t\t\t\t\t\tc.tipo_documento,\n\t\t\t\t\t\tc.documento,\n\t\t\t\t\t\tt.lista,\n\t\t\t\t\t\tt.vendedor,\n\t\t\t\t\t\tt.op_gravada,\n\t\t\t\t\t\tt.descuento_total,\n\t\t\t\t\t\tt.sub_total,\n\t\t\t\t\t\tt.igv,\n\t\t\t\t\t\tt.total,\n\t\t\t\t\t\tROUND(\n\t\t\t\t\t\tt.descuento_total / t.op_gravada * 100,\n\t\t\t\t\t\t2\n\t\t\t\t\t\t) AS dscto,\n\t\t\t\t\t\tt.condicion_venta,\n\t\t\t\t\t\tcv.descripcion,\n\t\t\t\t\t\tt.estado,\n\t\t\t\t\t\tt.usuario,\n\t\t\t\t\t\tt.agencia,\n\t\t\t\t\t\tu.nombre AS nom_usu,\n\t\t\t\t\t\tDATE(t.fecha) AS fecha,\n\t\t\t\t\t\tcv.dias,\n\t\t\t\t\t\tDATE_ADD(DATE(t.fecha), INTERVAL cv.dias DAY) AS fecha_ven\n\t\t\t\t\tFROM\n\t\t\t\t\t\ting_sal t\n\t\t\t\t\t\tLEFT JOIN clientesjf c\n\t\t\t\t\t\tON t.cliente = c.codigo\n\t\t\t\t\t\tLEFT JOIN condiciones_ventajf cv\n\t\t\t\t\t\tON t.condicion_venta = cv.id\n\t\t\t\t\t\tLEFT JOIN usuariosjf u\n\t\t\t\t\t\tON t.usuario = u.id\n\t\t\t\t\tWHERE t.estado = '$valor'\n\t\t\t\t\tORDER BY fecha DESC\";\n\n\t\t$stmt=Conexion::conectar()->prepare($sql);\n\n\t\t$stmt->execute();\n\n\t\treturn $stmt->fetchAll();\n\n\t\t}else{\n\n\t\t\t$sql=\"SELECT\n\t\t\t\t\tt.id,\n\t\t\t\t\tt.codigo,\n\t\t\t\t\tc.codigo AS cod_cli,\n\t\t\t\t\tc.nombre,\n\t\t\t\t\tc.tipo_documento,\n\t\t\t\t\tc.documento,\n\t\t\t\t\tt.lista,\n\t\t\t\t\tt.vendedor,\n\t\t\t\t\tt.op_gravada,\n\t\t\t\t\tt.descuento_total,\n\t\t\t\t\tt.sub_total,\n\t\t\t\t\tt.igv,\n\t\t\t\t\tt.total,\n\t\t\t\t\tROUND(\n\t\t\t\t\tt.descuento_total / t.op_gravada * 100,\n\t\t\t\t\t2\n\t\t\t\t\t) AS dscto,\n\t\t\t\t\tt.condicion_venta,\n\t\t\t\t\tcv.descripcion,\n\t\t\t\t\tt.estado,\n\t\t\t\t\tt.usuario,\n\t\t\t\t\tt.agencia,\n\t\t\t\t\tu.nombre AS nom_usu,\n\t\t\t\t\tDATE(t.fecha) AS fecha,\n\t\t\t\t\tcv.dias,\n\t\t\t\t\tDATE_ADD(DATE(t.fecha), INTERVAL cv.dias DAY) AS fecha_ven\n\t\t\t\tFROM\n\t\t\t\t\ting_sal t\n\t\t\t\t\tLEFT JOIN clientesjf c\n\t\t\t\t\tON t.cliente = c.codigo\n\t\t\t\t\tLEFT JOIN condiciones_ventajf cv\n\t\t\t\t\tON t.condicion_venta = cv.id\n\t\t\t\t\tLEFT JOIN usuariosjf u\n\t\t\t\t\tON t.usuario = u.id\n\t\t\t\tWHERE t.codigo = $valor\";\n\n\t\t$stmt=Conexion::conectar()->prepare($sql);\n\n\t\t$stmt->execute();\n\n\t\treturn $stmt->fetch();\n\n\t\t}\n\n\t\t$stmt=null;\n\n\t}", "public function mostrarVentas() {\n //String $retorno\n //Array Venta $col\n $retorno = \"\";\n $col = $this->getColVentas();\n for ($i = 0; $i < count($col); $i++) {\n $retorno .= $col[$i] . \"\\n\";\n $retorno .= \"-------------------------\\n\";\n }\n return $retorno;\n }", "static public function mdlSumTotVtasServ($tabla, $item, $valor, $cerrado, $fechacutvta){\t\n\n\tif($fechacutvta!=null){\n\t $stmt = Conexion::conectar()->prepare(\"SELECT h.`fecha_salida`, sum(h.cantidad*h.precio_venta) as total FROM $tabla h INNER JOIN productos p ON h.id_producto=p.id WHERE h.$item='\".$fechacutvta.\"' and p.totaliza=2 and h.id_caja=$valor and h.cerrado=$cerrado AND h.id_tipomov=1\");\n\t}else{\n\t $stmt = Conexion::conectar()->prepare(\"SELECT h.`fecha_salida`, sum(h.cantidad*h.precio_venta) as total FROM $tabla h INNER JOIN productos p ON h.id_producto=p.id WHERE h.$item=curdate() and p.totaliza=2 and h.id_caja=$valor and h.cerrado=$cerrado AND h.id_tipomov=1\");\n\t}\n\n\t$stmt -> execute();\n\n\treturn $stmt -> fetch();\n\n\t$stmt = null;\n\n}", "public function get_usuario_por_id_ventas($id_usuario)\n {\n\n\n $conectar = parent::conexion();\n parent::set_names();\n\n\n $sql = \"select u.id_usuario,v.id_usuario\n \n from usuarios u \n \n INNER JOIN ventas v ON u.id_usuario=v.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 get_resumen_ventas_cobros($fecha,$sucursal){\n\t$conectar= parent::conexion();\n\tparent::set_names(); \n\t$fecha_corte = $fecha.\"%\";\n\t$sql=\"select * from corte_diario where fecha_ingreso like ? and (sucursal_venta=? or sucursal_cobro=?);\";\n\t$sql=$conectar->prepare($sql);\n\t$sql->bindValue(1,$fecha_corte);\n\t$sql->bindValue(2,$sucursal);\n\t$sql->bindValue(3,$sucursal);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "public function get_datos_ventas_cargo($fecha,$sucursal){\n\t$conectar= parent::conexion();\n\tparent::set_names();\n \n\t$fecha_corte = $fecha.\"%\";\n\t$sql=\"select c.n_factura,c.fecha_ingreso,c.n_recibo,c.paciente,u.usuario,c.total_factura,c.forma_cobro,c.monto_cobrado,c.saldo_credito,c.abonos_realizados from corte_diario as c inner join usuarios as u on u.id_usuario=c.id_usuario where c.fecha_ingreso like ? and c.abonos_realizados='0' and c.tipo_pago='Cargo Automatico' and (sucursal_venta=? or sucursal_cobro=?);\";\n\t$sql=$conectar->prepare($sql);\n\t$sql->bindValue(1,$fecha_corte);\n\t$sql->bindValue(2,$sucursal);\n\t$sql->bindValue(3,$sucursal);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "public function getVentas() {\n\t\t$query = $this->db->query('\n\t\t\tSELECT\n\t\t\t\tv.idVenta as idVenta, \n\t\t\t\tu.nombre_usuario as usuario,\n\t\t\t\tc.nombre as cliente,\n\t\t\t \tv.fecha_venta as fecha, \n\t\t\t\tv.total as total\n\t\t\tFROM \n\t\t\t\tventas as v\n\t\t\tINNER JOIN \t\n\t\t\t\tusuarios as u on u.idUsuario = v.idUsuario \n\t\t\tINNER JOIN \n\t\t\t\tclientes as c on c.idCliente = v.idCliente\n\t\t\tORDER by fecha;\n\t\t');\n\t\t//si hay ventas, regresamos los resultados\n\t\tif ($query -> num_rows() > 0) {\n\t\t\treturn $query;\n\t\t}\n\t\t//si no hay regresamos un false\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "static public function ctrEtiquetasVentas(){\n\n\t\t$tabla = \"ventas\";\n\n\t\t$respuesta = ModeloVentas::mdlEtiquetasVentas($tabla);\n\n\t\treturn $respuesta;\n\t\t\n\t}", "function obtener_inf_cliente(){\n $sql=\"select c.id_cliente,c.razon_social \n from cliente c\n \";\n \n $consulta =$this->db->query($sql);\n return $consulta;\n }", "public function selectEmpresas() {\r\n return $this->getDb()->query(\"SELECT E.ID_EMPRESA,E.NOMBRE,E.TELEFONO,E.DIRECCION,concat(U.NOMBRE,concat(' ',U.APELLIDO)) \\\"USUARIO ENCARGADO\\\" ,E.ESTADO FROM EMPRESA E LEFT JOIN USUARIO U ON(E.ID_PERSONA_ENCARGADA=U.IDENTIFICADOR)\");\r\n }", "function get_all_produto_solicitacao_baixa_estoque()\n {\n \n $this->db->select('baixa.di,baixa.quantidade, u.nome_usuario,produto.nome as produto');\n $this->db->join('usuario u ','u.id = baixa.usuario_id');\n $this->db->join('produto','produto.id = baixa.produto_id');\n\n return $this->db->get('produto_solicitacao_baixa_estoque baixa')->result_array();\n }", "public function mostrar_reserves_tancades(){\n $usuari = session::get('idusuari');\n $sql = \"SELECT DISTINCT reserves.id, tipus_pagament.tipus AS metodepaga, pagaments.pagament_data AS datapaga, reserves.preu AS import FROM tipus_pagament\n INNER JOIN pagaments ON tipus_pagament.id = pagaments.tipus\n INNER JOIN reserves ON pagaments.idreserva = reserves.id\n INNER JOIN serveis_reservats ON reserves.id = serveis_reservats.idreserva \n INNER JOIN serveis ON serveis.id = serveis_reservats.idservei \n WHERE reserves.idusuari = \".$usuari.\" AND reserves.status = 'Pagada'\n ORDER BY datapaga;\";\n \n $query=$this->db->prepare($sql);\n $query->execute();\n if($query->rowCount()>=1) {\n $res=$query->fetchAll();\n return $res;\n }\n else\n return FALSE;\n }", "public function BuscarVentasFechas() \n\t{\n\t\tself::SetNames();\n\t\t$sql =\"SELECT detalleventas.codventa, cajas.nrocaja, ventas.idventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.totalpago2, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, SUM(detalleventas.cantventa) as articulos FROM (detalleventas LEFT JOIN ventas ON detalleventas.codventa=ventas.codventa) \n\t\tLEFT JOIN cajas ON cajas.codcaja=ventas.codcaja LEFT JOIN clientes ON ventas.codcliente=clientes.codcliente WHERE DATE_FORMAT(ventas.fechaventa,'%Y-%m-%d') >= ? AND DATE_FORMAT(ventas.fechaventa,'%Y-%m-%d') <= ? GROUP BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindValue(1, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\n\t\t\techo \"<div class='alert alert-danger'>\";\n\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN VENTAS DE PRODUCTOS PARA EL RANGO DE FECHAS SELECCIONADAS</center>\";\n\t\t\techo \"</div>\";\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[]=$row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "public function ListarProductosVendidos() \n\t{\n\t\tself::SetNames();\n\t\t$sql =\"SELECT \n\tproductos.codproducto, productos.producto, productos.codcategoria, productos.precioventa, productos.existencia, productos.stockminimo, categorias.nomcategoria, SUM(detalleventas.cantventa) as cantidad \n\tFROM\n\t(productos LEFT OUTER JOIN detalleventas ON productos.codproducto=detalleventas.codproducto) LEFT OUTER JOIN categorias ON \n\tcategorias.codcategoria=productos.codcategoria WHERE DATE_FORMAT(detalleventas.fechadetalleventa,'%Y-%m-%d') >= ? AND DATE_FORMAT(detalleventas.fechadetalleventa,'%Y-%m-%d') <= ? AND detalleventas.codproducto is not null GROUP BY productos.codproducto\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindValue(1, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\n\t\t\techo \"<div class='alert alert-danger'>\";\n\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN PRODUCTOS VENDIDOS PARA EL RANGO DE FECHAS SELECCIONADAS</center>\";\n\t\t\techo \"</div>\";\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[]=$row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "public function selectProductos($tabla, $tablaInner, $id) {\n $SQL = \"SELECT * FROM $tabla as pv \n INNER JOIN $tablaInner as cp ON cp.Id_clasificacion = pv.Id_clasificacion\";\n $SQLCOUNT = \"SELECT count(*) as cantidad FROM $tabla as pvv \n INNER JOIN $tablaInner as cpp ON cpp.Id_clasificacion = pvv.Id_clasificacion\";\n $where = \"WHERE cod_busqueda like'%$id[0]%'\n or producto like'%$id[0]%' \n or material like'%$id[0]%'\n or talla like'%$id[0]%'\n or color like'%$id[0]%'\n or clasificacion like'%$id[0]%'\";\n \n $SQL_ordenar = \"ORDER BY clasificacion\";\n\n if (!($id == NULL)) {\n $SQL = $SQL.' INNER JOIN ('.$SQLCOUNT.' '.$where.')as t '.$where;\n } else {\n $SQL = $SQL.' INNER JOIN ('.$SQLCOUNT.')as t '.$SQL_ordenar;\n }\n $stmt = $this->_db->prepare($SQL);\n $stmt->execute($id);\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n }", "function get_servicios_join_activos($id)\n {\n $id = $this->session->id;\n $this->db->select('u.id as id_trabajador, u.nombre, u.apellido_paterno, s.id, s.titulo, s.detalles, s.fecha, s.total');\n $this->db->from('usuario as u');\n $this->db->join('servicio as s', 's.id_trabajador = u.id', 'inner');\n $this->db->where('estado', 1);\n $this->db->where('id_cliente', $id);\n $this->db->order_by('s.fecha','DESC');\n $query = $this->db->get();\n return $query->result();\n }", "public function getReporteVentasDiario($data)\n\t{\n\t\t$spreadsheet = new Spreadsheet();\n\t\t$sheet = $spreadsheet->getActiveSheet();\n\t\t$sql = (\"SELECT \n\t\t\t\t\tfacturascli.codpago,\n\t\t\t\t\tclientes.nombre,\n\t\t\t\t\tclientes.razonsocial,\n\t\t\t\t\tclientes.codagente AS codigo_vendedor,\n\t\t\t\t\tagentes.nombre AS nombre_vendedor,\n\t\t\t\t\tfacturascli.fecha AS fecha_facturacion,\n\t\t\t\t\tfacturascli.vencimiento AS fecha_vencimiento,\n\t\t\t\t\tfacturascli.codigo,\n\t\t\t\t\tfacturascli.observaciones,\n\t\t\t\t\tfacturascli.total\n\t\t\t\tFROM\n\t\t\t\t\t`facturascli`\n\t\t\t\t\t\tINNER JOIN\n\t\t\t\t\tclientes ON clientes.codcliente = facturascli.codcliente\n\t\t\t\t\t\tLEFT JOIN\n\t\t\t\t\tagentes AS agentes ON agentes.codagente = clientes.codagente\n\t\t\t\tWHERE\n\t\t\t\t\tDATE(facturascli.fecha) = :fecha\n\t\t\t\tORDER BY clientes.codagente;\");\n\t\t\t\t\n\t\t$this->consulta('SET NAMES utf8');\n\t\t# Escribir encabezado de los productos\n\t\t$encabezado = [\"codpago\",\"nombre\",\"razonsocial\",\"codigo_vendedor\",\"nombre_vendedor\",\"fecha_facturacion\",\"fecha_vencimiento\",\"codigo\",\"observaciones\",\"total\",\"fecha_pago\"];\n\t\t# El último argumento es por defecto A1 pero lo pongo para que se explique mejor\n\t\t$sheet->fromArray($encabezado, null, 'A1');\n\t\t$parametros = array('fecha'=>$data);\n\t\t$resultado = $this->consulta($sql,$parametros);\n\t\t$res = $resultado->fetchAll(PDO::FETCH_ASSOC);\n\t\t$numeroDeFila = 2;\n\t\tforeach ($res as $data ) {\n\t\t\t# Obtener los datos de la base de datos\n\t\t\t$codpago = $data['codpago'];\n\t\t\t$nombre = $data['nombre'];\n\t\t\t$razonsocial = $data['razonsocial'];\n\t\t\t$codigo_vendedor = $data['codigo_vendedor'];\n\t\t\t$nombre_vendedor = $data['nombre_vendedor'];\n\t\t\t$fecha_facturacion = $data['fecha_facturacion'];\n\t\t\t$fecha_vencimiento = $data['fecha_vencimiento'];\n\t\t\t$codigo = $data['codigo'];\n\t\t\t$observaciones = $data['observaciones'];\n\t\t\t$total = $data['total'];\n\t\t\t# Escribirlos en el documento\n\t\t\t$sheet->setCellValueByColumnAndRow(1, $numeroDeFila, $codpago);\n\t\t\t$sheet->setCellValueByColumnAndRow(2, $numeroDeFila, $nombre);\n\t\t\t$sheet->setCellValueByColumnAndRow(3, $numeroDeFila, $razonsocial);\n\t\t\t$sheet->setCellValueByColumnAndRow(4, $numeroDeFila, $codigo_vendedor);\n\t\t\t$sheet->setCellValueByColumnAndRow(5, $numeroDeFila, $nombre_vendedor);\n\t\t\t$sheet->setCellValueByColumnAndRow(6, $numeroDeFila, $fecha_facturacion);\n\t\t\t$sheet->setCellValueByColumnAndRow(7, $numeroDeFila, $fecha_vencimiento);\n\t\t\t$sheet->setCellValueByColumnAndRow(8, $numeroDeFila, $codigo);\n\t\t\t$sheet->setCellValueByColumnAndRow(9, $numeroDeFila, $observaciones);\n\t\t\t$sheet->setCellValueByColumnAndRow(10, $numeroDeFila, $total);\n\t\t\t$numeroDeFila++;\n\t\t}\n\t\t$writer = new Xlsx($spreadsheet);\n\t\t$writer->save('../../reporte/reporte.xlsx');\n\t\techo \"true\";\n\t}", "public function getDetalleItemsVentaPriv($id_unico){\n //echo($id_unico);\n /*$consulta = 'SELECT *\n FROM vent_prof_det \n WHERE ISNULL(vent_prof_det_usr_baja) AND vent_prof_det_cod_unico=\"'.$id_unico.'\"';\n*/\n $consulta = 'SELECT *\n FROM vent_prof_det as vpd INNER JOIN alm_prod_cabecera as apc ON vpd.vent_prof_prod_cod_unico= apc.alm_prod_cab_id_unico_prod\n WHERE ISNULL(vent_prof_det_usr_baja) AND vent_prof_det_cod_unico=\"'.$id_unico.'\"';\n \n //print_r($consulta);\n return $this->mysql->query($consulta);\n }", "public function show($ecajachica_id)\n\t{\n $datos = Dte_ecajachica::where('ecajachica_id', $ecajachica_id)\n \t\t\t\t->join('serviproductos', 'serviproductos.id', '=', 'dte_ecajachicas.serviproducto_id')\n ->select('dte_ecajachicas.id','serviproductos.catalogo_id','serviproductos.nombre','serviproductos.tipo', 'dte_ecajachicas.cantidad','dte_ecajachicas.precio','dte_ecajachicas.itbms')\n ->get();\n //dd($datos->toArray());\t\t\n\n // encuentra los datos generales del encabezado de egreso de caja chica\n $ecajachica= Ecajachica::find($ecajachica_id);\n $ecajachica['fecha'] = Date::parse($ecajachica->fecha)->toFormattedDateString();\n\t\t//dd($ecajachica->toArray());\n\n //Obtiene todos los productos registrados en la factura de egresos de caja chica\n $datos_1= $datos->where('tipo', 0);\n $datos_1= $datos_1->pluck('nombre', 'id')->all(); \n //dd($datos_2);\n \n //Obtiene todos los servicios registrados en la factura de egresos de caja chica\n $datos_2= $datos->where('tipo', 1);\n $datos_2= $datos_2->pluck('nombre', 'id')->all(); \n \n // encuentra todos los productos asignados a un determinado proveedor\n\t\t$datos_3 = Org::find($ecajachica->org_id)->serviproductos()->where('tipo', 0)->where('activo', 1);\n $datos_3= $datos_3->pluck('nombre', 'serviproductos.id')->all(); \n \n // encuentra todos los servicios asignados a un determinado proveedor\n\t\t$datos_4 = Org::find($ecajachica->org_id)->serviproductos()->where('tipo', 1)->where('activo', 1);\n $datos_4= $datos_4->pluck('nombre', 'serviproductos.id')->all(); \n\n // Subtrae de la lista total de productos de la tabla serviproductos,\n // todos los productos ya registrados en la factura de egresos de caja chica.\n // para evitar asignar productos previamente asignadas\n\t\t$productos = array_diff($datos_3, $datos_1);\t\t\n\t\t//dd($productos); \n \n // Subtrae de la lista total de servicios de la tabla serviproductos,\n // todos los servicios ya registrados en la factura de egresos de caja chica.\n // para evitar asignar servicios previamente asignadas\n $servicios = array_diff($datos_4, $datos_2); \n //dd($servicios); \t\t\n \t\t\n\t\t// calcula y agrega el total\n\t\t$i=0;\t\t\n\t\t$subTotal = 0;\n\t\t$totalItbms = 0;\n\n\t\tforeach ($datos as $dato) {\n\t\t $datos[$i][\"total\"] = number_format((($dato->cantidad * $dato->precio) + $dato->itbms),2);\n\t\t $datos[$i][\"codigo\"] = Catalogo::find($dato->catalogo_id)->codigo;\n\t\t $subTotal = $subTotal + ($dato->cantidad * $dato->precio);\n\t\t $totalItbms = $totalItbms + $dato->itbms;\t\t \n\t\t $i++;\n\t\t} \n\n\t\treturn view('contabilidad.dte_ecajachicas.show')\n\t\t\t\t ->with('productos', $productos)\n\t\t\t\t ->with('servicios', $servicios)\n\t\t\t\t ->with('ecajachica', $ecajachica)\n\t\t\t\t ->with('subTotal', $subTotal)\n\t\t\t\t ->with('totalItbms', $totalItbms)\n\t\t\t\t ->with('datos', $datos);\n\t}", "protected function selectPagos($tabla) {\n $getproducto = $this->_db->query(\"SELECT deuda.Id_cliente as dni, nombre as nombre, apellidos as apellido, \n direccion as direccion, telefono as telefono, celular as celular, deuda.total as deuda\n FROM $tabla as pagos \n INNER JOIN venta as venta ON venta.Id_deuda = pagos.Id_deuda\n INNER JOIN productoventa as prodventa ON venta.cod_busqueda = prodventa.cod_busqueda\n INNER JOIN deuda as deuda ON deuda.Id_deuda = venta.Id_deuda\n INNER JOIN cliente as cliente ON cliente.Id_cliente = deuda.Id_cliente where pagos.estado = 0 and pagos.Fecha_Pago = CURDATE()\n GROUP BY cliente.Id_cliente\n ORDER BY deuda.Fecha_deuda\");\n $this->_db->cerrar();\n return $getproducto->fetchall();\n }", "public function getRecordatorio() {\n $recordatorio = $this->_db->query(\"SELECT deuda.Id_cliente as dni, nombre as nombre, apellidos as apellido, \n direccion as direccion, telefono as telefono, celular as celular, total as totalDeuda\n FROM pagos as pagos \n INNER JOIN venta as venta ON venta.Id_deuda = pagos.Id_deuda\n INNER JOIN productoventa as prodventa ON venta.cod_busqueda = prodventa.cod_busqueda\n INNER JOIN deuda as deuda ON deuda.Id_deuda = venta.Id_deuda\n INNER JOIN cliente as cliente ON cliente.Id_cliente = deuda.Id_cliente where pagos.estado >= 0 and pagos.Fecha_Pago = CURDATE()\n ORDER BY deuda.Fecha_deuda\"\n );\n return $recordatorio->fetchall();\n }", "public function getReporteClientesCartera()\n\t{\n\t\t$spreadsheet = new Spreadsheet();\n\t\t$sheet = $spreadsheet->getActiveSheet();\n\t\t$sql = \"SELECT\n\t\t\t\t\tag.nombre,\n\t\t\t\t\tcli.nombrecliente,\n\t\t\t\t\tclientes.razonsocial,\n\t\t\t\t\tcli.codigo,\n\t\t\t\t\tcli.codpago,\n\t\t\t\t\tcli.fecha,\n\t\t\t\t\tcli.vencimiento,\n\t\t\t\t\tTIMESTAMPDIFF(DAY, CURRENT_DATE(), cli.vencimiento) AS dias_vencidos,\n\t\t\t\t\tIF(Date(cli.vencimiento) < current_date(), 'Vencido', dayname(cli.vencimiento)) as dias,\n\t\t\t\t\tcli.observaciones,\n\t\t\t\t\tcli.total\n\t\t\t\tFROM\n\t\t\t\t\tfacturascli cli\n\t\t\t\t\tinner join clientes on clientes.codcliente = cli.codcliente\n\t\t\t\t\tinner join agentes ag on ag.codagente = clientes.codagente \n\t\t\t\tWHERE YEAR(vencimiento) >= '2020' and cli.pagada = 0;\";\n\t\t\t\t\n\t\t$this->consulta('SET NAMES utf8');\n\t\t# Escribir encabezado de los productos\n\t\t$encabezado = [\"nombre\",\"nombrecliente\",\"razonsocial\",\"codigo\",\"codpago\",\"fecha\",\"vencimiento\",\"dias_vencidos\",\"dias\",\"observaciones\",\"total\"];\n\t\t# El último argumento es por defecto A1 pero lo pongo para que se explique mejor\n\t\t$sheet->fromArray($encabezado, null, 'A1');\n\t\t$resultado = $this->consulta($sql);\n\t\t$res = $resultado->fetchAll(PDO::FETCH_ASSOC);\n\t\t$numeroDeFila = 2;\n\t\tforeach ($res as $data ) {\n\t\t\t# Obtener los datos de la base de datos\n\t\t\t$nombre = $data['nombre'];\n\t\t\t$nombrecliente = $data['nombrecliente'];\n\t\t\t$razonsocial = $data['razonsocial'];\n\t\t\t$codigo = $data['codigo'];\n\t\t\t$codpago = $data['codpago'];\n\t\t\t$fecha = $data['fecha'];\n\t\t\t$vencimiento = $data['vencimiento'];\n\t\t\t$dias_vencidos = $data['dias_vencidos'];\n\t\t\t$dias = $data['dias'];\n\t\t\t$observaciones = $data['observaciones'];\n\t\t\t$total = $data['total'];\n\t\t\t# Escribirlos en el documento\n\t\t\t$sheet->setCellValueByColumnAndRow(1, $numeroDeFila, $nombre);\n\t\t\t$sheet->setCellValueByColumnAndRow(2, $numeroDeFila, $nombrecliente);\n\t\t\t$sheet->setCellValueByColumnAndRow(3, $numeroDeFila, $razonsocial);\n\t\t\t$sheet->setCellValueByColumnAndRow(4, $numeroDeFila, $codigo);\n\t\t\t$sheet->setCellValueByColumnAndRow(5, $numeroDeFila, $codpago);\n\t\t\t$sheet->setCellValueByColumnAndRow(6, $numeroDeFila, $fecha);\n\t\t\t$sheet->setCellValueByColumnAndRow(7, $numeroDeFila, $vencimiento);\n\t\t\t$sheet->setCellValueByColumnAndRow(8, $numeroDeFila, $dias_vencidos);\n\t\t\t$sheet->setCellValueByColumnAndRow(9, $numeroDeFila, $dias);\n\t\t\t$sheet->setCellValueByColumnAndRow(10, $numeroDeFila, $observaciones);\n\t\t\t$sheet->setCellValueByColumnAndRow(11, $numeroDeFila, $total);\n\t\t\t$numeroDeFila++;\n\t\t}\n\t\t$writer = new Xlsx($spreadsheet);\n\t\t$writer->save('../../reporte/reporte.xlsx');\n\t\techo \"true\";\n\t}", "public function getVeiculosServidor($id_servidor){\n // $this->db->join('servidores', \"servidores.id_servidor = id_servidor\");\n // $query = $this->db->order_by('modelo')->get('veiculos');\n \n $this->db->select('modelo, placa'); \n $this->db->from('veiculoss');\n $this->db->join('servidores', \"servidores.id_servidor = $id_servidor\");\n $this->db->where(\"id_secretarias = \". $_SESSION['secretaria']);\n $query = $this->db->get();\n return $query->result_array();\n }", "function getPedidos($db) {\n //Trae todos los pedidos\n $query = \"SELECT p.id, p.idusuario, p.fechayhora, p.monto, \n (select COUNT(c.clavecarrito) FROM carrito c WHERE c.idpedido = p.id) as items, \n u.fullname, p.cumplido FROM pedidos p INNER JOIN usuarios u ON p.idusuario=u.id \n ORDER BY p.fechayhora DESC\";\n\n return mysqli_query($db, $query);\n}", "public static function getAllEntreprise($id){\n $con=new connexion();\n $cont=$con->executerequete(\"select e.id_entreprise,e.nom,v.nom_ville,e.adresse_complete,e.etat from tblentreprise e inner join tblville v on v.id_ville=e.ville_id where admin_id='$id'\");\n $con->closeconnexion();\n return $cont;\n }", "function listarServiciosTerminados()\n\t{\n\t\treturn \"select servicios.servicio_id,servicios.nombre_servicio, servicios.estado_servicio, servicios.descripcion, servicios.fecha_creacion,\n trabajadores.nombre,\nsucursales.nombre_sucursal\nfrom trabajadores, servicios,sucursales where servicios.trabajador_id = trabajadores.trabajador_id \nand servicios.estado_servicio = 0 \nand servicios.sucursal_id = sucursales.sucursal_id\";\n\t}", "public function muestra_resultados() {\n \t//dd($datos);\n \t/*https://zinoui.com/blog/css-tables-tutorial*/\n \t/*https://vuejs.org/v2/examples/grid-component.html*/\n \t/*http://webgenio.com/2017/01/14/40-bonitas-plantillas-tablas-css/*/\n\n \t$result = \\DB::table('pimof.dbo.estimaciones AS e')\n \t\t->leftJoin('pimof.dbo.arboles AS a', 'a.id', '=', 'e.id_arboles')\n ->select([\n 'e.id'\n , 'a.genero'\n , 'a.epiteto'\n , 'e.d130'\n , 'e.ht'\n , 'e.densidad'\n , 'e.ecuacion'\n , 'e.fraccion'\n , 'e.biomasa'\n , 'e.carbono'\n ])\n ->get();\n\n //dd($result);\n\t\t\n\t\t$tabla = '\n\t\t\t<table id=\"miTablaPersonalizada\" class=\"table table-striped table-responsive\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>id</th>\n\t\t\t\t\t\t<th>Especie</th>\n\t\t\t\t\t\t<th>d130</th>\n\t\t\t\t\t\t<th>ht</th>\n\t\t\t\t\t\t<th>Densidad</th>\n\t\t\t\t\t\t<th>Fracción</th>\n\t\t\t\t\t\t<th>Ecuación</th>\n\t\t\t\t\t\t<th>Carbono</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t';\n\n foreach ($result as $registro) {\n\n \t$tabla .= '\n \t\t\t<tr>\n\t\t\t\t\t\t<td>' . $registro->id . '</td>\n\t\t\t\t\t\t<td>' . $registro->genero . ' ' . $registro->epiteto . '</td>\n\t\t\t\t\t\t<td>' . round($registro->d130, 1) . '</td>\n\t\t\t\t\t\t<td>' . round($registro->ht, 1) . '</td>\n\t\t\t\t\t\t<td>' . round($registro->densidad, 2) . '</td>\n\t\t\t\t\t\t<td>' . round($registro->fraccion, 2) . '</td>\n\t\t\t\t\t\t<td>' . $registro->ecuacion . '</td>\n\t\t\t\t\t\t<td><b>' . round($registro->carbono, 2) . '</b></td>\n\t\t\t\t\t</tr>\n \t';\n }\n\n $tabla .= '\n \t\t</tbody>\n\t\t\t</table>\n\t\t\t';\n\t\t\n\t\treturn response($tabla);\n }", "function venta($mysqli,$fecha,$ref,$monto16,$monto0,$iva,$tipo,$factu,$cte){\n\t\t//en todos los casos\n\t\t$table='diario';\n\t\t$tmonto=$monto16+$monto0;\n\t\t$montof=$tmonto+$iva;\n\t\t//inicializa variable resultados\n\t\t\t//calculo del costo de ventas\n\t\t $costoc=$mysqli->query(\"SELECT SUM(haber)FROM inventario WHERE tipomov = 2 AND idoc= $ref\");\n\t\t\t$row=mysqli_fetch_row($costoc);\n\t\t\t$costo=$row[0];\n\t\t\t$costoc->close();\t\n\t\t\t//si existe el costo de ventas?\n\t\t\tif($costo!=''){\n\t\t\t\ttry {\n\t\t\t\t\t$mysqli->autocommit(false);\n\t\t\t\t\t//abono a inventario 115.01\n\t\t\t\t\t$abono=\"115.01\";\n\t\t\t\t\toperdiario($mysqli,$abono,1,1,$ref,$costo,$fecha,$factu);\n\t\t\t\t\t//cargo a costo de ventas 501.01\n\t\t\t\t\t$cargo=\"501.01\";\n\t\t\t\t\toperdiario($mysqli,$cargo,1,0,$ref,$costo,$fecha,$factu);\n\t\t\t\t\t//abono a ventas segun tasa\n\t\t\t\t\t//ventas tasa general \n\t\t\t\t\t\t$abono=\"401.01\";\n\t\t\t\t\t\toperdiario($mysqli,$abono,1,1,$ref,$monto16,$fecha,$factu,$cte);\n\t\t\t\t\t//ventas tasa 0 \n\t\t\t\t\t\t$abono=\"401.04\";\n\t\t\t\t\t\toperdiario($mysqli,$abono,1,1,$ref,$monto0,$fecha,$factu,$cte);\n\t\t\t\t\t//movimientos por tipo de venta\n\t\t\t\t\t\tswitch($tipo){\n\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\t//mostrador- cargo a caja y efectivo 101.01\n\t\t\t\t\t\t\t\t$cargo=\"101.01\";\n\t\t\t\t\t\t\t\toperdiario($mysqli,$cargo,1,0,$ref,$montof,$fecha,$factu);\n\t\t\t\t\t\t\t\t//iva trasladado cobrado 208.01\n\t\t\t\t\t\t\t\t$abono=\"208.01\";\n\t\t\t\t\t\t\t\toperdiario($mysqli,$abono,1,1,$ref,$iva,$fecha,$factu);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t//contado x ahora igual a anterior, luego se manda al cobro\n\t\t\t\t\t\t\t\t//mostrador- cargo a caja y efectivo 101.01\n\t\t\t\t\t\t\t\t$cargo=\"101.01\";\n\t\t\t\t\t\t\t\toperdiario($mysqli,$cargo,1,0,$ref,$montof,$fecha,$factu);\n\t\t\t\t\t\t\t\t//iva trasladado cobrado 208.01\n\t\t\t\t\t\t\t\t$abono=\"208.01\";\n\t\t\t\t\t\t\t\toperdiario($mysqli,$abono,1,1,$ref,$iva,$fecha,$factu);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t//credito cargo a clientes\n\t\t\t\t\t\t\t\t$cargo=\"105.01\";\n\t\t\t\t\t\t\t\toperdiario($mysqli,$cargo,1,0,$ref,$montof,$fecha,$factu,$cte);\n\t\t\t\t\t\t\t\t//iva trasladado no cobrado 209.01\n\t\t\t\t\t\t\t\t$abono=\"209.01\";\n\t\t\t\t\t\t\t\toperdiario($mysqli,$abono,1,1,$ref,$iva,$fecha,$factu);\t\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//efectuar la operacion\n\t\t\t\t\t$mysqli->commit();\n\t\t\t\t $resul=0;\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t//error en las operaciones de bd\n\t\t\t\t $mysqli->rollback();\n\t\t\t\t \t$resul=-2;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t//no hay costo de ventas\n\t\t\t\t$resul=-1;\n\t\t\t}\n\t\t\n\t\t return $resul;\n}", "public function vendasHoje(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT ifnull(count(*),0) as total FROM tbpedidos c WHERE DAY(c.data_finaliza) = Day(now()) and c.status = 'F';\";\n $rsvendahj = $this->conexao->query($sql);\n $result = $rsvendahj->fetch_array();\n $vendashoje = $result['total'];\n\n return $vendashoje;\n }", "function get_listado_estactual($filtro=array())\n\t{ \n $concat='';\n if (isset($filtro['anio']['valor'])) {\n \t$udia=dt_mocovi_periodo_presupuestario::ultimo_dia_periodo_anio($filtro['anio']['valor']);\n $pdia=dt_mocovi_periodo_presupuestario::primer_dia_periodo_anio($filtro['anio']['valor']);\n\t\t} \n //que sea una designacion correspondiente al periodo seleccionado o anulada dentro del periodo \n $where=\" WHERE ((a.desde <= '\".$udia.\"' and (a.hasta >= '\".$pdia.\"' or a.hasta is null)) or (a.desde='\".$pdia.\"' and a.hasta is not null and a.hasta<a.desde))\";\n $where2=\" WHERE 1=1 \";//es para filtrar por estado. Lo hago al final de todo\n if (isset($filtro['uni_acad'])) {\n $concat=quote($filtro['uni_acad']['valor']);\n switch ($filtro['uni_acad']['condicion']) {\n case 'es_igual_a': $where.= \" AND a.uni_acad = \".quote($filtro['uni_acad']['valor']);break;\n case 'es_distinto_de': $where.= \" AND a.uni_acad <> \".quote($filtro['uni_acad']['valor']);break;\n }\n }\n //si el usuario esta asociado a un perfil de datos le aplica igual a su UA\n $con=\"select sigla from unidad_acad \";\n $con = toba::perfil_de_datos()->filtrar($con);\n $resul=toba::db('designa')->consultar($con);\n if(count($resul)<=1){//es usuario de una unidad academica\n $where.=\" and a.uni_acad = \".quote($resul[0]['sigla']);\n $concat=quote($resul[0]['sigla']);//para hacer el update de baja\n }\n if (isset($filtro['iddepto'])) {\n switch ($filtro['iddepto']['condicion']) {\n case 'es_igual_a': $where.= \" AND iddepto =\" .$filtro['iddepto']['valor'];break;\n case 'es_distinto_de': $where.= \" AND iddepto <>\" .$filtro['iddepto']['valor'];break;\n }\n }\n if (isset($filtro['por_permuta'])) {\n switch ($filtro['por_permuta']['condicion']) {\n case 'es_igual_a': $where.= \" AND a.por_permuta =\" .$filtro['por_permuta']['valor'];break;\n case 'es_distinto_de': $where.= \" AND a.por_permuta <>\" .$filtro['por_permuta']['valor'];break;\n }\n }\n if (isset($filtro['carac']['valor'])) {\n switch ($filtro['carac']['valor']) {\n case 'R':$c=\"'Regular'\";break;\n case 'O':$c=\"'Otro'\";break;\n case 'I':$c=\"'Interino'\";break;\n case 'S':$c=\"'Suplente'\";break;\n default:\n break;\n }\n switch ($filtro['carac']['condicion']) {\n case 'es_igual_a': $where.= \" AND a.carac=\".$c;break;\n case 'es_distinto_de': $where.= \" AND a.carac<>\".$c;break;\n }\t\n }\n if (isset($filtro['estado'])) {\n switch ($filtro['estado']['condicion']) {\n case 'es_igual_a': $where2.= \" and est like '\".$filtro['estado']['valor'].\"%'\";break;\n case 'es_distinto_de': $where2.= \" and est not like '\".$filtro['estado']['valor'].\"%'\";break;\n }\n }\n if (isset($filtro['legajo'])) {\n switch ($filtro['legajo']['condicion']) {\n case 'es_igual_a': $where.= \" and legajo = \".$filtro['legajo']['valor'];break;\n case 'es_mayor_que': $where.= \" and legajo > \".$filtro['legajo']['valor'];break;\n case 'es_mayor_igual_que': $where.= \" and legajo >= \".$filtro['legajo']['valor'];break;\n case 'es_menor_que': $where.= \" and legajo < \".$filtro['legajo']['valor'];break;\n case 'es_menor_igual_que': $where.= \" and legajo <= \".$filtro['legajo']['valor'];break;\n case 'es_distinto_de': $where.= \" and legajo <> \".$filtro['legajo']['valor'];break;\n case 'entre': $where.= \" and legajo >= \".$filtro['legajo']['valor']['desde'].\" and legajo <=\".$filtro['legajo']['valor']['hasta'];break;\n }\n } \n if (isset($filtro['docente_nombre'])) {\n switch ($filtro['docente_nombre']['condicion']) {\n case 'contiene': $where.= \" and LOWER(translate(docente_nombre,'áéíóúÁÉÍÓÚäëïöüÄËÏÖÜ','aeiouAEIOUaeiouAEIOU')) like LOWER('%\".$filtro['docente_nombre']['valor'].\"%')\";break;\n case 'no_contiene': $where.= \" and LOWER(translate(docente_nombre,'áéíóúÁÉÍÓÚäëïöüÄËÏÖÜ','aeiouAEIOUaeiouAEIOU')) not like LOWER('\".$filtro['docente_nombre']['valor'].\"')\";break;\n case 'comienza_con': $where.= \" and LOWER(translate(docente_nombre,'áéíóúÁÉÍÓÚäëïöüÄËÏÖÜ','aeiouAEIOUaeiouAEIOU')) like LOWER('\".$filtro['docente_nombre']['valor'].\"%')\";break;\n case 'termina_con': $where.= \" and LOWER(translate(docente_nombre,'áéíóúÁÉÍÓÚäëïöüÄËÏÖÜ','aeiouAEIOUaeiouAEIOU')) like LOWER('%\".$filtro['docente_nombre']['valor'].\"')\";break;\n case 'es_igual': $where.= \" and LOWER(translate(docente_nombre,'áéíóúÁÉÍÓÚäëïöüÄËÏÖÜ','aeiouAEIOUaeiouAEIOU')) == LOWER('\".$filtro['docente_nombre']['valor'].\"')\";break;\n case 'es_distinto': $where.= \" and LOWER(translate(docente_nombre,'áéíóúÁÉÍÓÚäëïöüÄËÏÖÜ','aeiouAEIOUaeiouAEIOU')) <> LOWER('\".$filtro['docente_nombre']['valor'].\"')\";break;\n }\n } \n if (isset($filtro['programa'])) {\n $sql=\"select * from mocovi_programa where id_programa=\".$filtro['programa']['valor'];\n $resul=toba::db('designa')->consultar($sql);\n switch ($filtro['programa']['condicion']) {\n case 'es_igual_a': $where.= \" AND programa =\".quote($resul[0]['nombre']);break;\n case 'es_distinto_de': $where.= \" AND programa <>\".quote($resul[0]['nombre']);break;\n }\n } \n if (isset($filtro['tipo_desig'])) {\n switch ($filtro['tipo_desig']['condicion']) {\n case 'es_igual_a': $where.=\" AND a.tipo_desig=\".$filtro['tipo_desig']['valor'];break;\n case 'es_distinto_de': $where.=\" AND a.tipo_desig <>\".$filtro['tipo_desig']['valor'];break;\n }\n }\n if (isset($filtro['anulada'])) {\n switch ($filtro['anulada']['valor']) {\n case '0': $where.=\" AND not (a.hasta is not null and a.hasta<a.desde)\";break;\n case '1': $where.=\" AND a.hasta is not null and a.hasta<a.desde \";break;\n }\n } \n if (isset($filtro['cat_estat'])) {\n switch ($filtro['cat_estat']['condicion']) {\n case 'es_igual_a': $where2.= \" and cat_estat=\".quote($filtro['cat_estat']['valor']);break;\n case 'es_distinto_de': $where2.= \" and cat_estat <>\".quote($filtro['cat_estat']['valor']);break;\n }\n }\n if (isset($filtro['dedic'])) {\n switch ($filtro['dedic']['condicion']) {\n case 'es_igual_a': $where2.= \" and dedic=\".$filtro['dedic']['valor'];break;\n case 'es_distinto_de': $where2.= \" and dedic<>\".$filtro['dedic']['valor'];break;\n }\n } \n //me aseguro de colocar en estado B todas las designaciones que tienen baja\n if($concat!=''){ \n $sql2=\" update designacion a set estado ='B' \"\n . \" where estado<>'B' and a.uni_acad=\".$concat\n .\" and exists (select * from novedad b\n where a.id_designacion=b.id_designacion \n and (b.tipo_nov=1 or b.tipo_nov=4))\";\n }\n \n //designaciones sin licencia UNION designaciones c/licencia sin norma UNION designaciones c/licencia c norma UNION reservas\n $sql=$this->armar_consulta($pdia,$udia,$filtro['anio']['valor']);\n\t\t//si el estado de la designacion es B entonces le pone estado B, si es <>B se fija si tiene licencia sin goce o cese\n// $sql= \"select id_designacion,docente_nombre,legajo,nro_cargo,anio_acad,desde,hasta,cat_mapuche,cat_mapuche_nombre,cat_estat,dedic,carac,check_presup,id_departamento,id_area,id_orientacion,uni_acad,emite_norma,nro_norma,tipo_norma,nro_540,observaciones,estado,porc,dias_lic,programa,costo_vale as costo,est,expediente,nro from(\"\n// . \"select sub2.*,case when t_no.tipo_nov in (1,4) then 'B('||coalesce(t_no.tipo_norma,'')||':'||coalesce(t_no.norma_legal,'')||')' else case when t_no.tipo_nov in (2,5) then 'L('||t_no.tipo_norma||':'||t_no.norma_legal||')' else sub2.estado end end as est,t_i.expediente,case when d.tipo_desig=2 then costo_reserva(d.id_designacion,costo,\".$filtro['anio']['valor'].\") else costo end as costo_vale \"\n// . \" ,case when t_nor.id_norma is null then '' else case when t_nor.link is not null or t_nor.link <>'' then '<a href='||chr(39)||t_nor.link||chr(39)|| ' target='||chr(39)||'_blank'||chr(39)||'>'||t_nor.nro_norma||'</a>' else cast(t_nor.nro_norma as text) end end as nro \"\n// . \"from (\"\n// .\"select sub.id_designacion,docente_nombre,legajo,nro_cargo,anio_acad, sub.desde, sub.hasta,cat_mapuche, cat_mapuche_nombre,cat_estat,dedic,carac,id_departamento, id_area,id_orientacion, uni_acad,sub.emite_norma, sub.nro_norma,sub.tipo_norma,nro_540,sub.observaciones,estado,programa,porc,costo_diario,check_presup,licencia,dias_des,dias_lic,costo,max(t_no.id_novedad) as id_novedad from (\"\n// .\"select distinct b.id_designacion,docente_nombre,legajo,nro_cargo,anio_acad, b.desde, b.hasta,cat_mapuche, cat_mapuche_nombre,cat_estat,dedic,carac,id_departamento, id_area,id_orientacion, uni_acad,emite_norma, b.nro_norma,b.tipo_norma,nro_540,b.observaciones,estado,programa,porc,costo_diario,check_presup,licencia,dias_des,dias_lic,case when (dias_des-dias_lic)>=0 then ((dias_des-dias_lic)*costo_diario*porc/100) else 0 end as costo\"\n// .\" from (\"\n// .\" select a.id_designacion,a.docente_nombre,a.legajo,a.nro_cargo,a.anio_acad, a.desde, a.hasta,a.cat_mapuche, a.cat_mapuche_nombre,a.cat_estat,a.dedic,a.carac,b.a.id_departamento, a.id_area,a.id_orientacion, a.uni_acad, a.emite_norma, a.nro_norma,a.tipo_norma,a.nro_540,a.observaciones,a.estado,programa,porc,a.costo_diario,check_presup,licencia,a.dias_des,a.dias_lic\".\n// \" from (\".$sql.\") a\"\n// .$where \n// .\") b \"\n// . \" )sub\"\n// . \" LEFT OUTER JOIN novedad t_no ON (sub.id_designacion=t_no.id_designacion and t_no.desde<='\".$udia.\"' and (t_no.hasta is null or t_no.hasta>='\".$pdia.\"' ))\"\n// . \" GROUP BY sub.id_designacion,docente_nombre,legajo,nro_cargo,anio_acad, sub.desde,sub.hasta,cat_mapuche, cat_mapuche_nombre,cat_estat,dedic,carac,id_departamento, id_area,id_orientacion, uni_acad,sub.emite_norma, sub.nro_norma,sub.tipo_norma,nro_540,sub.observaciones,estado,programa,porc,costo_diario,check_presup,licencia,dias_des,dias_lic,costo\" \n// . \")sub2\"//obtengo el id_novedad maximo\n// . \" LEFT OUTER JOIN novedad t_no on (t_no.id_novedad=sub2.id_novedad)\"//con el id_novedad maximo obtengo la novedad que predomina\n// .\" LEFT JOIN impresion_540 t_i ON (nro_540=t_i.id)\"//para agregar el expediente \n// .\" LEFT OUTER JOIN designacion d ON (sub2.id_designacion=d.id_designacion)\"//como no tengo el id de la norma tengo que volver a hacer join\n// .\" LEFT OUTER JOIN norma t_nor ON (d.id_norma=t_nor.id_norma)\"\n// . \")sub3\"\n// .$where2\n// . \" order by docente_nombre,desde\"; \n $sql= \"select id_designacion,docente_nombre,legajo,nro_cargo,anio_acad,desde,hasta,cat_mapuche,cat_mapuche_nombre,cat_estat,dedic,carac,check_presup,id_departamento,id_area,id_orientacion,uni_acad,emite_norma,nro_norma,tipo_norma,nro_540,tkd,observaciones,estado,porc,dias_lic,programa,costo_vale as costo,est,expediente,nro from(\"\n . \"select sub2.*,sub2.nro_540||'/'||t_i.anio as tkd,case when t_no.tipo_nov in (1,4) then 'B('||coalesce(t_no.tipo_norma,'')||':'||coalesce(t_no.norma_legal,'')||')' else case when t_no.tipo_nov in (2,5) then 'L('||t_no.tipo_norma||':'||t_no.norma_legal||')' else sub2.estado end end as est,t_i.expediente,case when d.tipo_desig=2 then costo_reserva(d.id_designacion,costo,\".$filtro['anio']['valor'].\") else costo end as costo_vale \"\n . \" ,case when t_nor.id_norma is null then '' else case when t_nor.link is not null or t_nor.link <>'' then '<a href='||chr(39)||t_nor.link||chr(39)|| ' target='||chr(39)||'_blank'||chr(39)||'>'||t_nor.nro_norma||'</a>' else cast(t_nor.nro_norma as text) end end as nro \"\n . \"from (\"\n .\"select sub.id_designacion,docente_nombre,legajo,nro_cargo,anio_acad, sub.desde, sub.hasta,cat_mapuche, cat_mapuche_nombre,cat_estat,dedic,carac,id_departamento, id_area,id_orientacion, uni_acad,sub.emite_norma, sub.nro_norma,sub.tipo_norma,nro_540,sub.observaciones,estado,programa,porc,costo_diario,check_presup,licencia,dias_des,dias_lic,costo,max(t_no.id_novedad) as id_novedad from (\"\n .\"select distinct b.id_designacion,docente_nombre,legajo,nro_cargo,anio_acad, b.desde, b.hasta,cat_mapuche, cat_mapuche_nombre,cat_estat,dedic,carac,id_departamento, id_area,id_orientacion, uni_acad,emite_norma, b.nro_norma,b.tipo_norma,nro_540,b.observaciones,estado,programa,porc,costo_diario,check_presup,licencia,dias_des,dias_lic,case when (dias_des-dias_lic)>=0 then ((dias_des-dias_lic)*costo_diario*porc/100) else 0 end as costo\"\n .\" from (\"\n .\" select a.id_designacion,a.por_permuta,a.docente_nombre,a.legajo,a.nro_cargo,a.anio_acad, a.desde, a.hasta,a.cat_mapuche, a.cat_mapuche_nombre,a.cat_estat,a.dedic,a.carac,t.iddepto,a.id_departamento, a.id_area,a.id_orientacion, a.uni_acad, a.emite_norma, a.nro_norma,a.tipo_norma,a.nro_540,a.observaciones,a.estado,programa,porc,a.costo_diario,a.check_presup,licencia,a.dias_des,a.dias_lic\".\n \" from (\".$sql.\") a\"\n . \" INNER JOIN designacion d ON (a.id_designacion=d.id_designacion)\"\n . \" LEFT OUTER JOIN departamento t ON (t.iddepto=d.id_departamento)\"\n .$where \n .\") b \"\n . \" )sub\"\n . \" LEFT OUTER JOIN novedad t_no ON (sub.id_designacion=t_no.id_designacion and t_no.desde<='\".$udia.\"' and (t_no.hasta is null or t_no.hasta>='\".$pdia.\"' ))\"\n . \" GROUP BY sub.id_designacion,docente_nombre,legajo,nro_cargo,anio_acad, sub.desde,sub.hasta,cat_mapuche, cat_mapuche_nombre,cat_estat,dedic,carac,id_departamento, id_area,id_orientacion, uni_acad,sub.emite_norma, sub.nro_norma,sub.tipo_norma,nro_540,sub.observaciones,estado,programa,porc,costo_diario,check_presup,licencia,dias_des,dias_lic,costo\" \n . \")sub2\"//obtengo el id_novedad maximo\n . \" LEFT OUTER JOIN novedad t_no on (t_no.id_novedad=sub2.id_novedad)\"//con el id_novedad maximo obtengo la novedad que predomina\n .\" LEFT JOIN impresion_540 t_i ON (nro_540=t_i.id)\"//para agregar el expediente \n .\" LEFT OUTER JOIN designacion d ON (sub2.id_designacion=d.id_designacion)\"//como no tengo el id de la norma tengo que volver a hacer join\n .\" LEFT OUTER JOIN norma t_nor ON (d.id_norma=t_nor.id_norma)\"\n . \")sub3\"\n .$where2\n . \" order by docente_nombre,desde\"; \n return toba::db('designa')->consultar($sql);\n\t}", "public function buscar_por_id ($id){\n $consulta = \"SELECT t1.id AS id_producto, t2.id AS id_tienda, t1.nombre AS nombre_producto, t2.nombre AS nombre_tienda, t1.imagen, t1.marca, t1.descripcion, t1.precio, t1.stock, t1.categoria FROM productos_en_venta AS t1 JOIN tiendas AS t2 WHERE t1.id = \".$id.\" AND t1.id_tienda=t2.id\";\n if($resultado = $this->conexion->query($consulta)){\n $fila = $resultado->fetch_assoc();\n return array(\"error\"=>null, \"producto\"=>$fila);\n }else{\n echo \"Error: (\" . $this->conexion->errno . \") \" . $this->conexion->error;\n }\n }", "static public function ctrMostrarTestimoniosInnerJoin($item, $valor){\n\n\t\t$tabla1 = \"testimonios\";\n\t\t$tabla2 = \"reservas\";\n\t\t$tabla3 = \"usuarios\";\n\n\t\t$respuesta = ModeloTestimonios::mdlMostrarTestimoniosInnerJoin($tabla1, $tabla2, $tabla3, $item, $valor);\n\n\t\treturn $respuesta;\n\n\t}", "public function gerarVenda($titulo,$cliente){\n //$conexao = $c->conexao();\n\n\n $sql = \"INSERT INTO tbpedidos (reg, tipo, titulo, data_inc) VALUES ('$cliente','V','$titulo', NOW()) \";\n\n return $this->conexao->query($sql);\n\n\n }", "public function consulta_asistencia()\n {\n $fecha_reporte = cambiaf_a_mysql($this->txt_fecha_desde->Text);\n $dir = $this->drop_direcciones->SelectedValue;\n $cod_organizacion = usuario_actual('cod_organizacion');\n\n // se obtienen las justificaciones del día seleccionado\n $sql=\"SELECT (p.cedula) as cedula_just, p.nombres, p.apellidos, j.codigo, jd.fecha_desde, jd.hora_desde,\n jd.fecha_hasta, jd.hora_hasta, jd.observaciones, jd.lun, jd.mar, jd.mie, jd.jue, jd.vie,\n tf.descripcion as descripcion_falta, tj.descripcion as descripcion_tipo_justificacion\n\t\t\t\t\t FROM asistencias.justificaciones as j, asistencias.justificaciones_dias as jd,\n\t\t\t\t\t\t asistencias.justificaciones_personas as jp, organizacion.personas as p, organizacion.personas_nivel_dir as n, asistencias.tipo_faltas tf, asistencias.tipo_justificaciones tj\n\t\t\t\t\t\tWHERE ((p.cedula = jp.cedula) and\n\t\t\t\t\t\t (p.cedula = n.cedula) and (jd.codigo_tipo_falta = tf.codigo) and (tj.id = jd.codigo_tipo_justificacion) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%') and\n\t\t\t\t\t\t (p.fecha_ingreso <= '$fecha_reporte') and\n\t\t\t\t\t\t (jd.fecha_desde <= '$fecha_reporte') and\n\t\t\t\t\t\t\t (jd.fecha_hasta >= '$fecha_reporte') and\n\t\t\t\t\t\t\t (j.estatus='1') and (j.codigo=jd.codigo_just) and (j.codigo=jp.codigo_just))\n\t\t\t\t\t\tORDER BY p.nombres, p.apellidos, jp.cedula \";\n $this->justificaciones=cargar_data($sql,$this); \n\n // se obtiene el horario vigente para la fecha seleccionada\n $this->horario_vigente = obtener_horario_vigente($cod_organizacion,$fecha_reporte,$this);\n \n // se realizan las consultas para mostrar los listados\n // Se consultan los asistentes\n $sql=\"SELECT (p.cedula) as cedula_integrantes, CONCAT(p.nombres,' ',p.apellidos) as nombre,\n e.cedula, e.fecha, MIN(e.hora) as entrada, MAX(e.hora) as salida\n FROM asistencias.entrada_salida as e, organizacion.personas as p, organizacion.personas_nivel_dir as n\n WHERE ((p.cedula = e.cedula) and\n (p.cedula = n.cedula) and\n (n.cod_direccion LIKE '$dir%') and\n (p.fecha_ingreso <= '$fecha_reporte') and\n (e.fecha <= '$fecha_reporte') and\n (e.fecha >= '$fecha_reporte'))\n GROUP BY e.cedula\n ORDER BY entrada, p.nombres, p.apellidos \";\n $this->asistentes=cargar_data($sql,$this);\n $this->ind_asistentes = count($this->asistentes);\n\n // se consultan los inasistentes\n $sql2=\"SELECT p.cedula as cedula_integrantes, CONCAT(p.nombres,' ',p.apellidos) as nombre\n\t\t\t\t\t\t\t\t\t FROM organizacion.personas as p, asistencias.personas_status_asistencias as s,\n\t\t\t\t\t\t\t\t\t organizacion.personas_nivel_dir as n\n\t\t\t\t\t\t\t\t\t WHERE ((s.status_asistencia = '1') and\n\t\t\t\t\t\t\t\t\t \t\t (s.cedula = p.cedula) and\n\t\t\t\t\t\t\t\t\t\t\t (p.cedula = n.cedula) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%') and\n\t\t\t\t\t\t\t\t\t (p.fecha_ingreso <= '$fecha_reporte') and\n\t\t\t\t\t\t\t\t\t (p.cedula not in\n\t\t\t\t\t\t\t\t\t (SELECT e.cedula\n\t\t\t\t\t\t\t\t\t\t FROM asistencias.entrada_salida as e, organizacion.personas_nivel_dir as n\n\t\t\t\t\t\t\t\t\t\t \t WHERE ((e.fecha = '$fecha_reporte') and\n\t\t\t\t\t\t\t\t\t\t\t\t (p.cedula = n.cedula) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%'))\n\t\t\t\t\t\t\t\t\t\t\t GROUP BY e.cedula)))\n\t\t\t\t\t\t\t\t\t ORDER BY p.nombres, p.apellidos\";\n $this->inasistentes=cargar_data($sql2,$this);\n\n\n // Se consultan los asistentes para comparar inconsistencia de horas en el marcado\n // Si le falta hora\n $inconsistentes = array();\n foreach($this->asistentes as $arreglo){\n \n $sql2=\"SELECT COUNT(*) as n_horas FROM asistencias.entrada_salida as e\n\t\t\t WHERE e.fecha = '$fecha_reporte' AND e.cedula = '$arreglo[cedula_integrantes]' \";\n $resultado2=cargar_data($sql2,$this);\n if(!empty($resultado2)){\n if ($resultado2[0][n_horas]%2!=0) {//impar\n array_unshift($inconsistentes, array('cedula'=>$arreglo[cedula_integrantes], 'nombre'=>$arreglo[nombre],'salida'=>$arreglo[salida]));\n }//fin si\n }//fin si\n }//fin each\n\n\n\n // Se enlaza el nuevo arreglo con el listado de Direcciones\n //$this->DataGrid_fj->Caption=\"Reporte de Asistencias del \".$this->txt_fecha_desde->Text;\n if(!empty($inconsistentes)){\n $this->DataGrid_fh->DataSource=$inconsistentes;\n $this->DataGrid_fh->dataBind();\n }\n\n // Se enlaza el nuevo arreglo con el listado de Direcciones\n $this->DataGrid->Caption=\"Reporte de Asistencias del \".$this->txt_fecha_desde->Text;\n $this->DataGrid->DataSource=$this->asistentes;\n $this->DataGrid->dataBind();\n\n\n $this->DataGrid_ina->Caption=\"Inasistentes el d&iacute;a \".$this->txt_fecha_desde->Text;\n $this->DataGrid_ina->DataSource=$this->inasistentes;\n $this->DataGrid_ina->dataBind();\n\n /* Por un error que no supe identificar, el cual suma un numero adicional a la variable\n * de inasistentes no justificados, he tenido que sacarla del procedimiento donde normalmente\n * se contaba y tuve que realizarla por resta en esta sección.\n */\n $this->ind_inasistentes_no_just = count($this->inasistentes) - $this->ind_inasistentes_si_just;\n\n $this->Repeater->DataSource = $this->justificaciones;\n $this->Repeater->dataBind();\n\n $xale=rand(100,99999);\n // Se realiza la construcción del gráfico para indicadores\n\n $chart = new PieChart();\n $dataSet = new XYDataSet();\n if ($this->ind_asistentes>=1) {$dataSet->addPoint(new Point(\"Funcionarios Asistentes: (\".$this->ind_asistentes.\")\", $this->ind_asistentes));};\n if ($this->ind_inasistentes_no_just>=1) {$dataSet->addPoint(new Point(\"Inasistentes NO JUSTIFICADOS: (\".$this->ind_inasistentes_no_just.\")\", $this->ind_inasistentes_no_just));};\n if ($this->ind_inasistentes_si_just>=1) {$dataSet->addPoint(new Point(\"Inasistentes JUSTIFICADOS: (\".$this->ind_inasistentes_si_just.\")\", $this->ind_inasistentes_si_just));};\n $chart->setDataSet($dataSet);\n $chart->setTitle(\"Porcentajes de Asistencias / Inasistencias del: \".$this->txt_fecha_desde->Text);\n elimina_grafico($xale.\"_01.png\");\n $chart->render(\"imagenes/temporales/\".$xale.\"_01.png\");\n $this->grafico1->ImageUrl = \"imagenes/temporales/\".$xale.\"_01.png\";\n\n\n $chart2 = new PieChart();\n $dataSet2 = new XYDataSet();\n $this->ind_asistentes_no_retrasados=$this->ind_asistentes-$this->ind_asistentes_tarde_no_just-$this->ind_asistentes_tarde_si_just;\n if ($this->ind_asistentes_no_retrasados>=1) {$dataSet2->addPoint(new Point(\"Puntuales: (\".$this->ind_asistentes_no_retrasados.\")\", $this->ind_asistentes_no_retrasados));};\n if ($this->ind_asistentes_tarde_no_just>=1) {$dataSet2->addPoint(new Point(\"Impuntuales NO JUSTIFICADOS: (\".$this->ind_asistentes_tarde_no_just.\")\", $this->ind_asistentes_tarde_no_just));};\n if ($this->ind_asistentes_tarde_si_just>=1) {$dataSet2->addPoint(new Point(\"Impuntuales JUSTIFICADOS: (\".$this->ind_asistentes_tarde_si_just.\")\", $this->ind_asistentes_tarde_si_just));};\n $chart2->setDataSet($dataSet2);\n $chart2->setTitle(\"Porcentajes de Retrasos del: \".$this->txt_fecha_desde->Text);\n elimina_grafico($xale.\"_02.png\");\n $chart2->render(\"imagenes/temporales/\".$xale.\"_02.png\");\n $this->grafico2->ImageUrl = \"imagenes/temporales/\".$xale.\"_02.png\";\n\n // si la consulta de asistentes tiene resultados se habilita la impresion, sino, se deshabilita\n if (!empty($this->asistentes)) {$this->btn_imprimir->Enabled = true;} else {$this->btn_imprimir->Enabled = false;}\n\n }", "function getDatos(){\n $res = $this->Consulta('SELECT C.*, P.id_planta FROM '.$this->Table .' C\n INNER JOIN\n equipos E ON E.id_equipos = C.`id_equipos`\n INNER JOIN\n secciones S ON S.id_secciones = E.id_secciones\n INNER JOIN\n plantas P ON P.id_planta = S.id_planta\n \n WHERE '.$this->PrimaryKey.' = '.$this->_datos);\n $resultado = $res[0];\n // $resultado = array_map('utf8_encode',$resultado);\n \n print_r( json_encode( $resultado ) );\n }", "public function RelatorioCentroCusto($idobra, $idcentro) {\n $obra = new clsObra();\n $obra->preencheDados($idobra);\n\n $centroNome = \"\";\n if ($idcentro > 0) {\n $centro = new clsCentroCusto();\n $centro->RetornaCentroCusto($idcentro);\n $centroNome = \" - Centro de Custo: \" . $centro->getDescCentro();\n }\n\n $html = '<table border = \"3\" cellspacing = \"2\" cellpadding = \"2\">\n <tr height = \"2\">\n </br>\n <b><span style=\"font-size: 20px\">Retirada de Material</span></b>\n </br>\n <span align=\"center\" style=\"font-size: 20px\">Obra: ' . $obra->getDescricao() . $centroNome . '</span>\n <th align = \"center\" class = \"small\" width = \"150px\">Data Retirada</th>\n <th align = \"center\" class = \"small\" width = \"600px\">Material</th>\n <th align = \"center\" class = \"small\" width = \"150px\">Quantidade</th>\n </tr>';\n\n\n $SQL = \"SELECT re.QUANTRETIRADA, re.DATARETESTOQUE, CONCAT(mt.DESCMATERIAL, ' / ' , un.SIGLAUNID) MATERIAL\n FROM retirada_estoque re\n INNER JOIN material mt\n ON re.IDMATERIAL = mt.IDMATERIAL\n INNER JOIN unidade un\n ON re.IDUNIDADE = un.IDUNIDADE\n WHERE re.IDOBRA = \" . $idobra . \"\";\n//die($SQL);\n if ($idcentro > 0) {\n $SQL.=\" AND re.IDCENTRO =\" . $idcentro . \" \";\n }\n\n\n $SQL.=\" ORDER BY STR_TO_DATE(re.DATARETESTOQUE,'%d/%m/%Y'), mt.DESCMATERIAL \";\n\n $con = new gtiConexao();\n $con->gtiConecta();\n $tbl = $con->gtiPreencheTabela($SQL);\n $con->gtiDesconecta();\n\n //die($SQL);\n foreach ($tbl as $chave => $linha) {\n\n $html .= ' <tr height = \"1\">\n <td align = \"center\" class = \"small\" width = \"100px\"> ' . htmlentities($linha['DATARETESTOQUE']) . ' </td>\n <td align = \"center\" class = \"small\" width = \"100px\"> ' . htmlentities($linha['MATERIAL']) . ' </td>\n <td align = \"center\" class = \"small\" width = \"100px\"> ' . $linha['QUANTRETIRADA'] . ' </td>\n </tr>';\n }\n\n\n $html .= '</table> ';\n\n\n\n\n\n\n $html .= '<table border = \"3\" cellspacing = \"2\" cellpadding = \"2\">\n <tr height = \"2\">\n </br>\n <b><span style=\"font-size: 20px\">Retirada de Material - Soma Geral</span></b> \n <th align = \"center\" class = \"small\" width = \"650px\">Material</th>\n <th align = \"center\" class = \"small\" width = \"250px\">Quantidade</th>\n </tr>';\n\n\n $SQL = \"SELECT SUM(re.QUANTRETIRADA) SOMA, re.DATARETESTOQUE, CONCAT(mt.DESCMATERIAL, ' / ' , un.SIGLAUNID) MATERIAL\n FROM retirada_estoque re\n INNER JOIN material mt\n ON re.IDMATERIAL = mt.IDMATERIAL\n INNER JOIN unidade un\n ON re.IDUNIDADE = un.IDUNIDADE\n WHERE re.IDOBRA = \" . $idobra . \"\";\n//die($SQL);\n if ($idcentro > 0) {\n $SQL.=\" AND re.IDCENTRO =\" . $idcentro . \" \";\n }\n\n\n $SQL.=\" GROUP BY mt.DESCMATERIAL \n ORDER BY mt.DESCMATERIAL \";\n\n $con = new gtiConexao();\n $con->gtiConecta();\n $tbl = $con->gtiPreencheTabela($SQL);\n $con->gtiDesconecta();\n\n //die($SQL);\n foreach ($tbl as $chave => $linha) {\n\n $html .= ' <tr height = \"1\"> \n <td align = \"center\" class = \"small\" width = \"100px\"> ' . htmlentities($linha['MATERIAL']) . ' </td>\n <td align = \"center\" class = \"small\" width = \"100px\"> ' . $linha['SOMA'] . ' </td>\n </tr>';\n }\n\n\n $html .= '</table> ';\n\n\n\n\n\n //die(print_r($arrayNota));\n\n return $html;\n }", "public function gerencial_valorInventario(){\n\t\t\n\t\t$resultado = 0;\n\t\t\n\t\t$query = \"SELECT cantidad, idProducto\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t tb_productos_sucursal\";\n\t\t\n\t\t\n\t\t$conexion = parent::conexionCliente();\n\t\t\n \tif($res = $conexion->query($query)){\n \n /* obtener un array asociativo */\n while ($filas = $res->fetch_assoc()) {\n \t\n\t\t\t\t$idproducto = $filas['idProducto'];\n\t\t\t\t$cantidad\t= $filas['cantidad']; \n\t\t\t\t\n\t\t\t\t$query2 = \"SELECT precio \n\t\t\t\t\t\t\tFROM tb_productos WHERE idProducto = '$idproducto'\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif($res2 = $conexion->query($query2)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t while ($filas2 = $res2->fetch_assoc()) {\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t$precio = str_replace('.', '',$filas2['precio']);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$subtotal = $precio * $cantidad;\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $resultado = $resultado + $subtotal;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t }\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\n } \n \n }//fin if\n\t\t\n return $resultado;\t\n\t\t\n\t}", "function establecer_m2_reservas_concretadas() {\n// inner join lote on (res_lot_id=lot_id)\n// inner join zona on (lot_zon_id=zon_id)\n// where res_promotor like 'NET%'\");\n// $reservas = FUNCIONES::lista_bd_sql(\"select res_id,zon_precio from reserva_terreno\n// inner join lote on (res_lot_id=lot_id)\n// inner join zona on (lot_zon_id=zon_id)\n// where res_multinivel = 'si' and res_monto_m2=0\");\n\n\n\n $reservas = FUNCIONES::lista_bd_sql(\"select res_id,ven_metro from reserva_terreno\n\n inner join venta on (ven_res_id=res_id)\n\n where res_monto_m2=0 and res_estado in ('Concretado') and ven_estado in ('Pendiente','Pagado')\");\n\n\n\n $conec = new ADO();\n\n foreach ($reservas as $res) {\n\n $conec->ejecutar(\"update reserva_terreno set res_monto_m2=$res->ven_metro where res_id=$res->res_id\");\n }\n}", "public function vacunas_aplicarFiltrosVacunas($fechaInicial, $fechaFinal, $fechaInicialProximo, $fechaFinalProximo, $idVacuna, $idPropietario, $paciente){\n \t\n\t\t\t$resultado = array();\n\t\t\t$adicionQuery = \"WHERE 1 \";\n\t\t\t\n\t\t\tif($idVacuna != '0'){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \" AND V.idVacuna = '$idVacuna' \";\t\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif($fechaInicial != \"\" AND $fechaFinal != \"\"){\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \" AND ( V.fecha BETWEEN '$fechaInicial' AND '$fechaFinal')\";\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($fechaInicialProximo != \"\" AND $fechaFinalProximo != \"\"){\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \" AND ( V.fechaProximoDesparasitante BETWEEN '$fechaInicialProximo' AND '$fechaFinalProximo')\";\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\n\t\t\tif($idPropietario != \"0\"){\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \" AND P.idPropietario = '$idPropietario' \";\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($paciente != \"\"){\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \" AND V.idMascota = '$paciente' \";\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t\t$query = \" SELECT \n\t\t\t\t\t\t V.idMascotaVacunas,\n\t\t\t\t\t\t V.fecha,\n\t\t\t\t\t\t DATE_FORMAT(V.hora, '%H:%i') as hora,\n\t\t\t\t\t\t V.fechaProximaVacuna,\n\t\t\t\t\t\t V.observaciones,\n\t\t\t\t\t\t V.idVacuna,\n\t\t\t\t\t\t VV.nombre as nombreVacuna,\n\t\t\t\t\t\t M.nombre AS nombreMascota,\n\t\t\t\t\t\t M.sexo AS sexoMascota,\n\t\t\t\t\t\t P.identificacion AS identificacionPropietario,\n\t\t\t\t\t\t P.nombre AS nombrePropietario,\n\t\t\t\t\t\t P.apellido AS apellidoPropietario,\n\t\t\t\t\t\t P.telefono\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t tb_mascotas_vacunas AS V\n\t\t\t\t\t\t INNER JOIN\n\t\t\t\t\t\t tb_mascotas AS M ON V.idMascota = M.idMascota\n\t\t\t\t\t\t \tINNER JOIN\n\t\t\t\t\t\t tb_vacunas AS VV ON V.idVacuna = VV.idVacuna\n\t\t\t\t\t\t INNER JOIN\n\t\t\t\t\t\t tb_propietarios AS P ON P.idPropietario = M.idPropietario\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\".$adicionQuery.\"\n\t\t\t\t\t\t\n\t\t\t\t\t\tGROUP BY (V.idMascotaVacunas)\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tORDER BY (V.idMascotaVacunas) DESC; \";\n\t\t\t\t\t\n\t\t\t$conexion = parent::conexionCliente();\n\t\t\t\n\t\t\tif($res = $conexion->query($query)){\n\t \n\t /* obtener un array asociativo */\n\t while ($filas = $res->fetch_assoc()) {\n\t $resultado[] = $filas;\n\t }\n\t \n\t /* liberar el conjunto de resultados */\n\t $res->free();\n\t \n\t }\n\t\n\t return $resultado;\n\t\t\t\n\t\t\t\n }", "public function get_detalle_vf_beneficiario($evaluado,$n_orden){\n\n\t$conectar= parent::conexion();\n\tparent::set_names(); \n\n\t$sql = \"select*from detalle_ventas_flotantes where beneficiario=? and numero_orden=?;\";\n\t$sql = $conectar->prepare($sql);\n\t$sql->bindValue(1,$evaluado);\n\t$sql->bindValue(2,$n_orden);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n\n}", "function listarTipoVenta(){\n\t\t$this->procedimiento='vef.ft_tipo_venta_sel';\n\t\t$this->transaccion='VF_TIPVEN_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_tipo_venta','int4');\n\t\t$this->captura('codigo_relacion_contable','varchar');\n\t\t$this->captura('nombre','varchar');\n\t\t$this->captura('tipo_base','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('codigo','varchar');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('id_plantilla','int4');\n\t\t$this->captura('desc_plantilla','varchar');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}" ]
[ "0.6492791", "0.6489875", "0.6387158", "0.63345945", "0.6314662", "0.6298463", "0.62964994", "0.6282677", "0.6266095", "0.6251939", "0.6221606", "0.6220676", "0.62037873", "0.61875707", "0.61774224", "0.61552066", "0.6142549", "0.6139748", "0.6133056", "0.61275464", "0.61190975", "0.61180735", "0.6117714", "0.61068094", "0.6104515", "0.6088556", "0.6087646", "0.60817146", "0.6074627", "0.60606253", "0.60594726", "0.60523957", "0.60280776", "0.6026125", "0.6024841", "0.6018742", "0.5995823", "0.5989369", "0.5988603", "0.59809595", "0.597611", "0.59670126", "0.59652215", "0.5957224", "0.5955565", "0.5954613", "0.59497845", "0.59424686", "0.5934644", "0.59289455", "0.59272546", "0.5915351", "0.59149235", "0.5902458", "0.5894728", "0.5883946", "0.5883544", "0.58822143", "0.58821476", "0.5881222", "0.5875666", "0.58731604", "0.5868184", "0.5863799", "0.5858023", "0.5856992", "0.58555925", "0.58472335", "0.58366793", "0.58338934", "0.58271253", "0.58258146", "0.5824035", "0.5823417", "0.5818081", "0.5815277", "0.5811549", "0.5808285", "0.5808088", "0.58024013", "0.5795717", "0.5795686", "0.57936144", "0.5793248", "0.57912576", "0.57900274", "0.5787507", "0.57857746", "0.5779797", "0.5767654", "0.576488", "0.5759321", "0.5755783", "0.5753629", "0.5753504", "0.57520497", "0.57424295", "0.57389504", "0.57387966", "0.5737359", "0.57346225" ]
0.0
-1
Set up DB data
public function setUp(): void { parent::setUp(); $this->setUpComputop(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setupDBData()\n {\n /**\n * IMPORTANT NOTE : these functions must be executed sequentially in order for the command to work.\n */\n $this->setupProducts();\n $this->setupServerTypes();\n $this->setupServers();\n $this->setupUsers();\n }", "abstract protected function initDB();", "private function initDatabase() {\n \n \n \n }", "public function initDatabaseStructure( );", "private static function setupDB() {\n\t\t$tbl = self::$table;\n\t\t$dbw = wfGetDB( DB_MASTER );\n\t\twfDebugLog( __METHOD__, \"\\tCreating tables\\n\" );\n\t\t$dbw->query(\n\t\t\t\"CREATE TABLE IF NOT EXISTS $tbl ( pathway varchar(255), day varchar(50) )\", DB_MASTER\n\t\t);\n\t\twfDebugLog( __METHOD__, \"\\tDone!\\n\" );\n\t}", "private function initialiseDatabaseStructure(){\r\n $this->exec($this->userTableSQL);\r\n $query = \"INSERT INTO `user` (`userName`,`userEmail`,`userFirstName`,`userSurname`,`userPassword`,`userIsActive`,`userIsAdmin`) VALUES(?,?,?,?,?,?,?);\";\r\n $statement = $this->prepare($query);\r\n $password = md5('Halipenek3');\r\n $statement->execute(array('admin','[email protected]','Super','Admin',$password,1,1));\r\n\r\n //Create the knowledge Table\r\n $this->exec($this->knowledgeTableSQL);\r\n $this->exec($this->tagTableSQL);\r\n $this->exec($this->tagsTableSQL);\r\n }", "public function setUp(): void\n {\n if ( isset($this->db) )\n {\n return;\n }\n\n (new DBConnect\\Load\\INI(self::DB_CREDENTIALS))->run();\n $this->db = DBConnect\\Connect\\Bank::get();\n\n $this->table = new DBTable\\PostgreSQL(self::TABLE_NAME);\n $this->table->runFieldLookup($this->db);\n }", "protected function createDatabaseStructure() {}", "function setUp()\n\t{\n\t\tglobal $config;\n\t\tDb::init($config);\n\t\t$this->db = Db::get_instance();\n\t\t$this->sql = SqlObject::get_instance();\n\t}", "private final function _createDbStructure()\n {\n if ($conn = $this->_getConnection()) {\n $installer = new lib_Install('install');\n try {\n $installer->install();\n } catch (Exception $e) {\n app::log($e->getMessage(), app::LOG_LEVEL_ERROR);\n }\n }\n }", "protected function setUp()\n\t{\n\t\tparent::setUp();\n\n\t\t$oContext = &Context::getInstance();\n\n\t\t$db_info = include dirname(__FILE__) . '/../config/db.config.php';\n\n\t\t$db = new stdClass();\n\t\t$db->master_db = $db_info;\n\t\t$db->slave_db = array($db_info);\n\t\t$oContext->setDbInfo($db);\n\n\t\tDB::getParser(TRUE);\n\t}", "public function fill_db()\n {\n include('create_tables.php');\n\n $this->db->query($CLEAN);\n $this->db->query($APPTYPE);\n $this->db->query($BOOKINGS);\n $this->db->query($BUSINESSOWNER);\n $this->db->query($CUSTOMERS);\n $this->db->query($EMPLOYEES);\n $this->db->query($TIMESLOTS);\n $this->db->query($CANWORK);\n $this->db->query($HAVESKILL);\n $this->db->query($BUSINESS);\n $this->db->query($HOURS);\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}", "protected function initDatabaseRecord() {}", "public function setUp() {\n\t\t$this->PDO = $this->getConnection();\n\t\t$this->createTable();\n\t\t$this->populateTable();\n\n\t\t$this->ItemsTable = new ItemsTable($this->PDO);\n\t}", "private function setup_db_variables() {\n\t\tglobal $wpdb;\n\t\t$this::$dbtable = $wpdb->prefix . self::DBTABLE;\n\t\t$this::$dbtable_contexts = $wpdb->prefix . self::DBTABLE_CONTEXTS;\n\n\t\t/**\n\t\t * Filter db table used for simple history events\n\t\t *\n\t\t * @since 2.0\n\t\t *\n\t\t * @param string $db_table\n\t\t */\n\t\t$this::$dbtable = apply_filters( 'simple_history/db_table', $this::$dbtable );\n\n\t\t/**\n\t\t * Filter table name for contexts.\n\t\t *\n\t\t * @since 2.0\n\t\t *\n\t\t * @param string $db_table_contexts\n\t\t */\n\t\t$this::$dbtable_contexts = apply_filters(\n\t\t\t'simple_history/logger_db_table_contexts',\n\t\t\t$this::$dbtable_contexts\n\t\t);\n\t}", "public static function setup_db()\r\n {\r\n $installed_ver = get_option( CART_CONVERTER . \"_db_version\" );\r\n\r\n // prevent create table when re-active plugin\r\n if ( $installed_ver != CART_CONVERTER_DB_VERSION ) {\r\n CartModel::setup_db();\r\n EmailModel::setup_db();\r\n //MailTemplateModel::setup_db();\r\n \r\n add_option( CART_CONVERTER . \"_db_version\", CART_CONVERTER_DB_VERSION );\r\n }\r\n }", "protected function importDatabaseData() {}", "public function setUpDatabase()\n\t{\n\t\t$schemes = new Schemes;\n\t\t$schemes->createRequestTable();\n\n\t Customer::create([\n\t 'email' => '[email protected]',\n\t 'first_name' => 'Osuagwu',\n\t 'last_name' => 'Emeka',\n\t 'phone_number' => \"09095685594\",\n\t 'image' => 'https://github.com/rakit/validation',\n\t 'location' => 'Lagos, Nigeria',\n\t 'sex' => 'Male',\n\t ]);\n\n\t Customer::create([\n\t 'email' => '[email protected]',\n\t 'first_name' => 'Mustafa',\n\t 'last_name' => 'Ozyurt',\n\t 'phone_number' => \"09095685594\",\n\t 'image' => 'https://github.com/rakit/validation',\n\t 'location' => 'Berlin, Germany',\n\t 'sex' => 'Male',\n\t ]);\n\t}", "public function init()\n {\n $this->logger->info('DBService : init');\n\n $this->connect();\n $this->createTable( $this->pdo );\n }", "protected function setUp(): void\n {\n $this->dbSetUp();\n $this->prepareObjects();\n $this->createDummyData();\n }", "protected function setUp(): void\n {\n $this->recreateDbScheme();\n $this->getConnection()\n ->insertInitData($this->getDataSet());\n parent::setUp();\n }", "protected function setUpTestDatabase() {}", "public function setUp() {\n\t\t$this->getConnection();\n\t\tforeach($this->fixtureData() as $row) {\n\t\t\t$record = new ExampleSolrActiveRecord();\n\t\t\tforeach($row as $attribute => $value) {\n\t\t\t\t$record->{$attribute} = $value;\n\t\t\t}\n\t\t\t$this->assertTrue($record->save());\n\t\t}\n\t}", "private function createMainDatabaseRecords()\n {\n // get the .sql file\n $sql = (string) @file_get_contents( $this->plugin->getPath() . \"/Setup/install.sql\" );\n\n // insert it\n $this->db->exec( $sql );\n }", "public function setUp()\n {\n parent::setUp();\n\n $this->database = \\oxDb::getDb();\n }", "public function setupDatabase()\n\t{\n\n\t\t$installSql = $this->sourceDir . '/installation/sql/mysql/joomla.sql';\n\n\t\tif (0) //!file_exists($installSql))\n\t\t\tthrow new Exception(__METHOD__ . ' - Install SQL file not found in ' . $installSql, 1);\n\n\t\t$this->config->set('site_name', 'TEST ' . $this->config->get('target'));\n\t\t$this->config->set('db_name', $this->config->get('target'));\n\n\t\t$dbModel = new JacliModelDatabase($this->config);\n\n\t\t$this->out(sprintf('Creating database %s ...', $this->config->get('db_name')), false);\n\t\t$dbModel->createDB();\n\t\t$this->out('ok');\n\n\t\t$this->out('Populating database...', false);\n\t\t//$dbModel->populateDatabase($installSql);\n\t\t$this->out('ok');\n\n\t\t$this->out('Creating admin user...', false);\n\t\t$this->createAdminUser($dbModel);\n\t\t$this->out('ok');\n\n\t}", "protected function populateDatabase()\n {\n\n $orm = $this->db->getOrm();\n\n // first clean the database to make shure to have no interferences\n // from existing data\n $orm->cleanResource('WbfsysText');\n $orm->cleanResource('WbfsysRoleGroup');\n $orm->cleanResource('WbfsysRoleUser');\n $orm->cleanResource('WbfsysSecurityArea');\n $orm->cleanResource('WbfsysSecurityAccess');\n $orm->cleanResource('WbfsysGroupUsers');\n\n // clear the cache\n $orm->clearCache();\n\n // Ein paar daten in der Datenbank\n $textPublic = $orm->newEntity('WbfsysText');\n $textPublic->access_key = 'text_public';\n $orm->insert($textPublic);\n\n $textAccess = $orm->newEntity('WbfsysText');\n $textAccess->access_key = 'text_access';\n $orm->insert($textAccess);\n\n $textNoAccess = $orm->newEntity('WbfsysText');\n $textNoAccess->access_key = 'text_no_access';\n $orm->insert($textNoAccess);\n\n // Gruppen Rollen\n $groupUnrelated = $orm->newEntity('WbfsysRoleGroup');\n $groupUnrelated->name = 'Unrelated';\n $groupUnrelated->access_key = 'unrelated';\n $groupUnrelated->level = Acl::DENIED;\n $orm->insert($groupUnrelated);\n\n $groupHasAccess = $orm->newEntity('WbfsysRoleGroup');\n $groupHasAccess->name = 'Has Access';\n $groupHasAccess->access_key = 'has_access';\n $groupHasAccess->level = Acl::DENIED;\n $orm->insert($groupHasAccess);\n\n $groupHasNoAccess = $orm->newEntity('WbfsysRoleGroup');\n $groupHasNoAccess->name = 'Has no Access';\n $groupHasNoAccess->access_key = 'has_no_access';\n $groupHasNoAccess->level = Acl::DENIED;\n $orm->insert($groupHasNoAccess);\n\n // user roles\n $userAnon = $orm->newEntity('WbfsysRoleUser');\n $userAnon->name = 'annon';\n $userAnon->level = Acl::DENIED;\n $orm->insert($userAnon);\n\n $userHasAccess = $orm->newEntity('WbfsysRoleUser');\n $userHasAccess->name = 'has_access';\n $userHasAccess->level = Acl::DENIED;\n $orm->insert($userHasAccess);\n\n $userHasDAccess = $orm->newEntity('WbfsysRoleUser');\n $userHasDAccess->name = 'has_dataset_access';\n $userHasDAccess->level = Acl::DENIED;\n $orm->insert($userHasDAccess);\n\n $userHasNoAccess = $orm->newEntity('WbfsysRoleUser');\n $userHasNoAccess->name = 'has_no_access';\n $userHasNoAccess->level = Acl::DENIED;\n $orm->insert($userHasNoAccess);\n\n // security areas\n $areaModPublic = $orm->newEntity('WbfsysSecurityArea');\n $areaModPublic->access_key = 'mod-public';\n $areaModPublic->id_level_listing = User::LEVEL_SUPERADMIN;\n $areaModPublic->id_level_access = User::LEVEL_SUPERADMIN;\n $areaModPublic->id_level_insert = User::LEVEL_SUPERADMIN;\n $areaModPublic->id_level_update = User::LEVEL_SUPERADMIN;\n $areaModPublic->id_level_delete = User::LEVEL_SUPERADMIN;\n $areaModPublic->id_level_admin = User::LEVEL_SUPERADMIN;\n $areaModPublic->id_ref_listing = User::LEVEL_SUPERADMIN;\n $areaModPublic->id_ref_access = User::LEVEL_SUPERADMIN;\n $areaModPublic->id_ref_insert = User::LEVEL_SUPERADMIN;\n $areaModPublic->id_ref_update = User::LEVEL_SUPERADMIN;\n $areaModPublic->id_ref_delete = User::LEVEL_SUPERADMIN;\n $areaModPublic->id_ref_admin = User::LEVEL_SUPERADMIN;\n $orm->insert($areaModPublic);\n\n $areaModAccess = $orm->newEntity('WbfsysSecurityArea');\n $areaModAccess->access_key = 'mod-has_access';\n $areaModAccess->id_level_listing = User::LEVEL_SUPERADMIN;\n $areaModAccess->id_level_access = User::LEVEL_SUPERADMIN;\n $areaModAccess->id_level_insert = User::LEVEL_SUPERADMIN;\n $areaModAccess->id_level_update = User::LEVEL_SUPERADMIN;\n $areaModAccess->id_level_delete = User::LEVEL_SUPERADMIN;\n $areaModAccess->id_level_admin = User::LEVEL_SUPERADMIN;\n $areaModAccess->id_ref_listing = User::LEVEL_SUPERADMIN;\n $areaModAccess->id_ref_access = User::LEVEL_SUPERADMIN;\n $areaModAccess->id_ref_insert = User::LEVEL_SUPERADMIN;\n $areaModAccess->id_ref_update = User::LEVEL_SUPERADMIN;\n $areaModAccess->id_ref_delete = User::LEVEL_SUPERADMIN;\n $areaModAccess->id_ref_admin = User::LEVEL_SUPERADMIN;\n $orm->insert($areaModAccess);\n\n $areaModNoAccess = $orm->newEntity('WbfsysSecurityArea');\n $areaModNoAccess->access_key = 'mod-no_access';\n $areaModNoAccess->id_level_listing = User::LEVEL_SUPERADMIN;\n $areaModNoAccess->id_level_access = User::LEVEL_SUPERADMIN;\n $areaModNoAccess->id_level_insert = User::LEVEL_SUPERADMIN;\n $areaModNoAccess->id_level_update = User::LEVEL_SUPERADMIN;\n $areaModNoAccess->id_level_delete = User::LEVEL_SUPERADMIN;\n $areaModNoAccess->id_level_admin = User::LEVEL_SUPERADMIN;\n $areaModNoAccess->id_ref_listing = User::LEVEL_SUPERADMIN;\n $areaModNoAccess->id_ref_access = User::LEVEL_SUPERADMIN;\n $areaModNoAccess->id_ref_insert = User::LEVEL_SUPERADMIN;\n $areaModNoAccess->id_ref_update = User::LEVEL_SUPERADMIN;\n $areaModNoAccess->id_ref_delete = User::LEVEL_SUPERADMIN;\n $areaModNoAccess->id_ref_admin = User::LEVEL_SUPERADMIN;\n $orm->insert($areaModNoAccess);\n\n // access\n $access1 = $orm->newEntity('WbfsysSecurityAccess');\n $access1->id_group = $groupHasAccess;\n $access1->id_area = $areaModAccess;\n $access1->access_level = Acl::LISTING;\n $this->acl->createAreaAssignment($access1,array(),true);\n\n // user role assignments\n $entityGUser = $orm->newEntity('WbfsysGroupUsers');\n $entityGUser->id_user = $userHasAccess;\n $entityGUser->id_group = $groupHasAccess;\n $entityGUser->id_area = $areaModAccess;\n $this->acl->createGroupAssignment($entityGUser);\n\n $entityGUser = $orm->newEntity('WbfsysGroupUsers');\n $entityGUser->id_user = $userHasDAccess;\n $entityGUser->id_group = $groupHasAccess;\n $entityGUser->id_area = $areaModAccess;\n $entityGUser->vid = $textAccess;\n $this->acl->createGroupAssignment($entityGUser);\n\n }", "public function database() {\n\t\t$this->_check();\n\t\t$d['title_for_layout'] = __(\"Database creation\");\n\t\t$this->set($d);\n\t}", "protected function _initDbConnection() {\n\t\tif (!empty($this->db)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Create a new connection\n\t\tif (empty($this->config['datasource'])) {\n\t\t\tdie(\"FeedAggregatorPdoStorage: no datasource configured\\n\");\n\t\t}\n\n\t\t// Initialise a new database connection and associated schema.\n\t\t$db = new PDO($this->config['datasource']); \n\t\t$this->_initDbSchema();\n\t\t\n\t\t// Check the database tables exist\n\t\t$this->_initDbTables($db);\n\n\t\t// Database successful, make it ready to use\n\t\t$this->db = $db;\n\t}", "public static function init() {\n\t\tself::$_db = Storage::get('objects.database');\n\t}", "private function init_db()\n {\n /**\n * If we've set that we want to use the database, initialize it.\n * Or we may use our parent's\n *\n * Inicializa a base de dados se esse app estiver configurado pra usar a base\n * de dados. Ou usa do nosso parent\n */\n\n if (isset($this->parent->db)) {\n $this->db = $this->parent->db;\n } else {\n $this->load->db('mysql');\n }\n\n }", "public function init()\n {\n $this->_db = Instance::ensure($this->_db, Connection::class);\n }", "protected function setupDatabase()\n {\n $this->call('migrate');\n $this->call('db:seed');\n\n $this->info('Database migrated and seeded.');\n }", "private static function initDatabase() {\n\t\t\tif (self::Config('use_db')) {\n\t\t\t\t$host = self::Config('mysql_host');\n\t\t\t\t$user = self::Config('mysql_user');\n\t\t\t\t$pass = self::Config('mysql_password');\n\t\t\t\t$name = self::Config('mysql_dbname');\n\t\t\t\tDBManager::init($host, $user, $pass, $name);\n\t\t\t}\n\t\t}", "public function postSetup() \n {\n \\WScore\\Core::get( 'friends\\model\\Friends' );\n \\WScore\\Core::get( 'friends\\model\\Contacts' );\n $this->initDb( $this->front->request->getPost( 'initDb' ) );\n }", "public function setDatabaseConfig()\n {\n $this->_databaseConfig = Core_Model_Config_Json::getModulesDatabaseConfig();\n\n $this->_type = $this->_databaseConfig['type'];\n $this->_host = $this->_databaseConfig['host'];\n $this->_name = $this->_databaseConfig['name'];\n $this->_user = $this->_databaseConfig['user'];\n $this->_pass = $this->_databaseConfig['pass'];\n }", "private function initDB(){\n $sql = \"\n CREATE SCHEMA IF NOT EXISTS `\".$this->_database.\"` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;\n USE `\".$this->_database.\"` ;\n \";\n try {\n $dbh = new PDO(\"mysql:host=$this->_host\", $this->_username, $this->_password,array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));\n $dbh->exec($sql)\n or die(print_r($dbh->errorInfo(), true));\n } catch (PDOException $e) {\n $err_data = array('stmt'=>'on init');\n Helper_Error::setError( Helper_Error::ERROR_TYPE_DB , $e->getMessage() , $err_data , $e->getCode() );\n die(\"DB init ERROR: \". $e->getMessage());\n }\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 }", "private function init() {\n\t\t$GLOBALS[\"mlauto_db_version\"] = 1.0;\n\n\t\t//If SQL Table isn't initiated, initiate it\n\t\tClassificationModel::intializeTable();\n\t\tTermModel::intializeTable();\n\n\t\t$this->buildConfig();\n\n\t\tupdate_option(\"MLAuto_version\", $GLOBALS[\"mlauto_db_version\"]);\n\t}", "public function initDB() {\n\t\t$field = $this->factory->createILubFieldDefinition();\n\t\t$field->initDB();\n\t}", "protected function prepareDatabase()\n {\n $this->stateSaver->setConnection($this->input->getOption('database'));\n\n if (!$this->stateSaver->repositoryExists()) {\n $options = ['--database' => $this->input->getOption('database')];\n $this->call('migrate:install', $options);\n }\n }", "protected function setupDatabaseConnection()\n {\n $db = DBConnection::getInstance($this->config);\n\n $enc = property_exists($this->config, 'dbEncoding') ? $this->config->dbEncoding : 'utf8';\n $tz = property_exists($this->config, 'dbTimezone') ? $this->config->dbTimezone : '00:00';\n\n $db->query(\n sprintf('SET NAMES \"%s\"', $enc)\n );\n\n $db->query(\n sprintf('SET time_zone = \"%s\"', $tz)\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 }", "function setupDatabase($db){\n\t\tif($db == null) throw new Exception(\"Database is not given\");\n\t\t\n $sqlBirthdays = \"\n CREATE TABLE IF NOT EXISTS `birthdays` (\n `key` int(11) NOT NULL AUTO_INCREMENT,\n `date` date NOT NULL,\n `name` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,\n PRIMARY KEY (`key`)\n\t\t);\";\n\t\t\n\t\t$sqlEvents =\"\n\t\tCREATE TABLE IF NOT EXISTS `events` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `title` text NOT NULL,\n `date` date NOT NULL,\n `time` time NOT NULL,\n `descr` mediumtext CHARACTER SET latin1 COLLATE latin1_german1_ci NOT NULL,\n `startdate` date NOT NULL,\n `enddate` date NOT NULL,\n PRIMARY KEY (`id`)\n );\";\n\n $sqlTicker = \"\n\t\tCREATE TABLE IF NOT EXISTS `tickermsg` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `startdate` date NOT NULL,\n `enddate` date NOT NULL,\n `message` text NOT NULL,\n PRIMARY KEY (`id`)\n );\";\n\n // Execute the create querys\n $db->query($sqlBirthdays);\n $db->query($sqlEvents);\n $db->query($sqlTicker);\n }", "public function setUpDatabaseTables()\n {\n $table = new DModuleTable();\n $table -> setName(\"currencies\");\n $table -> addBigIncrements( \"id\" , true );\n $table -> addString( \"base\" , true);\n $table -> addLongText( 'rates' , true);\n $table -> addDateTime( 'added' , true );\n $table -> addBoolean( 'status' , true);\n $table -> addString( \"extra\" , false);\n $table -> addString( \"extra2\" , false);\n $this -> addTable( $table );\n }", "public function setUp()\n {\n foreach ($this->data as $row) {\n $this->table->insert($row);\n }\n\n parent::setUp();\n\n }", "protected function setUp() {\r\n $this->_instance = $this->getProvider()->get('PM\\Main\\Database');\r\n\r\n parent::setUp();\r\n }", "protected function fixture_setup() {\r\n $this->service = SQLConnectionService::get_instance($this->configuration);\r\n test_data_setup($this->service);\r\n }", "function populate(){\n\t\t$this->db_tools->populate();\n\t\t$this->db_tools->echo_populate();\n\t}", "public function setUp()\n {\n parent::setUp();\n $this->setupDatabase();\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}", "protected function _initDb()\r\n { \r\n if ( $this->_db === null ) {\r\n $file = APPLICATION_PATH . '/configs/database.php';\r\n if(file_exists($file) && filesize($file) > 100) {\r\n $database = require_once($file);\r\n $this->_db = Zend_Db::factory($database['database']['adapter'], \r\n $database['database']['params']);\r\n Zend_Db_Table::setDefaultAdapter($this->_db);\r\n } else {\r\n //Go to install script url\r\n header('Location: /install');\r\n }\r\n }\r\n }", "public function setUp() {\n\t\t$this->validConnectionString = \"host=testdatabase port=5432 dbname=AtroxTest user=WebUser password=test\";\n\t\t$this->application = Atrox_Core_Application::getInstance(Mock_Application::getInstance());\n\t\t$this->application->setConnection(new Atrox_Core_Data_PostgreSql_Connection($this->validConnectionString));\n\t\t$this->application->getConnection()->connect();\n\t\t$this->application->setLogPath(realpath(\"../../../../../Log\"));\n\n\t\t$this->application->createBlogTable();\n\t}", "public function setUp()\n {\n\n parent::setUp();\n\n $this->db = get_db();\n $this->_exhibitsTable = $this->db->getTable('NeatlineExhibit');\n\n }", "public function initialize()\n {\n $this->setSchema(\"smsgw_engine_db\");\n }", "private function init() {\n\t\tlist(, $this->db, $this->table) = explode('_', get_called_class(), 3);\n\t\t$this->db = defined('static::DB') ? static::DB : $this->db;\n\t\t$this->table = defined('static::TABLE') ? static::TABLE : $this->table;\n\t\t$this->pk = defined('static::PK') ? static::PK : 'id';\n\t}", "public function acfedu_create_fill_db() {\n\t\t\t\t$this->acfedu_check_table();\n\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t\t\tob_start();\n\t\t\t\tglobal $wpdb;\n //require_once( 'lib/import_nl.php' );\n //require_once( 'lib/import_be.php' );\n //require_once( 'lib/import_lux.php' );\n require_once( 'lib/import_id.php' );\n\t\t\t\t$sql = ob_get_clean();\n\t\t\t\tdbDelta( $sql );\n\t\t\t}", "private function setupDB()\n\t{\n\t\t$query = 'CREATE TABLE IF NOT EXISTS games (\n\t\t\t\t\tid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\t\t\t\tdate DATETIME\n\t\t)';\n\t\tmysql_query($query);\n\t\t\n\t\t$query = 'CREATE TABLE IF NOT EXISTS moves (\n\t\t\t\t\tid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\t\t\t\tgame_id INT NOT NULL,\n\t\t\t\t\tmove_nr INT NOT NULL,\n\t\t\t\t\tfrom_x INT NOT NULL,\n\t\t\t\t\tfrom_y INT NOT NULL,\n\t\t\t\t\tto_x INT NOT NULL,\n\t\t\t\t\tto_y INT NOT NULL,\n\t\t \t\t\tINDEX (game_id),\n\t\t \t\t\tINDEX (move_nr)\n\t\t)';\n\t\tmysql_query($query);\n\t}", "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}", "private static function initialize_db() {\n\t\tif ( ! defined( 'WP_CLI_SNAPSHOT_DB' ) ) {\n\t\t\tdefine( 'WP_CLI_SNAPSHOT_DB', Utils\\trailingslashit( WP_CLI_SNAPSHOT_DIR ) . 'wp_snapshot.db' );\n\t\t}\n\n\t\tif ( ! ( file_exists( WP_CLI_SNAPSHOT_DB ) ) ) {\n\t\t\tself::create_tables();\n\n\t\t\treturn;\n\t\t}\n\n\t\t// phpcs:ignore PHPCompatibility.Extensions.RemovedExtensions.sqliteRemoved -- False positive.\n\t\tself::$dbo = new \\SQLite3( WP_CLI_SNAPSHOT_DB );\n\t}", "public function setupDatabase()\n {\n exec('rm ' . storage_path() . '/testdb.sqlite');\n exec('cp ' . 'database/database.sqlite ' . storage_path() . '/testdb.sqlite');\n }", "public function setup()\n {\n $dataModel = eval(\"?>\" . file_get_contents( $this->getDataModelFilename() ));\n if($dataModel instanceof DataModelInterface) {\n $dataModel = new ProjectData($dataModel);\n }\n $this->getEngine()->bindData($dataModel);\n $this->getEngine()->activate();\n }", "protected function _initDb()\n {\n $this->bootstrap('configs');\n \n // combine application.ini & config.ini database settings\n $options = $this->getOptions();\n $dbSettings = $options['resources']['db'];\n $dbParams = Zend_Registry::get('config.config')->db->toArray();\n $dbSettings['params'] = array_merge($dbSettings['params'], $dbParams);\n \n $db = Zend_Db::factory($dbSettings['adapter'], $dbSettings['params']);\n if(!empty($dbSettings['isDefaultTableAdapter'])\n && (bool)$dbSettings['isDefaultTableAdapter']\n ) {\n Zend_Db_Table::setDefaultAdapter($db);\n }\n }", "public function initialize(){\n\t\t $db_params = OpenContext_OCConfig::get_db_config();\n\t\t $db = new Zend_Db_Adapter_Pdo_Mysql($db_params);\n\t\t $db->getConnection();\n\t\t $this->setUTFconnection($db);\n\t\t $this->db = $db;\n\t\t $this->checkTableIndex();\n\t\t $this->solrDocArray = false;\n\t\t $this->toDoList = false;\n\t\t $this->toDoCount = 0;\n\t\t $this->errors = array();\n\t\t $this->totalIndexed = 0;\n }", "protected function setUp()\n\t {\n\t\t$conn = $this->getConnection();\n\t\t$db = $conn->getConnection();\n\t\t$db->exec(\n\t\t \"CREATE TABLE IF NOT EXISTS `MySQLdatabase` (\" .\n\t\t \"id int NOT NULL AUTO_INCREMENT, \" .\n\t\t \"string text NOT NULL, \" .\n\t\t \"testblob longblob NOT NULL, \" .\n\t\t \"PRIMARY KEY (`id`)\" .\n\t\t \") ENGINE=InnoDB DEFAULT CHARSET=utf8;\"\n\t\t);\n\n\t\t$this->object = new MySQLdatabase($GLOBALS[\"DB_HOST\"], $GLOBALS[\"DB_DBNAME\"], $GLOBALS[\"DB_USER\"], $GLOBALS[\"DB_PASSWD\"]);\n\n\t\tparent::setUp();\n\t }", "function prepareForDb() {\n $this->description = sql_escape($this->description);\n $this->postsHeader = sql_escape($this->postsHeader);\n $this->postBody = sql_escape($this->postBody);\n $this->postsFooter = sql_escape($this->postsFooter);\n $this->formLogged = sql_escape($this->formLogged);\n $this->form = sql_escape($this->form);\n $this->navigation = sql_escape($this->navigation);\n $this->name = sql_escape($this->name);\n $this->nameLin = sql_escape($this->nameLin);\n $this->memberName = sql_escape($this->memberName);\n $this->date = sql_escape($this->date);\n $this->time = sql_escape($this->time); \n $this->nextPage = sql_escape($this->nextPage);\n $this->previousPage =sql_escape($this->previousPage);\n $this->firstPage = sql_escape($this->firstPage);\n $this->lastPage = sql_escape($this->lastPage);\n\t$this->gravDefault = sql_escape($this->gravDefault);\n }", "protected function _initDb(){\n $config = $this->getOptions();\n\n $db = Zend_Db::factory($config['resources']['db']['adapter'], $config['resources']['db']['params']);\n\n //set default adapter\n Zend_Db_Table::setDefaultAdapter($db);\n\n //save Db in registry for later use\n Zend_Registry::set(\"db\", $db);\n \n Zend_Controller_Action_HelperBroker::addPath(\n \t\tAPPLICATION_PATH .'/helpers');\n\t\t\n }", "private function setup_data_from_db() {\n\t\tglobal $wpdb;\n\n\t\t// get products\n\t\t$this->setup_products();\n\n\t\t// get 'devices'\n\t\t$this->devices = $wpdb->get_results( \"SELECT * FROM `{$wpdb->prefix}spa_devices` as devices\", ARRAY_A );\n\n\t\t// get 'volume'/'type'\n\t\t$this->data = $wpdb->get_results( \"SELECT * FROM `{$wpdb->prefix}spa_volume` as volume\", ARRAY_A );\n\n\t\tfor ( $i = 0; $i < count( $this->data ); $i++ ) {\n\t\t\t// get 'chemical'\n\t\t\t$this->data[$i]['data'] = $wpdb->get_results(\n\t\t\t\t$wpdb->prepare( \"\n\t\t\t\t\tSELECT chemical.* FROM `{$wpdb->prefix}spa_chemical` as chemical\n\t\t\t\t\tLEFT JOIN `{$wpdb->prefix}spa_volume_chemical` as relationtips\n\t\t\t\t\tON chemical.`id` = relationtips.`id_chemical`\n\t\t\t\t\tWHERE relationtips.`id_volume` = '%d'\n\t\t\t\t\", $this->data[$i]['id'] ), ARRAY_A );\n\n\t\t\t// get 'global_result'\n\t\t\t$this->data[$i]['global_result'] = $wpdb->get_results(\n\t\t\t\t$wpdb->prepare( \"\n\t\t\t\t\tSELECT global_result.* FROM `{$wpdb->prefix}spa_global_result` as global_result\n\t\t\t\t\tLEFT JOIN `{$wpdb->prefix}spa_volume_global_result` as relationtips\n\t\t\t\t\tON global_result.`id` = relationtips.`id_global_result`\n\t\t\t\t\tWHERE relationtips.`id_volume` = '%d'\n\t\t\t\t\", $this->data[$i]['id'] ), ARRAY_A );\n\n\t\t\tfor ( $j = 0; $j < count( $this->data[$i]['data'] ); $j++ ) {\n\t\t\t\t// get 'test'\n\t\t\t\t$this->data[$i]['data'][$j]['data'] = $wpdb->get_results(\n\t\t\t\t\t$wpdb->prepare( \"\n\t\t\t\t\t\tSELECT test.* FROM `{$wpdb->prefix}spa_test` as test\n\t\t\t\t\t\tLEFT JOIN `{$wpdb->prefix}spa_chemical_test` as relationtips\n\t\t\t\t\t\tON test.`id` = relationtips.`id_test`\n\t\t\t\t\t\tWHERE relationtips.`id_chemical` = '%d'\n\t\t\t\t\t\", $this->data[$i]['data'][$j]['id'] ), ARRAY_A );\n\n\t\t\t\tfor ( $k = 0; $k < count( $this->data[$i]['data'][$j]['data'] ); $k++ ) {\n\t\t\t\t\t// get 'value'\n\t\t\t\t\t$this->data[$i]['data'][$j]['data'][$k]['data'] = $wpdb->get_results(\n\t\t\t\t\t\t$wpdb->prepare( \"\n\t\t\t\t\t\t\tSELECT spa_value.* FROM `{$wpdb->prefix}spa_value` as spa_value\n\t\t\t\t\t\t\tLEFT JOIN `{$wpdb->prefix}spa_test_value` as relationtips\n\t\t\t\t\t\t\tON spa_value.`id` = relationtips.`id_value`\n\t\t\t\t\t\t\tWHERE relationtips.`id_test` = '%d'\n\t\t\t\t\t\t\", $this->data[$i]['data'][$j]['data'][$k]['id'] ), ARRAY_A );\n\n\t\t\t\t\tfor ( $l = 0; $l < count( $this->data[$i]['data'][$j]['data'][$k]['data'] ); $l++ ) {\n\t\t\t\t\t\t// get 'result'\n\t\t\t\t\t\t$this->data[$i]['data'][$j]['data'][$k]['data'][$l]['data'] = $wpdb->get_results(\n\t\t\t\t\t\t\t$wpdb->prepare( \"\n\t\t\t\t\t\t\t\tSELECT result.* FROM `{$wpdb->prefix}spa_result` as result\n\t\t\t\t\t\t\t\tLEFT JOIN `{$wpdb->prefix}spa_value_result` as relationtips\n\t\t\t\t\t\t\t\tON result.`id` = relationtips.`id_result`\n\t\t\t\t\t\t\t\tWHERE relationtips.`id_value` = '%d'\n\t\t\t\t\t\t\t\", $this->data[$i]['data'][$j]['data'][$k]['data'][$l]['id'] ), ARRAY_A );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function initDatabase()\n {\n $defaults = [\n 'user' => 'root',\n 'password' => '',\n 'prefix' => '',\n 'options' => [\n \\PDO::ATTR_PERSISTENT => true,\n \\PDO::ATTR_ERRMODE => 2,\n \\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',\n \\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => 1,\n \\PDO::ATTR_EMULATE_PREPARES => false\n ]\n ];\n\n if (empty($this->settings['db'])) {\n error_log('No DB data set in Settings.php');\n Throw new FrameworkException('Error on DB access');\n }\n\n if (empty($this->settings['db']['default'])) {\n error_log('No DB \"default\" data set in Settings.php');\n Throw new FrameworkException('Error on DB access');\n }\n\n foreach ($this->settings['db'] as $name => &$settings) {\n\n $prefix = 'db.' . $name;\n\n // Check for databasename\n if (empty($settings['dsn'])) {\n Throw new \\PDOException(sprintf('No DSN specified for \"%s\" db connection. Please add correct DSN for this connection in Settings.php', $name));\n }\n\n // Check for DB defaults and map values\n foreach ($defaults as $key => $default) {\n\n // Append default options to settings\n if ($key == 'options') {\n\n if (empty($settings['options'])) {\n $settings['options'] = [];\n }\n\n foreach ($defaults['options'] as $option => $value) {\n\n if (array_key_exists($option, $settings['options'])) {\n continue;\n }\n\n $settings[$key][$option] = $value;\n }\n }\n\n if (empty($settings[$key])) {\n $settings[$key] = $default;\n }\n }\n\n foreach ($settings as $key => $value) {\n $this->di->mapValue($prefix . '.conn.' . $key, $value);\n }\n\n $this->di->mapService($prefix . '.conn', '\\Core\\Data\\Connectors\\Db\\Connection', [\n $prefix . '.conn.dsn',\n $prefix . '.conn.user',\n $prefix . '.conn.password',\n $prefix . '.conn.options'\n ]);\n $this->di->mapFactory($prefix, '\\Core\\Data\\Connectors\\Db\\Db', [\n $prefix . '.conn',\n $settings['prefix']\n ]);\n }\n }", "public function initialize(){\n // Untuk mengeset database service yang digunakan untuk read data, default: 'db'\n // database service harus diregister di container dependecy injector\n $this->setReadConnectionService('db');\n\n // Untuk mengeset database service yang digunakan untuk write data, default : 'db'\n $this->setWriteConnectionService('db');\n\n // Untuk mengeset schema, default : empty string\n $this->setSchema('dbo');\n\n // Untuk mengeset nama tabel, default : nama class\n $this->setSource('upgrade');\n\n $this->belongsTo(\n 'id_user',\n Users::class,\n 'id_user',\n [\n 'reusable' => true,\n 'alias' => 'user'\n ]\n );\n }", "public function set(){\n\n /**\n * New Schema or Connect to existing schema\n */\n\n $schema = new Schema('Staff');\n $schema->destroy('id');\n $schema->build('id')->Primary()->Integer()->AutoIncrement();\n $schema->build('firstname')->String();\n $schema->build('lastname')->String();\n $schema->build('email')->String()->Unique();\n $schema->build('password')->String();\n $schema->build('IPPIS_NO')->String()->Unique(); \n $schema->build('religion')->String();\n $schema->build('denomination')->String();\n $schema->build('residential_address')->String();\n $schema->build('oauth_file_no')->String();\n $schema->build('Staff_rank')->String();\n $schema->build('department')->String();\n $schema->build('last_seen')->Timestamp();\n $schema->build('created_at')->Timestamp();\n }", "public function setupDatabase()\n {\n Artisan::call('migrate:refresh');\n Artisan::call('db:seed');\n\n self::$setupDatabase = false;\n }", "protected function _setup() {\n // $this->_createTable();\n parent::_setup();\n }", "public function initStorage() {\n if(empty($this -> _db)) {\n $db = new SQLite3('./prices.db');\n $this -> _db = $db;\n }\n \n }", "public function setUp()\n {\n TestConfiguration::setupDatabase();\n }", "function initialize()\n {\n $sql = \"\n CREATE TABLE IF NOT EXISTS `config` (`key` varchar(255) NOT NULL, `value` text NOT NULL, PRIMARY KEY (`key`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;\n CREATE TABLE IF NOT EXISTS `secureconfig` (`key` varchar(255) NOT NULL, `value` text NOT NULL, PRIMARY KEY (`key`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;\n \";\n try {\n $db = Base_Database::getConnection();\n $db->exec($sql);\n } catch (PDOException $e) {\n error_log('Initialize Base_Config failed: ' . $e->getMessage());\n die(\"An error occurred creating the configuration tables\");\n }\n }", "public function initialize(){\n // Untuk mengeset database service yang digunakan untuk read data, default: 'db'\n // database service harus diregister di container dependecy injector\n $this->setReadConnectionService('db');\n\n // Untuk mengeset database service yang digunakan untuk write data, default : 'db'\n $this->setWriteConnectionService('db');\n\n // Untuk mengeset schema, default : empty string\n $this->setSchema('dbo');\n\n // Untuk mengeset nama tabel, default : nama class\n $this->setSource('users');\n }", "public function setUp()\n {\n $dsn = 'mysql:host=localhost;dbname=demo';\n\n $pdo = new \\PDO($dsn, 'root', '');\n\n $driver = new MySQLDriver($pdo, 'demo');\n\n $this->table = new Table('post', $driver);\n }", "public function setUp() {\n\t\t$this->setUpDatabase();\n\t\t$this->match = new Match;\n\t}", "public function initialize()\n {\n $this->setSchema(\"mydb\");\n $this->setSource(\"paying\");\n $this->belongsTo('cid', 'Customers', 'cid', array('alias' => 'alias_customers'));\n $this->belongsTo('loanid', 'LoanInformation', 'loanid', array('alias' => 'alias_loan'));\n $this->hasManyToMany(\n 'payingid',\n 'Tracking',\n 'payingid', 'oid',\n 'DeptTrackers',\n 'oid',\n array(\n 'alias' => 'alias_depttrackers'\n )\n );\n }", "protected function _setupDb()\n {\n // First, delete the DB if it exists\n $this->_teardownDb();\n \n // Then, set up a clean new DB and return it\n list ($host, $port, $db) = $this->_getUrlParts();\n $db = trim($db, '/');\n \n return Sopha_Db::createDb($db, $host, $port);\n }", "public function setUp()\n\t{ \n\t\tparent::setUp();\n\n\t\t$this->app['config']->set('database.default','sqlite');\t\n\t\t$this->app['config']->set('database.connections.sqlite.database', ':memory:');\n\n\t\t$this->migrate();\n\t}", "protected function seedDatabase(): void\n {\n $this->seedProductCategories();\n $this->seedProducts();\n }", "public function initDBConnections(): void\n {\n $this->addConnectionsToConfig();\n $this->testConnections();\n }", "function dbInit()\n {\n if ( $this->IsConnected == false )\n {\n $this->Database = eZDB::globalDatabase();\n $this->IsConnected = true;\n }\n }", "protected function setUp() {\n $this->dbh = DB::getDBConnection('mysql:dbname=www_lab0123_users_test;host=127.0.0.1');\n\n // check if we actually got a connection\n if ($this->dbh == null) {\n $this->fail('DB::getDBConnection returned null..');\n }\n\n // create table in database (fail if couldn't do so)\n if (!$this->dbh->query(\n 'CREATE TABLE `users` (\n `id` int(11) NOT NULL,\n `email` varchar(255) NOT NULL,\n `password` varchar(255) NOT NULL,\n `name` varchar(255) NOT NULL,\n `phone` varchar(30) NOT NULL\n ) ENGINE=InnoDB DEFAULT CHARSET=latin1;'\n )) {\n\n $this->fail('Coudn\\'t create table in setup stage of testing');\n }\n\n \n }", "public function data() {\n\t\t$this->_check();\n\t\t$d['title_for_layout'] = __(\"Database construction\");\n\t\t\n\t\tif($this->request->is('post')) {\n\t\t\tApp::uses('File', 'Utility');\n\t\t\tApp::uses('CakeSchema', 'Model');\n\t\t\tApp::uses('ConnectionManager', 'Model');\n\t\t\t\t\t\n\t\t\t$db = ConnectionManager::getDataSource('default');\n\t\n\t\t\t// connection to the database\n\t\t\tif(!$db->isConnected()) {\n\t\t\t\t$this->Session->setFlash(__(\"Cannot connect to the database\"), \"Install.alert\");\n\t\t\t} else {\n\t\t\t\tcopy(PLUGIN_CONFIG.'Schema/Schema.php.install', CONFIG.'Schema/Schema.php');\n\n\t\t\t\t// fetches all information of the tables of the Schema.php file (app/Config/Schema/Schema.php)\n\t\t\t\t$schema = new CakeSchema(array('name' => 'app'));\n\t\t\t\t$schema = $schema->load();\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * saves the table in the database\n\t\t\t\t */\t\t\t\t\n\t\t\t\tforeach($schema->tables as $table => $fields) {\n\t\t\t\t\t$create = $db->createSchema($schema, $table);\n\t\t\t\t\ttry{\n\t\t\t\t\t\t$db->execute($create);\n\t\t\t\t\t} catch(Exception $e) {\n\t\t\t\t\t\t/*$this->Session->setFlash(__(\"<strong>\" .$table. \"</strong> table already exists.You have to choose another one.\"), \"Install.alert\");\n\t\t\t\t\t\t$this->redirect(array('action' => 'database')); */\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * fetches an array containing all entries for the database\n\t\t\t\t */\n\t\t\t\t$dataObjects = App::objects('class', PLUGIN_CONFIG. 'data' .DS);\n\t\n\t\t\t\tforeach ($dataObjects as $data) {\n\t\t\t\t\t// loads all classes contained in app/Plugin/Install/Config/data/\n\t\t\t\t\tApp::import('Install.Config/data', $data);\n\t\t\t\t\t\n\t\t\t\t\t// fetches all objects from the classes\n\t\t\t\t\t$classVars = get_class_vars($data);\n\t\t\t\t\t// fetches class name\n\t\t\t\t\t$modelAlias = substr($data, 0, -4);\n\t\t\t\t\t\n\t\t\t\t\t// fetches table name\t\n\t\t\t\t\t$table = $classVars['table'];\n\t\t\t\t\t\n\t\t\t\t\t// fetches all entries\n\t\t\t\t\t$records = $classVars['records'];\n\t\t\t\t\tApp::uses('Model', 'Model');\n\t\t\t\t\t$modelObject = new Model(array(\n\t\t\t\t\t\t'name'\t=> $modelAlias,\n\t\t\t\t\t\t'table' => $table,\n\t\t\t\t\t\t'ds'\t=> 'default',\n\t\t\t\t\t));\n\t\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * We will save each entry in the database\n\t\t\t\t\t */\n\t\t\t\t\tif (is_array($records) && count($records) > 0) {\n\t\t\t\t\t\tforeach($records as $record) {\n\t\t\t\t\t\t\t$modelObject->create($record);\n\t\t\t\t\t\t\t$modelObject->save();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!class_exists('Security')) {\n\t\t\t\t\trequire CAKE_CORE_INCLUDE_PATH .DS. 'Cake' .DS. 'Utility' .DS. 'security.php';\n\t\t\t\t}\n\t\t\t\tif($this->request->data['Install']['salt'] == 1) {\n\t\t\t\t\n\t\t\t\t\t$salt = $this->Install->changeConfiguration('Security.salt', Security::generateAuthKey());\n\t\t\t\t\tif($salt) {\t\t\n\t\t\t\t\t\t$users = $this->Install->query('SELECT * from users');\n\t\t\t\n\t\t\t\t\t\tforeach($users as $k => $v) {\n\t\t\t\t\t\t\t$v['users']['password'] = Security::hash($v['users']['username'], null, $salt);\n\t\t\t\t\t\t\t$this->Install->save($v);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tCakeSession::write('Install.salt', true);\n\t\t\t\n\t\t\t\t\t} else { \n\t\t\t\t\t\t$this->Session->setFlash(__(\"Error when generating new salt key\"), 'Install.alert');\t\n\t\t\t\t\t\treturn false; \n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t\tCakeSession::write('Install.salt', false);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->request->data['Install']['seed'] == 1) {\n\t\t\t\t\t$this->Install->changeConfiguration('Security.cipherSeed', mt_rand() . mt_rand());\n\t\t\t\t\tCakeSession::write('Install.seed', true);\n\t\t\t\t} else {\n\t\t\t\t\tCakeSession::read('Install.seed', false);\n\t\t\t\t}\n\t\t\t\t$this->redirect(array('action' => 'finish'));\n\t\t\t}\t\n\t\t}\n\t\t\n\t\t$this->set($d);\n\t}", "public function initialize()\n {\n $this->db = $this->getDi()->getShared('db');\n $this->setSchema(\"blogging\");\n $this->setSource(\"videos\");\n $this->skipAttributes(\n [\n '_created_at',\n '_updated_at',\n ]\n );\n }", "function MetaDatabases() {}", "public function __construct(){\n \n $this->create_tables();\n \n }", "public function seed()\n\t{\n\t\t$this->createDataType();\n\t\t$this->createDataRowForColumns();\n\t}", "public function setUp()\n {\n parent::setUp();\n \n $this->db = Ediary_Db::getInstance();\n $this->object = new Ediary_Database_Schema($this->db);\n \n // DEBUG: THIS WILL DROP TABLES AND RECREATE THEM\n //Ediary_Db::getInstance()->upgrade();\n }", "protected function setUp()\n {\n try {\n chdir(CWD . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR);\n if (!isset($this->db)) {\n $schema = \\Yana\\Files\\XDDL::getDatabase('check');\n $this->db = new \\Yana\\Db\\FileDb\\Connection($schema);\n }\n // reset database\n $this->db->remove('i', array(), 0);\n $this->db->remove('t', array(), 0);\n $this->db->remove('ft', array(), 0);\n $this->db->commit();\n $this->query = new \\Yana\\Db\\Queries\\Insert($this->db);\n } catch (\\Exception $e) {\n $this->markTestSkipped(\"Unable to connect to database\");\n }\n }", "protected function setUp() {\n $db = Kohana::config('database.default.connection.database');\n Kohana::config('database')->default['connection']['database'] = 'test_'.$db;\n DB::query(Database::DELETE, 'DROP TABLE IF EXISTS ut_init, ut_pop, db_deltas')\n ->execute();\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n User::truncate();\n Employee::truncate();\n Company::truncate();\n\n $userQuantity = 200;\n $companiesQuantity = 100;\n $employeesQuantity = 100;\n\n factory(User::class, $userQuantity)->create();\n factory(Company::class, $companiesQuantity)->create();\n factory(Employee::class, $employeesQuantity)->create();\n }", "public function beforeSetup()\n {\n $this->setUpDatabaseConnection();\n\n $this->createSchema();\n }", "protected function _initDbSchema() {\n\t\tif (!empty($this->schema)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t#################################################################\n\t\t#\n\t\t# TABLE: feed\n\t\t#\n\t\t\n\t\t$this->schema['feed']['create'] = <<<SQL\nCREATE TABLE IF NOT EXISTS `feed` (\n\tid INTEGER PRIMARY KEY AUTOINCREMENT,\n\turl VARCHAR(255) UNIQUE,\n\ttitle VARCHAR(255),\n\t\n\ttype VARCHAR(1),\n\tstatus VARCHAR(1),\n\tcreated DATETIME,\n\tlastUpdated DATETIME,\n\n\tlastPolled DATETIME,\n\tnextPoll DATETIME\n);\nSQL;\n\n\t\t$this->schema['feed']['add'] = <<<SQL\nINSERT INTO `feed` \n(id, url, title, type, status, created, lastUpdated, lastPolled, nextPoll)\nVALUES\n(NULL, :url, :title, :type, :status, \n :created, :lastUpdated, :lastPolled, :nextPoll);\nSQL;\n\n\t\t$this->schema['feed']['updatePoll'] = <<<SQL\nUPDATE `feed` \nSET\n\tlastUpdated = :lastUpdated,\n\tlastPolled = :lastPolled\nWHERE\n\tid = :id\nSQL;\n\n\t\t$this->schema['feed']['getAll'] = <<<SQL\nSELECT * FROM `feed`;\nSQL;\n\n\t\t$this->schema['feed']['getById'] = <<<SQL\nSELECT * FROM `feed`\nWHERE\n\tid = :id;\nSQL;\n\n\t\t$this->schema['feed']['getByUrl'] = <<<SQL\nSELECT * FROM `feed`\nWHERE\n\turl = :url;\nSQL;\n\n\t\t$this->schema['feed']['deleteById'] = <<<SQL\nDELETE FROM `feed`\nWHERE\n\tid = :id;\nSQL;\n\n\t\t$this->schema['feed']['deleteByUrl'] = <<<SQL\nDELETE FROM `feed`\nWHERE\n\turl = :url;\nSQL;\n\n\t\t#################################################################\n\t\t#\n\t\t# TABLE: author\n\t\t#\n\n\t\t$this->schema['author']['create'] = <<<SQL\nCREATE TABLE IF NOT EXISTS `author` (\n\tid INTEGER PRIMARY KEY AUTOINCREMENT,\n\tname VARCHAR(255),\n\turl VARCHAR(255),\n\temail VARCHAR(255),\n\t\n\tUNIQUE(name, url)\n);\nSQL;\n\n\t\t$this->schema['author']['add'] = <<<SQL\nINSERT INTO `author`\n(id, name, url, email)\nVALUES\n(NULL, :name, :url, :email)\nSQL;\n\n\t\t$this->schema['author']['getAll'] = <<<SQL\nSELECT * FROM `author`;\nSQL;\n\n\t\t$this->schema['author']['getByName'] = <<<SQL\nSELECT * FROM `author`\nWHERE\n\tname = :name;\nSQL;\n\n\t\t$this->schema['author']['getById'] = <<<SQL\nSELECT * FROM `author`\nWHERE\n\tid = :id;\nSQL;\n\n\t\t$this->schema['author']['deleteByName'] = <<<SQL\nDELETE FROM `author`\nWHERE\n\tname = :name;\nSQL;\n\n\t\t$this->schema['author']['deleteById'] = <<<SQL\nDELETE FROM `author`\nWHERE\n\tid = :id;\nSQL;\n\n\n\t\t#################################################################\n\t\t#\n\t\t# TABLE: entry\n\t\t#\n\t\t\n\t\t$this->schema['entry']['create'] = <<<SQL\nCREATE TABLE IF NOT EXISTS `entry` (\n\trow_id INTEGER PRIMARY KEY AUTOINCREMENT,\n\turl VARCHAR(255),\n\ttitle VARCHAR(255),\n\tid VARCHAR(255) UNIQUE,\n\tauthor_id INTEGER,\n\tsummary TEXT,\n\tcontent TEXT,\n\tpublished DATETIME,\n\tupdated DATETIME\n\n);\nSQL;\n\n\t\t$this->schema['entry']['add'] = <<<SQL\nINSERT INTO `entry`\n(row_id, url, title, id, author_id, summary, content, published, updated)\nVALUES\n(NULL, :url, :title, :id, :author_id, :summary, :content, :published, :updated)\nSQL;\n\n\t\t$this->schema['entry']['getAll'] = <<<SQL\nSELECT * FROM `entry`;\nSQL;\n\n\t\t// TODO: Add join for author id\n\t\t$this->schema['entry']['getById'] = <<<SQL\nSELECT * FROM `entry`\nWHERE\n\trow_id = :row_id;\nSQL;\n\n\t\t// TODO: Add join for author id\n\t\t$this->schema['entry']['getByAtomId'] = <<<SQL\nSELECT * FROM `entry`\nWHERE\n\tid = :id;\nSQL;\n\n\t\t$this->schema['entry']['deleteById'] = <<<SQL\nDELETE FROM `entry`\nWHERE\n\trow_id = :row_id;\nSQL;\n\n\t\t$this->schema['entry']['deleteByAtomId'] = <<<SQL\nDELETE FROM `entry`\nWHERE\n\tid = :id;\nSQL;\n\n\n\n\t\t#################################################################\n\t\t#\n\t\t# TABLE: feedentry\n\t\t#\n\t\t\n\t\t$this->schema['feedentry']['create'] = <<<SQL\nCREATE TABLE IF NOT EXISTS `feedentry` (\n\tfeed_id INTEGER,\n\tentry_id INTEGER,\n\tcreated DATETIME,\n\n\tPRIMARY KEY(feed_id, entry_id)\t\n);\nSQL;\n\n\t$this->schema['feedentry']['add'] = <<<SQL\nINSERT INTO `feedentry`\n(feed_id, entry_id, created)\nVALUES\n(:feed_id, :entry_id, :created)\nSQL;\n\n\t$this->schema['feedentry']['getByFeedUrl'] = <<<SQL\nSELECT \n\trow_id, entry.url, entry.title, entry.id, \n\tauthor_id, summary, content,\n\tentry.published, entry.updated\nFROM entry\nLEFT JOIN feedentry ON entry.row_id = feedentry.entry_id\nLEFT JOIN feed ON feedentry.feed_id = feed.id\nWHERE\n\tfeed.url = :feed_url\nORDER BY entry.published DESC\nSQL;\n\n\n\t}", "public function setUp()\n\t{\n\t\t$this->prepare_tables(\n\t\t\t'Model_User', \n\t\t\t'Model_Role', \n\t\t\t'Model_Roles_Users', \n\t\t\t'Model_User_Token'\n\t\t\t);\n\t}", "private function setDatabase()\n {\n $parentVars = get_class_vars(get_class($this));\n\n if (isset($parentVars['database']) && !empty($parentVars['database'])) {\n $this->database = $parentVars['database'];\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 }" ]
[ "0.85319763", "0.73220855", "0.7273695", "0.7214558", "0.71278703", "0.710581", "0.7091359", "0.70344174", "0.7015831", "0.6977156", "0.69509304", "0.6931439", "0.69308466", "0.6930586", "0.69107413", "0.68808347", "0.68684167", "0.68590796", "0.67982405", "0.67741096", "0.67484725", "0.67387307", "0.6713236", "0.6711062", "0.6697364", "0.6696681", "0.66811514", "0.6674489", "0.66661483", "0.6664734", "0.6659971", "0.66452914", "0.6637327", "0.66359794", "0.66263956", "0.66211", "0.6619161", "0.6605455", "0.65802026", "0.65761393", "0.6565714", "0.65491897", "0.6523618", "0.65159035", "0.64959025", "0.6492164", "0.64854693", "0.6481955", "0.648008", "0.6465079", "0.6464715", "0.6463936", "0.6456539", "0.6454167", "0.64317167", "0.641227", "0.64100945", "0.6408842", "0.640696", "0.6398443", "0.63971823", "0.63907367", "0.63797826", "0.63696826", "0.6367972", "0.63650393", "0.6364207", "0.6362195", "0.6360755", "0.6356042", "0.6342171", "0.63385427", "0.63265055", "0.6326014", "0.63180846", "0.63155705", "0.6310873", "0.63029134", "0.6288144", "0.62822485", "0.6276518", "0.6274367", "0.6273999", "0.6267879", "0.6254513", "0.624886", "0.62470835", "0.624047", "0.6238575", "0.6234798", "0.6230191", "0.62256056", "0.62211263", "0.6217859", "0.62170553", "0.6214837", "0.6213572", "0.62127274", "0.6212481", "0.6210995", "0.62107015" ]
0.0
-1
Sanitize key, removing spaces and replace them to underscore
protected function sanitize($key) { return strtolower(str_replace(' ', '_', $key)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sanitize_key( $key ) {\n\t$raw_key = $key;\n\t$key = strtolower( $key );\n\t$key = preg_replace( '/[^a-z0-9_\\-]/', '', $key );\n\n\t/**\n\t * Filter a sanitized key string.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $key Sanitized key.\n\t * @param string $raw_key The key prior to sanitization.\n\t */\n\treturn apply_filters( 'sanitize_key', $key, $raw_key );\n}", "function parse_clean_key($key)\n {\n \tif ($key == \"\")\n \t{\n \t\treturn \"\";\n \t}\n \t\n \t$key = htmlspecialchars(urldecode($key));\n \t$key = str_replace( \"..\" , \"\" , $key );\n \t$key = preg_replace( \"/\\_\\_(.+?)\\_\\_/\" , \"\" , $key );\n \t$key = preg_replace( \"/^([\\w\\.\\-\\_]+)$/\", \"$1\", $key );\n \t\n \treturn $key;\n }", "protected function normalize($key)\n {\n return str_replace('_', '', strtoupper($key));\n }", "protected function _normalizeKey($key)\n {\n $option = str_replace('_', ' ', strtolower($key));\n $option = str_replace(' ', '', ucwords($option));\n return $option;\n }", "function sanitize_key($key)\n {\n }", "function parseCleanKey($k){\r\n\t\tif($k<0){\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\t$k = htmlspecialchars(urldecode($k));\r\n\t\t$k = preg_replace(\"/\\.\\./\" , \"\" , $k);\r\n\t\t$k = preg_replace(\"/\\_\\_(.+?)\\_\\_/\" , \"\" , $k);\r\n\t\t$k = preg_replace(\"/^([\\w\\.\\-\\_]+)$/\", \"$1\", $k);\r\n\t\treturn $k;\r\n\t}", "public static function filterDataKey($key)\n {\n return preg_replace(\"/[^a-zA-Z0-9_]+/\", '_', $key);\n }", "protected function sanitizeKey($key)\n {\n return $key;\n }", "public static function normalizeKeyDelimiters($key)\r\n {\r\n return str_replace(array(' ', '_'), '-', $key);\r\n }", "function _CleanKey($key) {\n\t\t$this->_Log('Cache: cleaning ' . ($key ?? '<NULL>') );\n\n\t\t$new_key = preg_replace( '/[^a-z0-9]+/', '-', strtolower( $key ?? '' ) );\n\n\t\treturn $new_key;\n\t}", "public static function sanitizeCacheKey($key)\n {\n $chars = [\"{\",\"}\",\"(\",\")\",\"/\",\"\\\\\",\"@\",\":\"];\n $key = str_replace($chars, \"\", $key);\n\n return $key;\n }", "public static function sanitizeCacheKey($key): string\n {\n $chars = [\"{\",\"}\",\"(\",\")\",\"/\",\"\\\\\",\"@\",\":\"];\n $key = str_replace($chars, \"\", $key);\n\n return $key;\n }", "private function formatKey($key)\n {\n $key = ucwords(strtolower($key));\n $key = str_replace(' ', '', $key);\n return $key;\n }", "public static function alm_filters_revert_underscore($key){\n\t \t// If value is _year, _month, _day or _author remove the '_'\n\t \t$key = ($key === '_year' || $key === '_month' || $key === '_day' || $key === '_author') ? str_replace('_', '', $key) : $key;\n\t \treturn $key;\n \t}", "public static function alm_filters_replace_underscore($value){\n\t \t$underscore = strpos($value, '_');\n\t \tif($underscore){\n\t\t \t$charToReplace = substr($value, $underscore+1, 1);\n\t\t \t$value = str_replace('_'.$charToReplace, strToUpper($charToReplace), $value);\n\t \t}\n\n\t \t// If value is year, month or day add '_' before to prevent 404s. e.g. _year\n\t \t$value = ($value === 'year' || $value === 'month' || $value === 'day' || $value === 'author') ? '_'. $value : $value;\n\t \treturn $value;\n \t}", "private function formatKey(string $key): string\n\t{\n\t\treturn str_replace('_', '-', strtolower($key));\n\t}", "public function normaliseKey(string $key): string;", "function unprefix( $key, $strip_underscores = true ) {\n\n\treturn utils\\unprefix_meta_key( $key, '_wpmoly_', $strip_underscores );\n}", "public static function clear_key($k)\n\t{\n\t\tif(!$k)\n\t\t\treturn '';\n \t$k = htmlspecialchars(urldecode($k));\n \t$k = str_replace('..','',$k);\n \t$k = preg_replace('/\\_\\_(.+?)\\_\\_/','',$k);\n \t$k = preg_replace('/^([\\w\\.\\-\\_]+)$/','$1',$k);\n \treturn $k;\n\t}", "function str_underscore($str)\n{\n return strtolower(preg_replace('/(?<=\\\\w)([A-Z]+)/', '_\\\\1', $str));\n}", "private function _key($key) {\n if (empty($key)) {\n return false;\n }\n $key = preg_replace('/[\\s]+/', '_', strtolower(trim(str_replace(array(DIRECTORY_SEPARATOR, '/', '.'), '_', strval($key)))));\n return $key;\n }", "function _fixName($field_or_value_name) {\r\n if ($field_or_value_name == \"\")\r\n return \"\";\r\n // convert space into underscore\r\n $result = preg_replace(\"/ /\", \"_\", strtolower($field_or_value_name));\r\n // strip all non alphanumeric chars\r\n $result = preg_replace(\"/\\W/\", \"\", $result);\r\n return $result;\r\n }", "function cap_sanitize_key_list ($key_list)\n{\n $keys = explode (' ', $key_list);\n $result = array ();\n foreach ($keys as $key) {\n $result[] = cap_sanitize_key ($key);\n }\n return implode (' ', $result);\n}", "function remove_underscore($string)\n{\n return str_replace('_', ' ', $string);\n}", "protected function normalizeKey($key)\r\n {\r\n if ($this->normalization & static::NORMALIZE_TRIM) {\r\n $key = trim($key);\r\n }\r\n\r\n if ($this->normalization & static::NORMALIZE_DELIMITERS) {\r\n $key = static::normalizeKeyDelimiters($key);\r\n }\r\n\r\n if ($this->normalization & static::NORMALIZE_CASE) {\r\n $key = strtolower($key);\r\n }\r\n\r\n if ($this->normalization & static::NORMALIZE_CANONICAL) {\r\n $key = static::canonicalizeKey($key);\r\n }\r\n\r\n return $key;\r\n }", "private function _clean_input_keys($str) {\n\t\tif (!preg_match('/^[a-z0-9:_\\-\\/-\\\\\\\\*]+$/i', $str)) {\n\t\t\tlog_error('Disallowed Key Characters:' . $str);\n\t\t\texit ('Disallowed Key Characters:' . $str);\n\t\t}\n\n\t\treturn $str;\n\t}", "function safe_name($name) {\n return preg_replace(\"/\\W/\", \"_\", $name);\n }", "public static function camelCase2underscore(string $key): string\n {\n $str = lcfirst($key);\n return strtr($str, [\n 'A' => '_a', 'B' => '_b', 'C' => '_c', 'D' => '_d',\n 'E' => '_e', 'F' => '_f', 'G' => '_g', 'H' => '_h',\n 'I' => '_i', 'J' => '_j', 'K' => '_k', 'L' => '_l',\n 'M' => '_m', 'N' => '_n', 'O' => '_o', 'P' => '_p',\n 'Q' => '_q', 'R' => '_r', 'S' => '_s', 'T' => '_t',\n 'U' => '_u', 'V' => '_v', 'W' => '_w', 'X' => '_x',\n 'Y' => '_y', 'Z' => '_z',\n ]);\n }", "static function spaceOrUnderscore( $pattern ) {\n\t\treturn str_replace( ' ', '[ _]', $pattern );\n\t}", "function underscore(){\n\t\t$out = $this->_copy();\n\t\t$out->_String4 = mb_strtolower(preg_replace(\"/([a-z0-9\\p{Ll}])([A-Z\\p{Lu}])/u\",\"\\\\1_\\\\2\",$this->_String4));\n\t\treturn $out;\n\t}", "function underscore($str) {\n return preg_replace('/[\\s]+/', '_', trim(extension_loaded('mbstring') ? mb_strtolower($str) : strtolower($str)));\n}", "protected function clean_input_keys($str) {\n\t\t\n\t\tif ( ! preg_match('#^[&a-zA-Z0-9\\.:_/\\-\\s]+$#uD', $str)) {\n\t\t\techo $str.'<br />';\n\t\t\texit('Disallowed key characters in global data.');\n\t\t}\n\n\t\treturn $str;\n\t}", "function validName($name) {\n \n return preg_replace('/\\s+/', '_',$name);\n\n}", "protected function parseKey(): string\n {\n foreach ($this->getParams() as $key => $value) {\n $this->key = \\str_replace($key, $value, $this->key);\n }\n\n return $this->key;\n }", "public static function toUnderscoreSeparated($input)\r\n {\r\n \t// Convert spaces and dashes to underscores.\r\n \t$input = preg_replace('#[ \\-_]+#', '_', $input);\r\n \r\n \treturn $input;\r\n }", "public function testSpaceIsRepresentedByUnderscore()\n {\n $encoder = new QpMimeHeaderEncoder();\n $this->assertEquals('a_b', $encoder->encodeString('a b'), 'Spaces can be represented by more readable underscores as per RFC 2047.');\n }", "function replace_invalid_keys($key,$opt){\n\n if(is_string($key)){\n $key = preg_replace(INVALIDCHARSRGX, $opt->substitute_string, $key);\n $key = preg_replace(STARTCHARRGX, $opt->substitute_string, $key);\n }\n return $key;\n }", "public static function canonicalizeKey($key)\r\n {\r\n $words = explode('-', strtolower($key));\r\n\r\n foreach ($words as &$word) {\r\n $word = ucfirst($word);\r\n }\r\n\r\n return implode('-', $words);\r\n }", "public function cleanAlias( $value ){\n $value = $this->removeAccents($value); \n $value = strtolower($value);\n // remove anything not alphanumeric OR \"_\"\n $value = preg_replace(\"/([^a-z0-9_\\-]+)/i\", '_', $value);\n // remove duplicate \"_\"\n $value = preg_replace(\"/(__+)/\", '_', $value);\n // remove posible start/end \"_\"\n return trim($value, '_');\n }", "function underscore($s, $sep = '_') {\n\n $s = preg_replace('/([a-z0-9])([A-Z])/', '$1_$2', $s);\n $s = preg_replace('/([0-9])([a-z])/', '$1_$2', $s);\n $s = preg_replace('/([a-zA-Z])([0-9])/', '$1_$2', $s);\n $s = preg_replace('/[\\s_-]+/', $sep, $s);\n\n return strtolower($s);\n\n }", "public static function sanitizeId($id)\n {\n return preg_replace('#[^a-zA-Z0-9_]#', '_', $id);\n }", "static function try_modify_key($key)\n\t{\n\t\t//compatibility for the old iconfont that was based on numeric values\n\t\tif(is_numeric($key)) \n\t\t{\n\t\t\t$key = self::get_char_from_fallback($key);\n\t\t}\n\t\n\t\t//chars that are based on multiple chars like \\ueXXX\\ueXXX; need to be modified before passed\n\t\tif(!empty($key) && strpos($key, 'u',1) !== false)\n\t\t{\n\t\t\t$key = explode('u', $key);\n\t\t\t$key = implode('\\u',$key);\n\t\t\t$key = substr($key, 1);\n\t\t}\n\t\n\t\treturn $key;\n\t}", "function MCW_make_name_acceptable($name) {\n \n $name = strtr($name,\" \",\"_\");\n $name=preg_replace(\"/[^a-zA-Z0-9_äöüÄÖÜ]/\" , \"\" , $name);\n return $name;\n }", "function remove_underscores($word, $sub = ' ')\n {\n return str_replace('_', $sub, $word);\n }", "function sanitize_name( $name ) {\r\n\t\t$name = sanitize_title( $name ); // taken from WP's wp-includes/functions-formatting.php\r\n\t\t$name = str_replace( '-', '_', $name );\r\n\r\n\t\treturn $name;\r\n\t}", "public function cleanKeyFromUnicodeCharacters(string $key): string\n {\n return preg_replace('/&([a-z])[a-z]+;/i', '$1', htmlentities($key));\n }", "function put_underscore($str, $lower = true)\n {\n if (!$lower) {\n return str_replace(' ', '_', $str);\n }\n return strtolower(str_replace(' ', '_', $str));\n }", "function eL($key)\n{\n return Filters::noXSS(L($key));\n}", "protected function _normalizeString($string)\n {\n return preg_replace('/\\s+/', '_', $string);\n\n// $string = preg_replace('/([^a-z^0-9^_])+/','_',strtolower($string));\n// $string = preg_replace('/_{2,}/','_',$string);\n// return trim($string,'_');\n }", "public function underscore($word)\n\t{\n\t\treturn strtolower(preg_replace('/[^A-Z^a-z^0-9]+/','_',\n\t\t\t\tpreg_replace('/([a-zd])([A-Z])/','1_2',\n\t\t\t\t\tpreg_replace('/([A-Z]+)([A-Z][a-z])/','1_2',$word))));\n\t}", "public static function underscore($str) {\n $str[0] = strtolower($str[0]);\n $func = create_function('$c', 'return \"_\" . strtolower($c[1]);');\n return preg_replace_callback('/([A-Z])/', $func, $str);\n }", "public static function underscore($word) {\n return strtolower(preg_replace('#([a-z])([A-Z])#', '\\\\1_\\\\2', $word));\n }", "public static function underscore2camelCase(string $key): string\n {\n return strtr($key, array_flip([\n 'A' => '_a', 'B' => '_b', 'C' => '_c', 'D' => '_d',\n 'E' => '_e', 'F' => '_f', 'G' => '_g', 'H' => '_h',\n 'I' => '_i', 'J' => '_j', 'K' => '_k', 'L' => '_l',\n 'M' => '_m', 'N' => '_n', 'O' => '_o', 'P' => '_p',\n 'Q' => '_q', 'R' => '_r', 'S' => '_s', 'T' => '_t',\n 'U' => '_u', 'V' => '_v', 'W' => '_w', 'X' => '_x',\n 'Y' => '_y', 'Z' => '_z',\n ]));\n }", "function sanitize_file_name( $filename ) {\n\treturn preg_replace(\"([^\\w\\s\\d\\-_~,;:\\[\\]\\(\\].]|[\\.]{2,})\", '_', $filename);\n}", "function sanitize_username($s) {\n\treturn preg_replace(\"/[^a-zA-Z0-9-_]/\", '', trim($s));\n}", "public function sanitizer($var){\n\t\t$forbidden = array(\"²\",\"&\",\"\\\"\",\"'\",\"(\",\"è\",\"é\",\"ê\",\"ë\",\"ç\",\"à\",\")\",\"=\",\"~\",\"#\",\"{\",\"[\",\"|\",\"`\",\"\\\\\",\"^\",\"@\",\"]\",\"}\",\"+\",\"°\",\"%\",\"¤\",\"*\",\"!\",\":\",\",\",\";\",\"?\",\"/\",\"$\",\"£\",\"€\",\"<\",\">\",\" \");\n\t\t$allowed = array(\"-\",\"-\",\"-\",\"-\",\"-\",\"e\",\"e\",\"e\",\"e\",\"c\",\"a\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"_\");\n\n\t\t$sanitized = str_replace($forbidden,\"_\",$var);\n\n\t\tif(strlen($sanitized) >= 33) $sanitized = substr($sanitized,0,31);\n\n\t\treturn \t$sanitized;\n\t}", "protected function processKey($key)\n {\n if (!empty($this->keySuffix)) {\n return $key . '|' . $this->keySuffix;\n } else {\n return $key;\n }\n }", "protected function _sanitize_id($id)\n {\n // Change slashes and spaces to underscores\n return str_replace(['/', '\\\\', ' '], '_', $id);\n }", "private function sanitizeSecretName($secret_name) {\n\n $pattern = '/^[\\w\\d\\s\\-_]{4,}$/';\n if ($this->isInvalidStr($secret_name) || !preg_match($pattern, $secret_name)) {\n\n throw new \\Exception(\"Valid secret name string is required: \" . $pattern);\n }\n\n //append the suffix, trade spaces for underscores and lower\n return strtolower(str_replace(' ', '_', $secret_name));\n }", "protected function replaceSpecialChars($value)\r\n\t{\r\n//\t\techo \"$value: \" . preg_replace('/[-]/', '_', $value) . \"\\n\";\r\n\t\treturn preg_replace('/[-]/', '_', $value); //Convert non-word characters, hyphens and dots to underscores\r\n\t}", "public function format()\n {\n $formattedString = join('_', $this->toLower());\n if (strpos($formattedString, '_') === 0) {\n $formattedString = substr($formattedString, 1);\n }\n\n return $formattedString;\n }", "public static function quote_name($key)\n {\n if (is_object($key))\n return '('.strval($key).')';\n\n if (preg_match('/^[a-zA-Z]+[a-zA-Z0-9_]*$/', $key))\n return sprintf('`%s`', trim($key));\n\n return trim($key);\n }", "function cut_underscore($str, $uc = true)\n {\n if (!$uc) {\n return str_replace('_', '', $str);\n }\n return ucwords(str_replace(' ', '_', $str));\n }", "public function getKeyAttribute($key)\n {\n return strtolower(trim(\n preg_replace(\n '~[^a-zA-Z0-9]+~',\n '',\n preg_replace('~( |_|\\-)+~', ' ', $key)\n )\n ));\n }", "public function replaceUnderscore($method = false)\n {\n if (!$method) {\n return false;\n }\n $arr = explode('_', $method);\n $new = '';\n if (count($arr)) {\n foreach ($arr as $key => $value) {\n $new .= ucfirst($value);\n }\n }\n\n return $new;\n }", "public static function key2Label(string $key): string\n {\n $str = static::camelCase2underscore($key);\n $prepared = ucfirst(strtolower(\n strtr($str, ['_' => ' ', '.' => ' ','()' => ''])\n ));\n return preg_replace('/\\s+/', ' ', $prepared);\n }", "function wcs_sanitize_subscription_status_key( $status_key ) {\n\tif ( ! is_string( $status_key ) || empty( $status_key ) ) {\n\t\treturn '';\n\t}\n\t$status_key = ( 'wc-' === substr( $status_key, 0, 3 ) ) ? $status_key : sprintf( 'wc-%s', $status_key );\n\treturn $status_key;\n}", "function get_name_sanitized():string{\n $sanitize_name = $this->name ;\n foreach (self::SANITIZED_WORDS as $old => $new) {\n $sanitize_name = str_replace($old, $new, $sanitize_name);\n }\n return $sanitize_name;\n }", "function displayOneCfDef($key) {\n\t\treturn ucwords(str_replace('_',' ',$key));\n\t}", "public function escapeKeywords($key)\n {\n $key = str_replace('+', '\\+', $key);\n $key = str_replace('$', '\\$', $key);\n $key = str_replace('/', '\\/', $key);\n $key = str_replace('.', '\\.', $key);\n return $key;\n }", "function clean_id($id)\n{\n\t$id = str_replace('-', '_', $id);\n\treturn $id;\n}", "function camelCaseToUnderscore($str) {\n $str[0] = strtolower($str[0]);\n $func = create_function('$c', 'return \"_\" . strtolower($c[1]);');\n return preg_replace_callback('/([A-Z])/', $func, $str);\n }", "public function underscore($camelCasedWord);", "function RewriteLangKey ($string){\n\treturn trim(strip_tags($string));\n}", "function correctIdentifier($identifier) {\n $search = array(' ', ':', '.', '/');\n $replace = array('_', '_', '_', '-');\n return str_replace($search, $replace, $identifier);\n}", "private function getFunctionName($key) {\n return preg_replace_callback('/(?:^|_)(.?)/', function($m) { strtoupper($m[1]); },$key);\n }", "protected function keyReplacementPattern(string $keyName): string\n {\n $escaped = preg_quote('='.$this->getCurrentKey($keyName), '/');\n\n return \"/^$keyName{$escaped}/m\";\n }", "function u_ ($s) {\n $out = preg_replace('/([^_])([A-Z])/', '$1_$2', $s);\n return 'u_' . strtolower($out);\n}", "private function sanitize($key): ?string\n {\n if (empty($key) || !is_string($key) || (null === ($clean = preg_replace(static::SANITIZE_PATTERN, static::SANITIZE_REPLACEMENT, $key)))) {\n throw new InvalidArgumentException(\"Key '$key' is not a legal value!\");\n }\n\n return $clean;\n }", "public function getNormalizedName() {\n\n $name = str_replace(' ', '_', $this->getName());\n $name = strtolower($name);\n\n return preg_replace('/[^a-z0-9_]/i', '', $name);\n }", "public static function underscore($wordToCheck)\n {\n $tmp = $wordToCheck;\n $tmp = str_replace('::', '/', $tmp);\n $tmp = self::pregtr($tmp,\n array(\n '/([A-Z]+)([A-Z][a-z])/' => '\\\\1_\\\\2',\n '/([a-z\\d])([A-Z])/' => '\\\\1_\\\\2'\n )\n );\n\n return strtolower($tmp);\n }", "protected function sanitizeContentTypeGroupIdentifier(ContentTypeGroup $contentTypeGroup): string\n {\n return str_replace(' ', '_', $contentTypeGroup->identifier);\n }", "function wpartisan_sanitize_file_name( $filename ) {\n\n $sanitized_filename = remove_accents( $filename ); // Convert to ASCII \n // Standard replacements\n $invalid = array(\n ' ' => '-',\n '%20' => '-',\n '_' => '-',\n );\n $sanitized_filename = str_replace( array_keys( $invalid ), array_values( $invalid ), $sanitized_filename );\n \n $sanitized_filename = preg_replace('/[^A-Za-z0-9-\\. ]/', '', $sanitized_filename); // Remove all non-alphanumeric except .\n $sanitized_filename = preg_replace('/\\.(?=.*\\.)/', '', $sanitized_filename); // Remove all but last .\n $sanitized_filename = preg_replace('/-+/', '-', $sanitized_filename); // Replace any more than one - in a row\n $sanitized_filename = str_replace('-.', '.', $sanitized_filename); // Remove last - if at the end\n $sanitized_filename = strtolower( $sanitized_filename ); // Lowercase\n \n return $sanitized_filename;\n}", "function slug($value){\n//the pre_quote function is just used to quote regular expressions so that it doesn't get mixed up and result in an error\n //remove all characters not in the list(that what this means when we include \"empty string\")\n $value = preg_replace('![^'.preg_quote('_').'\\pL\\pN\\s]+!u','',mb_strtolower($value));\n\n //replace underscore with a dash\n $value = preg_replace('!['.preg_quote('_').'\\s]+!u','-',$value);\n\n //remove whitespace with the trim function\n //'-' was added as an argument so that the trim function does not remove it too\n\n return trim($value, '-');\n\n}", "public function formatKey(string $key): string;", "public function sanitizedName($name)\r\n\t{\r\n\t\t$cut_name = explode('_', $name);\r\n\t\t$fileName = array_slice($cut_name, 1);\r\n\t\treturn implode(\"_\", $fileName);\r\n\t}", "public static function camelToUnderdash(string $s):string {\n $s = preg_replace('#(.)(?=[A-Z])#', '$1_', $s);\n $s = strtolower($s);\n $s = rawurlencode($s);\n return $s;\n }", "function sa_sanitize_chars($filename) {\n return strtolower(preg_replace('/[^a-zA-Z0-9-_\\.]/', '', $filename));\n}", "static public function underscore($str)\n\t{\n\t\t$str = lcfirst($str);\n\t\treturn strtolower(preg_replace('/([A-Z]+)/', '_$1', $str));\n\t}", "public static function underscore($word, $sep = '_', $strtolower = true)\n {\n $sep = empty($sep) ? '_' : $sep;\n $return = preg_replace('/[^A-Z^a-z^0-9]+/', $sep,\n preg_replace('/([a-z\\d])([A-Z])/','\\1_\\2',\n preg_replace('/([A-Z]+)([A-Z][a-z])/','\\1_\\2',$word)));\n return $strtolower ? strtolower($return) : $return;\n }", "function strip_bad_chars( $input ) {\n $output = preg_replace( \"/[^a-zA-Z0-9_-]/\", \"\", $input );\n return $output;\n }", "private function normalizeKey( $key ) {\n if( !is_string( $key ) && !is_int( $key ) )\n throw new \\InvalidArgumentException( 'Argument 1 passed to ' . __METHOD__ . ' must be an integer or a string, ' . gettype( $key ) . ' given' );\n else if( strlen( $key ) > 256 )\n throw new \\InvalidArgumentException( 'Maximum key length is 256 characters' );\n else if( strpos( $key, '=' ) !== FALSE )\n throw new \\InvalidArgumentException( 'Key may not contain the equals character' );\n\n return $key;\n }", "protected function format_key($key)\n {\n }", "private function ValidateFileName($key){\n return $this->prefix . preg_replace('/[^a-zA-Z0-9_.-]/', '_', basename($key)).'.cache';\n }", "function normalize($string, $underscored = true){\r\r\n\r\r\n\t$string = trim($string);\r\r\n\r\r\n\t$string = str_replace(\r\r\n\t\tarray('á', 'à', 'ä', 'â', 'ª', 'Á', 'À', 'Â', 'Ä'),\r\r\n\t\tarray('a', 'a', 'a', 'a', 'a', 'A', 'A', 'A', 'A'),\r\r\n\t\t$string\r\r\n\t);\r\r\n\r\r\n\t$string = str_replace(\r\r\n\t\tarray('é', 'è', 'ë', 'ê', 'É', 'È', 'Ê', 'Ë'),\r\r\n\t\tarray('e', 'e', 'e', 'e', 'E', 'E', 'E', 'E'),\r\r\n\t\t$string\r\r\n\t);\r\r\n \r\r\n\t$string = str_replace(\r\r\n\t\tarray('í', 'ì', 'ï', 'î', 'Í', 'Ì', 'Ï', 'Î'),\r\r\n\t\tarray('i', 'i', 'i', 'i', 'I', 'I', 'I', 'I'),\r\r\n\t\t$string\r\r\n\t);\r\r\n\r\r\n\t$string = str_replace(\r\r\n\t\tarray('ó', 'ò', 'ö', 'ô', 'Ó', 'Ò', 'Ö', 'Ô'),\r\r\n\t\tarray('o', 'o', 'o', 'o', 'O', 'O', 'O', 'O'),\r\r\n\t\t$string\r\r\n\t);\r\r\n\r\r\n\t$string = str_replace(\r\r\n\t\tarray('ú', 'ù', 'ü', 'û', 'Ú', 'Ù', 'Û', 'Ü'),\r\r\n\t\tarray('u', 'u', 'u', 'u', 'U', 'U', 'U', 'U'),\r\r\n\t\t$string\r\r\n\t);\r\r\n\r\r\n\t$string = str_replace(\r\r\n\t\tarray('ñ', 'Ñ', 'ç', 'Ç'),\r\r\n\t\tarray('n', 'N', 'c', 'C',),\r\r\n\t\t$string\r\r\n\t);\r\r\n \tif($underscored){\r\r\n \t\treturn str_replace(' ', '_', $string);\r\r\n \t}\r\r\n\treturn $string;\r\r\n}", "function make_fieldname_text($fieldname) {\n\t$fieldname=str_replace(\"_\", \" \",$fieldname);\n\t$fieldname=ucfirst($fieldname);\n\treturn $fieldname;\t\t\n}", "private function removeSpecialCharacters(string $table): string\n {\n return (string) preg_replace('/[^a-zA-Z0-9_]/', '_', $table);\n }", "function espacio_guion($dato) {\n $dato = str_replace(' ', '_', $dato);\n return $dato;\n}", "protected static final function unmung($thing) {\n\t\treturn lcfirst(preg_replace_callback('/_([a-z])/', function ($m) { return strtoupper($m[1]); }, $thing));\n\t}", "public function sanatize($name)\n {\n $specialChars = array (\"#\",\"$\",\"%\",\"^\",\"&\",\"*\",\"!\",\"~\",\"�\",\"\\\"\",\"�\",\"'\",\"=\",\"?\",\"/\",\"[\",\"]\",\"(\",\")\",\"|\",\"<\",\">\",\";\",\":\",\"\\\\\",\",\");\n return str_replace($specialChars, \"_\", $name);\n }" ]
[ "0.78319865", "0.763481", "0.7522966", "0.75154793", "0.7513388", "0.74508363", "0.7443278", "0.73540926", "0.7339959", "0.72198635", "0.7205389", "0.71277475", "0.708133", "0.7064286", "0.69064254", "0.6821983", "0.677941", "0.6736304", "0.67110133", "0.66038823", "0.6601618", "0.6594524", "0.65874624", "0.6586911", "0.6561655", "0.6515913", "0.64981186", "0.64634067", "0.6456407", "0.6401265", "0.63983953", "0.63895154", "0.63691413", "0.6336269", "0.63274163", "0.6319917", "0.62727153", "0.622036", "0.6208763", "0.6201626", "0.61900604", "0.6184773", "0.614122", "0.61290365", "0.610145", "0.60862786", "0.60841817", "0.6066499", "0.6048311", "0.60464776", "0.6038624", "0.6037474", "0.5998273", "0.59735274", "0.5953013", "0.59529716", "0.59492534", "0.59421504", "0.5917082", "0.59139836", "0.58925414", "0.58913326", "0.5876968", "0.58681697", "0.5863872", "0.5861688", "0.5853222", "0.5845015", "0.58409727", "0.58342606", "0.5824398", "0.58239836", "0.5822156", "0.58121467", "0.5811887", "0.5810263", "0.58018667", "0.58005047", "0.57916105", "0.5790291", "0.57890546", "0.5786907", "0.57790923", "0.5751889", "0.57320124", "0.5728311", "0.57205886", "0.57131714", "0.5704906", "0.57028043", "0.57008374", "0.5696297", "0.5695535", "0.5692123", "0.56914264", "0.56906897", "0.56892264", "0.5672031", "0.5655229", "0.56510574" ]
0.830038
0
Determine if we have sort kind of language in our repository
public function hasLanguage($lang) { return isset($this->langList[$lang]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasLanguage() : bool;", "protected function _getSortType() {}", "protected function _getSortType() {}", "public function hasLang() {\n return $this->_has(1);\n }", "abstract protected function _getSortType();", "public function hasLanguages() {\n return $this->_has(2);\n }", "public function hasLang() {\n return $this->_has(5);\n }", "function dp_supported_sort_types() {\n\t$types = array(\n\t\t'date' => array(\n\t\t\t'label' => __('Date', 'dp'),\n\t\t\t'title' => __('Sort by Date', 'dp')\n\t\t),\n\t\t'title' => array(\n\t\t\t'label' => __('Title', 'dp'),\n\t\t\t'title' => __('Sort by Title', 'dp')\n\t\t),\n\t\t'views' => array(\n\t\t\t'label' => __('Views', 'dp'),\n\t\t\t'title' => __('Sort by Views', 'dp')\n\t\t),\n\t\t'likes' => array(\n\t\t\t'label' => __('Likes', 'dp'),\n\t\t\t'title' => __('Sort by Likes', 'dp')\n\t\t),\n\t\t'comments' => array(\n\t\t\t'label' => __('Comments', 'dp'),\n\t\t\t'title' => __('Sort by Comments', 'dp')\n\t\t),\n\t\t'rand' => array(\n\t\t\t'label' => __('Random', 'dp'),\n\t\t\t'title' => __('Sort Randomly', 'dp')\n\t\t)\n\t);\n\t\t\t\t\n\treturn apply_filters('dp_supported_sort_types', $types);\n}", "public function has_language() {\r\n\t\treturn (is_lang($this->language));\r\n\t}", "function testLanguage()\r\n {\r\n\t\tglobal $webUrl, $SERVER, $DATABASE;\r\n\r\n // Locate the list page of language.\r\n\t\t$this->assertTrue($this->get(\"$webUrl/languages.php\", array(\r\n\t\t\t 'server' => $SERVER,\r\n\t\t\t\t\t\t'database' => $DATABASE,\r\n\t\t\t\t\t\t'subject' => 'database'))\r\n\t\t\t\t\t);\r\n\r\n $this->assertWantedPattern('/sql/');\r\n\r\n return TRUE;\r\n }", "public function hasSort() {\n return $this->_has(3);\n }", "function checkLanguage($lang) {\n\t\t$lang_path = sprintf('%s%2$s/%2$s.%%s.php', LANG_FOLDER, $lang);\n\t\t$test_path = sprintf($lang_path, defined('USER_ADMIN')? 'admin':'gallery');\n\t\treturn (empty($lang) || !is_readable($test_path))?\n\t\t\t\t false\n\t\t\t\t :\n\t\t\t\t $lang_path;\n\t}", "function sort_flag() {\n return SORT_STRING;\n }", "protected function checkIfLanguagesExist() {}", "protected function _autoLanguage() {\n\t\t$_detectableLanguages = CakeRequest::acceptLanguage();\n\t\tforeach ($_detectableLanguages as $langKey) {\n\t\t\tif (isset($this->_l10nCatalog[$langKey])) {\n\t\t\t\t$this->_setLanguage($langKey);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (strpos($langKey, '-') !== false) {\n\t\t\t\t$langKey = substr($langKey, 0, 2);\n\t\t\t\tif (isset($this->_l10nCatalog[$langKey])) {\n\t\t\t\t\t$this->_setLanguage($langKey);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function upgradePossible () {\n $locale = git::getTagsInstallLatest();\n $repo = conf::getModuleIni('system_repo');\n $remote = git::getTagsRemoteLatest($repo);\n if ($remote > $locale) {\n return true;\n }\n return false;\n }", "public function isTranslated();", "public function isSortByCode()\n {\n return ($this->getSortBy() == 'code') ? true : false;\n }", "public static function isSupportedLanguage() {\n\t\tglobal $wgLanguageCode;\n\n\t\t// \"Publishers are also not permitted to place AdSense code on pages\n\t\t// with content primarily in an unsupported language\"\n\t\t// @see https://www.google.com/adsense/support/bin/answer.py?answer=9727\n\t\t$supportedAdLanguages = [\n\t\t\t// Arabic -> Dutch (+some Chinese variants)\n\t\t\t'ar', 'bg', 'zh', 'zh-hans', 'zh-hant', 'hr', 'cs', 'da', 'nl',\n\t\t\t// English and its variants\n\t\t\t'en', 'en-gb', 'en-ca', 'en-x-piglatin',\n\t\t\t// Finnish -> Polish\n\t\t\t'fi', 'fr', 'de', 'el', 'he', 'hu', 'hu-formal', 'it', 'ja', 'ko', 'no', 'pl',\n\t\t\t// Portuguese -> Turkish\n\t\t\t'pt', 'pt-br', 'ro', 'ru', 'sr', 'sr-ec', 'sr-el', 'sk', 'es', 'sv', 'th', 'tr',\n\t\t\t// http://adsense.blogspot.com/2009/08/adsense-launched-in-lithuanian.html\n\t\t\t'lt', 'lv', 'uk',\n\t\t\t// Vietnamese http://adsense.blogspot.co.uk/2013/05/adsense-now-speaks-vietnamese.html\n\t\t\t'vi',\n\t\t\t// Slovenian & Estonian http://adsense.blogspot.co.uk/2012/06/adsense-now-available-for-websites-in.html\n\t\t\t'sl', 'et',\n\t\t\t// Indonesian http://adsense.blogspot.co.uk/2012/02/adsense-now-speaks-indonesian.html\n\t\t\t'id',\n\t\t\t// Languages added post 2013 -\n\t\t\t'bn', 'ca', 'tl', 'hi', 'ms', 'ml', 'mr', 'es-419', 'ta', 'te', 'ur',\n\t\t\t'gu', 'kn', 'ko-kp', 'pnb', 'pa'\n\t\t];\n\n\t\tif ( in_array( $wgLanguageCode, $supportedAdLanguages ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function _sf_is_sort_by($option) {\n\t\t\n\t\t$options = _sf_get_list_of_sort_options();\n\t\t\n\t\t//// GETS GET FIRST AND MAKES SUREITS A VALID OPTION\n\t\tif(isset($_GET['sort']) && in_array($_GET['sort'], $options)) {\n\t\t\t\n\t\t\t//// IF IT'S A VALID OPTION\n\t\t\tif(in_array($option, $options)) {\n\t\t\t\t\n\t\t\t\t//// IF ITS THE CURRENT ONE\n\t\t\t\tif($_GET['sort'] == $option) {\n\t\t\t\t\t\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\treturn false;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t//// IF ITS A VALID OPTION\n\t\t\tif(in_array($option, $options)) {\n\t\t\t\t\t\n\t\t\t\t//// CHECKS AGAINST COOKIE FIRST\n\t\t\t\tif(isset($_COOKIE['sort'])) {\n\t\t\t\t\t\n\t\t\t\t\tif($_COOKIE['sort'] == $option) {\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\treturn false;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t}", "public function getSortType(): ?string\n {\n return $this->sort;\n }", "function getSort(){ return 301; }", "private function referenceLanguageDifferentThanPostLanguage() {\n\t\treturn $this->getFieldLanguage() !== $this->getPostLanguage();\n\t}", "function compare_author($a, $b) \n{ \n if (($a[$GLOBALS['MYLANGFIELDS'][0]] == DEFAULTLANG) && ($b[$GLOBALS['MYLANGFIELDS'][0]] == DEFAULTLANG))\n return strnatcmp($a[$GLOBALS['MYFIELDS'][0]], $b[$GLOBALS['MYFIELDS'][0]]);\n if ($a[$GLOBALS['MYLANGFIELDS'][0]] == DEFAULTLANG)\n return 1;\n if ($b[$GLOBALS['MYLANGFIELDS'][0]] == DEFAULTLANG)\n return -1;\n \n return strcmp_from_utf8($a[$GLOBALS['MYFIELDS'][0]], $b[$GLOBALS['MYFIELDS'][0]]); \n}", "function check_language () {\n \n global $CONF;\n $supported_languages \t\t\t= array ('de', 'en');\n $lang_array \t\t\t\t\t\t= preg_split ('/(\\s*,\\s*)/', $_SERVER['HTTP_ACCEPT_LANGUAGE']);\n \n if (is_array ($lang_array)) {\n \n $lang_first \t\t\t\t\t= strtolower ((trim (strval ($lang_array[0]))));\n $lang_first \t\t\t\t\t= substr ($lang_first, 0, 2);\n \n if (in_array ($lang_first, $supported_languages)) {\n \n $lang \t\t\t\t\t\t= $lang_first;\n \n } else {\n \n $lang \t\t\t\t\t\t= $CONF['default_language'];\n \n }\n } else {\n \n $lang\t\t\t\t\t\t\t = $CONF['default_language'];\n \n }\n \n return $lang;\n}", "function getSort(){\n return 301;\n }", "function yourls_is_rtl() {\n\tglobal $yourls_locale_formats;\n\tif( !isset( $yourls_locale_formats ) )\n\t\t$yourls_locale_formats = new YOURLS_Locale_Formats();\n\n\treturn $yourls_locale_formats->is_rtl();\n}", "function checkLanguage($lang) {\n global $DIR_LANG;\n # important note that '\\' must be matched with '\\\\\\\\' in preg* expressions\n\n return file_exists($DIR_LANG . remove_all_directory_separator($lang) . '.php');\n}", "function GetCurrentSortType()\n\t{\n\t\tif (isset ( $this->m_externalParmas ['sorttype'] ))\n\t\t{\n\t\t\treturn $this->m_externalParmas ['sorttype'];\n\t\t}\n\t\t\n\t\t$sortType = $this->m_sortType;\n\t\tif (($sortTypeNew = DB::REQUEST ( \"sortType\" )))\n\t\t{\n\t\t\t$sortType = $sortTypeNew;\n\t\t}\n\t\t\n\t\treturn $sortType;\n\t}", "public static function isSyncronized()\n {\n $db = JFactory::getDbo();\n //#__osrs_tags\n $fields = array_keys($db->getTableColumns('#__osrs_tags'));\n $extraLanguages = self::getLanguages();\n if (count($extraLanguages)) {\n foreach ($extraLanguages as $extraLanguage) {\n $prefix = $extraLanguage->sef;\n if (!in_array('keyword_' . $prefix, $fields)) {\n return false;\n }\n }\n }\n\n //osrs_emails\n $fields = array_keys($db->getTableColumns('#__osrs_emails'));\n $extraLanguages = self::getLanguages();\n if (count($extraLanguages)) {\n foreach ($extraLanguages as $extraLanguage) {\n $prefix = $extraLanguage->sef;\n if (!in_array('email_title_' . $prefix, $fields)) {\n return false;\n }\n }\n }\n\n //osrs_categories\n $fields = array_keys($db->getTableColumns('#__osrs_categories'));\n $extraLanguages = self::getLanguages();\n if (count($extraLanguages)) {\n foreach ($extraLanguages as $extraLanguage) {\n $prefix = $extraLanguage->sef;\n if (!in_array('category_name_' . $prefix, $fields)) {\n return false;\n }\n }\n }\n\n //osrs_amenities\n $fields = array_keys($db->getTableColumns('#__osrs_amenities'));\n $extraLanguages = self::getLanguages();\n if (count($extraLanguages)) {\n foreach ($extraLanguages as $extraLanguage) {\n $prefix = $extraLanguage->sef;\n if (!in_array('amenities_' . $prefix, $fields)) {\n return false;\n }\n }\n }\n\n //osrs_fieldgroups\n $fields = array_keys($db->getTableColumns('#__osrs_fieldgroups'));\n $extraLanguages = self::getLanguages();\n if (count($extraLanguages)) {\n foreach ($extraLanguages as $extraLanguage) {\n $prefix = $extraLanguage->sef;\n if (!in_array('group_name_' . $prefix, $fields)) {\n return false;\n }\n }\n }\n\n\n //osrs_osrs_extra_fields\n $fields = array_keys($db->getTableColumns('#__osrs_extra_fields'));\n $extraLanguages = self::getLanguages();\n if (count($extraLanguages)) {\n foreach ($extraLanguages as $extraLanguage) {\n $prefix = $extraLanguage->sef;\n if (!in_array('field_label_' . $prefix, $fields)) {\n return false;\n }\n }\n }\n\n //osrs_extra_field_options\n $fields = array_keys($db->getTableColumns('#__osrs_extra_field_options'));\n $extraLanguages = self::getLanguages();\n if (count($extraLanguages)) {\n foreach ($extraLanguages as $extraLanguage) {\n $prefix = $extraLanguage->sef;\n if (!in_array('field_option_' . $prefix, $fields)) {\n return false;\n }\n }\n }\n\n //osrs_property_field_value\n $fields = array_keys($db->getTableColumns('#__osrs_property_field_value'));\n $extraLanguages = self::getLanguages();\n if (count($extraLanguages)) {\n foreach ($extraLanguages as $extraLanguage) {\n $prefix = $extraLanguage->sef;\n if (!in_array('value_' . $prefix, $fields)) {\n return false;\n }\n }\n }\n\n\n //osrs_types\n $fields = array_keys($db->getTableColumns('#__osrs_types'));\n $extraLanguages = self::getLanguages();\n if (count($extraLanguages)) {\n foreach ($extraLanguages as $extraLanguage) {\n $prefix = $extraLanguage->sef;\n if (!in_array('type_name_' . $prefix, $fields)) {\n return false;\n }\n }\n }\n\n //osrs_properties\n $fields = array_keys($db->getTableColumns('#__osrs_properties'));\n $extraLanguages = self::getLanguages();\n if (count($extraLanguages)) {\n foreach ($extraLanguages as $extraLanguage) {\n $prefix = $extraLanguage->sef;\n if (!in_array('pro_name_' . $prefix, $fields)) {\n return false;\n }\n\n\t\t\t\tif (!in_array('price_text_' . $prefix, $fields)) {\n return false;\n }\n\n if (!in_array('address_' . $prefix, $fields)) {\n return false;\n }\n if (!in_array('metadesc_' . $prefix, $fields)) {\n return false;\n }\n if (!in_array('metakey_' . $prefix, $fields)) {\n return false;\n }\n\t\t\t\tif (!in_array('pro_browser_title_' . $prefix, $fields)) {\n return false;\n }\n }\n }\n\n //osrs_agents\n $fields = array_keys($db->getTableColumns('#__osrs_agents'));\n $extraLanguages = self::getLanguages();\n if (count($extraLanguages)) {\n foreach ($extraLanguages as $extraLanguage) {\n $prefix = $extraLanguage->sef;\n if (!in_array('bio_' . $prefix, $fields)) {\n return false;\n }\n }\n }\n\n //osrs_companies\n $fields = array_keys($db->getTableColumns('#__osrs_companies'));\n $extraLanguages = self::getLanguages();\n if (count($extraLanguages)) {\n foreach ($extraLanguages as $extraLanguage) {\n $prefix = $extraLanguage->sef;\n if (!in_array('company_description_' . $prefix, $fields)) {\n return false;\n }\n }\n }\n\n //osrs_states\n $fields = array_keys($db->getTableColumns('#__osrs_states'));\n $extraLanguages = self::getLanguages();\n if (count($extraLanguages)) {\n foreach ($extraLanguages as $extraLanguage) {\n $prefix = $extraLanguage->sef;\n if (!in_array('state_name_' . $prefix, $fields)) {\n return false;\n }\n }\n }\n\n\n //osrs_cities\n $fields = array_keys($db->getTableColumns('#__osrs_cities'));\n $extraLanguages = self::getLanguages();\n if (count($extraLanguages)) {\n foreach ($extraLanguages as $extraLanguage) {\n $prefix = $extraLanguage->sef;\n if (!in_array('city_' . $prefix, $fields)) {\n return false;\n }\n }\n }\n\n\t\t//osrs_cities\n $fields = array_keys($db->getTableColumns('#__osrs_countries'));\n $extraLanguages = self::getLanguages();\n if (count($extraLanguages)) {\n foreach ($extraLanguages as $extraLanguage) {\n $prefix = $extraLanguage->sef;\n if (!in_array('country_name_' . $prefix, $fields)) {\n return false;\n }\n }\n }\n\n return true;\n }", "public function isSortById()\n {\n return ($this->getSortBy() == 'id') ? true : false;\n }", "final protected function get_language() {\n\t\tif (preg_match('/[a-z]{2}-[a-z]{2}/', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']), $matches))\n\t\t\treturn $matches[0];\n\t\treturn false;\n\t}", "public function supportsLanguageSwitch(): bool;", "function determine_locale()\n {\n }", "public function hasSort()\n {\n return isset($this->customSort);\n }", "function sort_field(&$object, $lang) {\n return null;\n }", "private static function checkLanguages()\n {\n $acceptLanguage = self::getAcceptLanguage();\n self::$languages = array();\n\n if (!empty($acceptLanguage)) {\n $httpLanguages = preg_split('/q=([\\d\\.]*)/', $acceptLanguage, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);\n\n $languages = array();\n $key = 0;\n foreach (array_reverse($httpLanguages) as $value) {\n $value = trim($value, ',; .');\n if (is_numeric($value)) {\n $key = $value;\n } else {\n $languages[$key] = explode(',', $value);\n }\n }\n krsort($languages);\n\n foreach ($languages as $value) {\n self::$languages = array_merge(self::$languages, $value);\n }\n }\n }", "function is_beng () {\r\n /**\r\n * @desc : Language Detection\r\n * @author : Sajid Muhaimin Choudhury\r\n * @since : February 15, 2009\r\n */\r\n if ($beng_date_options['use bangla'] == 1) \r\n return 1; //Enable this to output only Bengali Language\r\n //return 0; //Enable this to output only English Language\r\n\t//if ($beng_date_options['use bangla'] == 1) return 1;\r\n\t\r\n return ((strcmp(substr(get_bloginfo('language'), 0, 2), 'bn'))=='0') ;\r\n }", "private function get_sort_type($sort): int\n\t{\n\t\tif ($sort == -1 || $sort === FALSE || strtolower($sort) == 'desc')\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 1;\n\t\t}\n\t}", "public function hasSorting()\n {\n return ($this->sortBy !== '');\n }", "function is_published($item, $language, $cache) {\n $filename = $item['directory'].'-'.$language.'.md';\n $path = 'content/'.$item['directory'].'/'.$filename; // TODO: find a way to set the content/ in a dynamic way\n $result = (\n array_key_exists($path, $cache) && \n (\n !array_key_exists('published', $item) ||\n (is_bool($item['published']) && $item['published']) ||\n (is_array($item['published']) &&\n (\n !array_key_exists($language, $item['published']) ||\n $item['published'][$language]\n )\n )\n )\n );\n return $result;\n}", "public function getSort() { return ''; }", "function is_translatable()\n {\n }", "static private function DetectLanguage() {\n\t\tself::$language = substr(basename($_SERVER['REQUEST_URI']), 0, 2);\n\t\tif (self::$language != 'de' && self::$language != 'us') {\n\t\t\tself::$language = 'us';\n\t\t}\n\t}", "public function isSortedDesc()\n {\n return $this->sorting === Grid::SORT_DESC;\n }", "function lang()\n {\n global $CFG; \n $language = $CFG->item('language');\n \n $lang = array_search($language, $this->languages);\n if ($lang)\n {\n return $lang;\n }\n \n return NULL; // this should not happen\n }", "function is_locale_switched()\n {\n }", "public function hasLanguage()\n {\n return $this->language !== null;\n }", "public function getLanguage() {\n $fields = array('language' => array(\n 'languageHeader' => 'header',\n 'languageElement',\n ));\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), $fields);\n return (is_countable($result['language'][0]['languageElement']) && count($result['language'][0]['languageElement']) > 1) ? array() : $result;\n }", "public function languageCode()\n {\n $languageObject = $this->languageObject();\n return ( $languageObject !== false ) ? $languageObject->attribute( 'locale' ) : false;\n }", "function getValidSorts() {\n\treturn array(\n\t\t// field => label\n\t\t'-images.count' => 'Images (Most)',\n\t\t'images.count' => 'Images (Least)',\n\t\t'name' => 'Name (A-Z)',\n\t\t'-name' => 'Name (Z-A)',\n\t\t'parent.name' => 'City (A-Z)',\n\t\t'-parent.name' => 'City (Z-A)',\n\t\t'-height' => 'Height (Highest)',\n\t\t'height' => 'Height (Lowest)',\n\t\t'-floors' => 'Floors (Most)',\n\t\t'floors' => 'Floors (Least)',\n\t\t'-year' => 'Year (Newest)',\n\t\t'year' => 'Year (Oldest)',\n\t);\n}", "public function getLanguage() {}", "function languageISO()\r\n {\r\n if ( $this->LanguageISO != \"\" )\r\n return $this->LanguageISO;\r\n else\r\n return false;\r\n }", "protected function compareLanguages($lang1, $lang2)\n\t{\n\t\treturn strcmp($lang1->name, $lang2->name);\n\t}", "function lixlpixel_detect_lang()\n{\n lixlpixel_get_env_var('HTTP_ACCEPT_LANGUAGE');\n lixlpixel_get_env_var('HTTP_USER_AGENT');\n\n $_AL=strtolower($GLOBALS['HTTP_ACCEPT_LANGUAGE']);\n $_UA=strtolower($GLOBALS['HTTP_USER_AGENT']);\n\n // Try to detect Primary language if several languages are accepted.\n foreach($GLOBALS['_LANG'] as $K)\n {\n if(strpos($_AL, $K)===0)\n return $K;\n }\n \n // Try to detect any language if not yet detected.\n foreach($GLOBALS['_LANG'] as $K)\n {\n if(strpos($_AL, $K)!==false)\n return $K;\n }\n foreach($GLOBALS['_LANG'] as $K)\n {\n if(preg_match(\"//[\\[\\( ]{$K}[;,_\\-\\)]//\",$_UA))\n return $K;\n }\n\n // Return default language if language is not yet detected.\n return $GLOBALS['_DLANG'];\n}", "public function getLangFromHeader() {\n\t\t$arr = $this->getHttpHeader();\n\n\t\t// look through sorted list and use first one that matches our languages\n\t\tforeach ($arr as $lang => $val) {\n\t\t\t$lang = explode('-', $lang);\n\t\t\tif (in_array($lang[0], $this->arrLang)) {\n\t\t\t\treturn $lang[0];\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function getLang();", "function _checkLanguageExistence($language) {\n global $basePath;\n\n if (file_exists($basePath.DIRECTORY_SEPARATOR.'lang'.DIRECTORY_SEPARATOR.$language.'.lang.php')) {\n return true;\n } else {\n return false;\n }\n }", "public function languageWhere() {}", "public function languageWhere() {}", "public function hasLanguages()\n {\n return boolval($this->languages);\n }", "public function getSortingCode(): ?string;", "function resolveLanguageFromBrowser()\n {\n $ret = false;\n if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n $env = $_SERVER['HTTP_ACCEPT_LANGUAGE'];\n $aLangs = preg_split(\n ';[\\s,]+;',\n substr($env, 0, strpos($env . ';', ';')), -1,\n PREG_SPLIT_NO_EMPTY\n );\n foreach ($aLangs as $langCode) {\n $lang = $langCode . '-' . SGL_Translation::getFallbackCharset();\n if (SGL_Translation::isAllowedLanguage($lang)) {\n $ret = $lang;\n break;\n }\n }\n }\n return $ret;\n }", "function GetCurrentSort()\n\t{\n\t\tif (isset ( $this->m_externalParmas ['sortby'] ))\n\t\t{\n\t\t\treturn $this->m_externalParmas ['sortby'];\n\t\t}\n\t\t//From CMS\n\t\t$res = $this->m_sortBy;\n\t\t\n\t\tif (($newRes = DB::REQUEST ( \"sort{$this->m_linkIDName}\" )))\n\t\t{\n\t\t\t$res = $newRes;\n\t\t}\n\t\treturn $res;\n\t}", "private function _detectLanguage() {\n if (isset($_GET['language']) && is_file('lang/'. $_GET['language'] .'.lang.php'))\n return $_GET['language'];\n\n $session = PHPSession::getInstance();\n\n if (isset($session['language']))\n return $session['language'];\n\n return $this->_getWebBrowserLanguage();\n }", "function MyMod_Sort_Detect($group=\"\")\n {\n $sort=\"\";\n $reverse=$this->Reverse;\n\n if ($this->CGI_VarValue($this->ModuleName.\"_Sort\")!=\"\")\n {\n $sort=$this->CGI_VarValue($this->ModuleName.\"_Sort\");\n $reverse=$this->CGI_VarValue($this->ModuleName.\"_Reverse\");\n }\n\n if ($sort==\"\" && $group!=\"\")\n {\n if (!empty($this->ItemDataGroups[ $group ][ \"Sort\" ]))\n {\n $sort=$this->ItemDataGroups[ $group ][ \"Sort\" ];\n $reverse=$this->ItemDataGroups[ $group ][ \"Reverse\" ];\n }\n }\n\n if ($sort) { $this->MyMod_Sort_Add($sort); }\n\n $this->Reverse=$reverse;\n\n return array($sort,$reverse);\n }", "public function getOrderByAllowed(): string;", "function GetDirection() : string\n{\n return GetLanguage() == 'ar' ? 'rtl' : 'ltr';\n}", "public function matchLanguage()\n\t{\n\t\t$pattern = '/^(?P<primarytag>[a-zA-Z]{2,8})'.\n '(?:-(?P<subtag>[a-zA-Z]{2,8}))?(?:(?:;q=)'.\n '(?P<quantifier>\\d\\.\\d))?$/';\n\t\t\n\t\tforeach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $lang) \n\t\t{\n\t\t\t$splits = array();\n\n\t\t\tif (preg_match($pattern, $lang, $splits)) \n\t\t\t{\n\t\t\t\t$language = $splits['primarytag'];\n\t\t\t\tif(isset($this->languages[$language]))\n\t\t\t\t\treturn $language;\n\t\t\t} \n\t\t\telse \n\t\t\t\treturn 'en';\n\t\t}\n\t\t\n\t\treturn 'en';\n\t}", "public function language();", "public function language();", "function compare_title($a, $b) \n{ \n if (($a[$GLOBALS['MYLANGFIELDS'][1]] == DEFAULTLANG) && ($b[$GLOBALS['MYLANGFIELDS'][1]] == DEFAULTLANG))\n return strnatcmp($a[$GLOBALS['MYFIELDS'][1]], $b[$GLOBALS['MYFIELDS'][1]]);\n if ($a[$GLOBALS['MYLANGFIELDS'][1]] == DEFAULTLANG)\n return 1;\n if ($b[$GLOBALS['MYLANGFIELDS'][1]] == DEFAULTLANG)\n return -1;\n \n return strcmp_from_utf8($a[$GLOBALS['MYFIELDS'][1]], $b[$GLOBALS['MYFIELDS'][1]]); \n}", "function is_config_auto_lang() {\n\treturn conditional_config('auto_lang');\n}", "protected function getLanguages() {}", "static function includeSorting()\n {\n return false;\n }", "public function negotiateLanguage()\n {\n $matches = $this->getMatchesFromAcceptedLanguages();\n foreach ($matches as $key => $q) {\n\n $key = ($this->configRepository->get('laravellocalization.localesMapping')[$key]) ?? $key;\n\n if (!empty($this->supportedLanguages[$key])) {\n return $key;\n }\n\n if ($this->use_intl) {\n $key = Locale::canonicalize($key);\n }\n\n // Search for acceptable locale by 'regional' => 'af_ZA' or 'lang' => 'af-ZA' match.\n foreach ( $this->supportedLanguages as $key_supported => $locale ) {\n if ( (isset($locale['regional']) && $locale['regional'] == $key) || (isset($locale['lang']) && $locale['lang'] == $key) ) {\n return $key_supported;\n }\n }\n }\n // If any (i.e. \"*\") is acceptable, return the first supported format\n if (isset($matches['*'])) {\n reset($this->supportedLanguages);\n\n return key($this->supportedLanguages);\n }\n\n if ($this->use_intl && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n $http_accept_language = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);\n\n if (!empty($this->supportedLanguages[$http_accept_language])) {\n return $http_accept_language;\n }\n }\n\n if ($this->request->server('REMOTE_HOST')) {\n $remote_host = explode('.', $this->request->server('REMOTE_HOST'));\n $lang = strtolower(end($remote_host));\n\n if (!empty($this->supportedLanguages[$lang])) {\n return $lang;\n }\n }\n\n return $this->defaultLocale;\n }", "function guess_lang()\n\t{\n\n\t\t// The order here _is_ important, at least for major_minor matches.\n\t\t// Don't go moving these around without checking with me first - psoTFX\n\t\t$match_lang = array(\n\t\t\t'arabic'\t\t\t\t\t\t\t\t\t\t\t=> 'ar([_-][a-z]+)?',\n\t\t\t'bulgarian'\t\t\t\t\t\t\t\t\t\t=> 'bg',\n\t\t\t'catalan'\t\t\t\t\t\t\t\t\t\t\t=> 'ca',\n\t\t\t'czech'\t\t\t\t\t\t\t\t\t\t\t\t=> 'cs',\n\t\t\t'danish'\t\t\t\t\t\t\t\t\t\t\t=> 'da',\n\t\t\t'german'\t\t\t\t\t\t\t\t\t\t\t=> 'de([_-][a-z]+)?',\n\t\t\t'english'\t\t\t\t\t\t\t\t\t\t\t=> 'en([_-][a-z]+)?',\n\t\t\t'estonian'\t\t\t\t\t\t\t\t\t\t=> 'et',\n\t\t\t'finnish'\t\t\t\t\t\t\t\t\t\t\t=> 'fi',\n\t\t\t'french'\t\t\t\t\t\t\t\t\t\t\t=> 'fr([_-][a-z]+)?',\n\t\t\t'greek'\t\t\t\t\t\t\t\t\t\t\t\t=> 'el',\n\t\t\t'spanish_argentina'\t\t\t\t\t\t=> 'es[_-]ar',\n\t\t\t'spanish'\t\t\t\t\t\t\t\t\t\t\t=> 'es([_-][a-z]+)?',\n\t\t\t'gaelic'\t\t\t\t\t\t\t\t\t\t\t=> 'gd',\n\t\t\t'galego'\t\t\t\t\t\t\t\t\t\t\t=> 'gl',\n\t\t\t'gujarati'\t\t\t\t\t\t\t\t\t\t=> 'gu',\n\t\t\t'hebrew'\t\t\t\t\t\t\t\t\t\t\t=> 'he',\n\t\t\t'hindi'\t\t\t\t\t\t\t\t\t\t\t\t=> 'hi',\n\t\t\t'croatian'\t\t\t\t\t\t\t\t\t\t=> 'hr',\n\t\t\t'hungarian'\t\t\t\t\t\t\t\t\t\t=> 'hu',\n\t\t\t'icelandic'\t\t\t\t\t\t\t\t\t\t=> 'is',\n\t\t\t'indonesian'\t\t\t\t\t\t\t\t\t=> 'id([_-][a-z]+)?',\n\t\t\t'italian'\t\t\t\t\t\t\t\t\t\t\t=> 'it([_-][a-z]+)?',\n\t\t\t'japanese'\t\t\t\t\t\t\t\t\t\t=> 'ja([_-][a-z]+)?',\n\t\t\t'korean'\t\t\t\t\t\t\t\t\t\t\t=> 'ko([_-][a-z]+)?',\n\t\t\t'latvian'\t\t\t\t\t\t\t\t\t\t\t=> 'lv',\n\t\t\t'lithuanian'\t\t\t\t\t\t\t\t\t=> 'lt',\n\t\t\t'macedonian'\t\t\t\t\t\t\t\t\t=> 'mk',\n\t\t\t'dutch'\t\t\t\t\t\t\t\t\t\t\t\t=> 'nl([_-][a-z]+)?',\n\t\t\t'norwegian'\t\t\t\t\t\t\t\t\t\t=> 'no',\n\t\t\t'punjabi'\t\t\t\t\t\t\t\t\t\t\t=> 'pa',\n\t\t\t'polish'\t\t\t\t\t\t\t\t\t\t\t=> 'pl',\n\t\t\t'portuguese_brazil'\t\t\t\t\t\t=> 'pt[_-]br',\n\t\t\t'portuguese'\t\t\t\t\t\t\t\t\t=> 'pt([_-][a-z]+)?',\n\t\t\t'romanian'\t\t\t\t\t\t\t\t\t\t=> 'ro([_-][a-z]+)?',\n\t\t\t'russian'\t\t\t\t\t\t\t\t\t\t\t=> 'ru([_-][a-z]+)?',\n\t\t\t'slovenian'\t\t\t\t\t\t\t\t\t\t=> 'sl([_-][a-z]+)?',\n\t\t\t'albanian'\t\t\t\t\t\t\t\t\t\t=> 'sq',\n\t\t\t'serbian'\t\t\t\t\t\t\t\t\t\t\t=> 'sr([_-][a-z]+)?',\n\t\t\t'slovak'\t\t\t\t\t\t\t\t\t\t\t=> 'sv([_-][a-z]+)?',\n\t\t\t'swedish'\t\t\t\t\t\t\t\t\t\t\t=> 'sv([_-][a-z]+)?',\n\t\t\t'thai'\t\t\t\t\t\t\t\t\t\t\t\t=> 'th([_-][a-z]+)?',\n\t\t\t'turkish'\t\t\t\t\t\t\t\t\t\t\t=> 'tr([_-][a-z]+)?',\n\t\t\t'ukranian'\t\t\t\t\t\t\t\t\t\t=> 'uk([_-][a-z]+)?',\n\t\t\t'urdu'\t\t\t\t\t\t\t\t\t\t\t\t=> 'ur',\n\t\t\t'viatnamese'\t\t\t\t\t\t\t\t\t=> 'vi',\n\t\t\t'chinese_traditional_taiwan'\t=> 'zh[_-]tw',\n\t\t\t'chinese_simplified'\t\t\t\t\t=> 'zh',\n\t\t);\n\n\t\tif (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))\n\t\t{\n\t\t\t$accept_lang_ary = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);\n\t\t\tfor ($i = 0; $i < sizeof($accept_lang_ary); $i++)\n\t\t\t{\n\t\t\t\t@reset($match_lang);\n\t\t\t\twhile (list($lang, $match) = each($match_lang))\n\t\t\t\t{\n\t\t\t\t\tif (preg_match('#' . $match . '#i', trim($accept_lang_ary[$i])))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (@file_exists(@$this->ip_realpath('language/lang_' . $lang)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $lang;\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\treturn 'english';\n\t}", "public function test_get_supported_languages()\n {\n $ocr = new \\App\\Modules\\OCR\\OCR();\n\n $lang = $ocr->supportedLanguages();\n\n PHPUnit::assertContains(\n 'eng',\n $lang,\n );\n\n }", "public function GetSortType() { return $this->SortType; }", "public function isMultilingual()\n {\n return class_exists('Wl')\n && !empty($this->multilingual) && (null === $this->table || $this->table->isMultilingual());\n }", "public function get_language()\n {\n }", "public function getLanguage();", "public function getLanguage();", "public function getLanguage();", "public function getLanguage();", "public function getLanguage();", "public function getLanguage();", "public function negotiateLanguage()\n {\n $matches = $this->getMatchesFromAcceptedLanguages();\n foreach ($matches as $key => $q) {\n if (isset($this->getLocales()[$key])) {\n return $key;\n }\n }\n // If any (i.e. \"*\") is acceptable, return the default locale\n if (isset($matches['*'])) {\n return $this->getDefault();\n }\n\n if (class_exists('Locale') && !empty(\\Request::server('HTTP_ACCEPT_LANGUAGE'))) {\n $http_accept_language = Locale::acceptFromHttp(\\Request::server('HTTP_ACCEPT_LANGUAGE'));\n\n if (isset($this->getLocales()[$http_accept_language])) {\n return $http_accept_language;\n }\n }\n\n if (\\Request::server('REMOTE_HOST')) {\n $remote_host = explode('.', \\Request::server('REMOTE_HOST'));\n $lang = strtolower(end($remote_host));\n\n if (isset($this->getLocales()[$lang])) {\n return $lang;\n }\n }\n\n return $this->getDefault();\n }", "function get_languages(){\n\t\t$dir = APPPATH.\"language/\";\n\t\t$dh = opendir($dir);\n\t\t$i=0;\n\t\twhile (false !== ($filename = readdir($dh))) {\n\t\t\tif($filename!=='.' && $filename!=='..' && is_dir($dir.$filename)){\n\t\t\t\t$files[$i]['dir'] = $filename;\n\t\t\t\t$files[$i]['count']=$this->get_count_lfiles($filename);\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\treturn (!empty($files))?$files:FALSE;\n\t}", "public function shouldSortWhenCreating(): string\n {\n return $this->sortable['sort_when_creating'] ?? config('laravel-sortable.sort_when_creating', 'end');\n }", "function check_rtl()\n {\n $current_lang = strtolower($this->config->item('language'));\n if (in_array($current_lang, $this->rtl_langs)) \n $this->is_rtl = TRUE;\n\n return true;\n }", "function languageDetect()\n {\n global $iConfig;\n\n $langs = array();\n\n if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))\n {\n\n preg_match_all('/([a-z]{1,8}(-[a-z]{1,8})?)\\s*(;\\s*q\\s*=\\s*(1|0\\.[0-9]+))?/', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $lang_parse); // break up string into pieces (languages and q factors)\n\n if (count($lang_parse[1]))\n {\n// $langs = array_combine($lang_parse[1], $lang_parse[4]); // create a list like \"en\" => 0.8 // PHP5 only\n foreach ($lang_parse[1] as $k => $v) $langs[$v] = $lang_parse[4][$k]; // replace \"array_combine\" for PHP4\n\n foreach ($langs as $lang => $val) {\n if ($val === '') $langs[$lang] = 1; // set default to 1 for any without q factor\n }\n arsort($langs, SORT_NUMERIC); // sort list based on value\n }\n }\n\n foreach ($langs as $lang => $val)\n {\n $lang_2s = substr($lang, 0,2);\n $path = sprintf('language/%s_lang.php', $lang_2s);\n if (file_exists($path)) return $lang_2s;\n }\n\n return $iConfig['default_lng'];\n }", "private function detectLanguage()\n {\n $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\n\n switch (mb_strtolower($lang)) {\n case 'ru':\n return 'russian';\n\n default:\n return 'english';\n }\n }", "public function providesForLanguage($langCode)\r\n {\r\n return substr($langCode, 0, 2) == 'en';\r\n }", "static public function isGerman() {\n\t\treturn (self::$language === 'de');\n\t}", "public function isAllLangs()\n\t{\n\t\treturn $this->useAllLangs;\n\t}", "function getDefaultLocalesOrder();", "public function getAllowedLanguages() {}", "abstract public function get_app_language();", "private function localise_langOl()\n {\n $boolOlPrefix = $this->pObj->objLocalise->conf_localisation[ 'TCA.' ][ 'value.' ][ 'langPrefix' ];\n\n switch ( $boolOlPrefix )\n {\n case( true ):\n $this->localise_langOlWiPrefix();\n $this->localise_langOlOrderBy();\n break;\n case( false ):\n default:\n $this->localise_langOlWoPrefix();\n break;\n }\n }", "public function get_desired_languages();" ]
[ "0.6430444", "0.6182204", "0.6182204", "0.61541563", "0.611528", "0.61069113", "0.60801303", "0.6009279", "0.5887657", "0.5882257", "0.5844884", "0.57931894", "0.57559663", "0.5735195", "0.5690353", "0.56764334", "0.56691086", "0.56581265", "0.5637068", "0.5600742", "0.5598608", "0.5589357", "0.55704737", "0.5552466", "0.5551545", "0.54894394", "0.5463887", "0.54461145", "0.54395473", "0.54379827", "0.5437593", "0.5425761", "0.5407335", "0.53897375", "0.53840035", "0.53736776", "0.53615034", "0.5360514", "0.5360453", "0.5356888", "0.53454727", "0.5340568", "0.5325109", "0.53200316", "0.5315606", "0.5315132", "0.5305017", "0.53041214", "0.53022593", "0.53012407", "0.5294498", "0.52942216", "0.5286741", "0.52825606", "0.52817065", "0.52810276", "0.527805", "0.5273447", "0.52710307", "0.52710307", "0.52554274", "0.5252599", "0.52471554", "0.523925", "0.5231432", "0.5230162", "0.52193063", "0.5208115", "0.51970434", "0.5196706", "0.5196706", "0.5195024", "0.51916575", "0.51902246", "0.5189398", "0.5187886", "0.5183171", "0.51828086", "0.5179606", "0.5172812", "0.51711017", "0.51663756", "0.51663756", "0.51663756", "0.51663756", "0.51663756", "0.51663756", "0.5162657", "0.5162281", "0.51585144", "0.5153632", "0.515267", "0.51497585", "0.5129364", "0.5128234", "0.5127034", "0.5123741", "0.5119094", "0.51156217", "0.5115451", "0.51149446" ]
0.0
-1
Find out if we are running in debug mode
protected function isDebugMode() { return ($this->config['debug'] === true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isDebug();", "public function isDebug();", "public function get_test_is_in_debug_mode()\n {\n }", "public function isDebug()\n {\n }", "public static function isDebug(): bool\n {\n return !empty(getenv('DEBUG'));\n }", "public final function isDebugEnabled()\n {\n return getenv('TEST') === 'true';\n }", "public function isDebugMode() {\n return $this->options['debug'];\n }", "public function checkDebugMode(): bool\n {\n return Config::get('app.debug', false);\n }", "public function isDebugOn()\n {\n return $this->debug;\n }", "public function isDebugMode()\n {\n return (boolean)env('APP_DEBUG');\n }", "public function isInDebugMode()\n {\n return $this->debugMode === true;\n }", "public static function debug()\n {\n return self::getBool('DEBUG');\n }", "public static function isDebugContext()\r\n\t{\r\n\t\treturn ( SETTINGS_DEBUG_MODE && self::isLocalContext() );\r\n\t}", "public static function isDebug() \n {\n if (array_key_exists(self::APPLICATION_ENV_KEY, $_SERVER))\n {\n return strtolower($_SERVER[self::APPLICATION_ENV_KEY]) == self::DEV_ENV_VALUE;\n }\n }", "public function isDebug()\n {\n return $this->_debug_mode;\n }", "public function isDebug()\n {\n return $this->debug;\n }", "public function isDebug()\n {\n return $this->debug;\n }", "function parcelcheckout_getDebugMode()\n\t{\n\t\tif(is_file(dirname(__FILE__) . '/debug.php'))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "protected function getDebugMode(): bool\n {\n return (bool)getenv('STAIRTOWER_TEST_DEBUG_MODE');\n }", "public function isDebug()\n {\n return $this->decoratedOutput->isDebug();\n }", "public function isDebugModeOn(){\n return( $this->debugMode === true );\n }", "public function isDebug() {\n return (bool) $this->getValue('debug');\n }", "public function isDebugMode()\n\t{\n\t\t$val =$this->getConfigValue('debug');\n\t\t\n\t\treturn !empty($val);\n\t}", "public static function isDebugMode(): bool\n {\n return (defined('SPLASH_DEBUG') && !empty(SPLASH_DEBUG));\n }", "public function debugMode()\n {\n return $this->settings['debug'];\n }", "public function isAllowDebugMode()\n {\n return $this->allowDebugMode;\n }", "public function get_debug_flag()\n {\n }", "public function is_debug_enabled() {\n\t\treturn $this->debug_enabled;\n\t}", "public function isDebugEnabled()\n\t{\n\t\treturn $this->is_debug_enabled;\n\t}", "function is_debug(): bool\n{\n return 1 === PHP_DEBUG;\n}", "public function check_debug_mode(): bool {\n\t\tif ( defined( 'YIKES_DEBUG_ENABLED' ) && true === YIKES_DEBUG_ENABLED ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function has_debug_constant() {\n\t\treturn defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ? true : false;\n\t}", "public function isDebug()\n {\n return (bool) (parent::isDebug()\n || $this->get('isDebug'));\n }", "public function isDebugEnabled()\n {\n return $this->_debugModeEnabled;\n }", "public function isDebugModeEnabled()\n {\n return $this->boolValue('trace.debug', false);\n }", "public function getDebugMode() : bool\n {\n return $this->debugMode;\n }", "public static function debug() : bool\n {\n }", "public function isModDebug() {\n if(isset($this->_instances['debug']) && !is_null($this->_instances['debug']))\n return true;\n return false;\n }", "public function enableDebugMode() {}", "public function debugger(): bool\n {\n return (bool)$this->getNestedProperty('header.debugger', true);\n }", "public function getDebugMode() {\n return $this->debugMode;\n }", "public function getDebug()\n {\n return $this->scopeConfig->isSetFlag(self::XML_PATH_DEBUG, ScopeInterface::SCOPE_STORE);\n }", "public static function log_debug_is_enabled() {\n\t\treturn defined( 'SIMPLE_HISTORY_LOG_DEBUG' ) && \\SIMPLE_HISTORY_LOG_DEBUG;\n\t}", "function test_debug( ) {\n\tif ( ! isset($_GET['DEBUG'])) {\n\t\treturn false;\n\t}\n\n\tif ( ! class_exists('Settings') || ! Settings::test( )) {\n\t\treturn false;\n\t}\n\n\tif ('' == trim(Settings::read('debug_pass'))) {\n\t\treturn false;\n\t}\n\n\tif (0 !== strcmp($_GET['DEBUG'], Settings::read('debug_pass'))) {\n\t\treturn false;\n\t}\n\n\t$GLOBALS['_&_DEBUG_QUERY'] = '&DEBUG='.$_GET['DEBUG'];\n\t$GLOBALS['_?_DEBUG_QUERY'] = '?DEBUG='.$_GET['DEBUG'];\n\treturn true;\n}", "private function isDev()\n {\n $is_localhost = (@$_SERVER['HTTP_HOST'] == 'localhost');\n $is_dev_server = (isset($GLOBALS['is_development_server']) && $GLOBALS['is_development_server'] == '1');\n $debug_enabled = $this->getSystemSetting('enable-js-debug-logging');\n $is_dev = ($is_localhost || $is_dev_server || $debug_enabled) ? 1 : 0;\n return $is_dev;\n }", "public function enableDebug();", "function debugMode($str = '')\n {\n\n if (strlen($str) == 0)\n {\n $d = false;\n }\n else if (strtolower(substr($str, 0, 7)) == '[debug]')\n {\n $d = true;\n }\n else\n {\n $d = false;\n }\n return $d;\n }", "public function getDebugMode()\n {\n return $this->getSettingArray()[\"debug_mode\"];\n }", "public function debugMode($debug) {\n if ((bool)$debug === TRUE) {\n // Debug output via drush_print can only be turned on if we are in\n // a drush call\n if (function_exists('drush_print') && function_exists('drush_get_option')) {\n $this->debug = $debug;\n }\n }\n return $this->debug;\n }", "public function debugMode($debug) {\n if (is_bool(($debug))) {\n if ($debug) {\n // Debug output via drush_print can only be turned on if we are in\n // a drush call\n if (function_exists('drush_print') && function_exists('drush_get_option')) {\n $this->debug = $debug;\n }\n }\n }\n return $this->debug;\n }", "public function enableDebug() {}", "function isDebug()\n {\n $this->methodExpectsRequest(__METHOD__);\n return $this->getRequest()->isDebug();\n }", "function _is_development_mode() {\n\t\treturn IMFORZA_Utils::is_development_mode();\n\t}", "function cg_debug() {\n\t# only run debug on localhost\n\tif ($_SERVER[\"HTTP_HOST\"]==\"localhost\" && defined('EPS_DEBUG') && EPS_DEBUG==true) return true;\n}", "function is_dev() {\n return env() === 'development';\n}", "public function isDevMode(): bool\n {\n return $this->devMode;\n }", "public function isDev(): bool;", "protected function _isDebugMode()\n {\n if ($this->_debugMode === null) {\n $this->_debugMode = (bool) $this->_getDataHelper()->isDebugModeEnabled();\n }\n return $this->_debugMode;\n }", "public static function isDevMode()\n\t{\n\t\treturn self::$app_mode === self::MODE_DEVELOPMENT;\n\t}", "function setDebug(){\n if(isset($_GET['debug']) && $_GET['debug']==\"true\"){\n return true;\n }\n return false;\n }", "public static function is_development_mode() {\n\t\t\t$development_mode = false;\n\t\t\tif ( defined( 'IMFORZA_DEBUG' ) ) {\n\t\t\t\t$development_mode = IMFORZA_DEBUG;\n\t\t\t} elseif ( site_url() && false === strpos( site_url(), '.' ) ) {\n\t\t\t\t$development_mode = true;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filter the imforza development mode.\n\t\t\t *\n\t\t\t * @param bool $development_mode Is imforza development mode active.\n\t\t\t */\n\t\t\treturn apply_filters( 'imforza_development_mode', $development_mode );\n\t\t}", "public static function getDebug() {\n\t\treturn self::$_debug;\n\t}", "public function isDev()\n {\n return ($this->_environment === 'development');\n }", "function GetDebug() {\n global $config, $_SESSION;\n static $debug_on;\n if (is_bool($debug_on)) {\n\n return $debug_on;\n }\n $debug_on = false;\n $debugSession = isset($_SESSION[$config['admin_debug_name']]) ? $_SESSION[$config['admin_debug_name']] : null;\n $debugGet = isset($_GET[$config['admin_debug_name']]) ? $_GET[$config['admin_debug_name']] : null;\n $debugKey = $config['admin_debug_key'];\n\n if (isset($debugSession) && $debugSession === $debugKey && !isset($debugGet))\n $debug_on = true;\n else\n if (isset($debugGet))\n if ($debugGet === $debugKey)\n $debug_on = true;\n else if ($debugGet === $debugKey)\n $debug_on = false;\n if ($debug_on)\n $_SESSION[$config['admin_debug_name']] = $debugKey;\n else\n unset($_SESSION[$config['admin_debug_name']]);\n return $debug_on;\n}", "function wp_is_development_mode($mode)\n {\n }", "public function getDebug();", "public function isMeaningful(): bool\n {\n return WP_DEBUG && WP_DEBUG_LOG;\n }", "public function testIsDebugMode()\n {\n $oControl = $this->getProxyClass(\"oxShopControl\");\n $oConfigFile = oxRegistry::get('oxConfigFile');\n\n $oConfigFile->iDebug = -1;\n $this->assertTrue($oControl->UNITisDebugMode());\n\n $oConfigFile->iDebug = 0;\n $this->assertFalse($oControl->UNITisDebugMode());\n }", "final protected static function canRun() : bool\n\t{\n\t\t$bCanRun = false;\n\n\t\t/*<!-- build:debug -->*/\n\t\t$bCanRun = parent::canRun();\n\n\t\tif ($bCanRun) {\n\t\t\t// Only when debugmode is set\n\t\t\t$aeSettings = \\MarkNotes\\Settings::getInstance();\n\t\t\t$bCanRun = $aeSettings->getDebugMode();\n\t\t}\n\t\t/*<!-- endbuild -->*/\n\n\t\treturn $bCanRun;\n\t}", "public function isDebugEnabled() {\n if ($this->getLevel() <= Logger::DEBUG) {\n return true;\n }\n return false;\n }", "public function isDevelopment() {}", "function is_dev(){\n return ENVIRONMENT == 'development';\n}", "function isDev(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_DEV; }", "public static function isDev()\n {\n return isset($_SERVER['ENV']) && $_SERVER['ENV'] == 'dev';\n }", "public static function isXdebugEnabled()\n {\n return (function_exists('xdebug_is_enabled')) ? xdebug_is_enabled() : false;\n }", "public function getDebug()\n\t{\n\t\treturn $this->debug;\n\t}", "static public function isTranslateDebugMode()\r\n {\r\n if ( null === self::$translateDebugMode ) {\r\n /**\r\n * TODO Load settings from config file\r\n */\r\n self::$translateDebugMode = ( 'on' == Warecorp_Config_Loader::getInstance()->getAppConfig('cfg.translate.xml')->translate->TranslateDebugMode ) ? true : false;\r\n }\r\n return (bool) self::$translateDebugMode;\r\n }", "function bimber_shares_debug_mode_enabled() {\n\t$enabled = 'standard' === bimber_get_theme_option( 'shares', 'debug_mode' );\n\n\treturn apply_filters( 'bimber_shares_debug_mode_enabled', $enabled );\n}", "public function GetDebug () \r\n\t{\r\n\t\treturn (self::$debug);\r\n\t}", "public function GetDebug () \r\n\t{\r\n\t\treturn (self::$debug);\r\n\t}", "function wp_get_development_mode()\n {\n }", "public function inDevelopment() {\n try {\n return Config::get()->environment === 'dev';\n } catch (Throwable $e) {\n return false;\n }\n }", "public function debug();", "public function debug();", "function DebugMode ( $bDebugMode=null )\n{\n if ( isset($bDebugMode) ) {\n $this->_DebugMode = $bDebugMode;\n return true;\n } else {\n return $this->_DebugMode;\n }\n}", "function debugOn()\n\t{\n\t\t$this->bDebug = true;\n\t}", "public function getDebug()\n {\n return $this->debug;\n }", "public function getDebug()\n {\n return $this->debug;\n }", "public function getDebug()\n {\n return $this->debug;\n }", "public function getDebug()\n {\n return $this->debug;\n }", "public function getDebug()\n {\n return $this->debug;\n }", "public function getDebug()\n {\n return $this->debug;\n }", "public function getDebug()\n {\n return $this->debug;\n }", "public function is_development_environment()\n {\n }", "public static function is_development()\n {\n return Kohana::$environment == Kohana::DEVELOPMENT;\n }", "private function is_debug_on( $path ) {\n\t\t$config = file( $path );\n\t\t$pattern = \"/^define\\(\\s*('|\\\")WP_DEBUG('|\\\"),\\s*true\\s*\\)/\";\n\t\tforeach ( $config as $key => $line ) {\n\t\t\t$line = trim( $line );\n\t\t\tif ( preg_match( $pattern, $line ) ) {\n\t\t\t\treturn $key;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function debug()\n {\n return $this -> debug;\n }", "protected function checkDebugOption() {\n global $argv;\n \n if (!empty($argv[1]) && $argv[1] === 'debug') {\n $this->setDebug(true);\n }\n else {\n $this->setDebug(false);\n }\n }", "function Debug($debug, $msg = \"Debugging\"){\n\tif(ENV == PRODUCTION && (!isset($_GET['debug'])) ){\n\t\treturn;\n\t}\n\n\techo '<pre class=\"debug\">';\n\techo '<h2>'.$msg.'</h2>';\n\tprint_r($debug);\n\techo '</pre>';\n}", "public function is_enabled() {\n\n\t\t// Check if debug is on\n\t\tif ( 'on' === $this->settings->get_option( 'debug' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}" ]
[ "0.87121755", "0.87121755", "0.85191625", "0.84699345", "0.8452304", "0.83404374", "0.8243965", "0.82243276", "0.8188247", "0.81654274", "0.8165049", "0.8157259", "0.814772", "0.8131445", "0.8123993", "0.8076107", "0.8076107", "0.80701536", "0.8030901", "0.80272955", "0.80133474", "0.79906356", "0.7976723", "0.79640895", "0.78482884", "0.7828838", "0.78262305", "0.77868956", "0.7779572", "0.7755723", "0.7688427", "0.76739496", "0.7669034", "0.76524734", "0.764472", "0.7635708", "0.760792", "0.7591579", "0.74514604", "0.74266636", "0.74109036", "0.74015456", "0.73790646", "0.7320162", "0.728767", "0.72851473", "0.7282102", "0.7271278", "0.72654605", "0.7246435", "0.72447854", "0.7236845", "0.72332394", "0.7194058", "0.71929973", "0.7189504", "0.7130354", "0.7124115", "0.7028026", "0.70249695", "0.70006424", "0.69828546", "0.6960584", "0.69574547", "0.69520587", "0.69494474", "0.6944491", "0.69422233", "0.69157463", "0.69125164", "0.69032794", "0.6898793", "0.6884537", "0.6882624", "0.6878349", "0.682719", "0.6817801", "0.68130213", "0.68042755", "0.68042755", "0.6780189", "0.6770973", "0.67597", "0.67597", "0.67578757", "0.6745333", "0.6745175", "0.6745175", "0.6745175", "0.6745175", "0.6745175", "0.6745175", "0.6745175", "0.67416954", "0.6724269", "0.6707886", "0.66867113", "0.66548073", "0.66448706", "0.66437787" ]
0.8123166
15
Get line in dot notation
protected function arrayGet($key, $default = null) { if (isset($this->list[$key])) { return $this->list[$key]; } foreach (explode('.', $key) as $segment) { if (! is_array($this->list) || ! array_key_exists($segment, $this->list)) { return value($default); } $this->list = $this->list[$segment]; } return $this->list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLine()\n {\n return $this->get(self::_LINE);\n }", "public function getLine() {\n return $this->parse()['line'];\n }", "public function getLine() {\n return $this->line;\n }", "public function getDot($key) {\n\t\treturn self::_getDot($key, $this); \n\t}", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "function getLine(){\n return $this->line;\n }", "public function getLeaderLineExtension() {}", "public function getLine() {\n\t\treturn $this->line;\n\t}", "public function getLine()\n {\n return $this->data[2];\n }", "public function get_line()\n {\n return $this->line;\n }", "public function getDotIndex(): int\n {\n return $this->dotIndex;\n }", "public function getLine()\n\t{\n\t\treturn $this->line;\n\t}", "public function getLine() {\r\n return $this->node->getLine();\r\n }", "public function getLine($line);", "public function getLineInfo() {\n return $this->get(self::LINE_INFO);\n }", "protected function get_line() { \n\t\t$line = $this->lines[$this->cursor]; \n\t\t$this->cursor++; return $line; \n\t}", "public function getLineName(): string\n {\n return $this->lineName;\n }", "public function getLineRef()\n {\n return $this->lineRef;\n }", "public function getLine();", "public function getLine();", "public function getLine();", "public function getLine();", "public function getLine()\n\t{\n\t\treturn $this->token->line;\n\t}", "public function getLinea()\n {\n return $this->linea;\n }", "public function getLineA();", "public function __toString() {\n\t\treturn join(\"\\n\", $this->dot_source).'}';\n\t}", "public function getLeaderLineOffset() {}", "final public function getLine()\n {\n return 25;\n }", "public function getLine(): array\n {\n \\Logger::getLogger(\\get_class($this))\n ->info(\n \\sprintf(\n __METHOD__.\" get stack with '%s' elements\",\n \\count($this->line)\n )\n );\n return $this->line;\n }", "public function getLineNote()\n {\n return $this->lineNote;\n }", "public function getLine1()\n {\n return (string) $this->json()->line1;\n }", "public function fnReadToken_dot() \n {\n $iNext = Utilities::fnGetCharCodeAt($this->sInput, $this->iPos + 1);\n if ($iNext >= 48 && $iNext <= 57) \n return $this->fnReadNumber(true);\n \n $iNext2 = Utilities::fnGetCharCodeAt($this->sInput, $this->iPos + 2);\n if ($this->aOptions['ecmaVersion'] >= 6 && $iNext == 46 && $iNext2 == 46) { // 46 = dot '.'\n $this->iPos += 3;\n return $this->fnFinishToken(TokenTypes::$aTypes['ellipsis']);\n } else {\n ++$this->iPos;\n return $this->fnFinishToken(TokenTypes::$aTypes['dot']);\n }\n }", "public function getStartLine() {\n if ( $this->reflectionSource instanceof ReflectionFunction ) {\n return $this->reflectionSource->getStartLine();\n } else {\n return parent::getStartLine();\n }\n }", "public function getLine(): int\n {\n return $this->line;\n }", "public function getLine(): int\n {\n return $this->line;\n }", "public function __toString(): string\n {\n return $this->line();\n }", "public function getLeaderLine() {}", "function getLine()\r\n {\r\n\t\t\tdo\r\n\t\t\t{\r\n\t\t\t\t$sLine = trim($this->referString[$this->currentLine]);\r\n\t\t\t\t$this->currentLine++;\r\n\t\t\t} while ($this->currentLine < count($this->referString) && !$sLine);\r\n\t\t\treturn $sLine;\r\n }", "public function getLineCharacter(): string\n {\n return $this->lineCharacter;\n }", "public function getLine4()\n {\n return (string) $this->json()->line4;\n }", "static function getExpectationLine() {\n $trace = new SimpleStackTrace(array('expect'));\n return $trace->traceMethod();\n }", "final function getLine();", "public function getLine(): int\n {\n return $this->node->start_lineno;\n }", "public function getLine3()\n {\n return (string) $this->json()->line3;\n }", "public function getLineNumber();", "public function getLineNumber();", "public function getLine2()\n {\n return (string) $this->json()->line2;\n }", "static function getLine($file,$line){\n\t\tif($file){\n\t\t\t$f = file($file);\n\t\t\t$code = substr($f[$line-1],0,-1);\n\t\t\treturn preg_replace('@^\\s*@','',$code);\n\t\t}\n\t}", "protected function getDots()\n {\n return $this->getDisabledLink($this->dotsText);\n }", "public function getStartLine(): int\n {\n return $this->node->getAttribute('startLine');\n }", "public static function dotted($word)\n {\n return str_replace('\\\\','.',self::lower($word));\n }", "public function getLine():int {\n\t\t\treturn $this->line;\n\t\t}", "public function getCalloutLine() {}", "public function getLine(int $line){\n return $this->file[$line] ?? \"\";\n }", "protected function getLineHeader($line) {\n\t\treturn Billrun_Factory::db()->logCollection()->query(array('header.stamp' => $line['log_stamp']))->cursor()->current();\n\t}", "public function getTagline(){\r\n\t\t\treturn $this->tagline;\r\n\t\t}", "function array_dot_get(array $array, $key) {\n\tif(strpos($key, '.') === false)\n\t\treturn $array[$key];\n\n\t$target = &$array;\n\t$keys = explode('.', $key);\n\tforeach($keys as $curKey) {\n\t\tif(!array_key_exists($curKey, $target))\n\t\t\treturn null;\n\t\t$target = &$target[$curKey];\n\t}\n\n\treturn $target;\n}", "public function getMiAttribute($value)\n {\n $dotted = '';\n for ($i = 0; $i < strlen($value); $i++) {\n $dotted .= substr($value, $i, 1) . '.';\n }\n return $dotted;\n }", "public function getLine5()\n {\n return (string) $this->json()->line5;\n }", "public function currentLine();", "public function getLine($lineNumber);", "public function getTypoLineGap() {}", "public function line($text) { return $this->l($text); }", "public function getLineNameArray() {\n return $this->line_name;\n }", "public function getLineTax()\n\t{\n\t\treturn $this->getKeyValue('line_tax'); \n\n\t}", "public function getEndLine() {\n if ( $this->reflectionSource instanceof ReflectionFunction ) {\n return $this->reflectionSource->getEndLine();\n } else {\n return parent::getEndLine();\n }\n }", "public function getStartLine(): int\n {\n return $this->node->getStartLine();\n }", "public function getLine(int $index) : string\n {\n return isset($this->lines[$index]) ? $this->lines[$index] : '';\n }", "public static function get($index)\n {\n return self::getInstance()->dotNotation->get($index);\n }", "function getLineHeight() { return $this->_lineheight; }", "public function testLineIntrospection() {\n\t\t$backup = error_reporting();\n\t\terror_reporting(E_ALL);\n\n\t\t$result = Inspector::lines(__FILE__, [__LINE__ - 4]);\n\t\t$expected = [__LINE__ - 5 => \"\\tpublic function testLineIntrospection() {\"];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$result = Inspector::lines(__CLASS__, [18]);\n\t\t$expected = [18 => 'class InspectorTest extends \\lithium\\test\\Unit {'];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$lines = 'This is the first line.' . PHP_EOL . 'And this the second.';\n\t\t$result = Inspector::lines($lines, [2]);\n\t\t$expected = [2 => 'And this the second.'];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$this->assertException('/(Missing argument 2|Too few arguments.*1 passed.*2 expected)/', function() {\n\t\t\tInspector::lines('lithium\\core\\Foo');\n\t\t});\n\t\t$this->assertNull(Inspector::lines(__CLASS__, []));\n\n\t\terror_reporting($backup);\n\t}", "public function getStartLine()\n\t{\n\t\treturn $this->startLine;\n\t}", "public static function _getDot($key, Wire $from) {\n\t\t$key = trim($key, '.');\n\t\tif(strpos($key, '.')) {\n\t\t\t// dot present\n\t\t\t$keys = explode('.', $key); // convert to array\n\t\t\t$key = array_shift($keys); // get first item\n\t\t} else {\n\t\t\t// dot not present\n\t\t\t$keys = array();\n\t\t}\n\t\tif($from->wire($key) !== null) return null; // don't allow API vars to be retrieved this way\n\t\tif($from instanceof WireData) {\n\t\t\t$value = $from->get($key);\n\t\t} else if($from instanceof WireArray) {\n\t\t\t$value = $from->getProperty($key);\n\t\t} else {\n\t\t\t$value = $from->$key;\n\t\t}\n\t\tif(!count($keys)) return $value; // final value\n\t\tif(is_object($value)) {\n\t\t\tif(count($keys) > 1) {\n\t\t\t\t$keys = implode('.', $keys); // convert back to string\n\t\t\t\tif($value instanceof WireData) $value = $value->getDot($keys); // for override potential\n\t\t\t\t\telse $value = self::_getDot($keys, $value);\n\t\t\t} else {\n\t\t\t\t$key = array_shift($keys);\n\t\t\t\t// just one key left, like 'title'\n\t\t\t\tif($value instanceof WireData) {\n\t\t\t\t\t$value = $value->get($key);\n\t\t\t\t} else if($value instanceof WireArray) {\n\t\t\t\t\tif($key == 'count') {\n\t\t\t\t\t\t$value = count($value);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$a = array();\n\t\t\t\t\t\tforeach($value as $v) $a[] = $v->get($key); \t\n\t\t\t\t\t\t$value = $a; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// there is a dot property remaining and nothing to send it to\n\t\t\t$value = null; \n\t\t}\n\t\treturn $value; \n\t}", "public function firstLine(){\n return $this->file[0] ?? '';\n }", "public function asDotSyntax()\n {\n $dotSyntax = $this->applyDotSyntax($this->compressed);\n $this->compressed = $dotSyntax;\n\n return $dotSyntax;\n }", "public function getLeading() {}", "public function getLeading() {}", "public function getLineNr()\n {\n return $this->lineNr;\n }", "protected function getDots()\n {\n return $this->getDisabledTextWrapper('<i class=\"ellipsis horizontal icon\"></i>');\n }", "final private function _methodLineNumber ($classOrObject, $method) {\n\t\t$ref = new ReflectionMethod($classOrObject, $method);\n\t\treturn $ref->getStartLine();\n\t}", "protected function getValueInterestFactor($line)\n {\n $line = explode(' ', $line); // [namespace] [\\ExLexartem\\Object;]\n $line = rtrim( trim($line[1]), ';' ); // [\\ExLexartem\\Object]\n $line = str_replace('\\\\', '.', $line); // [.ExLexartem.Object] (translate to prefered object hierarchy)\n\n var_dump($line);die;\n }", "public function getLineGap() {}", "function getFareCalcLine() {\n return $this->fareCalcLine;\n }", "private function parseDotNotation($property)\n {\n $values = explode('.', $property);\n $this->parts = $values;\n }", "public function getLine1(): ?string\n {\n return $this->line1;\n }", "public function getLine1(): ?string\n {\n return $this->line1;\n }", "public function getLine_numbers()\n\t{\n\t\treturn $this->getParser()->line_numbers;\n\t}", "public function getVerticalLine() {\n\t\treturn $this->vertical_line;\n\t}", "public function getDots()\n {\n return $this->getDisabledTextWrapper('&hellip;');\n }", "public function getLine(): int;", "private static function showCodeLines($file, $line){\n $text=\"\";\n $fileContent = file_get_contents($file);\n $lines = explode(\"\\n\",$fileContent);\n $nLines = Pokelio_Global::getConfig(\"EXCEPTION_SHOW_CODE_LINES\", 'Pokelio');\n $startLine=$line-$nLines;\n if($startLine<1){\n $startLine=1;\n }\n $endLine=$line+$nLines;\n if($endLine>sizeof($lines)){\n $endLine=sizeof($lines);\n }\n $text.= \" Code:\".\"\\n\";\n for($iLine=$startLine;$iLine<=$endLine;$iLine++){\n if($iLine==$line){\n $text.= \" !!!----> \";\n }else{\n $text.= \" \";\n }\n $text.= substr(\" \".$iLine,-4);\n $text.= \" \";\n $text.= str_replace(\"\\n\",\"\",$lines[$iLine-1]).\"\\n\";\n }\n return $text;\n }", "public function getLines();", "public function getLines();", "public function getLineHeight() {}", "public function getLineId()\n {\n return $this->line_id;\n }", "protected function preface():string {return df_kv(\n\t\tdf_context() + ['File' => df_path_relative($this::info('file')), 'Line' => $this::info('line')]\n\t);}" ]
[ "0.669564", "0.6590595", "0.6538726", "0.63994133", "0.6368601", "0.6368601", "0.6368601", "0.6368601", "0.6368601", "0.6368601", "0.632044", "0.628324", "0.62468445", "0.6224897", "0.62218463", "0.6153756", "0.6116666", "0.61078566", "0.6103376", "0.60859734", "0.60598874", "0.5995742", "0.59443957", "0.5924548", "0.5924548", "0.5924548", "0.5924548", "0.5859858", "0.5831158", "0.5771649", "0.57577944", "0.5731969", "0.5723484", "0.5721502", "0.56916237", "0.56471926", "0.5621806", "0.56196195", "0.55837137", "0.55837137", "0.55773056", "0.5569226", "0.545985", "0.5442094", "0.5421808", "0.54070526", "0.5395823", "0.5384653", "0.5374021", "0.5358079", "0.5358079", "0.533776", "0.5333199", "0.5322412", "0.5319569", "0.5316473", "0.5292105", "0.5287288", "0.5283078", "0.5266226", "0.52486134", "0.52437705", "0.522425", "0.52036595", "0.5200861", "0.51743823", "0.51593536", "0.5154402", "0.51356363", "0.5120926", "0.5114212", "0.5107304", "0.5092366", "0.5091474", "0.50709504", "0.50573426", "0.5044104", "0.5042005", "0.50348747", "0.50300133", "0.50286126", "0.50283957", "0.50201786", "0.5008576", "0.49811092", "0.49447206", "0.4942421", "0.49377444", "0.49329603", "0.4932103", "0.4932103", "0.4927238", "0.49212682", "0.49184278", "0.49131617", "0.48968658", "0.48891574", "0.48891574", "0.4888149", "0.48867533", "0.48576772" ]
0.0
-1
Replace word from parameters
protected function replaceParam($line, array $param) { foreach ($param as $key => $value) { $line = str_replace(':'.$key, $value, $line); } return $line; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function translate_replace($params){\n $string = array_shift($params);\n foreach ($params as $value){\n $replace[] = $value;\n }\n return XT::translate_replace($string, $replace);\n}", "private static function replaceParameters(string &$text, array $parameters) : string\n {\n foreach ($parameters as $parameter) {\n $text = preg_replace(\"/%s/\", $parameter, $text, 1);\n }\n\n return $text;\n }", "function userReplace($key, $text) {\r\n if (!$this->feed['params']['user_replace_on']) return $text;\r\n if (!is_array($this->feed['params']['replace'])) return $text;\r\n if (count($this->feed['params']['replace'][$key])) {\r\n foreach ($this->feed['params']['replace'][$key] as $v) {\r\n if ($v['limit'] == '') $v['limit'] = -1;\r\n $text = preg_replace($v['search'], $v['replace'], $text, $v['limit']);\r\n }\r\n }\r\n return $text;\r\n }", "function acf_str_replace($string = '', $search_replace = array())\n{\n}", "function replaceVarsInWhere($where) {\n // or popooon parameter with type \"structure2xml\"\n // %VAR with an sql_regcase ( hello gets to [Hh][Ee][Ll][Ll][Oo] ) and\n // +VAR with +VAR (\"hello world\" gets to \"+hello +world\" this is useful for fulltext search in mysql)\n $regs = array();\n $repl = array();\n if (is_array($this->getParameter(\"structure2xml\"))) {\n $requests = array_merge($_REQUEST,$this->getParameter(\"structure2xml\"));\n } else {\n $requests = $_REQUEST;\n }\n return self::replaceVarsInWhereStatic($where,$requests);\n \n }", "function find_replace($request) {\r\n\r\n $content = $request['content'];\r\n $keywords = $request['keywords'];\r\n\r\n foreach ($keywords as $keyword) {\r\n $content = str_replace($keyword['find'], $keyword['replace'], $content);\r\n }\r\n\r\n return $content;\r\n}", "function smarty_modifier_myreplace($string, $search) {\n\tif (count($search) > 0) {\n\t\t$newstring = strtr($string, $search);\n\t\treturn $newstring;\n\t} else {\n\t\treturn $string;\n\t}\n}", "private static function replaceVar(string $text, array $params): string\n {\n if ($text === '')\n return '';\n\n return sprintf($text, ...$params); // TODO improve this\n }", "public function replace(&$input, $args)\n {\n $args = $this->getArgs($args);\n $search = array_keys($args);\n $replace = array_values($args);\n $input = str_replace($search, $replace, $input);\n }", "function tpl_modifier_replace($string, $search, $replace)\r\n{\r\n\treturn str_replace($search, $replace, $string);\r\n}", "function formatWord ($param1)\n{\n return ucfirst($param1);\n}", "function replace($p, $str){\n $p2 = __t($p)->map(function($x) use($str){return $str;});\n return $p2();\n }", "function replace($template,$_DICTIONARY){\n\t\tforeach ($_DICTIONARY as $clave=>$valor) {\n\t\t\t$template = str_replace('#'.$clave.'#', $valor, $template);\n\t\t}\t\t\n\t\treturn $template;\n\t}", "public function register_replacements() {\n\t\trank_math_register_var_replacement(\n\t\t\t'randomword',\n\t\t\t[\n\t\t\t\t'name' => esc_html__( 'Random Word', 'rank-math' ),\n\t\t\t\t'description' => esc_html__( 'Persistent random word chosen from a list', 'rank-math' ),\n\t\t\t\t'variable' => 'randomword(word1|word2|word3)',\n\t\t\t\t'example' => ' ',\n\t\t\t],\n\t\t\t[ $this, 'get_randomword' ]\n\t\t);\n\t}", "function replace( $search, $replace ) {\n\treturn partial( 'str_replace', $search, $replace );\n}", "function __replace_special_name($leters = array(),$name = \"\", $idx = 0){\n\t\t\n\t\tif(count($leters) > $idx){\n\t\t\t$name = str_replace($leters[$idx][0], $leters[$idx][1], $name);\n\t\t\treturn $this->__replace_special_name($leters,$name,++$idx);\n\t\t}else{\n\t\t\treturn $name;\n\t\t\t\n\t\t}\t\n\t\t\n\t}", "function replaceWordInText($strText, $mixWord, $strReplaceContent)\n{\n global $boolDebug;\n if(!is_array($mixWord))\n $mixWord = array($mixWord);\n\n foreach ($mixWord as $strWord)\n $strText = preg_replace(\"/(?<![ÄäÜüÖößA-Za-z0-9\\-])(\".regex_real_string($strWord).\")(?![ÄäÜüÖößA-Za-z0-9\\-\\>]|\\!\\?\\.[ÄäÜüÖößA-Za-z0-9])/ui\", $strReplaceContent, $strText);\n\n return $strText;\n}", "public function editDefinition()\r\n{\r\n $query_string = \"UPDATE glossary \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"word = :word, \";\r\n $query_string .= \"worddefinition = :worddefinition \";\r\n $query_string .= \"WHERE wordid = :wordid\";\r\n\r\n return $query_string;\r\n}", "public function replaceText()\n {\n $parameters = func_get_args();\n\n //set parameter values\n if (count($parameters) == 3) {\n $oldText = $parameters[0];\n $newText = $parameters[1];\n $isRegularExpression = $parameters[2];\n } else if (count($parameters) == 4) {\n $oldText = $parameters[0];\n $newText = $parameters[1];\n $isRegularExpression = $parameters[2];\n $pageNumber = $parameters[3];\n } else\n throw new Exception('Invalid number of arguments');\n\n\n //Build JSON to post\n $fieldsArray = array('OldValue' => $oldText, 'NewValue' => $newText, 'Regex' => $isRegularExpression);\n $json = json_encode($fieldsArray);\n\n //Build URI to replace text\n $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . ((isset($parameters[3])) ? '/pages/' . $pageNumber : '') .\n '/replaceText';\n\n $signedURI = Utils::sign($strURI);\n\n $responseStream = Utils::processCommand($signedURI, 'POST', 'json', $json);\n\n $v_output = Utils::validateOutput($responseStream);\n\n if ($v_output === '') {\n //Save doc on server\n $folder = new Folder();\n $outputStream = $folder->GetFile($this->getFileName());\n $outputPath = AsposeApp::$outPutLocation . $this->getFileName();\n Utils::saveFile($outputStream, $outputPath);\n return $outputPath;\n } else\n return $v_output;\n }", "function cmfcString_replaceVariables($replacements,$text) {\n\t\tforeach ($replacements as $needle=>$replacement) {\n\t\t\t$text=str_replace($needle,$replacement,$text);\n\t\t}\n\t\treturn $text;\n\t}", "function FrontgetReplace($str, $frlp, $trlp) {\r\n $reqstr = str_replace($frlp, $trlp, $str);\r\n return $reqstr;\r\n}", "function transform_name( $name = '', $type = '' ) {\n\t$word = array( ' ' => $type, '&' => '' );\n\t$new = strtr( $name, $word );\n $new = strtolower( $new );\n return $new;\n}", "function transform_name( $name = '', $type = '' ) {\n $word = array( ' ' => $type, '&' => '' );\n $new = strtr( $name, $word );\n $new = strtolower( $new );\n\n return $new;\n}", "function replaceShortCode( $text, $array){\n\t$shortCodes = array( '%fname%', '%lname%', '%address%', '%address2%', '%city%', '%state%', '%zip%', '%pnumber%', \n\t\t\t\t\t\t '%pnumbertype%', '%snumber%', '%snumberType%', '%email%', '%job%', '%cover%', '%resume%', '%siteName%' );\n\t$variables = array( $array->fname, $array->lname, $array->address, $array->address2, $array->city, $array->state, $array->zip, $array->pnumber, \n\t\t\t\t\t\t $array->pnumbertype, $array->snumber, $array->snumberType, $array->email, $array->job, $array->cover, $array->resume, get_option( 'blogname' ) );\n\t\n\t$newText = str_replace( $shortCodes, $variables, $text );\n\t\n\treturn $newText;\n}", "function str_placeholder($replace, $string)\n {\n return str_replace(\n array_keys($replace),\n array_values($replace),\n $string\n );\n }", "public function getShortcodeReplace();", "protected function caseBinding($word)\n {\n $parser = static::$parser->make();\n\n return str_replace('?', '_', $parser->stripWildcards($word));\n }", "function param($inName, $inDefault) {\r\n\t\t$WHITE_LIST_PATTERN = '/(\\d\\w -_\\/)*/i';\r\n\t\t$WHITE_LIST_REPLACE = '${1}';\r\n\t\tif (isset($_REQUEST[$inName])) {\r\n\t\t\t// caveat: vulnerability\r\n\t\t\t$GLOBALS[$inName] = preg_replace($WHITE_LIST_PATTERN, $WHITE_LIST_REPLACE, $_REQUEST[$inName]);\r\n\t\t} else {\r\n\t\t\t$GLOBALS[$inName] = $inDefault;\r\n\t\t}\r\n\t}", "public function stringReplace(){\n\t\t\t\treturn str_replace(\"WEB APPLICATION\",\"WEBSITE\",$this->sentence);\n\t\t\t}", "public function _replaceAccented($word){\n\t\t$accentedVowels = $this->_locale->getAccentedVowels();\n\t\tforeach($accentedVowels as $vowel => $accentedVowel){\n\t\t\t$word = str_replace($accentedVowel, $vowel, $word);\n\t\t}\n\t\treturn $word;\n\t}", "function replace($search,$replace = null){\n\t\tif(is_array($search)){\n\t\t\t$_replaces_keys = array();\n\t\t\t$_replaces_values = array();\n\t\t\tforeach(array_keys($search) as $key){\n\t\t\t\t$_replaces_keys[] = $key;\n\t\t\t\t$_replaces_values[] = $search[$key];\n\t\t\t} \n\t\t\tif(sizeof($_replaces_keys)==0){\n\t\t\t\treturn $this;\n\t\t\t} \n\t\t\t$this->_String4 = str_replace($_replaces_keys,$_replaces_values,$this->_String4);\n\t\t\treturn $this;\n\t\t}\n\t\t$this->_String4 = str_replace($search,$replace,$this->_String4);\n\t\treturn $this;\n\t}", "function formatInput($param1)\n{\n return ucwords(strtolower($param1));\n}", "function textblock_template_replace(&$textblock, $replace)\n{\n foreach ($replace as $key => $value) {\n $textblock['title'] = str_replace(\"%$key%\", $value, $textblock['title']);\n $textblock['text'] = str_replace(\"%$key%\", $value, $textblock['text']);\n }\n}", "function r($search, $replace, $subject) {\n\t\treturn str_replace($search, $replace, $subject);\n\t}", "function _ws_apply_replace_tokens($str, $student, $contact, $link = '') {\n switch ($student['gender_id']) {\n case 1:\n $hisher = 'her';\n $heshe = 'she';\n $himher = 'her';\n break;\n\n case 2:\n $hisher = 'his';\n $heshe = 'he';\n $himher = 'him';\n break;\n\n default:\n $hisher = 'their';\n $heshe = 'they';\n $himher = 'them';\n }\n\n $patterns = array(\n '{student.first_name}', '{student.last_name}',\n '{contact.first_name}', '{contact.last_name}',\n '{he/she}', '{she/he}', '{his/her}', '{her/his}', '{him/her}', '{her/him}',\n '{link}',\n );\n $replacements = array(\n $student['first_name'], $student['last_name'],\n $contact['first_name'], $contact['last_name'],\n $heshe, $heshe, $hisher, $hisher, $himher, $himher,\n $link,\n );\n return str_ireplace($patterns, $replacements, $str);\n}", "public function contentStrReplace() {}", "public function replaceKeywords() {\n\t\t$keywords = array(\n\t\t\t'{user}'\t=> '([a-zA-Z0-9_-])+',\n\t\t\t'{slug}'\t=> '([\\.a-zA-Z0-9_-])+',\n\t\t\t'{category}'=> '([a-zA-Z0-9_-])+',\n\t\t\t'{year}'\t=> '([0-9]{4})+',\n\t\t\t'{month}'\t=> '([0-9]{1,2})+',\n\t\t\t'{day}'\t\t=> '([0-9]{1,2})+',\n\t\t\t'{id}'\t\t=> '([0-9])+'\n\t\t);\n\t\t$newkeys = str_replace(array_keys($keywords), $keywords, array_keys($this->routes));\n\t\t$this->routes = array_combine($newkeys, $this->routes);\n\t}", "function qa_lang_sub($identifier, $textparam, $symbol = '^')\n{\n\treturn str_replace($symbol, $textparam, qa_lang($identifier));\n}", "abstract public function replace($translations);", "function tf($string){\n\t$args=func_get_args();\n\t$r=CLang::translate(array_shift($args),'a');\n\treturn vsprintf($r!==false ? $r : $string,$args);\n}", "function replaceVariables($replacements,$text) {\n\t\tforeach ($replacements as $needle=>$replacement) {\n\t\t\t$text=str_replace($needle,$replacement,$text);\n\t\t}\n\t\treturn $text;\n\t}", "function censor_words($output)\n {\n foreach ($_SESSION['pgo_word_censor'] as $find => $replace)\n {\n $output = preg_replace(\"/\\b$find\\b/i\", $replace, $output);\n }\n return $output;\n }", "private function replaceTag(&$text, $newContent, $competitionId) {\n $text = preg_replace('/{hapodi id=\"'.$competitionId .'\"}/s', $newContent, $text);\n }", "private function hello(){\n \techo str_replace(\"this\",\"that\",\"HELLO WORLD!!\");\n \t\t}", "protected function replaceParameters(string $stub, array $parameters): string\n\t{\n\t\treturn str_replace(\n\t\t\t['DummyParameters', 'DummyParameter', '{{ parameters }}', '{{ parameter }}', '{{parameters}}', '{{parameter}}'],\n\t\t\timplode(', ', $parameters),\n\t\t\t$stub\n\t\t);\n\t}", "public function replace_text($text) {\n\t\tif (strlen($text) == 0) {\n\t\t\treturn 'Onbekend';\n\t\t}\n\t\t$text = str_replace('no', 'nee', $text);\n\t\t$text = str_replace('yes', 'ja', $text);\n\t\t$text = str_replace('on', 'aan', $text);\n\t\t$text = str_replace('off', 'uit', $text);\t\t\n\t\treturn $text;\n\t}", "function dowrite($str)\n{\n global $term_bold, $term_norm;\n $str = str_replace(\"%b\", $term_bold, $str);\n $str = str_replace(\"%B\", $term_norm, $str);\n print $str;\n}", "public function replace($key,$value,$string){\n\t\treturn str_replace(\"::$key::\",$value,$string);\n\t}", "public static function filter($str, $censorWords, $replacement = '*', $word = true) {\n\t\tif (! $word)\n\t\t\treturn str_ireplace ( $censorWords, $replacement, $str );\n\t\t\n\t\tforeach ( $censorWords as $c )\n\t\t\t$str = preg_replace ( \"/\\b(\" . str_replace ( '\\*', '\\w*?', preg_quote ( $c ) ) . \")\\b/i\", $replacement, $str );\n\t\t\n\t\treturn $str;\n\t}", "function bold($string, $word)\n{\n return str_ireplace($word,'<strong>'.$word.'</strong>',$string);\n }", "protected function _switchReplace(&$text, $data) {\n \n $assoc = array();\n $i = 0;\n foreach ($data->variable as $variables) {\n $assoc[$variables] = $data->value[$i];\n $i++;\n }\n\n foreach ($assoc as $variable => $value) {\n\n $searchTerm = '$' . \"$variable\";\n\n //search the article/module text for the PHP 'style' variable\n //and replace it with the entered value.\n $text = str_replace($searchTerm, $value, $text);\n }\n }", "static function replace( $search, $replace, $str = null )\n {\n if ( is_array( $search ) && ! $str ) {\n return self::dictReplace( $search, $replace );\n } // end if is array and no str\n $str = str_replace($search, $replace, $str);\n return $str;\n }", "public function replaceTokens($text) {\n $tokens = $this->macro->search($text);\n if (empty($tokens)) {\n return $text;\n }\n\n static $last = [];\n $replacements = [];\n foreach ($tokens as $type => $typeTokens) {\n foreach ($typeTokens as $name => $token) {\n if ($type == \"any\") {\n $value = $this->faker->{$name};\n $replacements[$token] = $value;\n $last[$name] = $value;\n } elseif ($type == \"last\") {\n $replacements[$token] = $last[$name];\n } elseif ($type == \"date\") {\n $replacements[$token] = date($name);\n } elseif ($type == \"mink\") {\n $replacements[$token] = $this->getMinkParameter($name);\n }\n }\n }\n\n $search = array_keys($replacements);\n $replace = array_values($replacements);\n return str_replace($search, $replace, $text);\n }", "public function replace($key, $value, $replacement);", "private function replaceLangVars($lang) {\r\n $this->template = preg_replace(\"/\\{L_(.*)\\}/isUe\", \"\\$lang[strtolower('\\\\1')]\", $this->template);\r\n }", "function stri_replace($find,$replace,$string)\n{\n if(!is_array($find))\n $find = array($find);\n \n if(!is_array($replace))\n {\n if(!is_array($find))\n $replace = array($replace);\n else\n {\n // this will duplicate the string into an array the size of $find\n $c = count($find);\n $rString = $replace;\n unset($replace);\n for ($i = 0; $i < $c; $i++)\n {\n $replace[$i] = $rString;\n }\n }\n }\n foreach($find as $fKey => $fItem)\n {\n $between = explode(strtolower($fItem),strtolower($string));\n $pos = 0;\n foreach($between as $bKey => $bItem)\n {\n $between[$bKey] = substr($string,$pos,strlen($bItem));\n $pos += strlen($bItem) + strlen($fItem);\n }\n $string = implode($replace[$fKey],$between);\n }\n return($string);\n}", "private function wordToLink($word)\n {\n\n $word = $word[0];\n $word_search = strtolower($this->removeAccent($word));\n //$word_search = $word;\n $this->psreplace->execute(array(':word' => $word_search));\n\n if ($this->psreplace->rowcount() > 0) {\n $req = $this->psreplace->fetch();\n $str = \"\";\n $str .= '<a title=\"';\n $str .= $req[\"def\"];\n $str .= '\" href=\"?word=';\n $str .= $word;\n $str .= '\"';\n if ($word_search == strtolower($this->search_term))\n $str .= ' class=\"fluo\"';\n $str .= '>';\n $str .= $word;\n $str .= \"</a>\";\n return $str;\n } else {\n return $word;\n }\n }", "private function _substitute_variable($text, $variable, $object, $function)\n\t{\n\t\tif (strstr($text, $variable))\n\t\t{\n\t\t\t$value = call_user_func(array($object, $function));\n\t\t\t$text = str_replace($variable, $value, $text);\n\t\t}\n\t\treturn $text;\n\t}", "function testReplaceWithRegex(){\n\t\t#mdx:replace\n\t\tParam::get('file_name')\n\t\t\t->context(['file_name'=>'My untitled document.pdf'])\t\n\t\t\t->filters()\n\t\t\t->replace('/\\s+/', '-');\n\n\t\t$output = Param::get('file_name')->process()->output;\n\t\t#/mdx var_dump($output)\n\t\t$this->assertEquals('My-untitled-document.pdf',$output);\n\t}", "function expression_function_replace($string, $search, $replacement = null)\n{\n if ($replacement === null) {\n if (!is_array($search)) {\n throw new \\InvalidArgumentException(\n '$search must be an array if only two arguments are supplied to replace'\n );\n }\n\n return str_replace(array_keys($search), $search, $string);\n } else {\n return str_replace($search, $replacement, $string);\n }\n}", "function _replace( &$word, $suffix, $replace, $m = 0 )\n {\n $sl = strlen($suffix);\n if ( substr($word, -$sl) == $suffix ) {\n $short = substr_replace($word, '', -$sl);\n if ( $this->count_vc($short) > $m ) {\n $word = $short . $replace;\n }\n // Found this suffix, doesn't matter if replacement succeeded\n return true;\n }\n return false;\n }", "function replace($text){\n\t\treturn preg_replace('/[^a-z A-Z]/','',strtolower(czech::autoCzech($text,'asc')));\n\t}", "function replace_specialChar($vTitle) {\r\n $rs_catname = $vTitle;\r\n $spstr = \"�#�#�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�\";\r\n $spArr = @explode(\"#\", $spstr);\r\n $i = 0;\r\n foreach ($spArr as $arr) {\r\n $rs_catname = str_replace($arr, \"-\", $rs_catname);\r\n $i++;\r\n }\r\n //print_r($rs_catname);exit;\r\n $rs_catname = str_replace(\"#\", \"-\", $rs_catname);\r\n $rs_catname = str_replace(\" \", \"-\", str_replace(\"&\", \"and\", $rs_catname));\r\n return $rs_catname;\r\n}", "protected function reemplazaParametro(){\n\t\t$vector=func_get_arg(0);\n\t\t$params=$this->dato;\n//\t\tprint_r($params);\n//\t\techo \"<br>\";\n\t\t$cant=sizeof($params);\n\t\t$accion=$vector[0];\n\t\tif (sizeof($params)!=0){\n\t\t\t$claves=array_keys($params);\n//\t\tfor($x=1;$x<$cant;$x++){\n\t\t\tforeach($claves as $clave){\n\t\t\t\t$str=\"#\".($clave).\"#\";\n\t\t\t\t$accion=str_replace($str,$params[$clave],$accion);\n\t\t\t}\n\t\t}\n\t\treturn $accion;\n\t}", "private function substitute(&$x) {\n if ($x == \"!\" || $x == \"not\" || $x == \"¬\") {\n $x = -1;\n # xor operator becomes -2\n } elseif ($x == \"^\" || $x == \"xor\" || $x == \"⊕\") {\n $x = -2;\n # xand operator becomes -3\n } elseif ($x == \"+\" || $x == \"xand\" || $x == \"⊖\") {\n $x = -3;\n # literal placeholders gets replaced\n } elseif (isset($this->literals[$x])) {\n $y = $this->literals[$x];\n # double escaped wrapper characters should be decoded\n foreach ($this->wrappers as $w)\n $y = str_replace(\"\\\\$w\", $w, $y);\n $x = $y;\n }\n }", "function virgule($nombre)\n{\n\t$nombre = preg_replace('#(.+),(.+)#','$1.$2',$nombre);\n\treturn $nombre;\n}", "function qoute_replacment($phrase){\r\n\t$find = array(\"\\’\", \"’\", \"\\‘\", \"‘\", \"\\'\", \"'\", \"—\", '\\”', '”', '\\“', '“', '\\\"', '\"',\"\\n\",\"\\r\",\"…\");\r\n\t//defince what to replace the find array with\r\n\t$replace = array(\"&apos;\", \"&apos;\", \"&apos;\", \"&apos;\", \"&apos;\", \"&apos;\", \"-\", \"&quot;\", \"&quot;\", \"&quot;\", \"&quot;\", \"&quot;\", \"&quot;\",\"&nbsp;\",\"&nbsp;\",\"...\");\r\n\t//html entities code incase you want that\r\n\t#$replace = array(\"&#39\", \"&#39\", \"&#39\", \"&#39\", \"&#39\", \"&#39\",\"—\", \"&#34\", \"&#34\", \"&#34\", \"&#34\", \"&#34\", \"&#34\");\r\n\t//do the replacing\r\n\t$newphrase = str_replace($find, $replace, $phrase);\r\n \t//return the replacing for output\r\n\treturn $newphrase;\r\n}", "public function testReplaceTags()\n\t{\n\t\t$this->assertEquals('143',$this->obj->replace_tags('1{{2}}3', '', array(\"2\"=>\"4\")));\n\t\t$this->assertEquals('143',$this->obj->replace_tags('1{{args:2}}3', 'args', array(\"2\"=>\"4\")));\n\t\t$this->assertEquals('143$var',$this->obj->replace_tags('1{{args:2}}3$var', 'args', array(\"2\"=>\"4\")));\n\t}", "function fillVariableIfActivated($strNeedle, $strReplace, $strHaystack, $boolActivated)\n {\n if ($boolActivated) {\n return preg_replace('/\\{'.$strNeedle.'\\}/mi', $strReplace, $strHaystack);\n }\n return $strHaystack;\n }", "public function getReplacementText();", "function replace_en($string, $eventTitle=''){\n\t\t\t\treturn (empty($eventTitle))?\n\t\t\t\t\tstr_replace('[event-name]', \"<span class='eventName'>Event Name</span>\", $string):\n\t\t\t\t\tstr_replace('[event-name]', $eventTitle, $string);\n\t\t\t}", "function seoname($name) {\n\tglobal $language_char_conversions, $originals, $replacements;\n\tif ((isset($language_char_conversions)) && ($language_char_conversions == 1)) {\n\t\t$search = explode(\",\", $originals);\n\t\t$replace = explode(\",\", $replacements);\n\t\t$name = str_replace($search, $replace, $name);\n\t}\n\t$name = stripslashes($name);\n\t$name = strtolower($name);\n\t$name = str_replace(\"&\", \"and\", $name);\n\t$name = str_replace(\" \", \"-\", $name);\n\t$name = str_replace(\"---\", \"-\", $name);\n\t$name = str_replace(\"/\", \"-\", $name);\n\t$name = str_replace(\"?\", \"\", $name);\n\t$name = preg_replace( \"/[\\.,\\\";'\\:]/\", \"\", $name );\n\t//$name = urlencode($name);\n\treturn $name;\n}", "function swap_bad_words($string)\n{\n global $gbBadWords;\n\n foreach ($gbBadWords as $bad_word)\n {\n $pattern = '/(\\W|^)(' . $bad_word . ')(\\W|$)/iu';\n\n //just get the first letter of bad_word into good_word\n $good_word = substr($bad_word, 0, 1);\n\n //fill out good_word with *s\n for ($i = 1; $i < strlen($bad_word); $i++)\n {\n $good_word .= '*';\n }\n //we replace the bad_word with good word including anything immediately adjacent\n //such as a comma, space, period or start/end of string.\n $replacement = '$1' . $good_word . '$3';\n $string = preg_replace($pattern, $replacement, $string);\n }\n\n //convert back to UTF-8\n return $string;\n\n}", "public function substitute( array $substitute );", "function langEchoReplaceVariables($string, $replace = array(), $language = '', $lower = '', $deleteEnters = false){\n\treturn langEcho($string, $language, $lower, $replace, $deleteEnters);\n}", "function lwreplace($lwchar){\n return(str_replace(' ','',$lwchar));\n}", "public static function translate($key) {\n if (!isset(self::$values[$key]))\n return $key;\n \n $replacement = self::$values[$key];\n \n $args = func_get_args();\n unset($args[0]);\n \n foreach($args as $key => $value)\n $replacement = str_replace('%'. $key, $value, $replacement);\n \n return $replacement;\n }", "function transform_text ($text, $settings) {\n foreach ($settings as $key => $value) {\n $text = str_replace(\"{{ $key }}\", $value, $text);\n }\n return $text;\n }", "public function transform($word, $rules)\n {\n foreach ($rules as $rule => $replacement)\n if (preg_match($rule, $word))\n return preg_replace($rule, $replacement, $word);\n return $word;\n }", "function getMessage($msg, $params=NULL){\r\n\tfor($i=0;$i<count($params);$i++)\r\n\t\t$msg = str_replace('%'.($i+1), $params[$i], $msg);\r\n\treturn $msg;\r\n}", "public function testReplace1()\n {\n $this->assertEquals(Str::replace('foo', 'oo', 'yy'), 'fyy');\n }", "abstract public function lookupWord($word);", "function remove_underscores($word, $sub = ' ')\n {\n return str_replace('_', $sub, $word);\n }", "static function strReplace($search, array $replace, $subject) {\n foreach ($replace as $value) {\n $subject = preg_replace(\"/$search/\", $value, $subject, 1);\n }\n\n return $subject;\n }", "public function replaceParameter($data) {\n\t\t$data = trim($data);\n\n\t\t// apply stripslashes to pevent double escape if magic_quotes_gpc is enabled\n\t\tif(get_magic_quotes_gpc())\n\t\t{\n\t\t\t$data = stripslashes($data);\n\t\t}\n\t\treturn $data;\n\t}", "public function replace( $old, $new );", "function lb_replace_tags($text, $product) {\n $search = array(\n '[product_name]', \n '[product_price]', \n '[product_merchant]',\n '[product_brand]',\n );\n \n $replace = array(\n $product['name'], \n round((float)$product['finalprice']/100, 0),\n $product['merchant'],\n $product['brand'],\n );\n \n $return_text = str_replace($search, $replace, $text);\n \n error_log('lb_replace_tags - $return_text: ' . $return_text . ', product: ' . print_r($product, true));\n\n return $return_text;\n}", "public function replace_sensor($text) {\n\t\tif (strlen($text) == 0) {\n\t\t\treturn 'Onbekend';\n\t\t}\n\t\t$text = str_replace('no', 'rust', $text);\n\t\t$text = str_replace('yes', 'alarm', $text);\n\t\t$text = str_replace('on', 'alarm', $text);\n\t\t$text = str_replace('off', 'rust', $text);\t\t\n\t\treturn $text;\n\t}", "function replace($search,$replace){\n\t\tsettype($search,\"string\");\n\n\t\t// prevod StringBuffer na string\n\t\tif(is_object($replace)){\n\t\t\t$replace = $replace->toString();\n\t\t}\n\n\t\tfor($i=0;$i<sizeof($this->_Items);$i++){\n\t\t\t$this->_Items[$i]->replace($search,$replace);\n\t\t}\n\t}", "public function replace($items);", "private function removeQuotes($matches) {\n\n\t\t\tif ( !$matches[1] ) {\n\t\t\t\t$matches[1] = 'Someone';\n\t\t\t}\n\t\t\t$replacement = sprintf('%s said: \"%s\"', $matches[1], $matches[2]);\n\t\t\treturn $replacement;\n\t\t}", "protected static function nameprep($text)\n {\n }", "function vlang_vars_name($str, $array){\n\t\n\tforeach($array as $k => $v){\n\t\t\n\t\t$str = str_replace('{{'.$k.'}}', $v, $str);\n\t\n\t}\n\t\n\treturn $str;\n\n}", "function QueryReplace($VAR, $VAL, $STR=false){\n\t\t$QueryString = array();\n\t\tif($STR !== false) $String = $STR;\n\t\telse $String = $_SERVER['QUERY_STRING'];\n\t\tparse_str($String, $Keys);\n\t\tforeach($Keys as $k => $v){\n\t\t\tif(trim($k) == trim($VAR)){ if($VAL != NULL) $QueryString[] = $k.\"=\".$VAL;\n\t\t\t} else $QueryString[] = $k.\"=\".$v;\n\t\t}\n\t\treturn implode(\"&\",$QueryString);\n\t}", "function change_name_placeholder( $translated, $text, $context, $domain ) {\n\n\tif ( 'fl-builder' == $domain && 'Name' == $text && 'First and last name.' == $context ) {\n\t\t\t$translated = 'First Name';\n\t}\n\n\treturn $translated;\n\n}", "function BadWordFunc ($RemoveBadWordText) {\n\t$RemoveBadWordText = eregi_replace(\"fuc?k|[kc]unt|asshole|shit|fag|wank|dick|pu[zs]?[zs][yi]|bastard|s[kc]rew|mole[zs]ter|mole[sz]t|coc?k\", \"****\", $RemoveBadWordText);\n \treturn $RemoveBadWordText;\n}", "function replaceTag($tag, $paramstring) {\n # append a space to possible open tags; trim and strip html tags; \n # replace multiple spaces by one space; change a space between quotes to a tilde\n $paramstring = str_replace(\"<\", \" <\", $paramstring);\n $paramstring = str_replace(\", \", \",\", $paramstring);\n $paramstring = strip_tags(trim($paramstring));\n $paramstring = preg_replace(\"{[ \\t\\n\\r]+}\", ' ', $paramstring );\n\n # harder find-and-replace: find spaces between quotes: change them to tildes \n # the regexp can only change one space at a time: do it 10 times to be \"sure\" \n $pattern = \"/=\\\"([^\\\"]*)[ ]/\";\n $replacement = \"=\\\"$1~\";\n if ( preg_match( $pattern, $paramstring ) > 0 ) {\n for ( $i = 0; $i < 10; $i++ ) {\n $paramstring = preg_replace($pattern, $replacement, $paramstring); \n }\n }\n # echo \"<!-- \" . $paramstring . \"-->\"; \n\n $params = explode(\" \", trim($paramstring));\n $result = keyValueInterpreter($params);\n\n if ($tag == \"showall\") {\n navajoInclude($result);\n }\n if ($tag == \"showmessage\") {\n messageInclude($result);\n }\n if ($tag == \"showmethod\") {\n methodInclude($result);\n } \n if ($tag == \"//\") {\n echo \"<!-- \" . $paramstring . \"-->\";\n }\n if ($tag == \"element\") {\n propertyInclude($result);\n }\n if ($tag == \"label\") {\n descriptionInclude($result);\n }\n if ($tag == \"errors\") {\n errorMessageInclude($result);\n }\n if ($tag == \"table\") {\n tableInclude($result);\n }\n if ($tag == \"submit\") {\n submitInclude($result);\n }\n if ($tag == \"service\") {\n callService($result);\n }\n if ($tag == \"setvalue\") {\n valueInclude($result);\n }\n if ($tag == \"setusername\") {\n usernameInclude($result);\n }\n if ($tag == \"classsuffix\") {\n setClassSuffix($result);\n }\n print \"\\n\";\n}", "function replace($text){\n\t\t\t\t\t\t\t\t\t\t$arrayText = array('TRUONG TIEU HOC','TRUONG THCS', 'TRUONG THPT');\n\t\t\t\t\t\t\t\t\t\t$str = \"\";\n\t\t\t\t\t\t\t\t\t\tfor ($i=0; $i < 3 ; $i++) { \n\t\t\t\t\t\t\t\t\t\t\tif (strpos($text, $arrayText[$i]) !== false) {\n\t\t\t\t\t\t\t\t\t\t\t\t$str = str_replace($arrayText[$i],\"\",$text);\n\t\t\t\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\t\t\t\t\treturn $str;\n\t\t\t\t\t\t\t\t\t}", "public function testUpdateValuesContainSpecialCharacters(): void { }", "function vnit_change_title($alias) {\r\n\t\r\n\t$alias = vnit_EncString ( $alias );\r\n\t\r\n\t$search = array ('&amp;', '&#039;', '&quot;', '&lt;', '&gt;', '&#x005C;', '&#x002F;', '&#40;', '&#41;', '&#42;', '&#91;', '&#93;', '&#33;', '&#x3D;', '&#x23;', '&#x25;', '&#x5E;', '&#x3A;', '&#x7B;', '&#x7D;', '&#x60;', '&#x7E;' );\r\n\t\r\n\t$alias = str_replace ( $search, \" \", $alias );\r\n\t\r\n\t$alias = preg_replace ( \"/([^a-z0-9-\\s])/is\", \"\", $alias );\r\n\t\r\n\t$alias = preg_replace ( \"/[\\s]+/\", \" \", $alias );\r\n\t\r\n\t$alias = preg_replace ( \"/\\s/\", \"-\", $alias );\r\n\t\r\n\t$alias = preg_replace ( '/(\\-)$/', '', $alias );\r\n\t\r\n\t$alias = preg_replace ( '/^(\\-)/', '', $alias );\r\n\t\r\n\t$alias = preg_replace ( '/[\\-]+/', '-', $alias );\r\n\t\r\n\treturn strtolower ( $alias );\r\n\r\n}" ]
[ "0.68283665", "0.6319737", "0.62181383", "0.6196162", "0.60961545", "0.6081606", "0.6008544", "0.587056", "0.5867038", "0.5838908", "0.5763723", "0.5757055", "0.5752817", "0.5727823", "0.5664337", "0.5655024", "0.56505275", "0.5650103", "0.5604259", "0.5590376", "0.55881417", "0.5572258", "0.55711186", "0.5565216", "0.5562251", "0.55547327", "0.5535425", "0.55184376", "0.5486276", "0.5478764", "0.54757124", "0.5462749", "0.54623103", "0.54533243", "0.5452942", "0.5443149", "0.54421896", "0.54238415", "0.5417778", "0.5410238", "0.5403589", "0.53740567", "0.53662604", "0.5364584", "0.5358074", "0.5355236", "0.5347483", "0.5342197", "0.5330757", "0.53267235", "0.5325209", "0.5317155", "0.5317063", "0.53058153", "0.5287933", "0.52766657", "0.52721983", "0.5258048", "0.52568793", "0.5254984", "0.52541995", "0.52514887", "0.52471226", "0.5229314", "0.521842", "0.52153623", "0.5213958", "0.5213111", "0.52099717", "0.5205879", "0.51938266", "0.518802", "0.5183379", "0.51804805", "0.51791716", "0.517803", "0.5172354", "0.51687783", "0.51664656", "0.51664346", "0.51651204", "0.516096", "0.5157287", "0.5149985", "0.514679", "0.514164", "0.514063", "0.5139747", "0.51379067", "0.5135978", "0.5135317", "0.5130304", "0.5128491", "0.5127824", "0.51250297", "0.51243556", "0.5122029", "0.5117542", "0.5116307", "0.51129144" ]
0.57284814
13
Creates a repository manager.
public function __construct(ProjectEnvironment $environment, EditableRepository $repo, PackageCollection $packages, PackageFileStorage $packageFileStorage) { $this->environment = $environment; $this->dispatcher = $environment->getEventDispatcher(); $this->repo = $repo; $this->config = $environment->getConfig(); $this->rootDir = $environment->getRootDirectory(); $this->rootPackage = $packages->getRootPackage(); $this->rootPackageFile = $environment->getRootPackageFile(); $this->packages = $packages; $this->packageFileStorage = $packageFileStorage; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createRepository()\n {\n $repositoryOptions = [\n 'repository' => $this->info['repositoryName'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'parent',\n 'uploads',\n 'data',\n 'int',\n 'float',\n 'bool',\n ]);\n\n $this->call('engez:repository', array_merge($repositoryOptions, $options));\n }", "private function createRepository()\n {\n $this->output->write('Creating repository... ');\n\n try {\n $versionControlRepository = ($this->config->scm->type == 'gitlab') ?\n new VersionControlRepositoryGitLab($this->config) : new VersionControlRepositoryGitHub($this->config);\n $versionControlRepository->create($this->project);\n\n $this->output->writeln('<info>OK</info>');\n } catch (\\Exception $e) {\n $message = 'Error: '. $e->getMessage();\n $this->output->writeln('<error>'. $message .'</error>');\n throw new \\RuntimeException($message);\n }\n }", "protected function makeRepo()\n {\n // debido a que el repositorio de direccion depende\n // del repositorio de empleado que tiene sus\n // dependendias, y como no queremos usar\n // el IOC container, lo hacemos\n // explicitamente aqui.\n return new AddressRepository(\n new Address(),\n new EmployeeRepository(\n new Employee(),\n new UserRepository(new User())\n )\n );\n }", "public function createRepository()\n {\n $schema = $this->getConnection()->getSchemaBuilder();\n\n $schema->create($this->table, function ($table) {\n $table->increments('id');\n $table->string('plugin');\n $table->string('migration');\n $table->integer('batch');\n });\n }", "public function createRepository()\n {\n if (!interface_exists('Puli\\Repository\\Api\\ResourceRepository')) {\n throw new RuntimeException('Please install puli/repository to create ResourceRepository instances.');\n }\n\n $repo = new JsonRepository(__DIR__.'/path-mappings.json', __DIR__.'/..', true);\n\n return $repo;\n }", "public function create($repository);", "protected function initRepository()\n {\n $this->repository = new Repository([\n 'name' => 'vendor/name',\n 'description' => '✈️The package is a ThinkSNS+ package.',\n 'type' => 'library',\n 'license' => 'MIT',\n 'require' => [\n 'php' => '>=7.1.3',\n ],\n 'autoload' => [],\n 'config' => [\n 'sort-packages' => true,\n ],\n ]);\n }", "protected function makeRepository()\n {\n if ($this->files->exists($path = $this->getRepositoryPath())) {\n return $this->error($this->className . ' already exists!');\n }\n $this->makeDirectory($path);\n $this->files->put($path, $this->compileRepositoryStub());\n $this->info('Repository created successfully.');\n }", "public function createRepositoryManager($name, array $adapterConfig, Config $globalConfig)\n {\n $factory = $this->getFactoryObject($name);\n\n if (!$factory instanceof RepositoryManagerFactory) {\n throw new \\LogicException(sprintf('Adapter %s does not support repository-management.', $name));\n }\n\n return $factory->createRepositoryManager($adapterConfig, $globalConfig);\n }", "public function create($name, $repo = null, $cache = null, $filters = array(), $manager = null)\n {\n $name = '\\\\TEST\\\\Models\\\\Managers\\\\' . $name;\n\n if (is_null($repo)) {\n $repo = $this->db;\n }\n\n if (is_null($cache)) {\n $cache = $this->cache;\n }\n\n return new $name($repo, $cache, $this, $filters, $manager);\n }", "private function createRepositoryDefinition()\n {\n $id = $this->getServiceId('repository');\n if (!$this->container->has($id)) {\n $definition = new Definition($class = $this->getServiceClass('repository'));\n $definition->setArguments([\n new Reference($this->getServiceId('manager')),\n new Reference($this->getServiceId('metadata'))\n ]);\n if (is_array($this->options['translation'])) {\n $definition\n ->addMethodCall('setLocaleProvider', [new Reference('ekyna_core.locale_provider.request')]) // TODO alias / configurable ?\n ->addMethodCall('setTranslatableFields', [$this->options['translation']['fields']])\n ;\n }\n $this->container->setDefinition($id, $definition);\n }\n }", "public function repository(Store $store)\n {\n return new Repository($store); \n }", "public function repository()\n {\n return new Eadrax\\Repository\\Project\\Add;\n }", "public function createRepository($entityName)\n {\n if (isset($this->repositories[$entityName])) {\n //echo 'Repo exist -> returning';\n return $this->repositories[$entityName];\n }\n\n $classname = \"\\\\Model\\Repository\\\\{$entityName}Repository\";\n\n //todo: might check if file with repo exist\n //echo 'creating repo'\n $repo = new $classname();\n $repo->setPdo($this->pdo);\n $this->repositories[$entityName] = $repo;\n\n return $repo;\n }", "public function createService(ServiceLocatorInterface $serviceLocator) {\n $config = $serviceLocator->get('Configuration');\n $params = $config['FileBank']['params'];\n $em = $serviceLocator->get('doctrine.entitymanager.orm_default');\n\n $manager = new Manager($params, $em, $serviceLocator);\n return $manager;\n }", "public static function create()\n {\n $isDevMode = true;\n $proxyDir = null;\n $cache = null;\n $useSimpleAnnotationReader = false;\n $config = Setup::createAnnotationMetadataConfiguration([__DIR__ . \"/../\"], $isDevMode, $proxyDir, $cache, $useSimpleAnnotationReader);\n // or if you prefer yaml or XML\n //$config = Setup::createXMLMetadataConfiguration(array(__DIR__.\"/config/xml\"), $isDevMode);\n //$config = Setup::createYAMLMetadataConfiguration(array(__DIR__.\"/config/yaml\"), $isDevMode);\n\n // database configuration parameters\n $conn = require __DIR__.'/../../config/doctrine.php';\n\n // obtaining the entity manager\n $entityManager = EntityManager::create($conn, $config);\n\n return $entityManager;\n }", "public function create($serviceManager);", "protected function repository(StoreInterface $store)\n\t{\n\t\treturn new Repository($store);\n\t}", "public static function &create($repo_path, $source = null) {\n\t\t\treturn GitRepo::create_new($repo_path, $source);\n\t\t}", "protected function getRepository() {\n\t\tif ($this->_repository === null) {\n\t\t\t$this->_repository = new AGitRepository();\n\t\t\t$this->_repository->setPath($this->path,true,true);\n\t\t\t$this->assertTrue(file_exists($this->path));\n\t\t}\n\t\treturn $this->_repository;\n\t}", "public function createRepository(CreateRepository $repository)\n {\n /** @var RepositoryResponse $response */\n $response = $this->apiClient->createRepository(['body' => new RepositoryRequest($repository)]);\n\n return $response->getRepository();\n }", "public function getRepository() : RepositoryInterface {\n\n if(null === $this->repository) {\n\n $quizModuleService = new ModuleService(new Meta(), new View());\n $this->repository = new Repository($this->getConfig(), $quizModuleService);\n }\n\n return $this->repository;\n }", "public static function create(string $type, array $config)\n {\n switch (strtolower($type)) {\n case self::REPO_BITBUCKET:\n return new BitbucketRepository($config);\n\n case self::REPO_GITHUB:\n return new GithubAbstractRepository($config);\n\n default:\n throw new \\Exception('Repository type {$type} is not defined.');\n }\n }", "public function repository()\n {\n return Repository::i();\n }", "public function getRepositoryManagers()\n {\n return $this->repositoryManagers;\n }", "public static function get(): AbstractRepository {\n return new static();\n }", "protected function registerManager()\r\n\t{\r\n\t\t$this->royalcms->bindShared('storage', function($royalcms)\r\n\t\t{\r\n\t\t\treturn new FilesystemManager($royalcms);\r\n\t\t});\r\n\t}", "private function createManagerDefinition()\n {\n $id = $this->getServiceId('manager');\n if (!$this->container->has($id)) {\n $this->container->setAlias($id, new Alias($this->getManagerServiceId()));\n }\n }", "public function getRepository($persistentObject, $persistentManagerName = null)\n {\n // TODO: Implement getRepository() method.\n }", "public function manager();", "public static function open($repo_path) {\n\t\t\treturn new GitRepo($repo_path);\n\t\t}", "protected function getRepository() {}", "public function createRepo(string $repo = null)\n {\n $end = $this->getVendorType() === 'org'\n ? '/orgs/' . $this->getVendor() . '/repos'\n : '/user/repos';\n $res = $this->request('POST', $end, [\n 'name' => $this->getName(),\n 'description' => $this->getDescription(),\n ]);\n if (Helper::isResponseOk($res)) {\n echo \"\\ngit remote add origin [email protected]:{$this->getFullName()}.git\\n\";\n echo \"git push -u origin master\\n\";\n }\n\n return $res;\n }", "public function createGit()\n {\n if($GLOBALS['TL_CONFIG']['bx_git_path'])\n {\n $gitPath = TL_ROOT.$GLOBALS['TL_CONFIG']['bx_git_path'];\n }else{\n $gitPath = TL_ROOT.\"/\";\n }\n\n $git = new GitPhp\\GitRepository($gitPath);\n $git->init()->execute();\n \n //Set Remote\n $url = explode(\"://\", $GLOBALS['TL_CONFIG']['bx_git_host_url']);\n $git->remote()->setUrl('origin', $url[0].\"://\".$GLOBALS['TL_CONFIG']['bx_git_host_user'].\":\".$GLOBALS['TL_CONFIG']['bx_git_host_pass'].\"@\".$url[1]);\n }", "public function getRepository(): ObjectRepository\n {\n return $this->repository;\n }", "public function getRepository();", "public abstract function getRepository();", "public function getRepository($repositoryClass){\n \n try {\n \n $repo = new $repositoryClass();\n $repo->_em = $this;\n \n return $repo;\n \n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n }\n }", "public static function createObjectManagerFactory($rootDir, array $initParams)\n {\n $dirList = self::createFilesystemDirectoryList($rootDir, $initParams);\n $driverPool = self::createFilesystemDriverPool($initParams);\n $configFilePool = self::createConfigFilePool();\n return new ObjectManagerFactory($dirList, $driverPool, $configFilePool);\n }", "public function getRepository($type)\n {\n return $this->createRepository(is_array($type) ? $type : [$type]);\n }", "abstract public function getRepository();", "abstract public function getRepository();", "abstract protected function getRepository();", "public function init(string $model_type): Repository;", "protected function makeRepositoryInterface()\n {\n if ($this->files->exists($path = $this->getInterfacePath())) {\n return $this->error($this->classParts() . 'Interface already exists!');\n }\n $this->makeDirectory($path);\n $this->files->put($path, $this->compileInterfaceStub());\n $this->info('Repository Interface created successfully.');\n }", "protected function repository($provider)\n {\n return new GatewayRepository($provider);\n }", "protected function repository($name)\n {\n parent::repository($name);\n\n return $this->repository;\n }", "protected function getRepository() {\n if(empty($this->repository)) {\n try {\n $pdo = new PDO(PDO_DSN, DB_USER, DB_PASS);\n $this->repository = new UserRepository($pdo);\n } catch (PDOException $e) {\n $this->errorMessages[] = 'Connection failed: ' . $e->getMessage();\n }\n }\n\n return $this->repository;\n }", "static public function createManager( $name, array $config, $resource )\n\t{\n\t\tif( ctype_alnum( $name ) === false )\n\t\t{\n\t\t\t$classname = is_string( $name ) ? '\\\\Aimeos\\\\MW\\\\Cache\\\\' . $name : '<not a string>';\n\t\t\tthrow new \\Aimeos\\MW\\Cache\\Exception( sprintf( 'Invalid characters in class name \"%1$s\"', $classname ) );\n\t\t}\n\n\t\t$iface = '\\\\Aimeos\\\\MW\\\\Cache\\\\Iface';\n\t\t$classname = '\\\\Aimeos\\\\MW\\\\Cache\\\\' . ucwords( $name );\n\n\t\tif( class_exists( $classname ) === false ) {\n\t\t\tthrow new \\Aimeos\\MW\\Cache\\Exception( sprintf( 'Class \"%1$s\" not available', $classname ) );\n\t\t}\n\n\t\t$manager = new $classname( $config, $resource );\n\n\t\tif( !( $manager instanceof $iface ) ) {\n\t\t\tthrow new \\Aimeos\\MW\\Cache\\Exception( sprintf( 'Class \"%1$s\" does not implement interface \"%2$s\"', $classname, $iface ) );\n\t\t}\n\n\t\treturn $manager;\n\t}", "protected function getRepository()\n {\n return $this->repository;\n }", "public function getRepository()\n {\n return $this->manager->getRepository($this->class);\n }", "public function actionCreate()\n\t{\n\t\t$model=new Repository;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Repository']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Repository'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('admin'));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function initRepository(): void;", "public function store(CreateManagerRequest $request)\n {\n if ($this->account->can('create', Manager::class)) {\n $request['password'] = bcrypt($request->password);\n $accounts = processParamAccount('App\\Models\\Manager');\n $manager = Manager::create($request->all());\n foreach (array_values($accounts) as $account) {\n $accountId = empty($account['id']) ? null : $account['id'];\n $account['email'] = $request->email;\n $account['password'] = $request['password'];\n $manager->accounts()->updateOrCreate(['id' => $accountId], $account);\n }\n \n $roleResourcesReq;\n $roleData['manager_id'] = $manager->id;\n switch ($request->role) {\n case 'mod':\n $roleData['name'] = 'mod' . $manager->id;\n if (count($request->role_resources)) {\n $roleResourcesReq = $request->role_resources;\n }\n break;\n case 'admin':\n $roleData['name'] = 'admin' . $manager->id;\n $roleResourcesReq = config('define.admin_role_resources');\n break;\n case 'provider':\n $roleData['name'] = 'provider' . $manager->id;\n $roleResourcesReq = config('define.provider_role_resources');\n break;\n }\n $role = Role::create($roleData);\n $now = \\Carbon\\Carbon::now()->toDateTimeString(); \n array_walk($roleResourcesReq, function(&$role_resource, $key) use($role, $now) {\n $role_resource['role_id'] = $role->id;\n $role_resource['created_at'] = $now;\n $role_resource['updated_at'] = $now;\n });\n $roleResource = RoleResource::insert($roleResourcesReq);\n return $this->successResponse($manager->load(['roleResources.resource:id,name', 'roleResources.role:id,name']), Response::HTTP_OK);\n } else {\n return $this->errorResponse(config('define.no_authorization'), Response::HTTP_UNAUTHORIZED);\n }\n }", "public static function addRepository(IOInterface $io, RepositoryManager $rm, array &$repos, $name, array $repoConfig, Pool $pool = null)\n {\n $repoConfig['name'] = $name;\n $repo = $rm->createRepository($repoConfig['type'], $repoConfig);\n\n return static::addRepositoryInstance($io, $rm, $repos, $name, $repo, $pool);\n }", "protected function getLocalRepository()\n {\n if (!$this->localRepo){\n $this->localRepo = new InstalledFilesystemRepository(\n new JsonFile(\n $this->composer->getConfig()->get(\"vendor-dir\") . \"/composer/installed_extra.json\"\n )\n );\n }\n\n return $this->localRepo;\n }", "public function getRepository()\n {\n return $this->repository;\n }", "public function getRepository()\n {\n return $this->repository;\n }", "public function getRepository()\n {\n return $this->repository;\n }", "public function getRepository()\n {\n return $this->repository;\n }", "public function getRepository()\n {\n return $this->repository;\n }", "public function getRepository()\n {\n return $this->repository;\n }", "public static function getRepository($objectManager, $objectClass)\n {\n return $objectManager->getRepository($objectClass);\n }", "public function createFilmRepository()\n {\n // il le demanderait dans son constructeur.\n // Ce serait donc le role de cette Factory d'instancier ce PDO\n // et de l'injecter au FilmRepository\n // La Factory aurait egalement pu gerer le lifecycle des PDOs\n // (un par repository ? un unique pour toute l'appli ?)\n return new FilmRepository();\n }", "public function setRepository($var)\n {\n GPBUtil::checkString($var, True);\n $this->repository = $var;\n\n return $this;\n }", "public static function getRepository()\n {\n if (is_null(static::$repository)) {\n static::$repository = static::buildRepository();\n }\n\n return static::$repository;\n }", "protected function registerManager()\n {\n $this->app->bindShared('dropbox', function ($app) {\n $config = $app['config'];\n $factory = $app['dropbox.factory'];\n\n return new DropboxManager($config, $factory);\n });\n\n $this->app->alias('dropbox', 'GrahamCampbell\\Dropbox\\DropboxManager');\n }", "public function create($remote = 'http://github.com/joomla/joomla-platform.git')\n\t{\n\t\t// Initialize variables.\n\t\t$out = array();\n\t\t$return = null;\n\n\t\t// We add the users repo to our remote list if it isn't already there\n\t\tif (!file_exists($this->_root . '/.git'))\n\t\t{\n\t\t\t// Execute the command.\n\t\t\texec('git clone -q ' . escapeshellarg($remote) . ' ' . escapeshellarg($this->_root), $out, $return);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new InvalidArgumentException('Repository already exists at ' . $this->_root . '.');\n\t\t}\n\n\t\t// Validate the response.\n\t\tif ($return !== 0)\n\t\t{\n\t\t\tthrow new RuntimeException(sprintf('The clone failed from remote %s with code %d and message %s.', $remote, $return, implode(\"\\n\", $out)));\n\t\t}\n\n\t\treturn $this;\n\t}", "protected function getModule_ManagerService()\n {\n return $this->services['module.manager'] = new \\phpbb\\module\\module_manager(${($_ = isset($this->services['cache.driver']) ? $this->services['cache.driver'] : ($this->services['cache.driver'] = new \\phpbb\\cache\\driver\\file())) && false ?: '_'}, ${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['ext.manager']) ? $this->services['ext.manager'] : $this->getExt_ManagerService()) && false ?: '_'}, 'phpbb_modules', './../', 'php');\n }", "public function load(ObjectManager $manager)\n {\n $projectPath = realpath($this->container->get('kernel')->getRootDir().'/../');\n $project = $manager->getRepository(Project::class)->findOneBy(['name' => basename($projectPath)]);\n if($project == null){\n $project = $this->container->get('web_composer.entity_factory')->createProject();\n }\n $project->setName(basename($projectPath));\n $project->setDirectory($projectPath);\n\n $manager->persist($project);\n $manager->flush();\n }", "public function getRepositoryFactory()\n {\n return $this->repositoryFactory;\n }", "public function repository(Store $store)\n {\n $repository = new Repository($store);\n\n if ($this->container->bound(DispatcherContract::class)) {\n $repository->setEventDispatcher(\n $this->container[DispatcherContract::class]\n );\n }\n\n return $repository;\n }", "abstract public function repository();", "protected function createManagerFromConfig(AdminConfig $adminConfig, EntityRepository $entityRepository)\n {\n $customManager = null;\n $methodsMapping = [];\n // set default entity manager\n /** @var EntityManager $entityManager */\n $entityManager = $this->getContainer()->get('doctrine')->getManager();\n // custom manager is optional\n if ($adminConfig->managerConfiguration) {\n $customManager = $this->getContainer()->get($adminConfig->managerConfiguration['name']);\n\n if (array_key_exists('save', $adminConfig->managerConfiguration)) {\n $methodsMapping['save'] = $adminConfig->managerConfiguration['save'];\n }\n if (array_key_exists('list', $adminConfig->managerConfiguration)) {\n $methodsMapping['list'] = $adminConfig->managerConfiguration['list'];\n }\n if (array_key_exists('edit', $adminConfig->managerConfiguration)) {\n $methodsMapping['edit'] = $adminConfig->managerConfiguration['edit'];\n }\n if (array_key_exists('delete', $adminConfig->managerConfiguration)) {\n $methodsMapping['delete'] = $adminConfig->managerConfiguration['delete'];\n }\n }\n $manager = new GenericManager(\n $entityRepository,\n $entityManager,\n $customManager,\n $methodsMapping\n );\n return $manager;\n }", "protected function createEntityManager()\n {\n $configuration = Setup::createAnnotationMetadataConfiguration(\n [$this->_config['models']],\n Environment::is('development'),\n $this->_config['proxies'],\n isset($this->_config['cache']) ? call_user_func($this->_config['cache']) : null\n );\n $configuration->setProxyNamespace($this->_config['proxyNamespace']);\n\n $eventManager = new EventManager();\n $eventManager->addEventListener([\n Events::postLoad,\n Events::prePersist,\n Events::preUpdate\n ], $this);\n\n $connection = $this->connectionSettings;\n $params = compact('connection', 'configuration', 'eventManager');\n return $this->_filter(__METHOD__, $params, function ($self, $params) {\n return EntityManager::create(\n $params['connection'],\n $params['configuration'],\n $params['eventManager']\n );\n });\n }", "public function getRepository($persistentObject, $persistentManagerName = null)\n {\n return $this->entityManager->getRepository($persistentObject);\n }", "public function init_repo() {\n\n\t\t\t// we don't need to maintain local repos for slim deploys\n\t\t\tif ( SLIM ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// if the repo is already initialised, we don't need to\n\t\t\tif ( is_dir( \"wpd-repos/{$this->config->repo[ 'name' ]}/.git\" ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// store the directory we're in right now, so we can come back\n\t\t\t$original_dir = getcwd();\n\n\t\t\t// switch the repo's directory\n\t\t\tchdir( \"wpd-repos/{$this->config->repo[ 'name' ]}\" );\n\n\t\t\t// initialise git\n\t\t\texec( 'git init' );\n\n\t\t\t// add the remote repo as a remote called origin\n\t\t\texec( \"git remote add origin \" . $this->config->repo[ 'git_url' ] );\n\n\t\t\t// switch back to the original directory\n\t\t\tchdir( $original_dir );\n\t\t}", "public function manager($model) {\n $namespaceModel = 'App\\Model\\\\' . $model;\n return new $namespaceModel(); \n }", "public function createReference($repository) { \n if ( $repository->exists() ) {\n throw new GitBackendException('Repository already exists');\n } \n $path = $repository->getPath();\n //create git root if does not exist\n $this->createGitRoot();\n //create project dir if does not exists\n $this->createProjectRoot($repository);\n $path = $this->getGitRootPath().DIRECTORY_SEPARATOR.$path;\n mkdir($path, 0770, true);\n chdir($path);\n $this->getDriver()->init($bare=true);\n\n return $this->setUpRepository($repository);\n }", "protected function createTokenRepository(array $config)\n {\n return new PasswordResetRepository($config['table'], $config['connection'], $config['expire'], $config['throttle']);\n }", "public function manager($type, BaseCommand $command, array $settings = array())\n\t{\n\t\treturn $this->factory($type, $command, $settings);\n\t}", "public function install() {\n $strReturn = \"\";\n\n $strReturn .= \"Creating picture upload folder\\n\";\n if(!is_dir(_realpath_._filespath_.\"/images/upload\"))\n mkdir(_realpath_._filespath_.\"/images/upload\", 0777, true);\n\n $strReturn .= \"Creating new picture repository\\n\";\n $objRepo = new class_module_mediamanager_repo();\n\n if($this->strContentLanguage == \"de\")\n $objRepo->setStrTitle(\"Hochgeladene Bilder\");\n else\n $objRepo->setStrTitle(\"Picture uploads\");\n\n $objRepo->setStrPath(_filespath_.\"/images/upload\");\n $objRepo->setStrUploadFilter(\".jpg,.png,.gif,.jpeg\");\n $objRepo->setStrViewFilter(\".jpg,.png,.gif,.jpeg\");\n $objRepo->updateObjectToDb();\n $objRepo->syncRepo();\n\n $strReturn .= \"ID of new repo: \".$objRepo->getSystemid().\"\\n\";\n\n $strReturn .= \"Setting the repository as the default images repository\\n\";\n $objSetting = class_module_system_setting::getConfigByName(\"_mediamanager_default_imagesrepoid_\");\n $objSetting->setStrValue($objRepo->getSystemid());\n $objSetting->updateObjectToDb();\n\n $strReturn .= \"Creating file upload folder\\n\";\n if(!is_dir(_realpath_._filespath_.\"/public\"))\n mkdir(_realpath_._filespath_.\"/public\", 0777, true);\n\n $strReturn .= \"Creating new file repository\\n\";\n $objRepo = new class_module_mediamanager_repo();\n\n if($this->strContentLanguage == \"de\")\n $objRepo->setStrTitle(\"Hochgeladene Dateien\");\n else\n $objRepo->setStrTitle(\"File uploads\");\n\n $objRepo->setStrPath(_filespath_.\"/downloads\");\n $objRepo->setStrUploadFilter(\".zip,.pdf,.txt\");\n $objRepo->setStrViewFilter(\".zip,.pdf,.txt\");\n $objRepo->updateObjectToDb();\n $objRepo->syncRepo();\n $strReturn .= \"ID of new repo: \".$objRepo->getSystemid().\"\\n\";\n\n $strReturn .= \"Setting the repository as the default files repository\\n\";\n $objSetting = class_module_system_setting::getConfigByName(\"_mediamanager_default_filesrepoid_\");\n $objSetting->setStrValue($objRepo->getSystemid());\n $objSetting->updateObjectToDb();\n\n\n return $strReturn;\n }", "public function create($data = array()) {\n\t\tparent::create($data);\n\t\t$this->dir = new RepoDir(false);\n\t\treturn $this;\n\t}", "protected function getObjectManager()\n {\n return $this->managerRegistry->getManager($this->managerName);\n }", "public function getRepository($entityName)\n {\n if (!class_exists($entityName)) {\n throw new \\RuntimeException(sprintf('Given entity %s does not exist', $entityName));\n }\n\n if (null === $repository = $this->getRepositoryClassName($entityName)) {\n $repository = 'Al\\Component\\QuickBase\\Model\\Repository';\n }\n\n return new $repository($this);\n }", "public function make()\n {\n if ($this->readers === null || $this->writers === null) {\n $defaults = self::defaultAdapters();\n }\n\n return new AdapterRepository(\n $this->readers === null ? $defaults : $this->readers,\n $this->writers === null ? $defaults : $this->writers,\n $this->immutable\n );\n }", "public function testCreateMemoryDB()\n {\n $dbManager = new DbManager([\n 'driver' => [\n 'name' => 'sqlite',\n 'arguments' => [\n ['location' => SQLite::LOCATION_MEMORY]\n ]\n ]\n ]);\n\n $this->assertInstanceOf(DbManager::class, $dbManager);\n\n return $dbManager;\n }", "public static function generateManager(): LaramoreManager\n {\n return new ValidationManager([]);\n }", "protected function getSecurity_Authentication_ManagerService()\n {\n $this->services['security.authentication.manager'] = $instance = new \\Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationProviderManager(array(0 => new \\Symfony\\Component\\Security\\Core\\Authentication\\Provider\\DaoAuthenticationProvider(${($_ = isset($this->services['fos_user.user_provider.username']) ? $this->services['fos_user.user_provider.username'] : $this->getFosUser_UserProvider_UsernameService()) && false ?: '_'}, ${($_ = isset($this->services['security.user_checker']) ? $this->services['security.user_checker'] : $this->getSecurity_UserCheckerService()) && false ?: '_'}, 'main', $this->get('security.encoder_factory'), true), 1 => new \\Symfony\\Component\\Security\\Core\\Authentication\\Provider\\AnonymousAuthenticationProvider('594831ac756863.97507592')), true);\n\n $instance->setEventDispatcher($this->get('event_dispatcher'));\n\n return $instance;\n }", "public function store()\n {\n $validated = request()->validate([\n 'name' => ['required', 'regex:/^[A-Za-z0-9_]*$/']\n ]);\n\n $repository = new Repository();\n $repository->name = $validated['name'];\n\n chdir('D:\\repositories');\n// file_put_contents('conf/gitolite.conf', $lines);// insert gitolite.conf\n// shell_exec('git config user.email tarc@admin');\n// shell_exec('git config user.name TARC_Admin');\n// shell_exec('git add conf/gitolite.conf');\n// shell_exec('git commit -m '.Staff::where('user_id', Auth::user()->id)->first()->staff_id);\n// shell_exec('git pull');\n// shell_exec('git push');\n shell_exec('git clone '. config('gitolite.git_server_url') .':' . $repository->name);\n// $output = shell_exec('rm -rf '.escapeshellarg($repository->name));\n// dd($output);\n return redirect('repositories')->with('success', 'Your '.$repository->name . ' repository has been created.');;\n }", "public function getRepository(){\n return $this->repository;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public static function getManager()\n {\n return new ImageManager([\n \"driver\" => self::getAvailableDriver(),\n ]);\n }", "public function getModuleManager();", "public function getManager()\n {\n $symfonyProcess = new Process($this->command);\n $symfonyProcess->setTimeout($this->timeout);\n\n $process = new InteractiveProcess(\n $symfonyProcess,\n $this->pipe,\n $this->waitStrategy\n );\n\n $this->manager->setProcess($process);\n\n return $this->manager;\n }", "public function getRepository($className);", "function createModule() \n {\n // load Module manager\n $moduleID = $this->values[ ModuleCreator::KEY_MODULE_ID ];\n $moduleManager = new RowManager_ModuleManager( $moduleID );\n \n $this->storeCommonVariables( $moduleManager );\n \n \n // if Module manager is not created then\n if (!$moduleManager->isCreated()) {\n \n // create Module Directory\n $directoryName = '';\n if ( !$moduleManager->isCore() ) {\n $directoryName = 'app_';\n }\n $directoryName .= $moduleManager->getModuleName();\n $this->createDirectory( $directoryName );\n \n // Create Base Files\n $this->createBaseFiles( $moduleManager );\n \n // update created status\n $moduleManager->setCreated();\n \n } else {\n \n // make sure variable info is updated\n \n }// end if\n \n \n // process StateVar info\n $this->processStateVarInfo( $moduleID );\n \n // process Data Access Object info\n $this->processDataAccessObjectInfo( $moduleID );\n \n // process Page Object info\n $this->processPageInfo( $moduleID );\n \n // process Page Transitions (form) info\n $this->processTransition( $moduleID );\n \n \n }", "public function manager()\n {\n \treturn $this->hasOne(manager::class);\n }", "protected function getPersistenceUnitRepository()\n {\n return $this->persistenceUnitRepository;\n }" ]
[ "0.7590872", "0.663245", "0.6438831", "0.6384132", "0.63506365", "0.6331685", "0.6193475", "0.61866355", "0.6169705", "0.6022134", "0.59838897", "0.5978751", "0.59387434", "0.58946335", "0.58865243", "0.57438046", "0.57409316", "0.5739539", "0.57221764", "0.56862164", "0.56724334", "0.5662611", "0.5651234", "0.55727065", "0.5570484", "0.5565625", "0.5560882", "0.55525804", "0.5540974", "0.55049354", "0.54993206", "0.54904556", "0.54873973", "0.54853314", "0.5472475", "0.54708385", "0.54498166", "0.5433207", "0.54040813", "0.5402429", "0.5399889", "0.5399889", "0.53916883", "0.53881705", "0.53804815", "0.5376435", "0.5369514", "0.5364217", "0.5318663", "0.52941984", "0.5277782", "0.5255254", "0.52505547", "0.5248591", "0.52414155", "0.52149755", "0.52112585", "0.52112585", "0.52112585", "0.52112585", "0.52112585", "0.52112585", "0.5198948", "0.5186533", "0.51851386", "0.5180786", "0.51767087", "0.51661855", "0.5155307", "0.51549923", "0.51489264", "0.5123272", "0.512277", "0.5118249", "0.5114701", "0.51127887", "0.5112525", "0.5105595", "0.51042217", "0.51030624", "0.5098414", "0.5082491", "0.5081624", "0.50812703", "0.50763005", "0.5072742", "0.5061111", "0.50530803", "0.50521004", "0.504947", "0.503975", "0.50324047", "0.50324047", "0.50324047", "0.5022925", "0.50137913", "0.5006367", "0.50057733", "0.5004419", "0.4999968", "0.49970803" ]
0.0
-1
Run the database seeds.
public function run() { DB::table('vines')->insert([ 'channel_id' => 3, 'channel_name' => 'lucaszera', 'title' => str_random(10), 'link' => 'watch?v=Ea3-Pcejfio', 'server' => 'Impera', 'playmode' => 'PvP', 'pvptype' => 'Open PvP', 'description' => 'Rei lucas teste tst', ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Prepend PHP code before the output (but after the namespace statement if present).
public function prependCode($code) { return $this->prependOutput($this->closePhpCode($this->openPhpCode($code))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prependOutput($code)\n {\n $this->setOutput(\n $this->hasNamespaceStatement($namespaceStatement, $output)\n ? $this->concatCode(\n $this->closePhpCode($namespaceStatement),\n $code,\n $this->openPhpCode($output)\n )\n : $this->concatCode($code, $this->output)\n );\n }", "protected function transpileEndPrepend(): string\n {\n return '<?php $__env->stopPrepend(); ?>';\n }", "protected function transpilePrepend($expression): string\n {\n return \"<?php \\$__env->startPrepend{$expression}; ?>\";\n }", "public function prependNamespace($namespace, $hints);", "public function insertPhpCode($code)\n {\n $this->current_buffer->append_subtree($this, new Smarty_Internal_ParseTree_Tag($this, $code));\n }", "public function prependNamespace(string $namespace, $hints);", "function yy_r14()\n {\n if ($this->text_is_php) {\n $this->compiler->prefix_code[] = $this->yystack[$this->yyidx + 0]->minor;\n $this->compiler->nocacheCode('', true);\n } else {\n // inheritance child templates shall not output text\n if (! $this->compiler->isInheritanceChild || $this->compiler->block_nesting_level > 0) {\n if ($this->strip) {\n $this->compiler->template_code->php('echo ')->string(preg_replace('![\\t ]*[\\r\\n]+[\\t ]*!', '', $this->yystack[$this->yyidx + 0]->minor))->raw(\";\\n\");\n } else {\n $this->compiler->template_code->php('echo ')->string($this->yystack[$this->yyidx + 0]->minor)->raw(\";\\n\");\n }\n }\n }\n }", "function yy_r75(){ $this->prefix_number++; $this->compiler->prefix_code[] = '<?php ob_start();?>'.$this->yystack[$this->yyidx + 0]->minor.'<?php $_tmp'.$this->prefix_number.'=ob_get_clean();?>'; $this->_retvalue = '$_tmp'.$this->prefix_number; }", "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 addNamespace($namespace);", "public function removeNamespaceDeclarations() {\n\t\t$this->processedClassCode = preg_replace(self::PATTERN_NAMESPACE_DECLARATION, '', $this->processedClassCode);\n\t}", "public function generate() {\n return 'namespace ' . $this->namespace;\n }", "public static function fixNamespaceDeclarations($source)\n {\n if (!function_exists('token_get_all') || !self::$useTokenizer) {\n if (preg_match('/(^|\\s)namespace(.*?)\\s*;/', $source)) {\n $source = preg_replace('/(^|\\s)namespace(.*?)\\s*;/', \"$1namespace$2\\n{\", $source).\"}\\n\";\n }\n\n return $source;\n }\n\n $rawChunk = '';\n $output = '';\n $inNamespace = false;\n $tokens = token_get_all($source);\n\n for ($i = 0; isset($tokens[$i]); ++$i) {\n $token = $tokens[$i];\n if (!isset($token[1]) || 'b\"' === $token) {\n $rawChunk .= $token;\n } elseif (in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {\n // strip comments\n continue;\n } elseif (T_NAMESPACE === $token[0]) {\n if ($inNamespace) {\n $rawChunk .= \"}\\n\";\n }\n $rawChunk .= $token[1];\n\n // namespace name and whitespaces\n while (isset($tokens[++$i][1]) && in_array($tokens[$i][0], array(T_WHITESPACE, T_NS_SEPARATOR, T_STRING))) {\n $rawChunk .= $tokens[$i][1];\n }\n if ('{' === $tokens[$i]) {\n $inNamespace = false;\n --$i;\n } else {\n $rawChunk = rtrim($rawChunk).\"\\n{\";\n $inNamespace = true;\n }\n } elseif (T_START_HEREDOC === $token[0]) {\n $output .= self::compressCode($rawChunk).$token[1];\n do {\n $token = $tokens[++$i];\n $output .= isset($token[1]) && 'b\"' !== $token ? $token[1] : $token;\n } while ($token[0] !== T_END_HEREDOC);\n $output .= \"\\n\";\n $rawChunk = '';\n } elseif (T_CONSTANT_ENCAPSED_STRING === $token[0]) {\n $output .= self::compressCode($rawChunk).$token[1];\n $rawChunk = '';\n } else {\n $rawChunk .= $token[1];\n }\n }\n\n if ($inNamespace) {\n $rawChunk .= \"}\\n\";\n }\n\n $output .= self::compressCode($rawChunk);\n\n if (\\PHP_VERSION_ID >= 70000) {\n // PHP 7 memory manager will not release after token_get_all(), see https://bugs.php.net/70098\n unset($tokens, $rawChunk);\n gc_mem_caches();\n }\n\n return $output;\n }", "function yy_r172()\n {\n if (empty($this->db_quote_code_buffer)) {\n $this->db_quote_code_buffer = \"ob_start();\\n\";\n }\n $this->db_quote_code_buffer .= $this->yystack[$this->yyidx + - 1]->minor->buffer;\n if ($this->block_nesting_level == count($this->compiler->_tag_stack)) {\n $this->prefix_number ++;\n $code = new Smarty_Compiler_Code();\n $code->iniTagCode($this->compiler);\n $code->formatPHP($this->db_quote_code_buffer . ' $_tmp' . $this->prefix_number . '=ob_get_clean();')->newline();\n $this->compiler->prefix_code[] = $code;\n $this->db_quote_code_buffer = '';\n $this->_retvalue = '$_tmp' . $this->prefix_number;\n } else {\n $this->_retvalue = false;\n }\n\n }", "public function add_head_marker() {\n\t\tglobal $wpUnited;\n\n\t\tif ($wpUnited->should_do_action('template-p-in-w') && (!PHPBB_CSS_FIRST)) {\n\t\t\techo '<!--[**HEAD_MARKER**]-->';\n\t\t}\n\t}", "function yy_r163(){ $this->prefix_number++; $this->compiler->prefix_code[] = '<?php ob_start();?>'.$this->yystack[$this->yyidx + 0]->minor.'<?php $_tmp'.$this->prefix_number.'=ob_get_clean();?>'; $this->_retvalue = '\".$_tmp'.$this->prefix_number.'.\"'; $this->compiler->has_variable_string = true; }", "public function PrependOutput(string $prepend = null) : self|string \n {\n if($prepend == null) return $this->prepend;\n else {\n $this->prepend = $prepend;\n return $this;\n }\n }", "function yy_r104()\n {\n $this->prefix_number ++;\n $code = new Smarty_Compiler_Code();\n $code->iniTagCode($this->compiler);\n $code->php(\"ob_start();\")->newline();\n $code->mergeCode($this->yystack[$this->yyidx + 0]->minor);\n $code->php(\"\\$_tmp{$this->prefix_number} = ob_get_clean();\")->newline();\n $this->compiler->prefix_code[] = $code;\n $this->_retvalue = '$_tmp' . $this->prefix_number;\n }", "public abstract function add($prefix, $output);", "public function prepend($middleware): void;", "public function stdWrap_prepend($content = '', $conf = [])\n {\n return $this->cObjGetSingle($conf['prepend'], $conf['prepend.'], '/stdWrap/.prepend') . $content;\n }", "public function testPrepend() {\n\t\t\t$builder = new StringBuilder();\n\t\t\t$builder->prepend(\"Hello\")->prepend(\"World\");\n\n\t\t\t$this->assertEquals(\"WorldHello\", $builder->__toString());\n\t\t\tunset($builder);\n\t\t}", "public function beforeCompile(): void\n\t{\n\t\tif (PHP_SAPI !== 'cli') {\n\t\t\treturn;\n\t\t}\n\n\t\t$builder = $this->getContainerBuilder();\n\n\t\t// Lookup for Symfony Console Application\n\t\t$application = $builder->getDefinitionByType(Application::class);\n\n\t\t// Register helper\n\t\t$neonizerHelper = $this->prefix('@neonizerHelper');\n\t\t$application->addSetup(new Statement('$service->getHelperSet()->set(?)', [$neonizerHelper]));\n\t}", "function yy_r137(){$this->prefix_number++; $this->compiler->prefix_code[] = '<?php $_tmp'.$this->prefix_number.'='.$this->yystack[$this->yyidx + 0]->minor.';?>'; $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.'$_tmp'.$this->prefix_number; }", "protected function transpileEndForeach(): string\n {\n return '<?php endforeach; ?>';\n }", "static function php_compiler ($space, $html)\n {\n return \"<?php\\n$space$html?>\";\n }", "function tideways_prepend_overwritten()\n{\n}", "function yy_r7(){ $this->compiler->tag_nocache = true; $this->_retvalue = $this->cacher->processNocacheCode(\"<?php echo '<?xml';?>\", $this->compiler, true); }", "function addNamespaces(array $namespaces);", "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 registerNamespaces();", "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}", "abstract protected function namespace(): string;", "protected function transpileEndEmpty(): string\n {\n return '<?php endif; ?>';\n }", "public function insert_inline_scripts() {\n }", "public function insert_inline_scripts() {\n }", "public function insert_inline_scripts() {\n }", "public function addScriptToHeader($context)\n\t\t{\n\t\t\tif(!empty(Symphony::Engine()->Author))\n\t\t\t{\n\t\t\t\tif(Symphony::Engine()->Author->isDeveloper())\n\t\t\t\t{\n\t\t\t\t\t$context['output'] = str_replace('</head>', '\n\t\t\t\t\t\t<link rel=\"stylesheet\" type=\"text/css\" media=\"screen,tv,projection\" href=\"'.URL.'/extensions/frontend_debug/assets/frontend_debug.css\" />\n\t\t\t\t\t\t<script type=\"text/javascript\" src=\"'.URL.'/extensions/frontend_debug/assets/frontend_debug.js\"></script>\n\t\t\t\t\t\t</head>', $context['output']);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function flipboard_namespace() {\n echo 'xmlns:media=\"http://search.yahoo.com/mrss/\"\n xmlns:georss=\"http://www.georss.org/georss\"';\n}", "function custom_header_container(){?>\n<?php \n}", "function prepend($content) {\n\t\t$this->write($content . $this->read());\n\t}", "protected function transpileEndForElse(): string\n {\n return '<?php endif; ?>';\n }", "function yy_r10()\n {\n if ($this->php_handling == Smarty::PHP_PASSTHRU) {\n $this->compiler->template_code->php(\"echo '<%';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_QUOTE) {\n $this->compiler->template_code->php(\"echo '&lt;%';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_ALLOW) {\n if ($this->asp_tags) {\n if (! ($this->compiler->template instanceof SmartyBC)) {\n $this->compiler->error(self::Err3);\n }\n $this->text_is_php = true;\n } else {\n $this->compiler->template_code->php(\"echo '<%';\\n\");\n }\n } elseif ($this->php_handling == Smarty::PHP_REMOVE) {\n if (! $this->asp_tags) {\n $this->compiler->template_code->php(\"echo '<%';\\n\");\n }\n }\n }", "public function mergePrefixCode($code)\n {\n $tmp = '';\n foreach ($this->compiler->prefix_code as $preCode) {\n $tmp .= $preCode;\n }\n $this->compiler->prefix_code = array();\n $tmp .= $code;\n return new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode($tmp, true));\n }", "public function m4() {\n $project = $this->project;\n $sources = implode(\" \", $this->sources);\n $date = date(\"Y-m-d H:i:s\");\n $m4_alias = str_replace('_', '-', $this->code);\n ob_start();\n echo <<<M4\ndnl Koda compiler, {$date}.\n\nPHP_ARG_WITH({$this->code}, for {$project->name} support,\n[ --with-{$m4_alias} Include {$project->name} support])\nPHP_ARG_ENABLE({$m4_alias}-debug, whether to enable debugging support in {$project->name},\n[ --enable-{$m4_alias}-debug Enable debugging support in {$project->name}], no, no)\n\nif test \"\\$PHP_{$this->CODE}_DEBUG\" != \"no\"; then\n AC_DEFINE({$this->CODE}_DEBUG, 1, [Include debugging support in {$project->name}])\n AC_DEFINE(KODA_DEBUG, 1, [Include koda debugging])\n CFLAGS=\"\\$CFLAGS -Wall -g3 -ggdb -O0\"\nelse\ndnl todo: remove this\n CFLAGS=\"\\$CFLAGS -Wall -g3 -ggdb -O0\"\nfi\n\nif test \"\\$PHP_{$this->CODE}\" != \"no\"; then\n PHP_ADD_INCLUDE(.)\n PHP_SUBST({$this->CODE}_SHARED_LIBADD)\n PHP_NEW_EXTENSION({$this->code}, {$sources}, \\$ext_shared,, \\$CFLAGS)\nfi\nM4;\n return ob_get_clean();\n }", "public function add_boilerplate() {\n\t\t$boilerplate = \"\\n\\n<!--\\n phpBB <-> WordPress integration by John Wells, (c) 2006-2013 www.wp-united.com \\n-->\\n\\n\";\n\t\t$this->innerContent = $this->innerContent . $boilerplate;\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}", "public function core_upgrade_preamble() {\n\t\t// They need to be able to perform backups, and to perform updates\n\t\tif (!UpdraftPlus_Options::user_can_manage() || (!current_user_can('update_core') && !current_user_can('update_plugins') && !current_user_can('update_themes'))) return;\n\n\t\tif (!class_exists('UpdraftPlus_Addon_Autobackup')) {\n\t\t\tif (defined('UPDRAFTPLUS_NOADS_B')) return;\n\t\t}\n\n\t\t?>\n\t\t<?php\n\t\t\tif (!class_exists('UpdraftPlus_Addon_Autobackup')) {\n\t\t\t\tif (!class_exists('UpdraftPlus_Notices')) include_once(UPDRAFTPLUS_DIR.'/includes/updraftplus-notices.php');\n\t\t\t\tglobal $updraftplus_notices;\n\t\t\t\techo apply_filters('updraftplus_autobackup_blurb', $updraftplus_notices->do_notice('autobackup', 'autobackup', true));\n\t\t\t} else {\n\t\t\t\techo apply_filters('updraftplus_autobackup_blurb', '');\n\t\t\t}\n\t\t?>\n\t\t<script>\n\t\tjQuery(function() {\n\t\t\tjQuery('.updraft-ad-container').appendTo(jQuery('.wrap p').first());\n\t\t});\n\t\t</script>\n\t\t<?php\n\t}", "private function appendIfModuleCheckStart(){\n\t\t$string = '<IfModule mod_rewrite.c>';\n\t\t$this->appendLineToRewrites($string);\n\t}", "public function register($prepend = false)\n {\n $this->composerClassLoader->unregister();\n spl_autoload_register(array($this, 'loadClassWithAlias'), true, $prepend);\n }", "function generateScriptHeader(& $Code) {\r\n ob_start();\r\n ?>\r\n/**@ * include 'remoteobject.js';\r\n <?php\r\n switch ( $this->RequestMethod ) {\r\n case 'rawpost':\r\n ?>\r\n* include 'request/rawpost.js';\r\n <?php\r\n break;\r\ncase 'post':\r\n ?>\r\n* include 'request/rawpost.js';\r\n <?php\r\n break;\r\n }\r\n\r\n if ( $this->RequestEncoding == 'xml' ) {\r\n ?>\r\n\r\n* include 'encode/xml.js';\r\n <?php\r\n } else {\r\n ?>\r\n* include 'encode/php.js';\r\n <?php\r\n }\r\n ?>\r\n*/\r\n <?php\r\n $Code->append(ob_get_contents());\r\n ob_end_clean();\r\n }", "public function testPrependLinePrefix() {\n\t\t\t$builder = new StringBuilder();\n\t\t\t$builder->setLineEnd(StringBuilder::LE_UNIX);\n\t\t\t$builder->prependLine(\"Hello\", false)->prependLine(\"World\", false);\n\n\t\t\t$this->assertEquals(\"\\nWorld\\nHello\", $builder->__toString());\n\t\t\tunset($builder);\n\t\t}", "function xml_end_functions($dir, $k, &$xml, $prepinace){\n \n $newline = \"\";\n if($prepinace[\"pretty\"]){\n $newline = \"\\n\"; \n }\n \n $xml .= \"</functions>\".$newline;\n}", "protected function compileIncludeFirst(string $expression): string\n {\n $expression = $this->stripParentheses($expression);\n\n return \"<?php echo \\$__env->first({$expression}, \\\\Hyperf\\\\Utils\\\\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>\";\n }", "function yy_r8()\n {\n if ($this->php_handling == Smarty::PHP_PASSTHRU) {\n $this->compiler->template_code->php(\"echo '<?php';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_QUOTE) {\n $this->compiler->template_code->php(\"echo '&lt;?php';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_ALLOW) {\n if (! ($this->compiler->context->smarty instanceof Smarty_Smarty2BC)) {\n $this->compiler->error(self::Err3);\n }\n $this->text_is_php = true;\n }\n }", "function yy_r13()\n {\n $this->is_xml = true;\n $this->compiler->template_code->php(\"echo '<?xml';\\n\");\n }", "private function compileComplex(Compiler $compiler): void\n {\n $prefix = $this->getAttribute('prefix');\n $postfix = $this->getAttribute('postfix');\n $lines = $this->getNode('lines');\n\n // We use normal subcompilation, which uses echo so we buffer our output.\n $compiler->write(\"ob_start();\\n\");\n $compiler->subcompile($lines);\n\n $ltrim_prefix = ltrim($prefix); // Trimmed version for use on first line\n $indent = ! trim($prefix) && ! trim($postfix); // Are we only indenting or also prefixing\n\n // Fetch the content of the lines inside of this block\n // and itterate over them\n $compiler\n ->write(\"\\$lines = explode(\\\"\\\\n\\\", ob_get_clean());\\n\")\n ->write(\"foreach (\\$lines as \\$key => \\$line) {\\n\")\n ->indent(1);\n\n // If we are indenting code we have the risk of generating empty lines, so check for this.\n if ($indent) {\n $compiler\n ->write(\"if (trim(\\$line)) {\\n\")\n ->indent(1);\n }\n\n // Write out the prefix for this line.\n if ($prefix) {\n $compiler->write(\"echo \\$key > 0 ? '$prefix' : '$ltrim_prefix' ;\\n\");\n }\n\n // Write the line itself\n $compiler->write(\"echo \\\"\\$line\\\";\\n\");\n\n // Close if statement for empty line check when indenting.\n if ($indent) {\n $compiler\n ->outdent(1)\n ->write(\"}\\n\");\n }\n\n // Write postfix and new line.\n $compiler\n ->write(\"echo \\\"$postfix\\\\n\\\";\\n\")\n ->outdent(1)\n ->write(\"}\\n\");\n }", "public function generate()\n {\n $placeHolders = [\n '<nameSpace>',\n '<useSpace>',\n '<annotation>',\n '<className>',\n '<body>',\n ];\n\n $replacements = [\n $this->generateNameSpace(),\n $this->generateUseStatements(),\n $this->generateAnnotation(),\n $this->generateClassName(),\n $this->generateBody(),\n ];\n\n $code = str_replace($placeHolders, $replacements, self::$classTemplate);\n\n return str_replace('<spaces>', $this->baseClass->getSpaces(), $code);\n }", "function _pre() {\n\n\t}", "public function testCompileBlockChildPrepend()\n {\n $result = $this->smarty->fetch('test_block_child_prepend.tpl');\n $this->assertContains(\"prepend - Default Title\", $result);\n }", "function basecss_insert_head($flux){\n\tif (!test_plugin_actif('Zcore')){\n\t\t$flux .= \"<\".\"?php header(\\\"X-Spip-Filtre: basecss_pied_de_biche\\\"); ?\".\">\";\n\t}\n\treturn $flux;\n}", "protected function prepend_controls($out = '')\n\t{\n\t\t// Check if we are in 'line' context and if the control div has been added\n\t\tif ($this->line_opened === true && $this->controls_opened === false)\n\t\t{\n\t\t\t$out = '<div class=\"controls\">'.\"\\n\".$out;\n\t\t\t$this->controls_opened = true;\n\t\t}\n\t\treturn $out;\n\t}", "protected function addAdditionalScript() {\necho <<< HTML\n <script src=\"scripts/ajax.js\"></script>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"styles/customer.css\">\nHTML; \n }", "public function beforeToHtml()\n {\n if (!\\class_exists('Mage')) {\n class_alias('\\LCB\\Mage\\Framework\\Mage', 'Mage');\n }\n }", "function addHeaderCode() {\r\n echo '<link type=\"text/css\" rel=\"stylesheet\" href=\"' . plugins_url('css/bn-auto-join-group.css', __FILE__).'\" />' . \"\\n\";\r\n}", "function pre_echo( $var ) {\n\techo '<pre>'.\"\\n\";\n\techo $var;\n\techo '</pre>'.\"\\n\";\n}", "public function hookHeader()\n\t{\n\t\t/* If 1.4 and no backward, then leave */\n\t\tif (!$this->backward)\n\t\t\treturn;\n\n\t\t/* Continue only if we are in the checkout process */\n\t\tif (Tools::getValue('controller') != 'order-opc' && (!($_SERVER['PHP_SELF'] == __PS_BASE_URI__.'order.php' || $_SERVER['PHP_SELF'] == __PS_BASE_URI__.'order-opc.php' || Tools::getValue('controller') == 'order' || Tools::getValue('controller') == 'orderopc' || Tools::getValue('step') == 3)))\n\t\t\treturn;\n\n\t\t/* Load JS and CSS files through CCC */\n\t\t$this->context->controller->addCSS($this->_path.'views/css/stripe-prestashop.css');\n\t\t\n\t\treturn '<script src=\"https://checkout.stripe.com/checkout.js\"></script>';\n\t}", "static public function prependIncludePath($path)\r\n {\r\n \tset_include_path(\r\n \t\t$path . PATH_SEPARATOR . \r\n \t\tget_include_path()\r\n \t);\r\n }", "protected function openPhp()\n\t{\n\t\tif ($this->in_php) {\n\t\t\treturn '';\n\t\t}\n\t\t$this->in_php = true;\n\t\treturn '<?php ';\n\t}", "function pre_tidy_ASP () {\r\n\t\t// document object could properly be created then somehow revert the ASP to its preprocessed state.\r\n\t\t// also: there could be includes with includes in them so we must process until no chances are made\r\n\t\t// but since we need to remove these afterwards; we need some way to mark the level of the include so as to\r\n\t\t// be able to match its closing and ending tags without using the DOM (since we cannot save the DOM after \r\n\t\t// unincluding some code since it may be necessary for the DOM.\r\n\t\t$ASP_include_statements = array(array(-1),-1);\r\n\t\t$count_of_level_of_include = 1;\r\n\t\tpreg_match_all('/<!--#include virtual=\"([^\"]*)\" -->/is', $this->code, $ASP_include_statements);\r\n\t\tforeach($ASP_include_statements[0] as $index => $ASP_include_statement) {\r\n\t\t\t$this->code = str_replace($ASP_include_statements[0][$index], '<!--ASPInclude' . $count_of_level_of_include . 'Begin-->\r\n' . html_entity_decode(file_get_contents(substr($ASP_include_statements[1][$index], 1))) . '<!--ASPInclude' . $count_of_level_of_include . 'End-->\r\n', $this->code);\r\n\t\t}\r\n\t\t$this->code = str_replace('<%', '<!--9o9ASPopen9o9', $this->code);\r\n\t\t$this->code = str_replace('%>', '9o9ASPclose9o9-->', $this->code);\r\n\t\t$count_of_level_of_include++;\r\n\t\treturn true;\t\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 }", "public static function addNamespace(string $prefix, string $baseDir, bool $prepend = false): void\n {\n if (!self::$registered) {\n spl_autoload_register([__CLASS__, 'load']);\n self::$registered = true;\n }\n\n // normalize namespace prefix\n $prefix = trim($prefix, '\\\\') . '\\\\';\n\n // normalize the base directory with a trailing separator\n $baseDir = rtrim($baseDir, '/') . DIRECTORY_SEPARATOR;\n $baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR) . '/';\n\n // initialize the namespace prefix array\n if (!isset(self::$map[$prefix])) {\n self::$map[$prefix] = [];\n }\n\n // retain the base directory for the namespace prefix\n if ($prepend) {\n array_unshift(self::$map[$prefix], $baseDir);\n } else {\n self::$map[$prefix][] = $baseDir;\n }\n }", "protected function printNamespaceDeclarations(){\n \n $unique_namespaces = array();\n $output = '';\n \n foreach( $this->getNamespaceHeap() as $namespace ){\n \n $application_namespace = explode( '.', $namespace );\n \n for( $index = 0; $index < count( $application_namespace ); $index++ ){\n \n $namespace_name = implode( '.', array_slice($application_namespace, 0, $index + 1) );\n \n $unique_namespaces[$namespace_name] = null;\n\n }\n \n }\n \n $unique_namespaces = array_keys( $unique_namespaces );\n\n foreach( $unique_namespaces as $unique_namespace ){\n\n if( !preg_match('/\\\\./', $unique_namespace) ){\n\n $output .= 'var ';\n \n }\n \n $output .= $unique_namespace . ' = ' . $unique_namespace . ' || {};' . \"\\n\";\n\n }\n\n return $output;\n\n }", "function yy_r11()\n {\n if ($this->php_handling == Smarty::PHP_PASSTHRU) {\n $this->compiler->template_code->php(\"echo '%>';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_QUOTE) {\n $this->compiler->template_code->php(\"echo '%&gt;';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_ALLOW) {\n if ($this->asp_tags) {\n $this->text_is_php = false;\n } else {\n $this->compiler->template_code->php(\"echo '%>';\\n\");\n }\n } elseif ($this->php_handling == Smarty::PHP_REMOVE) {\n if (! $this->asp_tags) {\n $this->compiler->template_code->php(\"echo '%>';\\n\");\n }\n }\n }", "public function prependContent ($content) {\r\n\t\t$this->content = (string)$content.$this->content;\r\n\t}", "public function prepend(ContainerBuilder $container): void\n {\n $extension = $container->getExtensions() ;\n\n }", "function prepend($content){\n\t\t$this->_String4 = \"$content\".$this->_String4;\n\t\treturn $this;\n\t}", "public function testPrependOrdering()\n {\n $one = function () {\n };\n $two = function () {\n };\n\n $stack = new MiddlewareStack();\n $this->assertCount(0, $stack);\n\n $stack->push($one);\n $this->assertCount(1, $stack);\n\n $stack->prepend($two);\n $this->assertCount(2, $stack);\n\n $this->assertSame($two, $stack->get(0));\n $this->assertSame($one, $stack->get(1));\n }", "function escapePhp() {\n\t\t$rv = $this->getContents();\n\t\t$changes = array(\n\t\t\t'<?' => '&lt;?',\n\t\t\t'?>' => '?&gt;',\n\t\t);\n\t\treturn str_replace( array_keys( $changes ), $changes, $rv );\n\t}", "function lapa_compiler_php_code($act, $parser)\n{\n if ($act == 1) {\n $buff = '';\n if (!isset(LapaEngineParser::$_plugins_property['php_code'])) {\n LapaEngineParser::$_plugins_property['php_code'] = array();\n }\n $attr = $parser->parseDirectiveAttributes();\n $name = isset($attr['name']) ? $attr['name']: 'default';\n $parser->newStackCommand(array('php_code', $name));\n $parser->_outputNew();\n }else {\n if ( (!$stack_commands = $parser->getStackCommand() ) || $stack_commands[0] != 'php_code' ) {\n throw new LapaEngineException('Неверный вызов \"/php_code\" cтрока %s.', $parser->templateLine());\n }\n /* вырезали буффер php кода, его надо еще вернуть */\n $buff = $parser->_outputGet();\n /* создаем переменную с значением */ \n LapaEngineParser::$_plugins_property['php_code'][$stack_commands[1]] = $stack_commands[1];\n $buff .= \"\\$_var_php_code['{$stack_commands[1]}'] = '\" . preg_replace(\"/(?!\\\\\\\\)\\\\'/\", '\\\\\\'','<?php ' . str_replace('\\\\', '\\\\\\\\',$buff) . ' ?>') . \"';\"; \n $parser->removeStackCommand(); \n LapaEngineParser::$_plugins_property['php_code'][$stack_commands[1]] = $stack_commands[1];\n }\n return $buff;\n}", "public function removeGlobalNamespaceSeparators() {\n\t\t$this->processedClassCode = preg_replace_callback(self::PATTERN_GLOBAL_OBJECT_NAMES, function($matches) {\n\t\t\treturn $matches['objectName'];\n\t\t}, $this->processedClassCode);\n\t}", "private function appendIfModuleCheckEnd(){\n\t\t$string = '</IfModule>';\n\t\t$this->appendLineToRewrites($string);\n\t}", "public static function addNamespace(string $prefix, string $base_dir, bool $prepend = false): void\r\n {\r\n // normalize namespace prefix\r\n $prefix = trim($prefix, '\\\\') . '\\\\';\r\n // normalize the base directory with a trailing separator\r\n $base_dir = rtrim($base_dir, DIRECTORY_SEPARATOR) . '/';\r\n // initialize the namespace prefix array\r\n if ( isset(self::$prefixes[$prefix]) === false ) {\r\n self::$prefixes[$prefix] = [];\r\n }\r\n // retain the base directory for the namespace prefix\r\n if ( $prepend ) {\r\n array_unshift(self::$prefixes[$prefix], $base_dir);\r\n } else {\r\n self::$prefixes[$prefix][] = $base_dir;\r\n }\r\n }", "protected function writeHeader()\n {\n fwrite( $this->fd,\n \"<?php\\n\" );\n }", "function wpplusonethis() {\r\n echo \"\\n\".'<!-- Start wpplusonethis -->'.\"\\n\";\r\n echo '<script type=\"text/javascript\" src=\"https://apis.google.com/js/plusone.js\"></script>' . \"\\n\"; \r\n echo '<!-- End Of wpplusonethis -->'.\"\\n\";\r\n }", "function showBegin( $appctx )\n\t\t{\n\t\t$appctx->Plus() ;\n\t\t}", "public function getNamespace($add_slashes = false)\n {\n return ($add_slashes ? '\\\\' : '') . $this->namespace . ($add_slashes ? '\\\\' : '');\n }", "protected function add_namespace_to_xml(SimpleXmlWriter $xw) {\n $xw->create_attribute('xmlns:unit', 'urn:proforma:tests:unittest:v1.1');\n $xw->create_attribute('xmlns:cs', 'urn:proforma:tests:java-checkstyle:v1.1');\n }", "function yy_r8(){$this->compiler->tag_nocache = true; $this->_retvalue = $this->cacher->processNocacheCode(\"<?php echo '?>';?>\\n\", $this->compiler, true); }", "public function prepend(ContainerBuilder $container)\n {\n $container->prependExtensionConfig('nogrod_xml_client', []);\n }", "function prependIncludePath( $pPath ) {\n\t\tif( !function_exists( \"get_include_path\" ) ) {\n\t\t\tinclude_once( UTIL_PKG_PATH . \"PHP_Compat/Compat/Function/get_include_path.php\" );\n\t\t}\n\t\tif( !defined( \"PATH_SEPARATOR\" ) ) {\n\t\t\tinclude_once( UTIL_PKG_PATH . \"PHP_Compat/Compat/Constant/PATH_SEPARATOR.php\" );\n\t\t}\n\t\tif( !function_exists( \"set_include_path\" ) ) {\n\t\t\tinclude_once( UTIL_PKG_PATH . \"PHP_Compat/Compat/Function/set_include_path.php\" );\n\t\t}\n\n\t\t$include_path = get_include_path();\n\t\tif( $include_path ) {\n\t\t\t$include_path = $pPath . PATH_SEPARATOR . $include_path;\n\t\t} else {\n\t\t\t$include_path = $pPath;\n\t\t}\n\t\treturn set_include_path( $include_path );\n\t}", "function insert_header_code () {\r\n\techo '\r\n\t<script language=\"javascript\" type=\"text/javascript\" src=\"'.get_settings('siteurl').'/wp-content/plugins/sanebull/sbq.js\"></script>\r\n\t<link rel=\"stylesheet\" href=\"'.get_settings('siteurl').'/wp-content/plugins/sanebull/sbq.css\" type=\"text/css\" media=\"screen\" />';\r\n}", "public function visitPhpCodeAstNode( ezcTemplatePhpCodeAstNode $code )\n {\n $this->write( $code->code );\n }", "function wpfc_podcast_add_namespace() {\n\techo 'xmlns:itunes=\"http://www.itunes.com/dtds/podcast-1.0.dtd\"';\n}", "public function WPHead() {\n\t\t// Just tag the page for fun.\n\t\techo \"\\n\\t\" . '<!-- This site uses Good Old Gallery, get it from http://wp.unwi.se/good-old-gallery -->' . \"\\n\\n\";\n\t}", "public function renderAjaxBodyBegin(&$output)\n\t{\n\t\t$html='';\n\t\t$replaceScripts='';\n\t\tif(isset($this->scriptFiles[self::POS_BEGIN])) {\n\t\t\tforeach($this->scriptFiles[self::POS_BEGIN] as $scriptFile)\n\t\t\t\t$replaceScripts.=$this->checkNotExistInsertScriptFile($scriptFile, \"jQuery('body').prepend\").\"\\n\";\n\t\t}\n\t\tif(isset($this->scripts[self::POS_BEGIN]))\n\t\t\t$html.=CHtml::script(implode(\"\\n\",$this->scripts[self::POS_BEGIN])).\"\\n\";\n\t\t\n\t\tif($replaceScripts!=='') {\n\t\t\t$html=CHtml::script($replaceScripts).\"\\n\".$html;\n\t\t}\n\t\tif($html!=='') {\n\t\t\t$output=$html.$output;\n\t\t}\n\t}", "public function testPrependReturn()\n {\n $cb = function () {\n };\n $stack = new MiddlewareStack();\n $this->assertSame($stack, $stack->prepend($cb));\n }", "public function hasNamespaceStatement(&$namespaceStatement = '', &$afterCode = '')\n {\n if (preg_match('/^(<\\?(?:php)?\\s+namespace\\s\\S.*)(((?:;|\\n|\\?>)[\\s\\S]*)?)$/U', $this->output, $matches)) {\n if (substr($matches[2], 0, 1) === ';') {\n $matches[1] .= ';';\n $matches[2] = substr($matches[2], 1);\n }\n\n $namespaceStatement = $matches[1];\n $afterCode = $matches[2];\n\n return true;\n }\n\n $afterCode = $this->output;\n\n return false;\n }", "function ihs_add_script_header() {\n\n\t\t$output = '';\n\n\t\t$id = ihs_get_current_page_id();\n\t\tif ( $id ) {\n\t\t\t$output = stripslashes( get_post_meta( $id, 'ihs_add_script_header_meta', true ) );\n\t\t}\n\t\techo $output;\n\t}", "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}" ]
[ "0.73207927", "0.6238934", "0.564552", "0.5590064", "0.55206805", "0.53966177", "0.5306035", "0.528575", "0.52251965", "0.52210873", "0.5152387", "0.5130917", "0.511452", "0.5095901", "0.5091888", "0.50676155", "0.50452393", "0.5009362", "0.49934798", "0.49457768", "0.49406514", "0.49257657", "0.48904625", "0.48780322", "0.48442784", "0.48406285", "0.48389497", "0.48301533", "0.4800817", "0.47964627", "0.47669804", "0.47401983", "0.47361755", "0.47316936", "0.47292027", "0.47292027", "0.47292027", "0.47285116", "0.47241488", "0.47077483", "0.47028387", "0.46949887", "0.46894786", "0.4680605", "0.4673321", "0.46654868", "0.46618232", "0.46605915", "0.46518746", "0.46508905", "0.46073952", "0.46043083", "0.45961222", "0.45828518", "0.45821384", "0.4575961", "0.4568774", "0.4568602", "0.45635533", "0.45595917", "0.4558312", "0.4556062", "0.4551847", "0.45517495", "0.45504734", "0.45496777", "0.45494092", "0.45440218", "0.4541883", "0.45387232", "0.4538291", "0.45290923", "0.45277026", "0.4526819", "0.4525883", "0.45240986", "0.45231616", "0.45151114", "0.45138544", "0.45123294", "0.45078897", "0.45041955", "0.44992456", "0.44982198", "0.4495981", "0.44953814", "0.44900322", "0.44896704", "0.44850272", "0.448136", "0.4480583", "0.44783145", "0.44778612", "0.4475474", "0.44676557", "0.44631523", "0.44630116", "0.44622016", "0.4461702", "0.44614905" ]
0.61591214
2
Prepend output (HTML code or PHP code with tags) before the output (but after the namespace statement if present).
public function prependOutput($code) { $this->setOutput( $this->hasNamespaceStatement($namespaceStatement, $output) ? $this->concatCode( $this->closePhpCode($namespaceStatement), $code, $this->openPhpCode($output) ) : $this->concatCode($code, $this->output) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prependCode($code)\n {\n return $this->prependOutput($this->closePhpCode($this->openPhpCode($code)));\n }", "protected function transpileEndPrepend(): string\n {\n return '<?php $__env->stopPrepend(); ?>';\n }", "public function prependNamespace($namespace, $hints);", "public function PrependOutput(string $prepend = null) : self|string \n {\n if($prepend == null) return $this->prepend;\n else {\n $this->prepend = $prepend;\n return $this;\n }\n }", "public function prependNamespace(string $namespace, $hints);", "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}", "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 yy_r14()\n {\n if ($this->text_is_php) {\n $this->compiler->prefix_code[] = $this->yystack[$this->yyidx + 0]->minor;\n $this->compiler->nocacheCode('', true);\n } else {\n // inheritance child templates shall not output text\n if (! $this->compiler->isInheritanceChild || $this->compiler->block_nesting_level > 0) {\n if ($this->strip) {\n $this->compiler->template_code->php('echo ')->string(preg_replace('![\\t ]*[\\r\\n]+[\\t ]*!', '', $this->yystack[$this->yyidx + 0]->minor))->raw(\";\\n\");\n } else {\n $this->compiler->template_code->php('echo ')->string($this->yystack[$this->yyidx + 0]->minor)->raw(\";\\n\");\n }\n }\n }\n }", "protected function transpilePrepend($expression): string\n {\n return \"<?php \\$__env->startPrepend{$expression}; ?>\";\n }", "public function renderAjaxBodyBegin(&$output)\n\t{\n\t\t$html='';\n\t\t$replaceScripts='';\n\t\tif(isset($this->scriptFiles[self::POS_BEGIN])) {\n\t\t\tforeach($this->scriptFiles[self::POS_BEGIN] as $scriptFile)\n\t\t\t\t$replaceScripts.=$this->checkNotExistInsertScriptFile($scriptFile, \"jQuery('body').prepend\").\"\\n\";\n\t\t}\n\t\tif(isset($this->scripts[self::POS_BEGIN]))\n\t\t\t$html.=CHtml::script(implode(\"\\n\",$this->scripts[self::POS_BEGIN])).\"\\n\";\n\t\t\n\t\tif($replaceScripts!=='') {\n\t\t\t$html=CHtml::script($replaceScripts).\"\\n\".$html;\n\t\t}\n\t\tif($html!=='') {\n\t\t\t$output=$html.$output;\n\t\t}\n\t}", "protected function prepend_controls($out = '')\n\t{\n\t\t// Check if we are in 'line' context and if the control div has been added\n\t\tif ($this->line_opened === true && $this->controls_opened === false)\n\t\t{\n\t\t\t$out = '<div class=\"controls\">'.\"\\n\".$out;\n\t\t\t$this->controls_opened = true;\n\t\t}\n\t\treturn $out;\n\t}", "function yy_r75(){ $this->prefix_number++; $this->compiler->prefix_code[] = '<?php ob_start();?>'.$this->yystack[$this->yyidx + 0]->minor.'<?php $_tmp'.$this->prefix_number.'=ob_get_clean();?>'; $this->_retvalue = '$_tmp'.$this->prefix_number; }", "public function StartOB() {\n ob_start();\n echo \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\";\n echo \"<urlset xmlns=\\\"http://www.sitemaps.org/schemas/sitemap/0.9\\\">\";\n echo \"\\r\\n\";\n }", "public final function startTag() : string\n {\n return $this->name ? '<' . $this->name . $this->attributes() . (static::$xhtml && $this->isEmpty ? ' />' : '>') : '';\n }", "public function prepend() {\n $num_of_args = func_num_args();\n if ( $num_of_args == 1 && gettype( func_get_arg( 0 ) ) == \"array\" ) {\n $args = func_get_arg( 0 );\n $num_of_args = count( $args );\n } else {\n $args = func_get_args();\n }\n for ( $i = 0; $i < $num_of_args; $i++ ) {\n $arg = $args[$i];\n if ( $arg instanceof AbstractHTMLElement ) {\n $arg = $arg->asHTML();\n }\n $this->content = $arg . $this->content;\n }\n return $this;\n }", "public function stdWrap_prepend($content = '', $conf = [])\n {\n return $this->cObjGetSingle($conf['prepend'], $conf['prepend.'], '/stdWrap/.prepend') . $content;\n }", "public function renderBodyBegin(&$output)\n\t{\n\t\t$html = '';\n\t\tif (isset($this->scriptFiles[self::POS_BEGIN]))\n\t\t{\n\t\t\tforeach ($this->scriptFiles[self::POS_BEGIN] as $scriptFile)\n\t\t\t\t$html.=self::scriptFile($scriptFile) . \"\\n\";\n\t\t}\n\t\tif (isset($this->scripts[self::POS_BEGIN]))\n\t\t\t$html.=self::script(implode(\"\\n\", $this->scripts[self::POS_BEGIN])) . \"\\n\";\n\n\t\tif ($html !== '')\n\t\t{\n\t\t\t$count = 0;\n\t\t\t$output = preg_replace('/(<body\\b[^>]*>)/is', '$1<###begin###>', $output, 1, $count);\n\t\t\tif ($count)\n\t\t\t\t$output = str_replace('<###begin###>', $html, $output);\n\t\t\telse\n\t\t\t\t$output = $html . $output;\n\t\t}\n\t}", "public function testPrepend() {\n\t\t\t$builder = new StringBuilder();\n\t\t\t$builder->prepend(\"Hello\")->prepend(\"World\");\n\n\t\t\t$this->assertEquals(\"WorldHello\", $builder->__toString());\n\t\t\tunset($builder);\n\t\t}", "public function testPrependHtml() {\r\n\t\t$this->testObject->prependHtml ( '<div>test</div>' );\r\n\t\t$this->assertTrue ( '<div>test</div>' == $this->testObject->getPrependHtml (), 'incorrect prepended html found' );\r\n\t}", "public function renderBodyBegin(&$output)\n\t{\n\t\t$html='';\n\t\tif(isset($this->scriptFiles[self::POS_BEGIN]))\n\t\t{\n\t\t\tforeach($this->scriptFiles[self::POS_BEGIN] as $scriptFile)\n\t\t\t\t$html.=self::scriptFile($scriptFile).\"\\n\";\n\t\t}\n\t\tif(isset($this->scripts[self::POS_BEGIN]))\n\t\t\t$html.=CHtml::script(implode(\"\\n\",$this->scripts[self::POS_BEGIN])).\"\\n\";\n\n\t\tif($html!=='')\n\t\t{\n\t\t\t$count=0;\n\t\t\t$output=preg_replace('/(<body\\b[^>]*>)/is','$2<###begin###>',$output,1,$count);\n\t\t\tif($count)\n\t\t\t\t$output=str_replace('<###begin###>',$html,$output);\n\t\t\telse\n\t\t\t\t$output=$html.$output;\n\t\t}\n\t}", "public function startContent() {\n ob_start();\n }", "function HTML_StartHead(){\n\t\techo \"<!DOCTYPE html>\\n\";\n\t\techo \"<html>\\n\";\n\t\techo \"<head>\\n\";\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}", "public function removeNamespaceDeclarations() {\n\t\t$this->processedClassCode = preg_replace(self::PATTERN_NAMESPACE_DECLARATION, '', $this->processedClassCode);\n\t}", "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}", "public abstract function add($prefix, $output);", "public function startIndent() {\r\n\t\treturn '<div class=indent>';\r\n\t}", "function yy_r163(){ $this->prefix_number++; $this->compiler->prefix_code[] = '<?php ob_start();?>'.$this->yystack[$this->yyidx + 0]->minor.'<?php $_tmp'.$this->prefix_number.'=ob_get_clean();?>'; $this->_retvalue = '\".$_tmp'.$this->prefix_number.'.\"'; $this->compiler->has_variable_string = true; }", "public function renderAjaxHead(&$output) {\n\t\t/*\n\t\t$count=preg_match('/(<title\\b[^>]*>|<\\\\/head\\s*>)/is',$output);\n\t\tif ($count){\n\t\t\t$this->renderHead($output);\n\t\t} else {\n\t\t*/\n\t\t\t$replaceScripts='';\n\t\t\t$html='';\n\t\t\tforeach($this->metaTags as $meta)\n\t\t\t\t$replaceScripts.=checkInsertReplaceMeta($meta).\"\\n\";\n\t\t\tforeach($this->linkTags as $link)\n\t\t\t\t$replaceScripts.=$this->checkNotExistInsertLink($link).\"\\n\";\n\t\t\tforeach($this->cssFiles as $url=>$media)\n\t\t\t\t$replaceScripts.=$this->checkNotExistInsertCssFile($url,$media).\"\\n\";\n\t\t\t\t\n\t\t\tforeach($this->css as $css)\n\t\t\t\t$html.=CHtml::css($css[0],$css[1]).\"\\n\";\n\t\t\tif($this->enableJavaScript) {\n\t\t\t\tif(isset($this->scriptFiles[self::POS_HEAD])) {\n\t\t\t\t\tforeach($this->scriptFiles[self::POS_HEAD] as $scriptFile)\n\t\t\t\t\t\t$replaceScripts.=$this->checkNotExistInsertScriptFile($scriptFile, \"jQuery('head').append\").\"\\n\";\n\t\t\t\t}\n\n\t\t\t\tif(isset($this->scripts[self::POS_HEAD]))\n\t\t\t\t\t$html.=CHtml::script(implode(\"\\n\",$this->scripts[self::POS_HEAD])).\"\\n\";\n\t\t\t}\n\t\t\tif($replaceScripts!=='') {\n\t\t\t\t$html=CHtml::script($replaceScripts).\"\\n\".$html;\n\t\t\t}\n\t\t\tif($html!=='') {\n\t\t\t\t$output=$html.$output;\n\t\t\t}\n\t\t//}\n\t}", "function prepend($content) {\n\t\t$this->write($content . $this->read());\n\t}", "public function prepend($middleware): void;", "public function renderHead(&$output)\n\t{\n\t\t$html = '';\n\t\tforeach ($this->metaTags as $meta)\n\t\t\t$html.=self::metaTag($meta['content'], null, null, $meta) . \"\\n\";\n\t\tforeach ($this->cssFiles as $url => $media)\n\t\t\t$html.=self::cssFile($url, $media) . \"\\n\";\n\n\t\tforeach($this->css as $css)\n\t\t\t$html.=self::css($css[0],$css[1]).\"\\n\";\n\t\t\t\t\n\t\tif(isset($this->gapiScripts[self::POS_HEAD]))\n\t\t{\n\t\t\tforeach ($this->gapiScripts[self::POS_HEAD] as $gapiScript)\n\t\t\t\t$html.=self::scriptFile($gapiScript) . \"\\n\";\n\t\t}\n\t\tif (isset($this->scriptFiles[self::POS_HEAD]))\n\t\t{\n\t\t\tforeach ($this->scriptFiles[self::POS_HEAD] as $scriptFile)\n\t\t\t\t$html.=self::scriptFile($scriptFile) . \"\\n\";\n\t\t}\n\n\t\tif (isset($this->scripts[self::POS_HEAD]))\n\t\t\t$html.=self::script(implode(\"\\n\", $this->scripts[self::POS_HEAD])) . \"\\n\";\n\n\n\t\tif ($html !== '')\n\t\t{\n\t\t\t$count = 0;\n\t\t\t$output = preg_replace('/(<title\\b[^>]*>|<\\\\/head\\s*>)/is', '<###head###>$1', $output, 1, $count);\n\t\t\tif ($count)\n\t\t\t\t$output = str_replace('<###head###>', $html, $output);\n\t\t\telse\n\t\t\t\t$output = $html . $output;\n\t\t}\n\t}", "protected function printHead($prefix='')\n {\n echo $prefix.'<HEAD>';\n if($this->getBrowserName() === 'IE')\n {\n $this->printIeCompatability($prefix.$prefix);\n }\n echo $prefix.$prefix.'<TITLE>'.$this->title.'</TITLE>';\n echo $prefix.$prefix.'<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">';\n foreach($this->head_tags as $tag)\n {\n echo $prefix.$prefix.$tag.\"\\n\";\n }\n echo $prefix.'</HEAD>';\n }", "public function add_head_marker() {\n\t\tglobal $wpUnited;\n\n\t\tif ($wpUnited->should_do_action('template-p-in-w') && (!PHPBB_CSS_FIRST)) {\n\t\t\techo '<!--[**HEAD_MARKER**]-->';\n\t\t}\n\t}", "public function StartOB() {\n ob_start();\n echo \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\";\n echo \"\\r\\n\";\n echo \"<sitemapindex xmlns=\\\"http://www.sitemaps.org/schemas/sitemap/0.9\\\">\";\n echo \"\\r\\n\";\n }", "public static function fixNamespaceDeclarations($source)\n {\n if (!function_exists('token_get_all') || !self::$useTokenizer) {\n if (preg_match('/(^|\\s)namespace(.*?)\\s*;/', $source)) {\n $source = preg_replace('/(^|\\s)namespace(.*?)\\s*;/', \"$1namespace$2\\n{\", $source).\"}\\n\";\n }\n\n return $source;\n }\n\n $rawChunk = '';\n $output = '';\n $inNamespace = false;\n $tokens = token_get_all($source);\n\n for ($i = 0; isset($tokens[$i]); ++$i) {\n $token = $tokens[$i];\n if (!isset($token[1]) || 'b\"' === $token) {\n $rawChunk .= $token;\n } elseif (in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {\n // strip comments\n continue;\n } elseif (T_NAMESPACE === $token[0]) {\n if ($inNamespace) {\n $rawChunk .= \"}\\n\";\n }\n $rawChunk .= $token[1];\n\n // namespace name and whitespaces\n while (isset($tokens[++$i][1]) && in_array($tokens[$i][0], array(T_WHITESPACE, T_NS_SEPARATOR, T_STRING))) {\n $rawChunk .= $tokens[$i][1];\n }\n if ('{' === $tokens[$i]) {\n $inNamespace = false;\n --$i;\n } else {\n $rawChunk = rtrim($rawChunk).\"\\n{\";\n $inNamespace = true;\n }\n } elseif (T_START_HEREDOC === $token[0]) {\n $output .= self::compressCode($rawChunk).$token[1];\n do {\n $token = $tokens[++$i];\n $output .= isset($token[1]) && 'b\"' !== $token ? $token[1] : $token;\n } while ($token[0] !== T_END_HEREDOC);\n $output .= \"\\n\";\n $rawChunk = '';\n } elseif (T_CONSTANT_ENCAPSED_STRING === $token[0]) {\n $output .= self::compressCode($rawChunk).$token[1];\n $rawChunk = '';\n } else {\n $rawChunk .= $token[1];\n }\n }\n\n if ($inNamespace) {\n $rawChunk .= \"}\\n\";\n }\n\n $output .= self::compressCode($rawChunk);\n\n if (\\PHP_VERSION_ID >= 70000) {\n // PHP 7 memory manager will not release after token_get_all(), see https://bugs.php.net/70098\n unset($tokens, $rawChunk);\n gc_mem_caches();\n }\n\n return $output;\n }", "function addNamespace($namespace);", "function yy_r104()\n {\n $this->prefix_number ++;\n $code = new Smarty_Compiler_Code();\n $code->iniTagCode($this->compiler);\n $code->php(\"ob_start();\")->newline();\n $code->mergeCode($this->yystack[$this->yyidx + 0]->minor);\n $code->php(\"\\$_tmp{$this->prefix_number} = ob_get_clean();\")->newline();\n $this->compiler->prefix_code[] = $code;\n $this->_retvalue = '$_tmp' . $this->prefix_number;\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 prepend($content){\n\t\t$this->_String4 = \"$content\".$this->_String4;\n\t\treturn $this;\n\t}", "public function testCompileBlockChildPrepend()\n {\n $result = $this->smarty->fetch('test_block_child_prepend.tpl');\n $this->assertContains(\"prepend - Default Title\", $result);\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 }", "function initialize () {\n $this->set_openingtag(\"<PRE[attributes]>\");\n\t $this->set_closingtag(\"</PRE>\");\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}", "private function getOgHeadLineString()\n\t{\n\t\t$prefix = 'og: http://ogp.me/ns# fb: http://ogp.me/fb# article: http://ogp.me/article#';\n\t\t\n\t\treturn sprintf('<head prefix=\"%s\">', $prefix) . \"\\n\";\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}", "public function generate() {\n return 'namespace ' . $this->namespace;\n }", "function venus_structural_wrap( $output, $original_output ) {\n\n\tswitch ( $original_output ) {\n\t\tcase 'open':\n\t\t\t$output = '<div class=\"container\"><div class=\"row\">';\n\t\t\tbreak;\n\t\tcase 'close':\n\t\t\t$output = '</div></div>';\n\t\t\tbreak;\n\t}\n\n\treturn $output;\n}", "function showBegin( $appctx )\n\t{\n\t\t$appctx->Plus() ;\n\t\t$appctx->Indent() ;\n\t\techo( \"<span id=\\\"$this->idx\\\" class=\\\"nodelabel\\\" >\\n\") ;\n\t}", "function topTagHtml(){\n echo\n '<!DOCTYPE html>\n <html>';\n}", "function topTagHtml(){\n echo\n '<!DOCTYPE html>\n <html>';\n}", "public function output_filter()\n\t{\n\t\tglobal $output;\n\t\t$this->output = &$output;\n\n\t\t$this->frontend = new Frontend();\n\t\t$this->module = $this->frontend->run();\n\n\t\tif (strstr($this->output, \"#fixemodule\")) {\n\t\t\t$this->output = $this->replace_placeholders($this->output);\n\t\t}\n\t}", "function initialize() {\n $this->set_openingtag(\"<CODE[attributes]>\");\n $this->set_closingtag(\"</CODE>\");\n }", "public function begin()\n\t{\n\t\t$this->show('<h3>' . get_class($this) . '</h3>' . LF . '<ul>' . LF);\n\t}", "function yy_r172()\n {\n if (empty($this->db_quote_code_buffer)) {\n $this->db_quote_code_buffer = \"ob_start();\\n\";\n }\n $this->db_quote_code_buffer .= $this->yystack[$this->yyidx + - 1]->minor->buffer;\n if ($this->block_nesting_level == count($this->compiler->_tag_stack)) {\n $this->prefix_number ++;\n $code = new Smarty_Compiler_Code();\n $code->iniTagCode($this->compiler);\n $code->formatPHP($this->db_quote_code_buffer . ' $_tmp' . $this->prefix_number . '=ob_get_clean();')->newline();\n $this->compiler->prefix_code[] = $code;\n $this->db_quote_code_buffer = '';\n $this->_retvalue = '$_tmp' . $this->prefix_number;\n } else {\n $this->_retvalue = false;\n }\n\n }", "function basecss_insert_head($flux){\n\tif (!test_plugin_actif('Zcore')){\n\t\t$flux .= \"<\".\"?php header(\\\"X-Spip-Filtre: basecss_pied_de_biche\\\"); ?\".\">\";\n\t}\n\treturn $flux;\n}", "public function WPHead() {\n\t\t// Just tag the page for fun.\n\t\techo \"\\n\\t\" . '<!-- This site uses Good Old Gallery, get it from http://wp.unwi.se/good-old-gallery -->' . \"\\n\\n\";\n\t}", "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 strong_open() {\n $this->doc .= '<strong>';\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 yy_r7(){ $this->compiler->tag_nocache = true; $this->_retvalue = $this->cacher->processNocacheCode(\"<?php echo '<?xml';?>\", $this->compiler, true); }", "public function prependContent ($content) {\r\n\t\t$this->content = (string)$content.$this->content;\r\n\t}", "function initialize () {\n $this->set_openingtag(\"<HEADER[attributes]>\");\n\t $this->set_closingtag(\"</HEADER>\");\n }", "function start_html($extra = '')\n{\n /** Starting the HTML document */\n start_tag('html', '', true, $extra) ;\n}", "function displayTagTopHtml(){\n echo\n '<!DOCTYPE html>\n <html lang=\"fr\">';\n}", "public function prepend(ContainerBuilder $container)\n {\n $container->prependExtensionConfig('nogrod_xml_client', []);\n }", "function tideways_prepend_overwritten()\n{\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 BasicHead()\n{\n print LoadTemplate(\"basic_head\");\n\n $_SESSION[\"head_printed\"] = true;\n}", "function initialize () {\n $this->set_openingtag(\"<SCRIPT[attributes]>\");\n\t $this->set_closingtag(\"</SCRIPT>\");\n }", "function yy_r13()\n {\n $this->is_xml = true;\n $this->compiler->template_code->php(\"echo '<?xml';\\n\");\n }", "public function beforeToHtml()\n {\n if (!\\class_exists('Mage')) {\n class_alias('\\LCB\\Mage\\Framework\\Mage', 'Mage');\n }\n }", "function _wp_get_head(){\n $msg=\"<?xml version='1.0' encoding='ISO-8859-2'?>\n\t\t\t\t\t<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'\n\t\t\t\t\t\t\t\t\t xmlns:xsd='http://www.w3.org/2001/XMLSchema'\n\t\t\t\t\t\t\t\t\t xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'\n\t\t\t\t\t\t\t\t\t xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'\n \t\t\t\t\t\t\t xmlns:ns4='http://codewebservice.namespace'\n\t\t\t\t\t\tSOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>\n\t\t\t\t\t<SOAP-ENV:Body>\n \t\";\n return $msg;\n }", "public function output_head() {\n\t\t// Verify tracking status\n\t\tif ( $this->disable_tracking() ) return;\n\n\t\t// no indentation on purpose\n\t\t?>\n<!-- Start WooCommerce KISSmetrics -->\n<script type=\"text/javascript\">\n\tvar _kmq = _kmq || [];\n\tfunction _kms(u) {\n\t\tsetTimeout(function () {\n\t\t\tvar s = document.createElement('script');\n\t\t\tvar f = document.getElementsByTagName('script')[0];\n\t\t\ts.type = 'text/javascript';\n\t\t\ts.async = true;\n\t\t\ts.src = u;\n\t\t\tf.parentNode.insertBefore(s, f);\n\t\t}, 1);\n\t}\n\t_kms('//i.kissmetrics.com/i.js');\n\t_kms('//doug1izaerwt3.cloudfront.net/<?php echo $this->api_key; ?>.1.js');\n\t_kmq.push(['identify', '<?php echo $this->get_identity(); ?>']);\n\t<?php if ( is_front_page() && $this->event_name['viewed_homepage'] ) echo \"_kmq.push(['record', '\" . $this->event_name['viewed_homepage'] . \"' ]);\\n\"; ?>\n</script>\n<!-- end WooCommerce KISSmetrics -->\n\t\t<?php\n\t}", "public function prepend($content)\n {\n return !empty($content) ? $this->renderContent($content) . ' ' : '';\n }", "public static function printHead() {\n header('Content-Type: text/html; charset='.CHARSET);\n // Checking Bootsprap is enabled\n if(BOOTSTRAP_ON === TRUE){\n //Bootstrap include\n echo BS_DOCTYPE5;\n echo '<html lang=\"'.LANG.'\">';\n echo '<head>';\n echo '<meta charset=\"'.CHARSET.'\">';\n echo '<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">';\n echo '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">';\n \n // HTML Title\n echo '<title>'.HTML_TITLE.'</title>';\n // Bootstrapping via CDN\n echo '<link rel=\"stylesheet\" href=\"'.BOOTSTRAP_CSS_CDN.'\">';\n echo '<link rel=\"stylesheet\" href=\"'.BOOTSTRAP_CSSTHEME_CDN.'\">';\n echo '<link rel=\"stylesheet\" href=\"'.MY_CSS.'\">';\n\n }\n elseif(BOOTSTRAP_ON === 5){\n echo BS_DOCTYPE5;\n echo '<html>';\n echo '<html lang=\"'.LANG.'\">';\n echo '<title>'.HTML_TITLE.'</title>';\n echo '<meta charset=\"'.CHARSET.'\">';\n echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'\n .PROJECT_HTTP_ROOT.'/inc/css/default.css\">';\n echo '<script src=\"'.PROJECT_HTTP_ROOT.'/js/default.js\" '\n .'type=\"text/javascript\"></script>';\n } \n else {\n echo BS_DOCTYPE401;\n echo '<html>';\n echo '<head>';\n echo '<title>'.HTML_TITLE.'</title>';\n echo '<meta http-equiv=\"content-type\" content=\"text/html; '\n .'charset='.CHARSET.'\">'.\"\\n\";\n echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'\n .PROJECT_HTTP_ROOT.'/inc/css/default.css.php\">';\n echo '<script src=\"'.PROJECT_HTTP_ROOT.'/js/default.js\" '\n .'type=\"text/javascript\"></script>';\n }\n \n echo '<meta name=\"description\" content=\"'.META_DESCRIPTION.'\">';\n echo '<meta name=\"author\" content=\"'.META_AUTHOR.'\">';\n echo '<meta name=\"keywords\" content=\"'.META_KEYWORDS.'\">';\n echo '<meta name=\"date\" content=\"'.META_DATE.'\">';\n echo '</head>';\n }", "public function renderHead(&$output)\n\t{\n\t\t$html='';\n\t\tforeach($this->metaTags as $meta)\n\t\t\t$html.=CHtml::metaTag($meta['content'],null,null,$meta).\"\\n\";\n\t\tforeach($this->linkTags as $link)\n\t\t\t$html.=CHtml::linkTag(null,null,null,null,$link).\"\\n\";\n\t\t\t\n\t\t//nlac:\n\t\t$html.= self::defCssLoader();\n\n\t\tforeach($this->cssFiles as $url=>$media)\n\t\t\t$html.=self::cssFile($url,$media).\"\\n\";\n\t\tforeach($this->css as $css)\n\t\t\t$html.=CHtml::css($css[0],$css[1]).\"\\n\";\n\t\tif($this->enableJavaScript)\n\t\t{\n\t\t\tif(isset($this->scriptFiles[self::POS_HEAD]))\n\t\t\t{\n\t\t\t\tforeach($this->scriptFiles[self::POS_HEAD] as $scriptFile)\n\t\t\t\t\t$html.=self::scriptFile($scriptFile).\"\\n\";\n\t\t\t}\n\n\t\t\tif(isset($this->scripts[self::POS_HEAD]))\n\t\t\t\t$html.=CHtml::script(implode(\"\\n\",$this->scripts[self::POS_HEAD])).\"\\n\";\n\t\t}\n\n\t\tif($html!=='')\n\t\t{\n\t\t\t$count=0;\n\t\t\t$output=preg_replace('/(<title\\b[^>]*>|<\\\\/head\\s*>)/is','<###head###>$2',$output,1,$count);\n\t\t\tif($count)\n\t\t\t\t$output=str_replace('<###head###>',$html,$output);\n\t\t\telse\n\t\t\t\t$output=$html.$output;\n\t\t}\n\t}", "function rainette_insert_head($flux) {\n\t$flux .= rainette_insert_head_css($flux);\n\n\treturn $flux;\n}", "function start()\n {\n ob_start();\n ob_implicit_flush(0);\n }", "function showBegin( $appctx )\n\t\t{\n\t\t$appctx->Plus() ;\n\t\t}", "public function output(){\n header('Content-type: text/xml');\n echo $this->getDocument();\n }", "public function prepend($content)\n\t{\n\t\t$this->content = $content.$this->content;\n\t}", "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 start_output() {\n echo \"<!DOCTYPE html><html><head>\";\n echo \\html_writer::empty_tag('meta', ['charset' => 'UTF-8']);\n echo \\html_writer::tag('title', $this->filename);\n echo \"<style>\nhtml, body {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n font-size: 13px;\n background: #eee;\n}\nth {\n border: solid 1px #999;\n background: #eee;\n}\ntd {\n border: solid 1px #999;\n background: #fff;\n}\ntr:hover td {\n background: #eef;\n}\ntable {\n border-collapse: collapse;\n border-spacing: 0pt;\n width: 80%;\n margin: auto;\n}\n</style>\n</head>\n<body>\";\n }", "public function openTag()\n {\n $this->writer->write('<?php' . PHP_EOL);\n return $this;\n }", "function start_capture () {\n if ($this->display_template_output) {\n\t // ob_end_clean(); // Clear out the capture buffer. Removed in v4.3.3\n\t ob_start();\n\t}\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 add_opengraph_doctype($output)\n{\n\t\treturn $output . ' xmlns:og=\"http://opengraphprotocol.org/schema/\" xmlns:fb=\"http://www.facebook.com/2008/fbml\"';\n}", "function tag($tag_name, $op, $pref = '', $nl = false, $extra = '')\n{\n echo $pref . '<' ;\n if ($op == 'close') {\n echo '/' ;\n }\n echo $tag_name ;\n if ($extra != '') {\n echo ' ' . $extra ;\n }\n echo '>' ;\n if ($nl == true) {\n NL() ;\n }\n}", "public function printContent()\n {\n GeneralUtility::logDeprecatedFunction();\n $this->content .= $this->doc->endPage();\n $this->content = $this->doc->insertStylesAndJS($this->content);\n echo $this->content;\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 yy_r10()\n {\n if ($this->php_handling == Smarty::PHP_PASSTHRU) {\n $this->compiler->template_code->php(\"echo '<%';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_QUOTE) {\n $this->compiler->template_code->php(\"echo '&lt;%';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_ALLOW) {\n if ($this->asp_tags) {\n if (! ($this->compiler->template instanceof SmartyBC)) {\n $this->compiler->error(self::Err3);\n }\n $this->text_is_php = true;\n } else {\n $this->compiler->template_code->php(\"echo '<%';\\n\");\n }\n } elseif ($this->php_handling == Smarty::PHP_REMOVE) {\n if (! $this->asp_tags) {\n $this->compiler->template_code->php(\"echo '<%';\\n\");\n }\n }\n }", "public function head() {\n\t\treturn '';\n\t}", "public function addScriptToHeader($context)\n\t\t{\n\t\t\tif(!empty(Symphony::Engine()->Author))\n\t\t\t{\n\t\t\t\tif(Symphony::Engine()->Author->isDeveloper())\n\t\t\t\t{\n\t\t\t\t\t$context['output'] = str_replace('</head>', '\n\t\t\t\t\t\t<link rel=\"stylesheet\" type=\"text/css\" media=\"screen,tv,projection\" href=\"'.URL.'/extensions/frontend_debug/assets/frontend_debug.css\" />\n\t\t\t\t\t\t<script type=\"text/javascript\" src=\"'.URL.'/extensions/frontend_debug/assets/frontend_debug.js\"></script>\n\t\t\t\t\t\t</head>', $context['output']);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function flipboard_namespace() {\n echo 'xmlns:media=\"http://search.yahoo.com/mrss/\"\n xmlns:georss=\"http://www.georss.org/georss\"';\n}", "public function addHead()\n {\n if (file_exists(DIRREQ . \"app/view/{$this->getDir()}/head.php\")) {\n include(DIRREQ . \"app/view/{$this->getDir()}/head.php\");\n }\n }", "public function prepend(HttpMessage $message, $top = null) {}", "public function testPrependLinePrefix() {\n\t\t\t$builder = new StringBuilder();\n\t\t\t$builder->setLineEnd(StringBuilder::LE_UNIX);\n\t\t\t$builder->prependLine(\"Hello\", false)->prependLine(\"World\", false);\n\n\t\t\t$this->assertEquals(\"\\nWorld\\nHello\", $builder->__toString());\n\t\t\tunset($builder);\n\t\t}", "function pre_echo( $var ) {\n\techo '<pre>'.\"\\n\";\n\techo $var;\n\techo '</pre>'.\"\\n\";\n}" ]
[ "0.58757246", "0.5805363", "0.58006907", "0.5750906", "0.56097054", "0.554297", "0.54619336", "0.5320644", "0.52834266", "0.52182925", "0.5192875", "0.5177417", "0.51601654", "0.5148874", "0.51479465", "0.5146182", "0.5137702", "0.512527", "0.51183283", "0.5111244", "0.5107774", "0.5084451", "0.5070424", "0.5064522", "0.5045186", "0.5034566", "0.50327384", "0.5018626", "0.50058895", "0.5004993", "0.5003828", "0.49933156", "0.49807906", "0.4971395", "0.49499592", "0.49495617", "0.49318135", "0.49289232", "0.49238926", "0.4919347", "0.4914717", "0.49135244", "0.48985174", "0.48968595", "0.48957476", "0.48779237", "0.48748875", "0.48684815", "0.48564744", "0.48546988", "0.4853001", "0.4853001", "0.48521158", "0.48454908", "0.48430663", "0.48349386", "0.48319367", "0.48110905", "0.48089448", "0.480468", "0.4800682", "0.47996885", "0.4796428", "0.47945386", "0.47833854", "0.47827098", "0.4779697", "0.47768113", "0.47763827", "0.4772368", "0.47691637", "0.47661418", "0.47649905", "0.47645152", "0.47471738", "0.4741963", "0.47403526", "0.47372437", "0.47367507", "0.47325295", "0.47296077", "0.47276178", "0.4726373", "0.4722589", "0.47219798", "0.47133598", "0.4711136", "0.47091487", "0.47086444", "0.47057495", "0.47045243", "0.47015676", "0.4695799", "0.46949595", "0.46888548", "0.4684228", "0.4673295", "0.46724313", "0.46678817", "0.46672565" ]
0.73823994
0
Check if the output contains a namespace statement at the beginning.
public function hasNamespaceStatement(&$namespaceStatement = '', &$afterCode = '') { if (preg_match('/^(<\?(?:php)?\s+namespace\s\S.*)(((?:;|\n|\?>)[\s\S]*)?)$/U', $this->output, $matches)) { if (substr($matches[2], 0, 1) === ';') { $matches[1] .= ';'; $matches[2] = substr($matches[2], 1); } $namespaceStatement = $matches[1]; $afterCode = $matches[2]; return true; } $afterCode = $this->output; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasNamespace() {\n return $this->_has(1);\n }", "public function hasNamespace() {\n return ($this->namespace !== '');\n }", "public function inNamespace()\n\t{\n\t\treturn false !== strrpos($this->name, '\\\\');\n\t}", "public function isNamespace($in)\n {\n $elt = $this->getElement($in);\n\n return ($elt && ($elt['a'] & self::ELT_NAMESPACE));\n }", "private static function hasNamespace($name)\n {\n return strpos($name, static::HINT_PATH_DELIMITER) > 0;\n }", "public static function isEnabledNamespace() {\n\t\tglobal $wgAdConfig;\n\n\t\t$title = RequestContext::getMain()->getTitle(); // @todo FIXME filthy hack\n\t\tif ( !$title ) {\n\t\t\treturn false;\n\t\t}\n\t\t$namespace = $title->getNamespace();\n\n\t\tif ( in_array( $namespace, $wgAdConfig['namespaces'] ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "protected function isInMainNamespace(): bool\n { if ($this->wikiPageAction->getNs() !== 0) {\n $this->log->notice(\"SKIP : page n'est pas dans Main (ns 0)\\n\");\n $this->db->skipArticle($this->title);\n\n return false;\n }\n return true;\n }", "public function isMessageNamespace() {\n\t\tglobal $wgTranslateMessageNamespaces;\n\t\t$namespace = $this->getTitle()->getNamespace();\n\t\treturn in_array( $namespace, $wgTranslateMessageNamespaces );\n\t}", "public function hasControllerNamespace()\r\n\t{\r\n\t\treturn !empty($this->controllerNamespace);\r\n\t}", "public function hasCurrentSuccess()\n {\n return $this->hasCurrent(self::NAMESPACE_SUCCESS);\n }", "public static function namespaceExist($namespace)\n {\n if (array_key_exists($namespace, $_SESSION)) {\n return true;\n }\n\n return false;\n }", "public function namespaceExists ( $namespace ) {\n\n return false !== array_search($namespace, $this->_namespaces);\n }", "public function hasPrefix()\n\t{\n\t\treturn $this->prefix !== null;\n\t}", "public function genericGetVariablesSucceedsWithNamespaceTSFE() {}", "protected function printNamespaceDeclarations(){\n \n $unique_namespaces = array();\n $output = '';\n \n foreach( $this->getNamespaceHeap() as $namespace ){\n \n $application_namespace = explode( '.', $namespace );\n \n for( $index = 0; $index < count( $application_namespace ); $index++ ){\n \n $namespace_name = implode( '.', array_slice($application_namespace, 0, $index + 1) );\n \n $unique_namespaces[$namespace_name] = null;\n\n }\n \n }\n \n $unique_namespaces = array_keys( $unique_namespaces );\n\n foreach( $unique_namespaces as $unique_namespace ){\n\n if( !preg_match('/\\\\./', $unique_namespace) ){\n\n $output .= 'var ';\n \n }\n \n $output .= $unique_namespace . ' = ' . $unique_namespace . ' || {};' . \"\\n\";\n\n }\n\n return $output;\n\n }", "protected function hasNamespace($key)\n {\n return (bool)strpos($key, $this->nsSeparator);\n }", "public function genericGetVariablesSucceedsWithNamespaceGP() {}", "public function genericGetVariablesSucceedsWithNamespaceGP() {}", "private function parseNamespace() {\n\n\t\t$namespace = '';\n\t\twhile (($token = $this->next())){\n\t\t\tif ($token[0] === T_STRING || $token[0] === T_NS_SEPARATOR) {\n\t\t\t\t$namespace .= $token[1];\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $namespace;\n\t}", "private function isHeader(): bool\n {\n return $this->translation->getOriginal() === '' && $this->translation->getContext() === null;\n }", "protected static function isNamespaced($className) {\n\t\t\t$result = strpos($className, '\\\\');\n\t\t\tif ($result !== false) {\n\t\t\t\t$result = true;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "public function hasNamespace($namespace)\n {\n return isset( $this->namespaces[ $namespace ] );\n }", "public function testGetNamespace() {\n\t\t$session = $this->getSession();\n\t\t$this->assertSame('test', $session->getNamespace(), 'Namespace does not match');\n\t}", "public function hasCurrentInfo()\n {\n return $this->hasCurrent(self::NAMESPACE_INFO);\n }", "abstract protected function namespace(): string;", "public static function inParsing()\n {\n return static::$process > 0;\n }", "public function isEmpty()\r\n {\r\n return !isset($this->getNamespace()->{$this->getMember()});\r\n }", "public function getNamespaceFromSource($code)\n {\n if (preg_match('/namespace\\s*([^;]+);/', $code, $m)==1) {\n return trim($m[1]);\n }\n\n return false;\n }", "public function get_namespaces()\n {\n }", "public function hasStart(){\n return $this->_has(2);\n }", "public function hasStart(){\n return $this->_has(2);\n }", "public function getNamespace() {\n $namespaces = $this\n ->getTree()\n ->getRootNode()\n ->selectDescendantsOfType('n_NAMESPACE')\n ->getRawNodes();\n\n foreach (array_reverse($namespaces) as $namespace) {\n if ($namespace->isAfter($this)) {\n continue;\n }\n\n $body = $namespace->getChildByIndex(1);\n if ($body->getTypeName() != 'n_EMPTY') {\n if (!$body->containsDescendant($this)) {\n continue;\n }\n }\n\n return $namespace->getNamespaceName();\n }\n\n return null;\n }", "public function clear(string $namespace = ''): bool;", "public function isRoot() {\n\t\t//die($this->host );\n\t\treturn $this->host == ''; //|| count($rdns) <=2;\n\t}", "public static function hasOutput()\n {\n $session = self::getSession();\n return isset($session->content);\n }", "public function testParseProcessNamespaceDeclarations(): void\n {\n $sch = $this->sut->parse($this->getXs('attribute_0006.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(\n [\n '' => 'http://example.org', \n 'foo' => 'http://example.org/foo', \n ], \n $attr\n );\n self::assertAttributeElementHasNoAttribute($attr);\n self::assertSame([], $attr->getElements());\n }", "function startsWith($prefix) {\n $node = $this->find($prefix);\n return $node != null; // 前缀存在即可\n }", "private function _checkOutputHeaders(&$outputheaders) {\n //Not implemented in this example\n return true;\n }", "public function validateNamespace()\r\n {\r\n $this->ns = ltrim($this->ns, '\\\\');\r\n $path = Az::getAlias('@' . str_replace('\\\\', '/', $this->ns), false);\r\n if ($path === false) {\r\n $this->addError('ns', 'Namespace must be associated with an existing directory.');\r\n }\r\n }", "public function GetControllerHasAbsoluteNamespace ();", "private function getNamespaceName() {\n if ($this->getTypeName() != 'n_NAMESPACE') {\n return null;\n }\n\n $namespace_name = $this->getChildByIndex(0);\n if ($namespace_name->getTypeName() == 'n_EMPTY') {\n return null;\n }\n\n return '\\\\'.$namespace_name->getConcreteString();\n }", "function flipboard_namespace() {\n echo 'xmlns:media=\"http://search.yahoo.com/mrss/\"\n xmlns:georss=\"http://www.georss.org/georss\"';\n}", "public function has ($namespace) {\n return isset($this->messages[$namespace]);\n }", "public function initializeNamespaces ( ) {\n\n $stream = $this->getStream();\n $this->_namespaces = $stream->getDocNamespaces();\n\n if(empty($this->_namespaces))\n throw new Exception\\NamespaceMissing(\n 'The XML document %s must have a default namespace at least.',\n 4, $this->getInnerStream()->getStreamName());\n\n if(1 == count($this->_namespaces))\n $stream->registerXPathNamespace(\n '__current_ns',\n current($this->_namespaces)\n );\n else\n foreach($this->_namespaces as $prefix => $namespace) {\n\n if('' == $prefix)\n $prefix = '__current_ns';\n\n $stream->registerXPathNamespace($prefix, $namespace);\n }\n\n return;\n }", "function _outputTree () {\r\n if ($this->_noOutput) {\r\n return true;\r\n }\r\n $output = $this->_outputNode ($this->_root);\r\n if (is_string ($output)) {\r\n $this->_output = $this->_applyPostfilters ($output);\r\n unset ($output);\r\n return true;\r\n }\r\n \r\n return false;\r\n }", "private function isInNamespace($class, $namespace)\n {\n return substr($class, 0, strlen($namespace)) === $namespace;\n }", "public function getDeclaredNamespaceName(File $phpcsFile, $stackPtr)\n {\n $tokens = $phpcsFile->getTokens();\n\n // Check for the existence of the token.\n if ($stackPtr === false || isset($tokens[$stackPtr]) === false) {\n return false;\n }\n\n if ($tokens[$stackPtr]['code'] !== \\T_NAMESPACE) {\n return false;\n }\n\n if ($tokens[($stackPtr + 1)]['code'] === \\T_NS_SEPARATOR) {\n // Not a namespace declaration, but use of, i.e. `namespace\\someFunction();`.\n return false;\n }\n\n $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true, null, true);\n if ($tokens[$nextToken]['code'] === \\T_OPEN_CURLY_BRACKET) {\n /*\n * Declaration for global namespace when using multiple namespaces in a file.\n * I.e.: `namespace {}`.\n */\n return '';\n }\n\n // Ok, this should be a namespace declaration, so get all the parts together.\n $validTokens = array(\n \\T_STRING => true,\n \\T_NS_SEPARATOR => true,\n \\T_WHITESPACE => true,\n );\n\n $namespaceName = '';\n while (isset($validTokens[$tokens[$nextToken]['code']]) === true) {\n $namespaceName .= trim($tokens[$nextToken]['content']);\n $nextToken++;\n }\n\n return $namespaceName;\n }", "public function testParseProcessNamespaceDeclarations(): void\n {\n $sch = $this->sut->parse($this->getXs('extension_0006.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(\n [\n '' => 'http://example.org', \n 'foo' => 'http://example.org/foo', \n ], \n $ext\n );\n self::assertSimpleContentExtensionElementHasNoAttribute($ext);\n self::assertSame([], $ext->getElements());\n }", "static public function exists($namespace){\n return Session::is_set($namespace);\n }", "protected abstract function _getNamespaces();", "public function matchesNamespace(string $identifier): bool\n {\n return $this->namespace === (new Identifier($identifier))->getNamespace();\n }", "function startsWith($prefix)\n {\n if (empty($prefix)) {\n return false;\n }\n $endNode = $this->searchEndNode($prefix);\n return $endNode != null;\n }", "public function getStreamNamespace();", "public function clearCurrent($namespace = null)\n {\n $container = $this->getContainer();\n\n if ($namespace) {\n if (!$container->offsetExists($namespace)) {\n return false;\n }\n\n unset($container->{$namespace});\n return true;\n }\n\n foreach ($container as $namespace => $notifications) {\n $container->offsetUnset($namespace);\n }\n\n return true;\n }", "public static function fixNamespaceDeclarations($source)\n {\n if (!function_exists('token_get_all') || !self::$useTokenizer) {\n if (preg_match('/(^|\\s)namespace(.*?)\\s*;/', $source)) {\n $source = preg_replace('/(^|\\s)namespace(.*?)\\s*;/', \"$1namespace$2\\n{\", $source).\"}\\n\";\n }\n\n return $source;\n }\n\n $rawChunk = '';\n $output = '';\n $inNamespace = false;\n $tokens = token_get_all($source);\n\n for ($i = 0; isset($tokens[$i]); ++$i) {\n $token = $tokens[$i];\n if (!isset($token[1]) || 'b\"' === $token) {\n $rawChunk .= $token;\n } elseif (in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {\n // strip comments\n continue;\n } elseif (T_NAMESPACE === $token[0]) {\n if ($inNamespace) {\n $rawChunk .= \"}\\n\";\n }\n $rawChunk .= $token[1];\n\n // namespace name and whitespaces\n while (isset($tokens[++$i][1]) && in_array($tokens[$i][0], array(T_WHITESPACE, T_NS_SEPARATOR, T_STRING))) {\n $rawChunk .= $tokens[$i][1];\n }\n if ('{' === $tokens[$i]) {\n $inNamespace = false;\n --$i;\n } else {\n $rawChunk = rtrim($rawChunk).\"\\n{\";\n $inNamespace = true;\n }\n } elseif (T_START_HEREDOC === $token[0]) {\n $output .= self::compressCode($rawChunk).$token[1];\n do {\n $token = $tokens[++$i];\n $output .= isset($token[1]) && 'b\"' !== $token ? $token[1] : $token;\n } while ($token[0] !== T_END_HEREDOC);\n $output .= \"\\n\";\n $rawChunk = '';\n } elseif (T_CONSTANT_ENCAPSED_STRING === $token[0]) {\n $output .= self::compressCode($rawChunk).$token[1];\n $rawChunk = '';\n } else {\n $rawChunk .= $token[1];\n }\n }\n\n if ($inNamespace) {\n $rawChunk .= \"}\\n\";\n }\n\n $output .= self::compressCode($rawChunk);\n\n if (\\PHP_VERSION_ID >= 70000) {\n // PHP 7 memory manager will not release after token_get_all(), see https://bugs.php.net/70098\n unset($tokens, $rawChunk);\n gc_mem_caches();\n }\n\n return $output;\n }", "public function hasStatement();", "public function hasNamespace(string $namespace)\n {\n return isset($this->upplyDirNames[$namespace]['name']);\n }", "public function prefixDecl(){\n try {\n // Sparql11query.g:36:3: ( PREFIX PNAME_NS iriRef ) \n // Sparql11query.g:37:3: PREFIX PNAME_NS iriRef \n {\n $this->match($this->input,$this->getToken('PREFIX'),self::$FOLLOW_PREFIX_in_prefixDecl120); \n $this->match($this->input,$this->getToken('PNAME_NS'),self::$FOLLOW_PNAME_NS_in_prefixDecl122); \n $this->pushFollow(self::$FOLLOW_iriRef_in_prefixDecl124);\n $this->iriRef();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function canSetLocalNamespace();", "public function getNamespaceCount();", "public function hasStatement(): bool\n {\n return !empty($this->statements);\n }", "public function getNamespaceName();", "public function isNamespaced($FQName)\n {\n if (strpos($FQName, '\\\\') !== 0) {\n throw new PHPCS_Exception('$FQName must be a fully qualified name');\n }\n\n return (strpos(substr($FQName, 1), '\\\\') !== false);\n }", "function classExistsInNamespaces($class);", "public function hasSyscmd(){\n return $this->_has(21);\n }", "public function getStatusName($dataSpace);", "public function IsWsdlRequested(){\r\n\t\treturn $this->ForceOutputWsdl||((isset($_GET['wsdl'])||isset($_GET['WSDL']))&&!$this->ForceNotOutputWsdl);\r\n\t}", "public function validateNamespace()\n {\n $this->ns = ltrim($this->ns, '\\\\');\n $path = Yii::getAlias('@' . str_replace('\\\\', '/', $this->ns), false);\n if ($path === false) {\n $this->addError('ns', 'Namespace must be associated with an existing directory.');\n }\n }", "public function updateNamespacePrefix()\n {\n $concept = false;\n \n if (isset($this->resource->index[$this->uri]['http://www.w3.org/1999/02/22-rdf-syntax-ns#type']))\n {\n // get resource type\n $type = $this->resource->index[$this->uri]['http://www.w3.org/1999/02/22-rdf-syntax-ns#type'][0]['value'];\n // get namespace and concept from type\n $concept = str_replace($this->resource->ns, '', $type);\n $model = substr($type, 0, -1 * strlen($concept));\n $model_ns = array_search($model, $this->resource->ns);\n \n if ($model_ns !== false) $this->ns_prefix = $model_ns;\n }\n \n return $concept;\n }", "public function hasCurrentError()\n {\n return $this->hasCurrent(self::NAMESPACE_ERROR);\n }", "public function determineNamespace(File $phpcsFile, $stackPtr)\n {\n $tokens = $phpcsFile->getTokens();\n\n // Check for the existence of the token.\n if (isset($tokens[$stackPtr]) === false) {\n return '';\n }\n\n // Check for scoped namespace {}.\n if (empty($tokens[$stackPtr]['conditions']) === false) {\n $namespacePtr = $phpcsFile->getCondition($stackPtr, \\T_NAMESPACE);\n if ($namespacePtr !== false) {\n $namespace = $this->getDeclaredNamespaceName($phpcsFile, $namespacePtr);\n if ($namespace !== false) {\n return $namespace;\n }\n\n // We are in a scoped namespace, but couldn't determine the name. Searching for a global namespace is futile.\n return '';\n }\n }\n\n /*\n * Not in a scoped namespace, so let's see if we can find a non-scoped namespace instead.\n * Keeping in mind that:\n * - there can be multiple non-scoped namespaces in a file (bad practice, but it happens).\n * - the namespace keyword can also be used as part of a function/method call and such.\n * - that a non-named namespace resolves to the global namespace.\n */\n $previousNSToken = $stackPtr;\n $namespace = false;\n do {\n $previousNSToken = $phpcsFile->findPrevious(\\T_NAMESPACE, ($previousNSToken - 1));\n\n // Stop if we encounter a scoped namespace declaration as we already know we're not in one.\n if (empty($tokens[$previousNSToken]['scope_condition']) === false && $tokens[$previousNSToken]['scope_condition'] === $previousNSToken) {\n break;\n }\n\n $namespace = $this->getDeclaredNamespaceName($phpcsFile, $previousNSToken);\n\n } while ($namespace === false && $previousNSToken !== false);\n\n // If we still haven't got a namespace, return an empty string.\n if ($namespace === false) {\n return '';\n } else {\n return $namespace;\n }\n }", "public function exists($group, $namespace = null)\n {\n\n \n \n }", "function getNameSpace() { return $this->_namespace; }", "public function _get_namespaces($type);", "public function checkRootlineForIncludeSection() {}", "public function process( File $phpcsFile, $stackPtr ) {\n\n\t\t$tokens = $phpcsFile->getTokens();\n\n\t\t$statements = [];\n\n\t\twhile ( ( $stackPtr = $phpcsFile->findNext( \\T_NAMESPACE, ( $stackPtr + 1 ) ) ) !== false ) {\n\n\t\t\t$next_non_empty = $phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true );\n\t\t\tif ( $next_non_empty === false ) {\n\t\t\t\t// Live coding or parse error.\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( $tokens[ $next_non_empty ]['code'] === \\T_NS_SEPARATOR ) {\n\t\t\t\t// Not a namespace declaration, but the use of the namespace keyword as operator.\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// OK, found a namespace declaration.\n\t\t\t$statements[] = $stackPtr;\n\n\t\t\tif ( isset( $tokens[ $stackPtr ]['scope_condition'] )\n\t\t\t\t&& $tokens[ $stackPtr ]['scope_condition'] === $stackPtr\n\t\t\t) {\n\t\t\t\t// Scoped namespace declaration.\n\t\t\t\t$phpcsFile->addError(\n\t\t\t\t\t'Scoped namespace declarations are not allowed.',\n\t\t\t\t\t$stackPtr,\n\t\t\t\t\t'ScopedForbidden'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( $tokens[ $next_non_empty ]['code'] === \\T_SEMICOLON\n\t\t\t\t|| $tokens[ $next_non_empty ]['code'] === \\T_OPEN_CURLY_BRACKET\n\t\t\t) {\n\t\t\t\t// Namespace declaration without namespace name (= global namespace).\n\t\t\t\t$phpcsFile->addError(\n\t\t\t\t\t'Namespace declarations without a namespace name are not allowed.',\n\t\t\t\t\t$stackPtr,\n\t\t\t\t\t'NoNameForbidden'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$count = \\count( $statements );\n\t\tif ( $count > 1 ) {\n\t\t\t$data = [\n\t\t\t\t$count,\n\t\t\t\t$tokens[ $statements[0] ]['line'],\n\t\t\t];\n\n\t\t\tfor ( $i = 1; $i < $count; $i++ ) {\n\t\t\t\t$phpcsFile->addError(\n\t\t\t\t\t'There should be only one namespace declaration per file. Found %d namespace declarations. The first declaration was found on line %d',\n\t\t\t\t\t$statements[ $i ],\n\t\t\t\t\t'MultipleFound',\n\t\t\t\t\t$data\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn ( $phpcsFile->numTokens + 1 );\n\t}", "public function testShouldBeAbleToGetNamespaceOfTheFile()\n\t {\n\t\t$namespace = $this->_getFileNamespace(__FILE__);\n\t\t$this->assertEquals(__NAMESPACE__, $namespace);\n\t }", "public function namespacing()\n {\n return $this->namespacing ? trim($this->namespacing, '::') . '::' : '';\n }", "static function get_namespace_classname($namespace, $classname)\r\n {\r\n $classname_parts = explode('\\\\', $classname);\r\n\r\n if (count($classname_parts) == 1)\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n $class_name = $classname_parts[count($classname_parts) - 1];\r\n array_pop($classname_parts);\r\n if (implode('\\\\', $classname_parts) != $namespace)\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n return $class_name;\r\n }\r\n }\r\n }", "public function isScopeRoot();", "public function isRootNode()\n {\n return true;\n }", "abstract function tables_present($prefix);", "public function getDefaultNamespace();", "public function inNamespace() {\n return $this->forwardCallToReflectionSource( __FUNCTION__ );\n }", "public function testGetNamespace()\n {\n /** @var ServiceInterface $service */\n foreach ([$this->dataService, $this->messageService, $this->responseService] as $service) {\n $this->assertEquals('http://ws.communicatorcorp.com/', $service->getNamespace());\n }\n }", "function getScriptOutputStatus($output)\n{\n return preg_match('/^Hello\\sWorld[,|.|!]?\\sthis\\sis\\s[a-zA-Z\\-]{2,}\\s[a-zA-Z\\-]{2,}(\\s[a-zA-Z]{2,})?\\swith\\sHNGi7\\sID\\s(HNG-\\d{3,})\\sand\\semail\\s(([a-z0-9\\+_\\-]+)(\\.[a-z0-9\\+_\\-]+)*@([a-z0-9\\-]+\\.)+[a-z]{2,6})\\susing\\s[a-zA-Z0-9|#]{2,}\\sfor\\sstage\\s2\\stask?$/i', trim($output)) ? 'pass' : 'fail';\n}", "public function getNamespaceName()\n\t{\n\t\t$pos = strrpos($this->name, '\\\\');\n\t\treturn false === $pos ? '' : substr($this->name, 0, $pos);\n\t}", "function is_output($arg)\n{\n\tif (mb_substr ($arg, 0, 9) === \"--output=\")\n\t\treturn true;\n\treturn false;\n}", "public function hasOtherOutput()\n {\n return count($this->_otherOutput) > 0;\n }", "protected function stdOutIsComleted()\n {\n if (empty($this->stdout) || substr($this->stdout, -1) !== \"\\n\") {\n return false;\n }\n\n $lastline = substr($this->stdout, strrpos($this->stdout, \"\\n\", -2) + 1);\n if (substr($lastline, 0, 3) === 'OK ') {\n return true;\n } elseif (substr($lastline, 0, 3) === 'ERROR: ') {\n $this->setError($lastline);\n return true;\n }\n\n return false;\n }", "public function get_namespaces(){\n\t\t// Array with the namespaces that are found.\n\t\t$nss = array();\n\n\t\tif($this->has_capability('NAMESPACE')){\n\t\t\t//IMAP ccommand\n\n\t\t\t$command = \"NAMESPACE\\r\\n\";\n\t\t\t$this->send_command($command);\n\t\t\t$result = $this->get_response(false, true);\n\n\t\t\t$namespaceCmdFound=false;\n\n\t\t\t$insideNamespace=false;\n\n\t\t\t$namespace = array('name'=>null, 'delimiter'=>null);\n\n\t\t\tforeach ($result as $vals) {\n\t\t\t\tforeach ($vals as $val) {\n\t\t\t\t\tif (!$namespaceCmdFound && strtoupper($val) == 'NAMESPACE') {\n\t\t\t\t\t\t$namespaceCmdFound = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tswitch (strtoupper($val)) {\n\n\t\t\t\t\t\t\tcase '(':\n\t\t\t\t\t\t\t\t$insideNamespace = true;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase ')':\n\t\t\t\t\t\t\t\t$insideNamespace = false;\n\n\t\t\t\t\t\t\t\tif(isset($namespace['name'])){\n\t\t\t\t\t\t\t\t\t$namespace['name']=$this->utf7_decode(trim($namespace['name'], $namespace['delimiter']));\n\t\t\t\t\t\t\t\t\t$nss[] = $namespace;\n\t\t\t\t\t\t\t\t\t$namespace = array('name' => null, 'delimiter' => null);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tif ($insideNamespace) {\n\t\t\t\t\t\t\t\t\tif (!isset($namespace['name'])) {\n\t\t\t\t\t\t\t\t\t\t$namespace['name'] = $val;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$namespace['delimiter'] = $val;\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\tbreak;\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\treturn $nss;\n\t\t}else\n\t\t{\n\t\t\treturn array(array('name'=>'','delimiter'=>$this->get_mailbox_delimiter()));\n\t\t}\n\t}", "public static function view_namespace()\n\t{\n\t\treturn __NAMESPACE__;\t\n\t}", "public function checkNamespace($column=null, $value=null,$id=null){\r\n\t\tif(!$column || is_null($value)) return false;\r\n\t\t\r\n\t\t$mask = self::getMask();\r\n\t\t\r\n\t\t$stt = false;\r\n if(!preg_match('/^([A-Za-z_])+([A-Za-z0-9_\\-])*$/',$value)) $stt = false;\r\n elseif($u = $mask->getOne($mask->idField,array($column=>$value), 'ASSOC')){\r\n if($id && $u[$mask->idField]==$id) $stt = true;\r\n }else $stt = true;\r\n return $stt;\r\n }", "abstract protected function isStartToken(string $token) : bool;", "function startsWith($prefix) {\n $cur = $this->root;\n for ($i = 0; $i < strlen($prefix); $i++) {\n $c = substr($prefix, $i, 1);\n if (!isset($cur->next[$c])) {\n return false;\n }\n $cur = $cur->next[$c];\n }\n return true;\n }", "public function testLookupNamespaceReturnsStringWhenAddedToSchemaElementAndParentPrefixBoundToNamespace(): void\n {\n $parent = new SchemaElement();\n $parent->addComplexTypeElement($this->sut);\n $parent->bindNamespace('foo', 'http://example.org/foo');\n self::assertSame('http://example.org/foo', $this->sut->lookupNamespace('foo'));\n }", "public function getNamespaces() {}", "protected function initCtrlHasAbsNamespace () {\n\t\tif (mb_strpos($this->controller, '//') === 0)\n\t\t\t$this->flags |= static::FLAG_CONTROLLER_ABSOLUTE_NAMESPACE;\n\t}", "public function startsWith($prefix) {\n return mb_strpos($this->rawString, $prefix, 0, $this->charset) === 0;\n }", "function startsWith($prefix)\n {\n $node = $this->root;\n for ($i = 0; $i < strlen($prefix); $i++) {\n $index = ord($prefix[$i]) - ord('a');\n if (isset($node->children[$index])) {\n $node = $node->children[$index];\n } else {\n return false;\n }\n }\n return true;\n }" ]
[ "0.6916824", "0.6832139", "0.6678534", "0.58095455", "0.5740581", "0.571218", "0.5710529", "0.56909853", "0.56116325", "0.54563093", "0.5415549", "0.5394336", "0.53494585", "0.5325554", "0.53163046", "0.53065044", "0.5304125", "0.53023636", "0.5142671", "0.5140365", "0.51137775", "0.51114905", "0.5070839", "0.5069333", "0.5049884", "0.5047734", "0.5025989", "0.5023856", "0.49943376", "0.49921092", "0.49921092", "0.4963009", "0.49155545", "0.4908616", "0.49027678", "0.48920488", "0.48875347", "0.48785502", "0.4877461", "0.48753574", "0.48652592", "0.4843108", "0.48401234", "0.482695", "0.4818651", "0.4813351", "0.48057786", "0.47924784", "0.47904506", "0.4789568", "0.4782968", "0.4775107", "0.4763386", "0.476298", "0.47502416", "0.47488916", "0.47427738", "0.4740035", "0.47375846", "0.47301927", "0.4728531", "0.47114772", "0.47063565", "0.4703742", "0.46908632", "0.4679636", "0.46701968", "0.4665766", "0.466149", "0.46455818", "0.4644169", "0.46302807", "0.46293327", "0.46049836", "0.46016887", "0.46013445", "0.46004203", "0.4594553", "0.4588861", "0.4586047", "0.45846787", "0.45834145", "0.4578858", "0.4572109", "0.45716473", "0.45673037", "0.45669374", "0.45655894", "0.45648453", "0.4559792", "0.45585412", "0.45555362", "0.4552701", "0.45512068", "0.45370927", "0.4532011", "0.4530329", "0.45293564", "0.45192462", "0.4515808" ]
0.68481815
1
prepare a connection with a paypal app
public function __construct() { $this->_handle = ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function paypal_class() {\n \n // initialization constructor. Called when class is created.\n \n $this->paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';\n //$this->paypal_url = 'https://www.paypal.com/cgi-bin/webscr';\n \n $this->last_error = '';\n \n $this->ipn_log_file = '.ipn_results.log';\n $this->ipn_log = true; \n $this->ipn_response = '';\n \n // populate $fields array with a few default values. See the paypal\n // documentation for a list of fields and their data types. These defaul\n // values can be overwritten by the calling script.\n\n $this->add_field('rm','2'); // Return method = POST\n $this->add_field('cmd','_xclick'); \n \n }", "public function __construct()\n {\n if(config('paypal.settings.mode') == 'live'){\n $this->client_id = config('paypal.live_client_id');\n $this->secret = config('paypal.live_secret');\n //$this->plan_id = env('PAYPAL_LIVE_PLAN_ID', '');\n } else {\n $this->client_id = config('paypal.sandbox_client_id');\n $this->secret = config('paypal.sandbox_secret');\n //$this->plan_id = env('PAYPAL_SANDBOX_PLAN_ID', '');\n }\n \n // Set the Paypal API Context/Credentials\n $this->apiContext = new ApiContext(new OAuthTokenCredential($this->client_id, $this->secret));\n $this->apiContext->setConfig(config('paypal.settings'));\n }", "public function __construct()\n {\n // initialization constructor. Called when class is created.\n\n\t\tif (basket_plus::getBasketVar(PAYPAL_TEST_MODE)){\n\t\t\t// sandbox paypal\n\t\t\t$this->paypal_url = \"https://www.sandbox.paypal.com/cgi-bin/webscr\";\n\t\t\t$this->secure_url = \"ssl://www.sandbox.paypal.com\";\n\t\t}\n\t\telse{\n // normal paypal\n\t\t\t$this->paypal_url = \"https://www.paypal.com/cgi-bin/webscr\";\n\t\t\t$this->secure_url = \"ssl://www.paypal.com\";\n\t\t}\n\n $this->last_error = '';\n\n //$this->ipn_log_file = Kohana::log_directory().Kohana::config('paypal.ipn_logfile');\n //$this->ipn_log = true;\n $this->ipn_response = '';\n\n // populate $fields array with a few default values. See the paypal\n // documentation for a list of fields and their data types. These default\n // values can be overwritten by the calling script.\n\n }", "public function __construct()\n {\n /*if(config('paypal.settings.mode') == 'live'){\n $this->client_id = config('paypal.live_client_id');\n $this->secret = config('paypal.live_secret');\n } else {\n $this->client_id = config('paypal.sandbox_client_id');\n $this->secret = config('paypal.sandbox_secret');\n }\n\n // Set the Paypal API Context/Credentials\n $this->apiContext = new ApiContext(new OAuthTokenCredential($this->client_id, $this->secret));\n $this->apiContext->setConfig(config('paypal.settings'));\n */\n //parent::__construct();\n\n /** setup PayPal api context **/\n $paypal_conf = \\Config::get('paypal');\n $this->apiContext = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->apiContext->setConfig($paypal_conf['settings']);\n }", "public function __construct()\n {\n if ( config('services.paypal.settings.mode') === 'live' ) {\n $this->paypalClientId = config('services.paypal.live_client_id');\n $this->paypalSecret = config('services.paypal.live_secret');\n } else {\n $this->paypalClientId = config('services.paypal.sandbox_client_id');\n $this->paypalSecret = config('services.paypal.sandbox_secret');\n }\n \n // Set the Paypal API Context/Credentials\n $this->paypalApiContext = new \\PayPal\\Rest\\ApiContext(new \\PayPal\\Auth\\OAuthTokenCredential($this->paypalClientId, $this->paypalSecret));\n $this->paypalApiContext->setConfig(config('services.paypal.settings'));\n }", "public function __construct()\n {\n// $paypal_conf = \\Config::get('paypal');\n// $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n// $this->_api_context->setConfig($paypal_conf['settings']);\n }", "public function create(){\n $payer = new Payer();\n $payer->setPaymentMethod(\"paypal\");\n\n // Set redirect URLs\n $redirectUrls = new RedirectUrls();\n\n if (App::environment() == 'production') {\n $app_url = \"https://doomus.com.br/public\";\n } else {\n $app_url = \"http://localhost:8000\";\n }\n\n $redirectUrls->setReturnUrl(\"$app_url/execute-payment\")\n ->setCancelUrl(\"$app_url/cancel-payment\");\n\n // Set payment amount\n if(session('cupom') !== null && session('valorFrete') !== null){\n $amount = new Amount();\n $amount->setCurrency(\"BRL\")\n ->setTotal(round(Cart::total(), 2) + str_replace(',','.', session('valorFrete')));\n }elseif(session('valorFrete') !== null){\n $amount = new Amount();\n $amount->setCurrency(\"BRL\")\n ->setTotal(Cart::total() + str_replace(',','.', session('valorFrete')));\n }else{\n $amount = new Amount();\n $amount->setCurrency(\"BRL\")\n ->setTotal(Cart::total());\n }\n\n // Set transaction object\n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setDescription(\"Payment description\");\n\n // Create the full payment object\n $payment = new Payment();\n $payment->setIntent('sale')\n ->setPayer($payer)\n ->setRedirectUrls($redirectUrls)\n ->setTransactions(array($transaction));\n\n // Create payment with valid API context\n try {\n $payment->create($this->_apiContext);\n \n // Get PayPal redirect URL and redirect the customer\n return redirect($payment->getApprovalLink());\n \n // Redirect the customer to $approvalUrl\n } catch (PayPalConnectionException $ex) {\n echo $ex->getCode();\n echo $ex->getData();\n die($ex);\n } catch (Exception $ex) {\n die($ex);\n }\n }", "function photo_shop_paypal_class () {\r\n\r\n // initialization constructor. Called when class is created.\r\n\t global $CONFIG;\r\n $this->last_error = '';\r\n $this->ipn_log = $CONFIG['photo_shop_paypal_ipn_log'];\r\n $this->ipn_log_file = $CONFIG['photo_shop_paypal_ipn_logfile'];\r\n $this->ipn_response = '';\r\n }", "function performPaymentInitialization() {\r\n\t\t;\r\n\t\t$request = \"\";\r\n\t\t$response = \"\";\r\n\t\t$requestbuffer;\r\n\t\t$xmlData = \"\";\r\n\t\t$hm;\r\n\t\ttry {\r\n\t\t\tif ($request != null) {\r\n\t\t\t\t$xmlData = $data;\r\n\t\t\t} else {\r\n\t\t\t\t$keyParser = new KeyStore ();\r\n\t\t\t\t$this->key = $keyParser->parseKeyStore ( $this->keystorePath );\r\n\t\t\t\t$xmlData = $this->parseResource ( $this->key, $this->resourcePath, $this->alias );\r\n\t\t\t}\r\n\t\t\tvar_dump ( $xmlData );\r\n\t\t\t\r\n\t\t\tif ($xmlData != null) {\r\n\t\t\t\t$hm = $this->parseXMLRequest ( $xmlData );\r\n\t\t\t} else {\r\n\t\t\t\t$error = \"Alias name does not exits\";\r\n\t\t\t}\r\n\t\t\tvar_dump ( $hm );\r\n\t\t\t$this->key = $hm ['resourceKey'];\r\n\t\t\t// echo $this->key;\r\n\t\t\t$requestbuffer = $this->buildHostRequest ();\r\n\t\t\t$requestbuffer .= \"id=\" . $hm [\"id\"] . \"&\";\r\n\t\t\t\r\n\t\t\t$requestbuffer .= 'password=' . $hm ['password'] . \"&\";\r\n\t\t\t$webaddr = $hm ['webaddress'];\r\n\t\t\t// echo \"<br><br><br><br>\" . $requestbuffer . \"<br><br><br>\";\r\n\t\t\t$request = $requestbuffer;\r\n\t\t\tvar_dump ( $request );\r\n\t\t\t// var_dump($request);\r\n\t\t\t// var_dump($webaddr);\r\n\t\t\t$pipe = new ipayTransactionPipe ();\r\n\t\t\t// echo \"<br/>REQUEST\" . $request;\r\n\t\t\t\r\n\t\t\t$response = $pipe->performHostedTransaction ( $request, $webaddr );\r\n\t\t\tVAR_DUMP ( $response );\r\n\t\t\t// System.out.println(\"response:::::::\" + response);\r\n\t\t\tif ($response == null) {\r\n\t\t\t\t// echo \"null\";\r\n\t\t\t\t$this->error = \"Error while connecting \" . $response;\r\n\t\t\t\treturn - 1;\r\n\t\t\t} else {\r\n\t\t\t\tif ($response != null) {\r\n\t\t\t\t\t// echo \"not null\";\r\n\t\t\t\t\t$this->setpaymentId ( $response [0] );\r\n\t\t\t\t\t$this->setpaymentPage ( $response [1] );\r\n\t\t\t\t\t// $this->paymentPage = $response[1];\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->error = \"Error while connecting \" + $response;\r\n\t\t\t\t\treturn - 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch ( Exception $e ) {\r\n\t\t\t\r\n\t\t\t$this->error = \"Error while connecting \" + $response;\r\n\t\t\treturn - 1;\r\n\t\t}\r\n\t}", "public function postPaymentWithpaypal(Request $request)\n {\n \t$plan = Package::findOrFail($request->plan_id);\n \t$currency_code = Config::first()->currency_code;\n $currency_code = strtoupper($currency_code);\n\n $payer = new Payer();\n $payer->setPaymentMethod('paypal');\n\n \t$item_1 = new Item();\n\n $item_1->setName($plan->name) /** item name **/\n ->setCurrency($currency_code)\n ->setQuantity(1)\n ->setPrice($plan->amount); /** unit price **/\n\n $item_list = new ItemList();\n $item_list->setItems(array($item_1));\n\n $amount = new Amount();\n $amount->setCurrency($currency_code)\n ->setTotal($plan->amount);\n\n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setItemList($item_list)\n ->setDescription('Subscription');\n\n $redirect_urls = new RedirectUrls();\n $redirect_urls->setReturnUrl(route('getPaymentStatus')) /** Specify return URL **/\n ->setCancelUrl(route('getPaymentFailed'));\n\n $payment = new Payment();\n $payment->setIntent('Sale')\n ->setPayer($payer)\n ->setRedirectUrls($redirect_urls)\n ->setTransactions(array($transaction));\n /** dd($payment->create($this->_api_context));exit; **/\n try {\n $payment->create($this->_api_context);\n } catch (\\PayPal\\Exception\\PPConnectionException $ex) {\n if (\\Config::get('app.debug')) {\n return back()->with('deleted', 'Connection timeout');\n /** echo \"Exception: \" . $ex->getMessage() . PHP_EOL; **/\n /** $err_data = json_decode($ex->getData(), true); **/\n /** exit; **/\n } else {\n return back()->with('deleted', 'Some error occur, sorry for inconvenient');\n /** die('Some error occur, sorry for inconvenient'); **/\n }\n }\n\n foreach($payment->getLinks() as $link) {\n if($link->getRel() == 'approval_url') {\n $redirect_url = $link->getHref();\n break;\n }\n }\n\n /** add payment ID to session **/\n Session::put('paypal_payment_id', $payment->getId());\n Session::put('plan', $plan);\n\n if(isset($redirect_url)) {\n /** redirect to paypal **/\n return redirect($redirect_url);\n }\n\n \treturn back()->with('deleted', 'Unknown error occurred');\n }", "public function add_payments() {\n\n global $redis;\n\n $user_id = $this->params['user_id'];\n $associate_id = !empty($this->params['associate_id']) ? $this->params['associate_id'] : 0;\n $payment_account_id = $this->params['payment_account_id'];\n $paypal_username = $this->params['paypal_username'];\n $account_dbobj = $this->params['account_dbobj'];\n\n // validate paypal username\n $paypal = new PaypalAccount($account_dbobj);\n $paypal->findOne(\"username='\".$account_dbobj->escape($paypal_username).\"'\");\n if($paypal->getId() === 0) {\n if(!$paypal->setUsername($paypal_username)) {\n $this->errnos[INVALID_PAYPAL_ACCOUNT] = 1;\n $this->status = 1;\n return;\n }\n }\n $paypal->save();\n\n $payment_account = new PaymentAccount($account_dbobj);\n if(!empty($payment_account_id)) {\n $payment_account->findOne('id='.$payment_account_id);\n }\n $payment_account->setPaypalAccountId($paypal->getId());\n $payment_account->save();\n\n $user = new User($account_dbobj);\n $user->findOne('id='.$user_id);\n BaseMapper::saveAssociation($user, $payment_account, $account_dbobj);\n\n if(!empty($associate_id) && $is_active_associate = AssociatesMapper::is_active_associate($associate_id, $account_dbobj)) {\n $associate = new Associate($account_dbobj);\n $associate->findOne('id='.$associate_id);\n $associate->setStatus(ACTIVATED);\n $associate->save();\n $redis->set(\"associate::$associate_id:status\", $associate->getStatus());\n }\n\n $this->response['paypal_account_id'] = $paypal->getId();\n $this->response['paypal_username'] = $paypal->getUsername();\n\n $this->status = 0;\n\n // warm up cache\n $redis->set(\"user:$user_id:payment_account_id\", $payment_account->getId());\n $redis->set(\"payment_account:{$payment_account->getId()}:paypal_account_id\",$paypal->getId());\n $paypal_account_id = $paypal->getId();\n $redis->set(\"paypal_account:$paypal_account_id:username\", $paypal->getUsername());\n $redis->set(\"paypal_account:$paypal_account_id:status\", $paypal->getStatus());\n $redis->set(\"paypal_account:$paypal_account_id:created\", $paypal->getCreated());\n $redis->set(\"paypal_account:$paypal_account_id:updated\", $paypal->getUpdated());\n\n\n }", "public function __construct() {\n $paypal_conf = Config::get('paypal_payment');\n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->_api_context->setConfig($paypal_conf['settings']);\n }", "public function create_payment_using_paypal($param = ''){\n\t\t// This sample code demonstrates how you can process a \n\t\t// PayPal Account based Payment.\n\t\t// API used: /v1/payments/payment\n\n\t\t// ### Payer\n\t\t// A resource representing a Payer that funds a payment\n\t\t// For paypal account payments, set payment method\n\t\t// to 'paypal'.\n\n\t\t//load settings \n\t\t$this->_api_context->setConfig($this->config->item('settings'));\n\n\n\t\t$payer = new Payer();\n\t\t$payer->setPaymentMethod(\"paypal\");\n\n\t\t$items = array(array(\n\t\t\t'name'\t\t=> 'coffee cup',\n\t\t\t'currency' => 'USD',\n\t\t\t'quantity' => 1,\n\t\t\t'sku'\t\t=> \"123123\",\n\t\t\t'price'\t\t=> \"7.50\"\n\t\t\t),array(\n\t\t\t'name'\t\t=> 'coffee bars',\n\t\t\t'currency' => 'USD',\n\t\t\t'quantity' => 5,\n\t\t\t'sku'\t\t=> \"321321\",\n\t\t\t'price'\t\t=> \"2\"\n\t\t\t));\n\n\t\t// ### Itemized information\n\t\t// (Optional) Lets you specify item wise\n\t\t// information\n\n\t\t$itemList = new ItemList();\n\t\t$itemList->setItems($items);\n\n\t\t// ### Additional payment details\n\t\t// Use this optional field to set additional\n\t\t// payment information such as tax, shipping\n\t\t// charges etc.\n\n\t\t$details = array(\n\t\t\t'shipping' => \"1.20\",\n\t\t\t'tax' => \"1.30\",\n\t\t\t'subtotal' => \"17.50\"\n\t\t\t);\n\n\t\t// ### Amount\n\t\t// Lets you specify a payment amount.\n\t\t// You can also specify additional details\n\t\t// such as shipping, tax.\n\t\t$amount = array(\n\t\t\t'currency' => 'USD',\n\t\t\t'total' => \"20\",\n\t\t\t'details' => $details\n\t\t\t);\n\n\t\t// ### Transaction\n\t\t// A transaction defines the contract of a\n\t\t// payment - what is the payment for and who\n\t\t// is fulfilling it. \n\n\t\t$transaction = array(\n\t\t\t'amount'\t=> $amount,\n\t\t\t'item_list' => $itemList,\n\t\t\t'description'=> 'payment description',\n\t\t\t'invoice_number'=> uniqid()\n\t\t\t);\n\n\t\t// ### Redirect urls\n\t\t// Set the urls that the buyer must be redirected to after \n\t\t// payment approval/ cancellation.\n\t\t$baseUrl = HOMEURL;\n\t\t$redirectUrls = new RedirectUrls();\n\t\t$redirectUrls->setReturnUrl($baseUrl.\"paypal_1/statuspayment\")\n\t\t ->setCancelUrl($baseUrl.\"paypal_1/cancelpayment\");\n\n\t\t// ### Payment\n\t\t// A Payment Resource; create one using\n\t\t// the above types and intent set to 'sale'\n\t\t$payment = new Payment();\n\t\t$payment->setIntent(\"sale\")\n\t\t ->setPayer($payer)\n\t\t ->setRedirectUrls($redirectUrls)\n\t\t ->setTransactions(array($transaction));\n\n\n\t\t// For Sample Purposes Only.\n\t\t$request = clone $payment;\n\n\t\t// ### Create Payment\n\t\t// Create a payment by calling the 'create' method\n\t\t// passing it a valid apiContext.\n\t\t// (See bootstrap.php for more on `ApiContext`)\n\t\t// The return object contains the state and the\n\t\t// url to which the buyer must be redirected to\n\t\t// for payment approval\n\t\ttry {\n\t\t $payment->create($this->_api_context);\n\t\t} catch (Exception $ex) {\n\t\t // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY\n\t\t ResultPrinter::printError(\"Created Payment Using PayPal. Please visit the URL to Approve.\", \"Payment\", null, $request, $ex);\n\t\t exit(1);\n\t\t}\n\n\t\t// ### Get redirect url\n\t\t// The API response provides the url that you must redirect\n\t\t// the buyer to. Retrieve the url from the $payment->getApprovalLink()\n\t\t// method\n\t\t$approvalUrl = $payment->getApprovalLink();\n\n\t\t// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY\n\t\t//ResultPrinter::printResult(\"Created Payment Using PayPal. Please visit the URL to Approve.\", \"Payment\", \"<a href='$approvalUrl' >$approvalUrl</a>\", $request, $payment);\n\n\t\t//return $payment;\n\t\t//echo \"<pre>\";print_r($payment);die;\n\n\t\t//process payment function redirection\n\n\t\tforeach ($payment->getLinks() as $link) {\n\t\t\tif($link->getRel() == 'approval_url'){\n\t\t\t\t$redirect_url = $link->getHref();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(isset($redirect_url)){\n\t\t\tredirect($redirect_url);\n\t\t}\n\n\t\techo \"Some Error Was occured please try again...!\";\n\n\t\t\n\n\t}", "function ciniki_sapos_web_paypalExpressCheckoutGet(&$ciniki, $tnid, $args) {\n\n //\n // Load paypal settings\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDetailsQueryDash');\n $rc = ciniki_core_dbDetailsQueryDash($ciniki, 'ciniki_sapos_settings', 'tnid', $tnid, 'ciniki.sapos', 'settings', 'paypal');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['settings']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.181', 'msg'=>'Paypal processing not configured'));\n }\n $paypal_settings = $rc['settings'];\n\n if( isset($paypal_settings['paypal-ec-site']) && $paypal_settings['paypal-ec-site'] == 'live' ) {\n $paypal_endpoint = \"https://api-3t.paypal.com/nvp\";\n $paypal_redirect_url = \"https://www.paypal.com/webscr?cmd=_express-checkout\";\n } elseif( isset($paypal_settings['paypal-ec-site']) && $paypal_settings['paypal-ec-site'] == 'sandbox' ) {\n $paypal_endpoint = \"https://api-3t.sandbox.paypal.com/nvp\";\n $paypal_redirect_url = \"https://www.sandbox.paypal.com/webscr?cmd=_express-checkout\";\n } else {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.182', 'msg'=>'Paypal processing not configured'));\n }\n\n if( !isset($paypal_settings['paypal-ec-clientid']) || $paypal_settings['paypal-ec-clientid'] == '' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.183', 'msg'=>'Paypal processing not configured'));\n }\n if( !isset($paypal_settings['paypal-ec-password']) || $paypal_settings['paypal-ec-password'] == '' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.184', 'msg'=>'Paypal processing not configured'));\n }\n if( !isset($paypal_settings['paypal-ec-signature']) || $paypal_settings['paypal-ec-signature'] == '' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.185', 'msg'=>'Paypal processing not configured'));\n }\n\n $paypal_clientid = $paypal_settings['paypal-ec-clientid'];\n $paypal_password = $paypal_settings['paypal-ec-password'];\n $paypal_signature = $paypal_settings['paypal-ec-signature'];\n\n //\n // Get the paypal token to start the express checkout process\n //\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $paypal_endpoint);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n //turning off the server and peer verification(TrustManager Concept).\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n \n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n curl_setopt($ch, CURLOPT_POST, 1);\n\n $nvpreq=\"METHOD=GetExpressCheckoutDetails\"\n . \"&VERSION=93\"\n . \"&PWD=\" . $paypal_password \n . \"&USER=\" . $paypal_clientid\n . \"&SIGNATURE=\" . $paypal_signature\n . \"&TOKEN=\" . urlencode($args['token'])\n . \"\";\n \n curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n // Execute\n $response = curl_exec($ch);\n\n // Parse response\n $nvpResArray = array();\n $kvs = explode('&', $response);\n foreach($kvs as $kv) {\n list($key, $value) = explode('=', $kv);\n $nvpResArray[urldecode($key)] = urldecode($value);\n }\n\n if( curl_errno($ch)) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.186', 'msg'=>'Error processing request: ' . curl_error($ch)));\n } else {\n curl_close($ch);\n }\n if( strtolower($nvpResArray['ACK']) == 'success' || strtolower($nvpResArray['ACK']) == 'successwithwarning' ) {\n $paypal_payer_id = urldecode($nvpResArray['PAYERID']);\n $_SESSION['paypal_payer_id'] = $paypal_payer_id;\n return array('stat'=>'ok');\n } \n\n error_log(\"PAYPAL-ERR: \" . urldecode($nvpResArray['L_ERROCODE0']) . '-' . urldecode($nvpResArray['L_SHORTMESSAGE0']));\n\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.187', 'msg'=>'Oops, we seem to have an error. Please try again or contact us for help. '));\n}", "public function actionCheck($param)\n {\n\n /*$json = json_decode($data);\n echo $json->tls_version.'<br />';\n //$curl_info = curl_version();\n //echo $curl_info['ssl_version'];\n printf(\"0x%x\\n\", OPENSSL_VERSION_NUMBER);*/\n\n define(\"LOG_FILE\", __DIR__.\"/Paypal.log\");\n $raw_post_data = file_get_contents('php://input');\n $raw_post_array = explode('&', $raw_post_data);\n $myPost = array();\n foreach ($raw_post_array as $keyval) {\n $keyval = explode ('=', $keyval);\n if (count($keyval) == 2)\n $myPost[$keyval[0]] = urldecode($keyval[1]);\n }\n $req = 'cmd=_notify-validate';\n if(function_exists('get_magic_quotes_gpc')) {\n \t$get_magic_quotes_exists = true;\n }\n foreach ($myPost as $key => $value) {\n \t$value = $get_magic_quotes_exists && get_magic_quotes_gpc() == 1\n ? urlencode(stripslashes($value))\n : urlencode($value);\n $req .= \"&$key=$value\";\n }\n $paypal_url = $this->settings->paypal_demo ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr';\n $ch = curl_init($paypal_url);\n if ($ch == false) {\n \tdie('no curl init');\n }\n curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_SSLVERSION, 6);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $req);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));\n $res = curl_exec($ch);\n if (curl_errno($ch) != 0) {\n $error = curl_error($ch);\n \t//error_log(date('[Y-m-d H:i e] '). \"Can't connect to PayPal to validate IPN message: \" . $error . PHP_EOL, 3, LOG_FILE);\n \tcurl_close($ch);\n \tdie($error);\n } else {\n\t\tif(DEBUG == true) {\n\t\t\t//error_log(date('[Y-m-d H:i e] '). \"HTTP request of validation request:\". curl_getinfo($ch, CURLINFO_HEADER_OUT) .\" for IPN payload: $req\" . PHP_EOL, 3, LOG_FILE);\n\t\t\t//error_log(date('[Y-m-d H:i e] '). \"HTTP response of validation request: $res\" . PHP_EOL, 3, LOG_FILE);\n\t\t}\n\t\tcurl_close($ch);\n }\n $tokens = explode(\"\\r\\n\\r\\n\", trim($res));\n $res = trim(end($tokens));\n if (strcmp($res, \"VERIFIED\") == 0) {\n if($param->receiver_email == '' || $param->receiver_email != $this->settings->paypal_email\n || !$param->Exists('item_number', true) || $param->mc_currency != 'USD') {\n //error_log('Error 1'.PHP_EOL, 3, LOG_FILE);\n die('error');\n }\n $this->_table->current = $param->item_number;\n if($this->_table->id != $param->item_number || $this->_table->status != 0\n || (float)$param->mc_gross != (float)$this->_table->sum) {\n //error_log('Error 2'.PHP_EOL, 3, LOG_FILE);\n die('error');\n }\n if(strtolower($param->payment_status) == 'completed') {\n $this->_table->status = 2;\n $this->_table->message = $param->txn_id;\n $this->_table->date_payed = date(\"Y-m-d H:m:i\");\n $this->_table->Save();\n //error_log(date('[Y-m-d H:i e] '). \"Verified IPN: $req \". PHP_EOL, 3, LOG_FILE);\n die('ok');\n } else {\n //error_log(date('[Y-m-d H:i e] '). \"Status: \".$param->payment_status.PHP_EOL, 3, LOG_FILE);\n }\n } else if (strcmp ($res, \"INVALID\") == 0) {\n \t//error_log(date('[Y-m-d H:i e] '). \"Invalid IPN: $req\" . PHP_EOL, 3, LOG_FILE);\n }\n die('error');\n }", "public function processPaypal(){\r\n\t// and redirect to thransaction details page\r\n\t}", "public function paypal(Request $request)\n {\nrequire 'vendor/autoload.php';\n\n$apiContext = new \\PayPal\\Rest\\ApiContext(\n new \\PayPal\\Auth\\OAuthTokenCredential(\n 'AedIVbiADiRsvL3jFM6Z6Kcx5wSgwyBIMJFFQq0UFcBfrew-mhHGMZVpqWJhvQGbn-HkUpt5F023HH4n',\n 'EIs32ISB07N21Ey0z2a4Qthy5Obo173s1wD9Yx9hhiYJoC2bxdnNJVLpb2MvnT5QTYK74RBMg84FvPd4'\n )\n);\n\n return response()->json([\n 'message' => 'paypal route hit',\n 'request' => $request->all()\n ]);\n }", "public function __construct()\n {\n $paypal_conf = config('paypal');\n \n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->_api_context->setConfig($paypal_conf['settings']);\n \n }", "public function construitUrl()\n {\n //Site de l'API Paypal\n $urlPaypal = \"https://api-3t.sandbox.paypal.com/nvp?\";\n //Version de l'API de paypal\n $version = \"204.0\";\n //Compte Utilisateur du vendeur\n $user = \"test.seller_api1.yopmail.com\";\n //Mot de passe pour acceder à l'API\n $pass = \"CMASHX59W3RDVVKE\";\n //Signature de l'API\n $signature = \"AFcWxV21C7fd0v3bYYYRCpSSRl31AD3ZWGs6j9kywv41tSL0XrUzyrSf\";\n //Concaténation pour avoir l'url de base\n $urlPaypal = $urlPaypal.'VERSION='.$version.'&USER='.$user.'&PWD='.$pass.'&SIGNATURE='.$signature;\n\n return $urlPaypal;\n }", "public function init()\r\n { \r\n\t\ttry\r\n\t\t{ \r\n $orderNumber = addslashes( $_GET['order_number'] ) ? : null;\r\n if ( is_null( $orderNumber) ) { return; }\r\n \r\n $table = new Application_Subscription_Checkout_Order();\r\n if( ! $orderInfo = $table->selectOne( null, array( 'order_id' => $orderNumber ) ) )\r\n {\r\n return false;\r\n }\r\n //var_export( $orderInfo );\r\n if( ! is_array( $orderInfo['order'] ) )\r\n {\r\n //\tcompatibility\r\n $orderInfo['order'] = unserialize( $orderInfo['order'] );\r\n }\r\n //$orderInfo['order'] = unserialize( $orderInfo['order'] );\r\n $orderInfo['total'] = 0;\r\n\r\n foreach( $orderInfo['order']['cart'] as $name => $value )\r\n {\r\n if( ! isset( $value['price'] ) )\r\n {\r\n $value = array_merge( self::getPriceInfo( $value['price_id'] ), $value );\r\n }\r\n $orderInfo['total'] += $value['price'] * $value['multiple'];\r\n //$counter++;\r\n }\r\n\r\n $secretKey = Paypal_Settings::retrieve( 'secret_key' );\r\n\r\n // var_Export( $secretKey );\r\n\r\n $result = array();\r\n\r\n //The parameter after verify/ is the transaction reference to be verified\r\n $url = 'https://api.sandbox.paypal.com/v2/checkout/orders/' . $_REQUEST['ref'];\r\n echo $url;\r\n\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt(\r\n $ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']\r\n );\r\n curl_setopt(\r\n $ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $secretKey ]\r\n );\r\n $request = curl_exec($ch);\r\n curl_close($ch);\r\n\r\n if ( $request ) {\r\n $result = json_decode($request, true);\r\n }\r\n\r\n //Use the $result array\r\n var_export( $request );\r\n \r\n //\tconfirm status\r\n /* var_export( ! empty( $result['Error'] ) );\r\n var_export( @$result['StatusCode'] !== '00' );\r\n var_export( @$result['Amount'] != @$orderInfo['total'] );\r\n var_export( @$result['Amount'] );\r\n var_export( @$orderInfo['total'] );\r\n var_export( @$result['AmountIntegrityCode'] !== '00' );\r\n */\t\t\r\n if( empty( $result['status'] ) )\r\n {\r\n //\tPayment was not successful.\r\n $orderInfo['order_status'] = 'Payment Failed';\r\n }\r\n else\r\n {\r\n $orderInfo['order_status'] = 'Payment Successful';\r\n }\r\n\r\n //var_export( $orderInfo );\r\n $orderInfo['order_random_code'] = $_REQUEST['ref'];\r\n $orderInfo['gateway_response'] = $result;\r\n\r\n //var_export( $orderNumber );\r\n\r\n self::changeStatus( $orderInfo );\r\n //$table->update( $orderInfo, array( 'order_id' => $orderNumber ) );\r\n\r\n //$response = new SimpleXMLElement(file_get_contents($url));\r\n\r\n //var_export( $orderInfo );\r\n //var_export( $result );\r\n\r\n //\tCode to change check status goes heres\r\n //\tif( )\r\n return $orderInfo;\r\n\t\t} \r\n\t\tcatch( Exception $e )\r\n { \r\n // Alert! Clear the all other content and display whats below.\r\n // $this->setViewContent( '<p class=\"badnews\">' . $e->getMessage() . '</p>' ); \r\n // $this->setViewContent( '<p class=\"badnews\">Theres an error in the code</p>' ); \r\n // return false; \r\n }\r\n\t}", "public function createPaypalPayment(){\n try {\n $client = new Client();\n $paymentResponse = $client->request('POST', $this->paypalPaymentUrl, [\n 'headers' => [\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->accessKey,\n ],\n 'body' => $this->salesData->salesData()\n ]);\n $this->parsePaymentBody($paymentResponse);\n \n } catch (\\Exception $ex) {\n $error = $ex->getMessage();\n return $error;\n }\n return $this->paymentBody->id;\n\n }", "public function __construct()\r\n {\r\n $paypal_conf = Config::get('paypal');\r\n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\r\n $this->_api_context->setConfig($paypal_conf['settings']);\r\n }", "public function paypalAction()\n {\n $adaptor = new \\Phalcon\\Logger\\Adapter\\File(APPLICATION_LOG_DIR . '/payment-paypal-ipn-' . date('Y-m-d') . '.log');\n $adaptor->info(var_export($_REQUEST, true));\n $response = new Response();\n $response->setStatusCode(200, 'OK');\n return $response;\n }", "public function __construct(){\n\t\t$paypal_conf = config('paypal');\n\t\t$this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n\t\t$this->_api_context->setConfig($paypal_conf['settings']);\n\t}", "function create_payment_with_paypal()\n\t{\n\t\t$this->_api_context->setConfig($this->config->item('settings'));\n\n\n\t\t// ### Payer\n\t\t// A resource representing a Payer that funds a payment\n\t\t// For direct credit card payments, set payment method\n\t\t// to 'credit_card' and add an array of funding instruments.\n\n\t\t$payer = new \\PayPal\\Api\\Payer();\n\t\t$payer->setPaymentMethod('paypal');\n\n\t\t// ### Itemized information\n\t\t// (Optional) Lets you specify item wise\n\t\t// information\n\n\n\t\t$ListItemes = array();\n\n\t\tif (is_null(get_cookie(\"cart\")))\n\t\t\tredirect(\"cart\");\n\n\n\t\t$arr = json_decode(get_cookie(\"cart\"), TRUE);\n\n\t\t$ids = array();\n\n\t\tforeach ($arr as $a) {\n\t\t\t$ids[] = $a['id'];\n\t\t}\n\n\t\tif (count($ids) > 0)\n\t\t\t$info = $this->m_p->s_cart(\"products\", $ids, FALSE);\n\t\telse\n\t\t\tredirect(\"cart\");\n\n\n\t\t$products = array();\n\n\t\t$tprice = 0;\n\t\t$ship = get_info(\"shipping\", $this->input->post(\"shipping\"), \"price\") ?? 0;\n\n\t\t$i = 0;\n\n\t\tforeach ($info as $key) {\n\t\t\t$infoa[$key->id] = $key;\n\t\t}\n\n\t\tforeach ($arr as $idk => $k) {\n\t\t\t$key = $infoa[$k['id']];\n\n\t\t\t$options = isset($k['op']) ? json_decode($k['op']) : array();\n\n\t\t\t$products[] = array(\"q\" => $k[\"q\"], \"id\" => $k['id'], \"op\" => $options);\n\n\t\t\t$pr = number_format($key->price - ($key->price * $key->discount / 100), 2);\n\t\t\t$tpr = isset($k['q']) ? number_format($pr * $k['q'], 2) : $pr;\n\n\t\t\t$tprice = $tprice + $tpr;\n\n\t\t\t$ListItemes[$i] = array(\n\t\t\t\t\"name\" \t\t\t=> get_info(\"products\", $key->id, \"title\"),\n\t\t\t\t\"sku\" \t\t\t=> $key->id,\n\t\t\t\t\"currency\" => \"USD\",\n\t\t\t\t\"quantity\" \t\t=> isset($k['q']) ? $k['q'] : 1,\n\t\t\t\t\"price\" \t\t=> $pr\n\t\t\t);\n\n\t\t\t$i++;\n\t\t}\n\n\t\t$date = \"Y-m-d\";\n\n\t\t// if(!empty($coupon))\n\t\t// {\n\t\t// \t$c = $this->m_p->s_a(\"discounts\", array(\"coupon\" => $coupon, \"date >=\" => $date));\n\n\t\t// \tif(count($c) != 0)\n\t\t// \t{\n\t\t// \t\tforeach($c as $k)\n\t\t// \t\t\t$num = $k->num;\n\n\t\t// \t\t$tprice = $tprice - $num * $tprice / 100;\n\t\t// \t}\n\t\t// }\n\n\t\t$ip = $this->input->ip_address();\n\n\t\t$date = date(\"Y-m-d\");\n\n\t\t$results = $this->db->query(\"SELECT * FROM account where dateat like '$date%' \")->row();\n\t\tif ($results) {\n\t\t\t$target = $results->target;\n\t\t} else {\n\t\t\t$target = '00';\n\t\t}\n\t\t$bill_no = '#OR' . strtoupper(substr(md5(uniqid(mt_rand(), true)), 0, 4));\n\t\t$currency_type = $this->input->post(\"currency_type\");\n\t\t$arrInsert = array(\n\t\t\t\"name\" => $this->input->post(\"fullname\"),\n\t\t\t\"tele\" => $this->input->post(\"phone\"),\n\t\t\t\"email\" => $this->input->post(\"email\"),\n\t\t\t\"address\" => $this->input->post(\"address\"),\n\t\t\t\"address2\" => $this->input->post(\"address2\"),\n\t\t\t\"city\" => $this->input->post(\"city\"),\n\t\t\t\"state\" => $this->input->post(\"state\"),\n\t\t\t\"zipcode\" => $this->input->post(\"zipcode\"),\n\t\t\t\"country\" => $this->input->post(\"country\"),\n\t\t\t\"note\" => $this->input->post(\"note\"),\n\t\t\t\"ip\" => $ip,\n\t\t\t\"pay\" => \"paypal\",\n\t\t\t\"totalPrice\" => $tprice + $ship,\n\t\t\t\"products\" => json_encode($products),\n\t\t\t\"date\" => time(),\n\t\t\t\"target\" => $target,\n\t\t\t\"order_id\" => $bill_no,\n\t\t\t\"datetime\" => date('Y-m-d\\TH:i:s'),\n\t\t\t'currency_type' => $currency_type\n\t\t);\n\n\t\t$orderId = $this->m_p->ins(\"orders\", $arrInsert);\n\t\t\n\t\t$itemList = new ItemList();\n\t\t$itemList->setItems($ListItemes);\n\n\t\t// ### Additional payment details\n\t\t// Use this optional field to set additional\n\t\t// payment information such as tax, shipping\n\t\t// charges etc.\n\t\t$details['tax'] = number_format($ship, 2);\n\t\t$details['subtotal'] = number_format($tprice, 2);\n\t\t// ### Amount\n\t\t// Lets you specify a payment amount.\n\t\t// You can also specify additional details\n\t\t// such as shipping, tax.\n\t\t$amount['currency'] = \"USD\";\n\t\t$amount['total'] = number_format($details['tax'] + $details['subtotal'], 2);\n\t\t$amount['details'] = $details;\n\t\t// ### Transaction\n\t\t// A transaction defines the contract of a\n\t\t// payment - what is the payment for and who\n\t\t// is fulfilling it.\n\n\t\t//exit();\n\n\t\t$transaction['description'] = 'Payment';\n\t\t$transaction['amount'] = $amount;\n\t\t$transaction['invoice_number'] = uniqid();\n\t\t$transaction['item_list'] = $itemList;\n\t\t$transaction['custom'] = $orderId;\n\n\t\t// ### Redirect urls\n\t\t// Set the urls that the buyer must be redirected to after\n\t\t// payment approval/ cancellation.\n\t\t$baseUrl = base_url();\n\t\t$redirectUrls = new RedirectUrls();\n\t\t$redirectUrls->setReturnUrl($baseUrl . \"paypal/getPaymentStatus\")\n\t\t\t->setCancelUrl($baseUrl . \"paypal/getPaymentStatus\");\n\n\t\t// ### Payment\n\t\t// A Payment Resource; create one using\n\t\t// the above types and intent set to sale 'sale'\n\t\t$payment = new Payment();\n\t\t$payment->setIntent(\"sale\")\n\t\t\t->setPayer($payer)\n\t\t\t->setRedirectUrls($redirectUrls)\n\t\t\t->setTransactions(array($transaction));\n\n\t\ttry {\n\t\t\t$payment->create($this->_api_context);\n\t\t} catch (Exception $ex) {\n\t\t\t// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY\n\t\t\tprint_r($ex);\n\t\t\texit(1);\n\t\t}\n\t\tforeach ($payment->getLinks() as $link) {\n\t\t\tif ($link->getRel() == 'approval_url') {\n\t\t\t\t$redirect_url = $link->getHref();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (isset($redirect_url)) {\n\t\t\t/** redirect to paypal **/\n\t\t\tredirect($redirect_url);\n\t\t}\n\n\t\t$this->session->set_flashdata('success_msg', 'Unknown error occurred');\n\t\tredirect('home/checkout');\n\t}", "public function __construct()\n {\n $paypal_conf = \\Config::get('paypal');\n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->_api_context->setConfig($paypal_conf['settings']);\n }", "public function __construct()\n {\n /** setup PayPal api context **/\n $paypal_conf = \\Config::get('paypal');\n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->_api_context->setConfig($paypal_conf['settings']);\n }", "public function paypal_payment($paymentID = \"\", $paymentToken = \"\", $payerID = \"\", $paypalClientID = \"\", $paypalSecret = \"\") {\n $paypal_keys = get_settings('paypal');\n $paypal_data = json_decode($paypal_keys);\n\n $paypalEnv = $paypal_data[0]->mode; // Or 'production'\n if ($paypal_data[0]->mode == 'sandbox') {\n $paypalURL = 'https://api.sandbox.paypal.com/v1/';\n } else {\n $paypalURL = 'https://api.paypal.com/v1/';\n }\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $paypalURL.'oauth2/token');\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $paypalClientID.\":\".$paypalSecret);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"grant_type=client_credentials\");\n $response = curl_exec($ch);\n curl_close($ch);\n\n if(empty($response)){\n return false;\n }else{\n $jsonData = json_decode($response);\n $curl = curl_init($paypalURL.'payments/payment/'.$paymentID);\n curl_setopt($curl, CURLOPT_POST, false);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl, CURLOPT_HEADER, false);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Authorization: Bearer ' . $jsonData->access_token,\n 'Accept: application/json',\n 'Content-Type: application/xml'\n ));\n $response = curl_exec($curl);\n curl_close($curl);\n\n // Transaction data\n $result = json_decode($response);\n\n // CHECK IF THE PAYMENT STATE IS APPROVED OR NOT\n if($result && $result->state == 'approved'){\n return true;\n }else{\n return false;\n }\n }\n }", "private function _saveSettingsBasic()\r\n\t{\r\n\t\tif (!isset($_POST['paypal_usa_account']) || !$_POST['paypal_usa_account'])\r\n\t\t\t$this->_error[] = $this->l('Your Paypal Business Account is required.');\r\n\t\tif (!isset($_POST['paypal_usa_api_username']) || !$_POST['paypal_usa_api_username'])\r\n\t\t\t$this->_error[] = $this->l('Your Paypal API Username is required.');\r\n\t\tif (!isset($_POST['paypal_usa_api_password']) || !$_POST['paypal_usa_api_password'])\r\n\t\t\t$this->_error[] = $this->l('Your Paypal API Password is required.');\r\n\t\tif (!isset($_POST['paypal_usa_api_signature']) || !$_POST['paypal_usa_api_signature'])\r\n\t\t\t$this->_error[] = $this->l('Your Paypal API Signature is required.');\r\n\r\n\t\tConfiguration::updateValue('PAYPAL_USA_ACCOUNT', pSQL(Tools::getValue('paypal_usa_account')));\r\n\t\tConfiguration::updateValue('PAYPAL_USA_API_USERNAME', pSQL(Tools::getValue('paypal_usa_api_username')));\r\n\t\tConfiguration::updateValue('PAYPAL_USA_API_PASSWORD', pSQL(Tools::getValue('paypal_usa_api_password')));\r\n\t\tConfiguration::updateValue('PAYPAL_USA_API_SIGNATURE', pSQL(Tools::getValue('paypal_usa_api_signature')));\r\n\t\tConfiguration::updateValue('PAYPAL_USA_SANDBOX', (bool)Tools::getValue('paypal_usa_sandbox'));\r\n\r\n\t\t/* PayPal Express Checkout options */\r\n\t\tif (Configuration::get('PAYPAL_USA_EXPRESS_CHECKOUT') && !isset($_POST['paypal_usa_checkbox_shopping_cart']) && !isset($_POST['paypal_usa_checkbox_product']))\r\n\t\t\t$this->_error[] = $this->l('As PayPal Express Checkout is enabled, please select where it should be displayed.');\r\n\t\telse\r\n\t\t{\r\n\t\t\tConfiguration::updateValue('PAYPAL_USA_EXP_CHK_PRODUCT', isset($_POST['paypal_usa_checkbox_product']));\r\n\t\t\tConfiguration::updateValue('PAYPAL_USA_EXP_CHK_SHOPPING_CART', isset($_POST['paypal_usa_checkbox_shopping_cart']));\r\n\t\t\tConfiguration::updateValue('PAYPAL_USA_EXP_CHK_BORDER_COLOR', pSQL(Tools::getValue('paypal_usa_checkbox_border_color')));\r\n\t\t}\r\n\r\n\t\t/* Automated check to verify the API credentials configured by the merchant */\r\n\t\tif (Configuration::get('PAYPAL_USA_API_USERNAME') && Configuration::get('PAYPAL_USA_API_PASSWORD') && Configuration::get('PAYPAL_USA_API_SIGNATURE'))\r\n\t\t{\r\n\t\t\t$result = $this->postToPayPal('GetBalance', '');\r\n\t\t\tif (strtoupper($result['ACK']) != 'SUCCESS' && strtoupper($result['ACK']) != 'SUCCESSWITHWARNING')\r\n\t\t\t\t$this->_error[] = $this->l('Your Paypal API crendentials are not valid, please double-check their values or contact PayPal.');\r\n\t\t}\r\n\r\n\t\tif (!count($this->_error))\r\n\t\t\t$this->_validation[] = $this->l('Congratulations, your configuration was updated successfully');\r\n\t}", "public function payments() {\n \n PageContext::$response->activeLeftMenu = 'Settings';\n $this->view->setLayout(\"home\");\n\n $epaypal=($this->post('p_paypal')=='on') ? 'Y' : 'N';\n $sandbox=($this->post('p_sandbox')=='on') ? 'Y' : 'N';\n\n $e_auth=($this->post('e_auth')=='on') ? 'Y' : 'N';\n $a_test=($this->post('a_test')=='on') ? 'Y' : 'N';\n\n $error = NULL;\n\n // Paypal Settings\n if($this->isPost()) {\n\n $arrUpdate = array(\"value\"=>addslashes($epaypal));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='enablepaypal'\");\n\n $arrUpdate = array(\"value\"=>addslashes($sandbox));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='enablepaypalsandbox'\");\n\n $arrUpdate = array(\"value\"=>addslashes($this->post('p_tocken')));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='paypalidentitytoken'\");\n\n $arrUpdate = array(\"value\"=>addslashes($this->post('p_email')));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='paypalemail'\");\n \n $arrUpdate = array(\"value\"=>addslashes($e_auth));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='authorize_enable'\");\n\n $arrUpdate = array(\"value\"=>addslashes($this->post('a_logid')));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='authorize_loginid'\");\n\n $arrUpdate = array(\"value\"=>addslashes($this->post('a_tkey')));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='authorize_transkey'\");\n\n $arrUpdate = array(\"value\"=>addslashes($this->post('a_email')));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='authorize_email'\");\n\n $arrUpdate = array(\"value\"=>addslashes($a_test));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='authorize_test_mode'\");\n\n\n $arrUpdate = array(\"value\"=>addslashes($this->post('currency')));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='admin_currency'\");\n\n // Success Message\n // $this->view->message = (empty($error)) ? \"Changes Saved Successfully\" : $error;\n PageContext::$response->success_message = \"Changes Saved Successfully\" ;\n PageContext::addPostAction('successmessage');\n\n\n } // End isPost\n\n $this->view->authEnable = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='authorize_enable'\");\n\n $this->view->authLoginId = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='authorize_loginid'\");\n\n $this->view->authtransKey = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='authorize_transkey'\");\n\n $this->view->authEmail = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='authorize_email'\");\n\n $this->view->authTestMode = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='authorize_test_mode'\");\n\n\n //**************** PAYPAL\n\n\n $this->view->enablePaypal = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='enablepaypal'\");\n\n $this->view->enableSandBox = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='enablepaypalsandbox'\");\n\n $this->view->paypalTocken = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='paypalidentitytoken'\");\n\n $this->view->paypalEmail = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='paypalemail'\");\n\n $this->view->currency = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='admin_currency'\");\n\n }", "private function setupApplicationEnvironment(){\n\n // TODO: MAKE MORE EFFICENT WITH CACHING\n if($this->version == null)\n $this->version = env('PAYPAL_VERSION', 'dev-2.0-beta');\n\n if($this->endpoint == null)\n $this->endpoint = env('PAYPAL_ENDPOINT');\n \n if($this->username == null)\n $this->username = env('PAYPAL_USERNAME');\n\n if($this->password == null)\n $this->password = env('PAYPAL_PASSWORD');\n\n if($this->signature == null)\n $this->signature = env('PAYPAL_SIGNATURE');\n\n if($this->isDirect == null)\n $this->isDirect = env('PAYPAL_DIRECT', true);\n\n if($this->payment_method == null) \n $this->payment_method = ($this->isDirect) ? Objects::CREDIT_CARD : env('PAYMENT_METHOD');\n\n // Set our enviornment based on production or development\n $this->environment = (!$this->isDevelopment) ? new ProductionEnvironment() : new SandboxEnvironment();\n\n $this->client = new PayPalHttpClient($this->environment);\n\n }", "public function __construct()\n {\n \n /** setup PayPal api context **/\n $paypal_conf = \\Config::get('paypal');\n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->_api_context->setConfig($paypal_conf['settings']);\n }", "public function __construct()\n {\n \n /** setup PayPal api context **/\n $paypal_conf = \\Config::get('paypal');\n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->_api_context->setConfig($paypal_conf['settings']);\n }", "public function __construct()\n {\n $this->middleware('referer');\n if (App::getLocale() == \"it\") {\n Moment::setLocale('it_IT');\n }\n\n\n $this->_apiContext = PayPal::ApiContext(\n config('services.paypal.client_id'),\n config('services.paypal.secret'));\n\n\n $this->_apiContext->setConfig(array(\n 'mode' => (getenv('APP_ENV') == \"local\") ? 'sandbox' : 'live',\n 'service.EndPoint' => (getenv('APP_ENV') == \"local\") ? 'https://api.sandbox.paypal.com' : 'https://api.paypal.com',\n 'http.ConnectionTimeOut' => 30,\n 'log.LogEnabled' => false,\n 'log.FileName' => storage_path('logs/paypal.log'),\n 'log.LogLevel' => 'FINE'\n ));\n\n\n }", "public function __construct()\n {\n\n /** PayPal api context **/\n $paypal_conf = \\Config::get('paypal');\n $this->_api_context = new ApiContext(new OAuthTokenCredential(\n $paypal_conf['client_id'],\n $paypal_conf['secret'])\n );\n $this->_api_context->setConfig($paypal_conf['settings']);\n\n }", "function buy(){\r\n\t\t$returnURL = base_url().'paypal/success'; //payment success url\r\n\t\t$cancelURL = base_url().'paypal/cancel'; //payment cancel url\r\n\t\t$notifyURL = base_url().'paypal/ipn'; //ipn url\r\n\t\t\r\n\t\t$r_name = $this->input->post('r_name');\r\n\t\t$id = $this->input->post('id');\r\n\t\t$price = $this->input->post('price_room');\r\n\t\t$userID = 1; //current user id\r\n\t\t$logo = base_url().'assets/img/logo.png';\r\n\t\t\r\n\t\t$this->paypal_lib->add_field('return', $returnURL);\r\n\t\t$this->paypal_lib->add_field('cancel_return', $cancelURL);\r\n\t\t$this->paypal_lib->add_field('notify_url', $notifyURL);\r\n\t\t$this->paypal_lib->add_field('item_name', $r_name);\r\n\t\t$this->paypal_lib->add_field('custom', $userID);\r\n\t\t$this->paypal_lib->add_field('item_number', $id);\r\n\t\t$this->paypal_lib->add_field('amount', $price);\t\t\r\n\t\t$this->paypal_lib->image($logo);\r\n\t\t\r\n\t\t$this->paypal_lib->paypal_auto_form();\r\n\t}", "public function __construct()\n {\n // parent::__construct();\n \n /** setup PayPal api context **/\n $paypal_conf = \\Config::get('paypal');\n\t\t//print_r($paypal_conf);exit;\n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->_api_context->setConfig($paypal_conf['settings']);\n }", "public function setUp()\n {\n $this->_paypal = new Paypal();\n\n $this->_payment = new Payment($this->_paypal);\n }", "function PPHttpPost($methodName_, $nvpStr_) {\n\tglobal $environment;\n\n\tglobal $API_UserName, $API_Password, $API_Signature;\n\n\t// Set up your API credentials, PayPal end point, and API version.\n\n\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\n\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment) {\n\t\t//$API_Endpoint = \"https://api-3t.$environment.paypal.com/nvp\";\n\t\t$API_Endpoint = \"https://api-3t.sandbox.paypal.com/nvp\";\n\t}\n\t$version = urlencode('57.0');\n\n\t// Set the curl parameters.\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n\t// Turn off the server and peer verification (TrustManager Concept).\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t// Set the API operation, version, and API signature in the request.\n\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\n\t// Set the request as a POST FIELD for curl.\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n\t// Get response from the server.\n\t$httpResponse = curl_exec($ch);\n\n\tif(!$httpResponse) {\n\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t}\n\n\t// Extract the response details.\n\t$httpResponseAr = explode(\"&\", $httpResponse);\n\n\t$httpParsedResponseAr = array();\n\tforeach ($httpResponseAr as $i => $value) {\n\t\t$tmpAr = explode(\"=\", $value);\n\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t}\n\t}\n\n\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t}\n\n\treturn $httpParsedResponseAr;\n}", "public function __construct($config=\"\"){\r\n\r\n\t//default settings\r\n\t$settings = array(\r\n\t\t'business' => '[email protected]', //paypal email address\r\n\t\t'currency' => 'GBP', //paypal currency\r\n\t\t'cursymbol'=> '&pound;', //currency symbol\r\n\t\t'location' => 'GB', //location code (ex GB)\r\n\t\t'returnurl'=> 'http://mysite/myreturnpage',//where to go back when the transaction is done.\r\n\t\t'returntxt'=> 'Return to My Site', //What is written on the return button in paypal\r\n\t\t'cancelurl'=> 'http://mysite/mycancelpage',//Where to go if the user cancels.\r\n\t\t'shipping' => 0, //Shipping Cost\r\n\t\t'custom' => '' //Custom attribute\r\n\t);\r\n\r\n\t//overrride default settings\r\n\tif(!empty($config)){foreach($config as $key=>$val){\r\n\t\tif(!empty($val)){ $settings[$key] = $val; }\r\n\t}}\r\n\t\r\n\t//Set the class attributes\r\n\t$this->business = $settings['business'];\r\n\t$this->currency = $settings['currency'];\r\n\t$this->cursymbol = $settings['cursymbol'];\r\n\t$this->location = $settings['location'];\r\n\t$this->returnurl = $settings['returnurl'];\r\n\t$this->returntxt = $settings['returntxt'];\r\n\t$this->cancelurl = $settings['cancelurl'];\r\n\t$this->shipping = $settings['shipping'];\r\n\t$this->custom = $settings['custom'];\r\n\t$this->items = array();\r\n\r\n}", "private function getPaypal()\n {\n if($this->isTest == true){\n return 'www.sandbox.paypal.com';\n } else {\n return 'www.paypal.com';\n }\n }", "public function postPaymentWithpaypal(Request $request)\n {\n// echo $request;\n// echo $request->get('amount');\n// echo $sdfdsf=$request->get('checkoutInfo');\n// exit;\n $payer = new Payer();\n $payer->setPaymentMethod('paypal');\n $item_1 = new Item();\n $item_1->setName('Item 1') /** item name **/\n ->setCurrency('USD')\n ->setQuantity(1)\n ->setPrice($request->get('amount')); /** unit price **/\n $item_list = new ItemList();\n $item_list->setItems(array($item_1));\n $amount = new Amount();\n $amount->setCurrency('USD')\n ->setTotal($request->get('amount'));\n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setItemList($item_list)\n ->setDescription('Your transaction description');\n $redirect_urls = new RedirectUrls();\n $redirect_urls->setReturnUrl(URL::route('payment.status')) /** Specify return URL **/\n ->setCancelUrl(URL::route('payment.status'));\n// $redirect_urls->setReturnUrl(URL::route('payment.status',['amount'=>$request->get('amount'),'checkoutInfo'=>$request->get('checkoutInfo')])) /** Specify return URL **/\n// ->setCancelUrl(URL::route('payment.status',['amount'=>$request->get('amount'),'checkoutInfo'=>$request->get('checkoutInfo')]));\n $payment = new Payment();\n $payment->setIntent('Sale')\n ->setPayer($payer)\n ->setRedirectUrls($redirect_urls)\n ->setTransactions(array($transaction));\n /** dd($payment->create($this->_api_context));exit; **/\n try {\n $payment->create($this->_api_context);\n } catch (\\PayPal\\Exception\\PPConnectionException $ex) {\n if (\\Config::get('app.debug')) {\n \\Session::put('error','Connection timeout');\n return Redirect::route('addmoney.paywithpaypal');\n /** echo \"Exception: \" . $ex->getMessage() . PHP_EOL; **/\n /** $err_data = json_decode($ex->getData(), true); **/\n /** exit; **/\n } else {\n \\Session::put('error','Some error occur, sorry for inconvenient');\n return Redirect::route('addmoney.paywithpaypal');\n /** die('Some error occur, sorry for inconvenient'); **/\n }\n }\n foreach($payment->getLinks() as $link) {\n if($link->getRel() == 'approval_url') {\n $redirect_url = $link->getHref();\n break;\n }\n }\n /** add payment ID to session **/\n Session::put('paypal_payment_id', $payment->getId());\n Session::put('checkoutInfo', $request->get('checkoutInfo'));\n \n if(isset($redirect_url)) {\n /** redirect to paypal **/\n return Redirect::away($redirect_url);\n }\n \\Session::put('error','Unknown error occurred');\n return Redirect::route('addmoney.paywithpaypal');\n }", "public function __construct($config = array())\r\n {\r\n $config = Arr::merge((array) Kohana::config('paypal'), $config);\r\n\r\n // Save the config in the object\r\n $this->config = $config;\r\n\r\n $this->paypal_url = isset($config['url']) ? $config['url'] : 'https://www.paypal.com/cgi-bin/webscr';\r\n }", "function verify_and_retrieve_payment()\r\n\t{\r\n\t\t$email = $_GET['ipn_email']; \r\n\t\t$header = \"\"; \r\n\t\t$emailtext = \"\"; \r\n\t\t// Read the post from PayPal and add 'cmd' \r\n\t\t$req = 'cmd=_notify-validate';\r\n\r\n\t\tif(function_exists('get_magic_quotes_gpc')) \r\n\t\t{ \r\n\t\t\t$get_magic_quotes_exits = true;\r\n\t\t}\r\n\r\n\t\tforeach ($_POST as $key => $value)\r\n\t\t// Handle escape characters, which depends on setting of magic quotes \r\n\t\t{ \r\n\t\t\tif($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) \r\n\t\t\t{ \r\n\t\t\t\t$value = urlencode(stripslashes($value)); \r\n\t\t\t} \r\n\t\t\telse \r\n\t\t\t{ \r\n\t\t\t\t$value = urlencode($value); \r\n\t\t\t} \r\n\t\t \r\n\t\t\t$req .= \"&$key=$value\"; \r\n\t\t} // Post back to PayPal to validate \r\n\t\t \r\n\t\t$header .= \"POST /cgi-bin/webscr HTTP/1.0\\r\\n\"; \r\n\t\t$header .= \"Content-Type: application/x-www-form-urlencoded\\r\\n\"; \r\n\t\t$header .= \"Content-Length: \" . strlen($req) . \"\\r\\n\\r\\n\"; \r\n\r\n\t\t$fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30); \r\n\r\n\t\t // Process validation from PayPal\r\n\t\tif (!$fp) \r\n\t\t{ // HTTP ERROR \r\n\t\t} \r\n\t\telse \r\n\t\t{ // NO HTTP ERROR \r\n\t\t\tfputs ($fp, $header . $req); \r\n\t\t \r\n\t\t\twhile (!feof($fp)) \r\n\t\t\t{ \r\n\t\t\t\t$res = fgets ($fp, 1024); \r\n\t\t\t\tif (strcmp ($res, \"VERIFIED\") == 0) \r\n\t\t\t\t{ \r\n\t\t\t\t\t// TODO: // Check the payment_status is Completed \r\n\t\t\t\t\t// Check that txn_id has not been previously processed \r\n\t\t\t\t\t// Check that receiver_email is your Primary PayPal email \r\n\t\t\t\t\t// Check that payment_amount/payment_currency are correct \r\n\t\t\t\t\t// Process payment \r\n\t\t\t\t\t// If 'VERIFIED', send an email of IPN variables and values to the \r\n\t\t\t\t\t// specified email address \r\n\t\t \r\n\t\t\t\t\t$f_result = array( true, $_POST );\r\n\t\t\t\t\t\r\n\t\t\t\t\t//foreach ($_POST as $key => $value)\r\n\t\t\t\t\t//{ \r\n\t\t\t\t\t\t//$emailtext .= $key . \" = \" .$value .\"\\n\\n\";\r\n\t\t\t\t\t//} \r\n\t\t\t \r\n\t\t\t\t\t//mail($email, \"Live-VERIFIED IPN\", $emailtext . \"\\n\\n\" . $req); \r\n\t\t\t\t} \r\n\t\t\t\telse if (strcmp ($res, \"INVALID\") == 0) \r\n\t\t\t\t{ // If 'INVALID', send an email. TODO: Log for manual investigation. \r\n\t\t\t\t\t//foreach ($_POST as $key => $value)\r\n\t\t\t\t\t//{ \r\n\t\t\t\t\t//\t$emailtext .= $key . \" = \" .$value .\"\\n\\n\"; \r\n\t\t\t\t\t//} \r\n\t\t\t\t\t\r\n\t\t\t\t\t//mail($email, \"Live-INVALID IPN\", $emailtext . \"\\n\\n\" . $req); \r\n\t\t\t\t\t$f_result = array( false, $_POST );\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t \r\n\t\t\tfclose ($fp); \r\n\t\t}\r\n\t\r\n\t\treturn $f_result;\r\n\t}", "public function buy(){\n\n $id=89025555; //id di connessione\n $password=\"test\"; //password di connessione\n\n //è necessario foramttare il totale in NNNNNN.NN\n $importo= number_format(StadiumCart::total(),2,'.','');//importo da pagare\n\n $trackid=\"STDRX\".time(); //id transazione\n\n $urlpositivo=\"http://stadium.reexon.net/cart/receipt\";\n $urlnegativo=\"http://stadium.reexon.net/cart/error\";\n $codicemoneta=\"978\"; //euro\n //prelevo i dati inseriti durante la fase acquisto\n $user = (object)Session::get('user');\n\n $data=\"id=$id\n &password=$password\n &action=4\n &langid=ITA\n &currencycode=$codicemoneta\n &amt=$importo\n &responseURL=$urlpositivo\n &errorURL=$urlnegativo\n &trackid=$trackid\n &udf1=\".$user->email.\"\n &udf2=\".$user->mobile.\"\n &udf3=\".$user->firstname.\"\n &udf4=\".$user->lastname.\"\n &udf5=EE\";\n $curl_handle=curl_init();\n //curl_setopt($curl_handle,CURLOPT_URL,'https://www.constriv.com:443/cg/servlet/PaymentInitHTTPServlet');\n curl_setopt($curl_handle,CURLOPT_URL,'https://test4.constriv.com/cg301/servlet/PaymentInitHTTPServlet');\n curl_setopt($curl_handle, CURLOPT_VERBOSE, true);\n curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,5);\n curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);\n curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl_handle, CURLOPT_POST, 1);\n curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $data);\n $buffer = curl_exec($curl_handle);\n\n if (empty($buffer))\n {\n return curl_error($curl_handle);\n }\n else\n {\n //print $buffer;\n $url=explode(\":\",$buffer);\n $transaction_id=$url[0];\n curl_close($curl_handle);\n //prepara il link per il pagamento\n if(strlen($transaction_id)>0){\n $redirectURL = $url[1].\":\".$url[2].\"?PaymentID=$transaction_id\";\n echo \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=$redirectURL\\\">\";\n }\n }\n\n }", "public function returnFromPaypal($token)\n {\n $quote = $this->_quote;\n $payment = $quote->getPayment();\n\n $setServiceResponse = $this->_checkoutSession->getSetServiceResponse();\n $request = $this->dataBuilder->buildCheckStatusService($setServiceResponse, $quote);\n $getDetailsResponse = $this->_api->checkStatusService($request);\n $this->_checkoutSession->setGetDetailsResponse($getDetailsResponse);\n\n $isBillingAgreement = $payment->getAdditionalInformation(VaultConfigProvider::IS_ACTIVE_CODE);\n\n // signing up for billing agreement\n if ($isBillingAgreement) {\n $baRequest = $this->dataBuilder->buildBillingAgreementService(\n $setServiceResponse['requestID'],\n $quote\n );\n\n $baResponse = $this->_api->billingAgreementService($baRequest);\n\n // saving BA info to payment\n $payment->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_BA_REQUEST_ID, $baResponse->requestID);\n $payment->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_BA_EMAIL, $baResponse->billTo->email);\n $payment->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_BA_PAYER_ID, $baResponse->apReply->payerID);\n $payment->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_BA_ID, $baResponse->apReply->billingAgreementID);\n $payment->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_BA_DATE, $baResponse->apBillingAgreementReply->dateTime);\n }\n\n $this->ignoreAddressValidation();\n\n // import shipping address\n $exportedShippingAddress = $getDetailsResponse['shippingAddress'];\n if (!$quote->getIsVirtual()) {\n $shippingAddress = $quote->getShippingAddress();\n if ($shippingAddress) {\n if ($exportedShippingAddress\n && $quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_BUTTON) == 1\n ) {\n $shippingAddress = $this->_setExportedAddressData($shippingAddress, $exportedShippingAddress);\n $shippingAddress->setPrefix(null);\n $shippingAddress->setCollectShippingRates(true);\n $shippingAddress->setSameAsBilling(0);\n }\n\n // import shipping method\n $code = '';\n $quote->getPayment()->setAdditionalInformation(\n self::PAYMENT_INFO_TRANSPORT_SHIPPING_METHOD,\n $code\n );\n }\n }\n\n // import billing address\n $portBillingFromShipping = $quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_BUTTON) && !$quote->isVirtual();\n if ($portBillingFromShipping) {\n $billingAddress = clone $shippingAddress;\n $billingAddress->unsAddressId()->unsAddressType()->setCustomerAddressId(null);\n $data = $billingAddress->getData();\n $data['save_in_address_book'] = 0;\n $quote->getBillingAddress()->addData($data);\n $quote->getShippingAddress()->setSameAsBilling(1);\n } else {\n $billingAddress = $quote->getBillingAddress();\n }\n $exportedBillingAddress = $getDetailsResponse['billingAddress'];\n\n $billingAddress = $this->_setExportedAddressData($billingAddress, $exportedBillingAddress, true);\n $billingAddress->setCustomerNote($exportedBillingAddress->getData('note'));\n $billingAddress->setCustomerAddressId(null); // force new address creation for the order instead of updating address book entity\n $quote->setBillingAddress($billingAddress);\n $quote->setCheckoutMethod($this->getCheckoutMethod());\n\n // import payment info\n $payment->setMethod($this->_methodType);\n $payment\n ->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_PAYER_ID, $getDetailsResponse['paypalPayerId'])\n ->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_PAYER_EMAIL, $getDetailsResponse['paypalCustomerEmail'])\n ->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_TOKEN, $token)\n ;\n $quote->collectTotals();\n $this->quoteRepository->save($quote);\n }", "public function action_paypal_callback()\n\t{\n $post = $this->request->post();\n\t\t$type = $this->request->param('id');\n\t\t$payment = new Model_Realexpayments; // Not actually \"Realex\"\n\t\t$data['purchase_time'] = date('Y-m-d H:i:s');\n\n\t\tIbHelpers::htmlspecialchars_array($post);\n\n\t\t$data['cart_details'] = json_encode(IbHelpers::iconv_array($post));\n\n try\n\t\t{\n $is_booking = ($type == 'booking' AND isset($post['custom']));\n\t\t\t$is_product = ($type == 'product' AND isset($post['custom']));\n\t\t\t$is_invoice = ($type == 'invoice' AND isset($post['custom']));\n\t\t\t$data['paid'] = 1;\n\t\t\t$data['payment_type'] = 'PayPal';\n\t\t\t$data['payment_amount'] = isset($post['mc_gross']) ? $post['mc_gross'] : '';\n\n\t\t\tif ($is_booking)\n\t\t\t{\n\t\t\t\t// Use contact details from the booking, which should also be the data filled out in the checkout form\n\t\t\t\t$booking = Model_CourseBookings::load(trim($post['custom'], '|'));\n $data['customer_name'] = $booking['student']['first_name'].' '.$booking['student']['last_name'];\n\t\t\t\t$data['customer_telephone'] = $booking['student']['phone'];\n\t\t\t\t$data['customer_address'] = $booking['student']['address'];\n\t\t\t\t$data['customer_email'] = $booking['student']['email'];\n\t\t\t}\n\t\t\telseif ($is_product OR $is_invoice)\n\t\t\t{\n\t\t\t\t$cart = new Model_Cart($post['custom']);\n\n\t\t\t\t// Set the cart item as paid\n\t\t\t\t$cart->set_paid(1)->save();\n\n\t\t\t\t// Send the emails\n\t\t\t\t$cart = $cart->get_instance();\n\t\t\t\t$form_data = json_decode($cart['form_data']);\n\t\t\t\t$cart_data = json_decode($cart['cart_data']);\n\t\t\t\t$cart_data = isset($cart_data->data) ? $cart_data->data : new stdClass();\n $cart_data->payment_type = 'Paypal';\n\n\t\t\t\t$data['customer_name'] = isset($form_data->ccName) ? $form_data->ccName : '';\n\t\t\t\t$data['customer_telephone'] = isset($form_data->phone) ? $form_data-> phone : '';\n\t\t\t\t$data['customer_address'] = isset($form_data->address_1) ? $form_data->address_1 : '';\n\t\t\t\t$data['customer_address'] .= isset($form_data->address_2) ? ', '.$form_data->address_2 : '';\n\t\t\t\t$data['customer_address'] .= isset($form_data->address_3) ? ', '.$form_data->address_3 : '';\n\t\t\t\t$data['customer_address'] .= isset($form_data->address_4) ? ', '.$form_data->address_4 : '';\n\t\t\t\t$data['customer_email'] = isset($form_data->email) ? $form_data->email : '';\n\t\t\t\t$data['cart_id'] = isset($cart_data->id) ? $cart_data->id : '';\n\n\t\t\t\t$payment->send_mail_seller($form_data, (array) $cart_data);\n\t\t\t\t$payment->send_mail_customer($form_data, NULL, (array) $cart_data);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Use contact details from the buyer's PayPal account\n\t\t\t\t$data['customer_name'] = trim((isset($post['first_name'])?$post['first_name']:'').' '.(isset($post['last_name'])?$post['last_name']:''));\n\t\t\t\t$data['customer_telephone'] = isset($post['contact_phone']) ? $post['contact_phone'] : '';;\n\t\t\t\t$data['customer_address'] = \"\".\n\t\t\t\t\t(isset($post['address_name']) ? $post['address_name'] .\"\\n\" : '').\n\t\t\t\t\t(isset($post['address_street']) ? $post['address_street'] .\"\\n\" : '').\n\t\t\t\t\t(isset($post['address_city']) ? $post['address_city'] .\"\\n\" : '').\n\t\t\t\t\t(isset($post['address_state']) ? $post['address_state'] .\"\\n\" : '').\n\t\t\t\t\t(isset($post['address_zip']) ? $post['address_zip'] .\"\\n\" : '').\n\t\t\t\t\t(isset($post['address_country']) ? $post['address_country'].\"\\n\" : '');\n\t\t\t\t$data['customer_email'] = isset($post['payer_email']) ? $post['payer_email'] : '';\n\t\t\t}\n\n\t\t\tDB::insert('plugin_payments_log')->values($data)->execute();\n\n if ($is_booking)\n\t\t\t{\n\t\t\t\tModel_CourseBookings::paypal_handler_old($booking['id'], $post['mc_gross'], $post['txn_id']);\n\n\t\t\t\t// send success emails regarding bookings\n\t\t\t\t$payment->send_mail_seller_bookings($post);\n\t\t\t\t$payment->send_mail_customer_bookings($post);\n\t\t\t}\n\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tLog::instance()->add(Log::ERROR, $e->getMessage().\"\\n\".$e->getTraceAsString());\n\t\t\t$data['payment_type'] = 'Test/failed payment';\n\t\t\tModel_Errorlog::save($e);\n\t\t\tDB::insert('plugin_payments_log')->values($data)->execute();\n\t\t}\n\t}", "public function paypal_payouts($data=false)\n {\n global $environment;\n $paypal_credentials = PaymentGateway::where('site','PayPal')->get();\n $api_user = $paypal_credentials[1]->value;\n $api_pwd = $paypal_credentials[2]->value;\n $api_key = $paypal_credentials[3]->value;\n $paymode = $paypal_credentials[4]->value;\n \n $client = $paypal_credentials[6]->value;\n $secret = $paypal_credentials[7]->value;\n \n if($paymode == 'sandbox')\n $environment = 'sandbox';\n else\n $environment = '';\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, \"https://api.$environment.paypal.com/v1/oauth2/token\");\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); \n curl_setopt($ch, CURLOPT_USERPWD, $client.\":\".$secret);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"grant_type=client_credentials\");\n\n $result = curl_exec($ch);\n $json = json_decode($result);\n if(!isset($json->error))\n {\n curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);\n curl_setopt($ch, CURLOPT_URL, \"https://api.$environment.paypal.com/v1/payments/payouts?sync_mode=true\");\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data); \n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\"Content-Type: application/json\",\"Authorization: Bearer \".$json->access_token,\"\"));\n\n $result = curl_exec($ch);\n\n if(empty($result))\n {\n $json =\"error\";\n }\n else\n {\n $json = json_decode($result);\n }\n curl_close($ch);\n \n }\n else\n {\n $json =\"error\";\n \n }\n\n $payout_response = $json;\n $data = array();\n\n if($payout_response != \"error\") {\n if($payout_response->batch_header->batch_status==\"SUCCESS\") {\n if($payout_response->items[0]->transaction_status == 'SUCCESS') {\n $correlation_id = $payout_response->items[0]->transaction_id;\n $data['success'] = true;\n $data['transaction_id'] = $correlation_id;\n } \n else {\n $data['success'] = false;\n $data['message'] = $payout_response->items[0]->errors->name;\n }\n \n }\n else {\n $data['success'] = false;\n $data['message'] = $payout_response->name;\n }\n }\n else {\n $data['success'] = false;\n $data['message'] = 'Unknown error';\n }\n\n return $data;\n }", "function connect($con_type, $post_data){\n $con_array = array(\n '1' => 'https://ipaytest.arca.am:8445/payment/rest/register.do',\n '2' => 'https://ipaytest.arca.am:8445/payment/rest/getOrderStatusExtended.do',\n '3' => 'https://ipaytest.arca.am:8445/payment/rest/reverse.do'\n );\n\n $curl = curl_init($con_array[$con_type]);\n\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER , true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);\n curl_setopt($curl, CURLOPT_HEADER, false);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);\n\n $x = curl_exec($curl);\n\n curl_close($curl);\n $result = json_decode($x);\n return $result;\n}", "public function preparePayment() {\n\n $order = $this->getOrder();\n $payment = $this->getPaymentModule();\n\n $amount = $order->getTotalAmount();\n $amount = (int) round($amount * 100);\n $orderId = $order->get(\"id\");\n\n $payment->setId($orderId);\n $payment->setCurrency($this->modules->get(\"PadCart\")->currency);\n\n $url = $this->page->httpUrl;\n $payment->setProcessUrl($url . \"process/\" . $orderId . \"/\");\n $payment->setFailureUrl($url . \"fail/\");\n $payment->setCancelUrl($url . \"cancel/\");\n\n $customer = Array();\n $customer['givenName'] = $order->pad_firstname;\n $customer['familyName'] = $order->pad_lastname;\n $customer['streetAddress'] = $order->pad_address;\n $customer['streetAddress2'] = $order->pad_address2;\n $customer['locality'] = $order->pad_city;\n $customer['postalCode'] = $order->pad_postcode;\n $customer['country'] = $order->pad_countrycode;\n $customer['email'] = $order->email;\n $payment->setCustomerData($customer);\n\n foreach ($order->pad_products as $p) {\n $amount = $p->pad_price * 100; // Amount in payment modules always in cents\n if ($this->cart->prices_without_tax) $amount = $amount + ($p->pad_tax_amount * 100 / $p->pad_quantity); // TODO: currently we have only\n $payment->addProduct($p->title, $amount, $p->pad_quantity, $p->pad_percentage, $p->pad_product_id);\n }\n }", "public function return_url(Request $request){\n\t\t // Get the payment ID before session clear\n //echo 'pppp'.$payment_id = Session::get('paypal_payment_id');\n\t\t//echo '<br><pre>'; print_r($request['PayerID']); echo '</pre>'; die;\n // clear the session payment ID\n //Session::forget('paypal_payment_id');\n\n\t\tif (empty($request['PayerID']) || empty($request['token'])) {\n\t\t\treturn redirect('service/payment/status')->with('error', 'Payment failed');\n }\n\t\t$payment_id = $request['paymentId'];\n\t\t$payment = Payment::get($payment_id, $this->_api_context);\n\t\t// PaymentExecution object includes information necessary\n // to execute a PayPal account payment.\n // The payer_id is added to the request query parameters\n // when the user is redirected from paypal back to your site\n\t\t$execution = new PaymentExecution();\n $execution->setPayerId($request['PayerID']);\n //Execute the payment\n $result = $payment->execute($execution, $this->_api_context);\n //echo '<pre>';print_r($result);echo '</pre>';exit; // DEBUG RESULT, remove it later\n if ($result->getState() == 'approved') { // payment made\n //update database\n\t\t\t$user=Auth::user();\n\t\t\t$user_id=$user->id;\n\t\t\t$service_id=$request['service_id'];\n\t\t\t$service=Service::find($service_id,['name','price']);\n\t\t\t$user_order_data=[\n\t\t\t\t\t\t\t'user_id'=>$user_id,\n\t\t\t\t\t\t\t'item_id'=>$service_id,\n\t\t\t\t\t\t\t'item_name'=>$service->name,\n\t\t\t\t\t\t\t'item_type'=>'service',\n\t\t\t\t\t\t\t'item_amount'=> $service->price,\n\t\t\t\t\t\t\t'approved'=>1\n\t\t\t\t\t\t\t];\n\t\t\t$order_obj=Order::create($user_order_data);\n\t\t\t$order_id=$order_obj->id;\n\t\t\t$transaction_data=[\n\t\t\t\t\t\t\t 'order_id'=>$order_id,\n\t\t\t\t\t\t\t 'transaction_id'=>$result->getId(),\n\t\t\t\t\t\t\t 'amount'=>$service->price,\n\t\t\t\t\t\t\t 'transaction_type'=>'credit',\n\t\t\t\t\t\t\t 'payment_gateway_id' => 1,\n\t\t\t\t\t\t\t 'payment_method_id' => 2,\n\t\t\t\t\t\t\t 'order_status'=>1\n\t\t\t\t\t\t\t ];\n\t\t\tOrderTransaction::create($transaction_data);\n\t\t\t// forget the session of the service used to get service info for payment\n\t\t\tSession::forget('payment_service_id');\n\t\t\treturn redirect('service/payment/status')->with('success', 'Payment has been completed successfully!');\n }\n\n\t}", "function index() {\n if (empty($_GET['action']))\n $_GET['action'] = 'process';\n// echo \"<pre>\";\n// var_dump($_REQUEST);\n// echo \"<pre>\";\n switch ($_GET['action']) {\n case 'process': // Process and order...\n // There should be no output at this point. To process the POST data,\n // the submit_paypal_post() function will output all the HTML tags which\n // contains a FORM which is submited instantaneously using the BODY onload\n // attribute. In other words, don't echo or printf anything when you're\n // going to be calling the submit_paypal_post() function.\n // This is where you would have your form validation and all that jazz.\n // You would take your POST vars and load them into the class like below,\n // only using the POST values instead of constant string expressions.\n // For example, after ensureing all the POST variables from your custom\n // order form are valid, you might have:\n //\n // $this->paypal->add_field('first_name', $_POST['first_name']);\n // $this->paypal->add_field('last_name', $_POST['last_name']);\n// echo \"<pre>\";\n// var_dump($_SESSION);\n// echo \"<pre>\";\n if (!$this->session->userdata('is_logged_in')) {\n $type = $this->session->userdata('type');\n redirect('http://www.streamact.com/', 'refresh');\n }\n try {\n $description = $_POST['description'];\n $payment = $_POST['payment'];\n $type_payment = $_POST['type_payment'];\n $rand = rand(1000, 9999);\n $id = date(\"Ymd\") . date(\"His\") . rand(1000, 9999) . $rand;\n// echo \"<pre>\";\n// var_dump($_POST);\n// echo \"<pre>\";\n //$key = \"track_\".md5(date(\"Y-m-d:\").rand());\n\n $this->paypal->add_field('business', '[email protected]');\n// $this->paypal->add_field('return', 'http://www.streamact.com/panel/user_purchase');\n $this->paypal->add_field('return', 'http://www.streamact.com/panel/paypal/success');\n $this->paypal->add_field('cancel_return', 'http://www.streamact.com/panel/store');\n $this->paypal->add_field('notify_url', 'http://www.streamact.com/panel/paypal/ipn');\n $this->paypal->add_field('item_name', $description);\n $this->paypal->add_field('amount', $payment);\n $this->paypal->add_field('key', $key);\n $this->paypal->add_field('item_number', $id);\n\n\n $paypal_transaction = new stream\\stream_paypal_transactions();\n $paypal_transaction->type_payment = $type_payment;\n $paypal_transaction->amount = $payment;\n $paypal_transaction->id_producto = $_POST['id'];\n $paypal_transaction->notes = isset($_POST['notes']) ? $_POST['notes'] : 0;\n $paypal_transaction->id_seguimiento = $id;\n $paypal_transaction->id_usuario = $_SESSION['user_id'];\n $paypal_transaction->type_user = ($_SESSION['type'] == \"User\") ? \"2\" : $_SESSION['type'] == \"Artist\" ? \"1\" : \"0\";\n $paypal_transaction->type_payment = $_POST['type_payment'];\n $paypal_transaction->fecha_hora = date(\"Y-m-d H:i:s\");\n \n\n $this->stream->persist($paypal_transaction);\n $this->stream->flush();\n // submit the fields to paypal\n $this->paypal->submit_paypal_post();\n } catch (Exception $exc) {\n echo \"<pre>\";\n echo $exc->getTraceAsString();\n echo \"<pre>\";\n }\n\n// $paypal_transaction->ipn_track_id=$myPost[''];\n // $this->paypal->dump_fields(); // for debugging, output a table of all the fields\n break;\n }\n }", "function PPHttpPost($methodName_, $nvpStr_, $PayPalApiUsername, $PayPalApiPassword, $PayPalApiSignature, $PayPalMode) {\n $API_UserName = urlencode($PayPalApiUsername);\n $API_Password = urlencode($PayPalApiPassword);\n $API_Signature = urlencode($PayPalApiSignature);\n\n $paypalmode = ($PayPalMode == 'sandbox') ? '.sandbox' : '';\n\n $API_Endpoint = \"https://api-3t\" . $paypalmode . \".paypal.com/nvp\";\n $version = urlencode('109.0');\n\n // Set the curl parameters.\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n // Turn off the server and peer verification (TrustManager Concept).\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n\n // Set the API operation, version, and API signature in the request.\n $nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\n // Set the request as a POST FIELD for curl.\n curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n // Get response from the server.\n $httpResponse = curl_exec($ch);\n\n if (!$httpResponse) {\n exit(\"$methodName_ failed: \" . curl_error($ch) . '(' . curl_errno($ch) . ')');\n }\n\n // Extract the response details.\n $httpResponseAr = explode(\"&\", $httpResponse);\n\n $httpParsedResponseAr = array();\n foreach ($httpResponseAr as $i => $value) {\n $tmpAr = explode(\"=\", $value);\n if (sizeof($tmpAr) > 1) {\n $httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n }\n }\n\n if ((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n exit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n }\n\n return $httpParsedResponseAr;\n }", "function paypal_ipn()\n {\n if ($this->paypal->validate_ipn() == true) {\n\n $payment_id = $_POST['custom'];\n $payment = $this->db->get_where('package_payment',array('package_payment_id' => $payment_id))->row();\n $data['payment_details'] = json_encode($_POST);\n $data['purchase_datetime'] = time();\n $data['payment_code'] = date('Ym', $data['purchase_datetime']) . $payment_id;\n $data['payment_timestamp'] = time();\n $data['payment_type'] = 'Paypal';\n $data['payment_status'] = 'paid';\n $data['expire'] = 'no';\n $this->db->where('package_payment_id', $payment_id);\n $this->db->update('package_payment', $data);\n\n $prev_express_interest = $this->db->get_where('member', array('member_id' => $payment->member_id))->row()->express_interest;\n $prev_direct_messages = $this->db->get_where('member', array('member_id' => $payment->member_id))->row()->direct_messages;\n $prev_photo_gallery = $this->db->get_where('member', array('member_id' => $payment->member_id))->row()->photo_gallery;\n\n $data1['membership'] = 2;\n $data1['express_interest'] = $prev_express_interest + $this->db->get_where('plan', array('plan_id' => $payment->plan_id))->row()->express_interest;\n $data1['direct_messages'] = $prev_direct_messages + $this->db->get_where('plan', array('plan_id' => $payment->plan_id))->row()->direct_messages;\n $data1['photo_gallery'] = $prev_photo_gallery + $this->db->get_where('plan', array('plan_id' => $payment->plan_id))->row()->photo_gallery;\n\n $package_info[] = array('current_package' => $this->Crud_model->get_type_name_by_id('plan', $payment->plan_id),\n 'package_price' => $this->Crud_model->get_type_name_by_id('plan', $payment->plan_id, 'amount'),\n 'payment_type' => $data['payment_type'],\n );\n $data1['package_info'] = json_encode($package_info);\n\n $this->db->where('member_id', $payment->member_id);\n $this->db->update('member', $data1);\n recache();\n\n if ($this->Email_model->subscruption_email('member', $payment->member_id, $payment->plan_id)) {\n //echo 'email_sent';\n } else {\n //echo 'email_not_sent';\n $this->session->set_flashdata('alert', 'not_sent');\n }\n }\n }", "public function __construct()\n {\n parent::__construct();\n\n /** verifico se produção ou sandbox * */\n switch (Config::PS_AMBIENTE) {\n\n // ambiente de testes\n case 'sandbox':\n $this->psWS = 'https://ws.sandbox.pagseguro.uol.com.br/v2/checkout';\n $this->psWSTransparente = 'https://ws.sandbox.pagseguro.uol.com.br/v2/sessions';\n $this->psURL = 'https://sandbox.pagseguro.uol.com.br/v2/checkout/payment.html';\n $this->psURL_Script = 'https://stc.sandbox.pagseguro.uol.com.br/pagseguro/api/v2/checkout/pagseguro.lightbox.js';\n $this->ScriptTransparente = 'https://stc.sandbox.pagseguro.uol.com.br/pagseguro/api/v2/checkout/pagseguro.directpayment.js';\n $this->psURL_Notificacao = 'https://ws.sandbox.pagseguro.uol.com.br/v2/transactions/';\n $this->token = Config::PS_TOKEN_SB;\n break;\n // ambiente de produção real\n case 'production':\n $this->psWS = 'https://ws.pagseguro.uol.com.br/v2/checkout';\n $this->psWSTransparente = 'https://ws.pagseguro.uol.com.br/v2/sessions';\n $this->psURL = 'https://pagseguro.uol.com.br/v2/checkout/payment.html';\n $this->psURL_Script = 'https://stc.pagseguro.uol.com.br/pagseguro/api/v2/checkout/pagseguro.lightbox.js';\n $this->ScriptTransparente = 'https://stc.pagseguro.uol.com.br/pagseguro/api/v2/checkout/pagseguro.directpayment.js';\n $this->psURL_Notificacao = 'https://ws.pagseguro.uol.com.br/v2/transactions/';\n $this->token = Config::PS_TOKEN;\n break;\n }\n\n }", "function PPHttpPost($methodName_, $nvpStr_) \n\t{\n\t\tglobal $environment;\n\t\t$API_UserName = urlencode('fhefoto_api1.yahoo.no');\n\t\t$API_Password = urlencode('N6SEDXLJKPN6PPWY');\n\t\t$API_Signature = urlencode('AlVtORxlymlrQpGY-fnzOdIuxvT1A2nTmy.LlXvPkOP5oU0VdZitgeEV');\n\t\n\t\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\n\t\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment) {\n\t\t\t$API_Endpoint = \"https://api-3t.$environment.paypal.com/nvp\";\n\t\t}\n\t\t$version = urlencode('51.0');\n\n\t\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\t\t$httpResponse = curl_exec($ch);\n\n\t\tif(!$httpResponse) {\n\t\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t\t}\n\n\t\t$httpResponseAr = explode(\"&\", $httpResponse);\n\n\t\t$httpParsedResponseAr = array();\n\t\tforeach ($httpResponseAr as $i => $value) {\n\t\t\t$tmpAr = explode(\"=\", $value);\n\t\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t\t}\n\t\t}\n\n\t\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t\t}\n\n\t\treturn $httpParsedResponseAr;\n\t}", "public function paypalAction() {\n\n $request = $this->getRequest();\n $orderId = (integer) $request->getParam('orderId', 0);\n\n $order = null;\n //try to find according to customerId\n if ($orderId > 0) {\n try {\n $order = new Yourdelivery_Model_Order($orderId);\n $transaction = new Yourdelivery_Model_DbTable_Paypal_Transactions();\n $this->view->paypal = $transaction->getByOrder($order->getId());\n $this->view->payerId = $transaction->getPayerId($order->getId());\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n \n }\n }\n \n $this->view->order = $order;\n }", "public function finish_paypal_connect() {\n\t\tif (\n\t\t\t! Loader::is_admin_page() ||\n\t\t\t! isset( $_GET['paypal-connect-finish'] ) // phpcs:ignore CSRF ok.\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! function_exists( 'wc_gateway_ppec' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// @todo This is a bit hacky but works. Ideally, woocommerce-gateway-paypal-express-checkout would contain a filter for us.\n\t\tadd_filter( 'wp_redirect', array( $this, 'overwrite_paypal_redirect' ), 10, 2 );\n\t\twc_gateway_ppec()->ips->maybe_received_credentials();\n\t\tremove_filter( 'wp_redirect', array( $this, 'overwrite_paypal_redirect' ) );\n\t}", "function ipn()\r\n {\r\n $paypalInfo = $this->input->post(); \r\n\t\t $order_id= $paypalinfo['custom'];\r\n\t\t $payment_status=$paypalinfo['payment_status'];\r\n $paypalURL = $this->paypal_lib->paypal_url; \r\n $result = $this->paypal_lib->curlPost($paypalURL,$paypalInfo); \r\n //check whether the payment is verified\r\n if(preg_match(\"/VERIFIED/\",$result)){\r\n //insert the transaction data into the database\r\n $this->Order_model->insertTransaction($paypalInfo); \r\n }\r\n }", "function __construct($properties = null) {\n\t\t$this->info = parent::getGateway();\n\n\t\t/**\n\t\t# API user: The user that is identified as making the call. you can\n\t\t# also use your own API username that you created on PayPal�s sandbox\n\t\t# or the PayPal live site\n\t\t*/\n\t\t$this->API_UserName=$this->info['merchant']['api_username'];\n\n\n\t\t/**\n\t\t# API_password: The password associated with the API user\n\t\t# If you are using your own API username, enter the API password that\n\t\t# was generated by PayPal below\n\t\t# IMPORTANT - HAVING YOUR API PASSWORD INCLUDED IN THE MANNER IS NOT\n\t\t# SECURE, AND ITS ONLY BEING SHOWN THIS WAY FOR TESTING PURPOSES\n\t\t*/\n\t\t$this->API_Password=$this->info['merchant']['api_password'];\n\n\t\t/**\n\t\t# API_Signature:The Signature associated with the API user. which is generated by paypal.\n\t\t*/\n\t\t$this->API_Signature=$this->info['merchant']['api_signature'];\n\n\t\t/**\n\t\t# Version: this is the API version in the request.\n\t\t# It is a mandatory parameter for each API request.\n\t\t# The only supported value at this time is 2.3\n\t\t*/\n\t\t$this->version=2.3;\n\n\t\t$this->subject = '';\n\n\t\t// below three are needed if used permissioning\n\t\t$this->AUTH_token='';\n\n\t\t$this->AUTH_signature='';\n\n\t\t$this->AUTH_timestamp='';\n\n\t\t$this->USE_PROXY = FALSE;\n\n\t\t/**\n\t\t# PROXY_HOST and PROXY_PORT will be read only if USE_PROXY is set to TRUE\n\n\t\t$this->PROXY_HOST = 127.0.0.1;\n\t\t$this->PROXY_PORT = 808;\n\t\t*/\n\n\t\t/* Define the PayPal URL. This is the URL that the buyer is\n\t\t first sent to to authorize payment with their paypal account\n\t\t change the URL depending if you are testing on the sandbox\n\t\t or going to the live PayPal site\n\t\t For the sandbox, the URL is\n\t\t https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=\n\t\t For the live site, the URL is\n\t\t https://www.paypal.com/webscr&cmd=_express-checkout&token=\n\t\t */\n\t\tif ($this->info['merchant']['type'] == 0) {\n\t\t\t$this->PAYPAL_URL = 'https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=';\n\n\t\t\t/**\n\t\t\t# Endpoint: this is the server URL which you have to connect for submitting your API request.\n\t\t\t*/\n\t\t\t$this->API_Endpoint ='https://api-3t.sandbox.paypal.com/nvp';\n\t\t} else {\n\t\t\t$this->PAYPAL_URL = 'https://www.paypal.com/webscr&cmd=_express-checkout&token=';\n\n\t\t\t/**\n\t\t\t# Endpoint: this is the server URL which you have to connect for submitting your API request.\n\t\t\t*/\n\t\t\t$this->API_Endpoint ='https://api-3t.paypal.com/nvp';\n\t\t}\n\n\t\t// Ack related constants\n\t\t$this->ACK_SUCCESS = 'SUCCESS';\n\t\t$this->ACK_SUCCESS_WITH_WARNING = 'SUCCESSWITHWARNING';\n\n\t\tparent::__construct($properties);\n\t}", "private function client(){\n\t\t$activatedPaypal = DAO::getById(\\models\\ActivatedPaypal::class, 1);\n\n\t\t$sandboxmode = $activatedPaypal->getActivePaypal()->getSandboxmode();\n\t\t$clientId = $activatedPaypal->getActivePaypal()->getClientid();\n\t\t$clientSecret = $activatedPaypal->getActivePaypal()->getClientsecret();\n\n\t\tif($sandboxmode){\n\t\t\t$environment = new SandboxEnvironment($clientId, $clientSecret);\n\t\t}else{\n\t\t\t$environment = new ProductionEnvironment($clientId, $clientSecret);\n\t\t}\n\t\t$client = new PayPalHttpClient($environment);\n\t\treturn $client;\n\t}", "public function paypalButon(){\n\t\t$course_id \t\t\t= request('course_id');\n\t\t$course \t\t\t= Course::find($course_id);\n\t\t$paypal_id \t\t\t= config('services.paypal.id');\n\t\t$amount \t\t\t= $course->value;\n\t\t$cop \t\t\t\t= $course->cop;\n\t\t$descuento \t\t\t= 0;\n\t\t$desc_cop \t\t\t= 0;\n\t\t$route \t\t\t\t= request()->root();\n\t\t$url_acepted \t\t= $route.'/courses/epay_acepted';\n\t\t$url_rejected \t\t= $route.'/courses/epay_rejected';\n\t\t$url_pending \t\t= $route.'/courses/epay_pending';\n\t\t$epay_key \t\t\t= env('EPAY_PUBLIC_KEY');\n\t\t$epay_test \t\t\t= env('EPAY_TEST');\n\t\t$type \t\t\t\t= request('type');\t\t\n\n\t\tsession(['course_id' => $course_id]);\n\t\tsession(['cop' => $cop]);\n\n\t\tif(request('coupon')!= \"\"){\n\t\t\t$coupon = request('coupon');\n\t\t\t\n\t\t //valido el coupon que sea correcto y que tenga existencia\n\t\t\tif($this->checkCoupon($coupon)){\n\t\t\t\tsession(['coupon' => $coupon]); // almaceno el coupon en una session para una vez que se confirme la subscripcion rebajarlo del total\n\t\t\t\t//ahora aplico el descuento para este coupon\n\t\t\t\t$price = $course->value; \n\t\t\t\t$percent = Coupon::where('code',$coupon)->first()->percent;\n\t\t\t\t$new_price = $price - ($price * $percent);\t\t\n\t\t\t\t$amount \t= $new_price;\n\t\t\t\t$descuento = $price * $percent;\n\t\t\t\t//hago lo mismo pero para la moneda colombiana\n\t\t\t\t$cop \t\t= $cop - ($cop * $percent); \n\t\t\t\t$desc_cop \t= $course->cop * $percent; \n\t\t\t\tsession(['cop' => $cop]);\t\t\n\t\t\t\treturn view('courses.paypal', compact('amount','paypal_id','course',\n\t\t\t\t'descuento','cop','desc_cop','url_acepted','url_rejected','url_pending','epay_key','epay_test','type'));\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn back()->with('message', ['danger', __(\"Cupon No Valido\")]);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn view('courses.paypal', compact('amount','paypal_id','course',\n\t\t\t'descuento','cop','desc_cop','url_acepted','url_rejected','url_pending','epay_key','epay_test','type'));\n\t\t}\n\t}", "function create_paypal_payment($total, $currency, $desc, $my_items, $redirect_url, $cancel_url){\r\n\t$redirectUrls = new PayPal\\Api\\RedirectUrls();\r\n\t$redirectUrls->setReturnUrl($redirect_url);\r\n\t$redirectUrls->setCancelUrl($cancel_url);\r\n\t\r\n\t$payer = new PayPal\\Api\\Payer();\r\n\t$payer->setPaymentMethod(\"paypal\");\r\n\t\r\n\t$amount = new PayPal\\Api\\Amount();\r\n\t$amount->setCurrency($currency);\r\n\t$amount->setTotal($total);\r\n\t\t\t\t\t\t\t\t\t\r\n\t$items = new PayPal\\Api\\ItemList();\r\n\t$items->setItems($my_items);\r\n\t\t\r\n\t$transaction = new PayPal\\Api\\Transaction();\r\n\t$transaction->setAmount($amount);\r\n\t$transaction->setDescription($desc);\r\n\t$transaction->setItemList($items);\r\n\r\n\t$payment = new PayPal\\Api\\Payment();\r\n\t$payment->setRedirectUrls($redirectUrls);\r\n\t$payment->setIntent(\"sale\");\r\n\t$payment->setPayer($payer);\r\n\t$payment->setTransactions(array($transaction));\r\n\t\r\n\t$payment->create(apiContext());\r\n\t\r\n\treturn $payment;\r\n}", "function process_cc() {\n\t\t$paymentType =urlencode( $_POST['paymentType']);\n\t\t$firstName =urlencode($this->info['post']['firstName']);\n\t\t$lastName =urlencode($this->info['post']['lastName']);\n\t\t$creditCardType =urlencode($this->info['post']['creditCardType']);\n\t\t$creditCardNumber = urlencode($this->info['post']['creditCardNumber']);\n\t\t$expDateMonth =urlencode($this->info['post']['expDateMonth']);\n\n\t\t// Month must be padded with leading zero\n\t\t$padDateMonth = str_pad($expDateMonth, 2, '0', STR_PAD_LEFT);\n\n\t\t$expDateYear =urlencode($this->info['post']['expDateYear']);\n\t\t$cvv2Number = urlencode($this->info['post']['cvv2Number']);\n\t\t$address1 = urlencode($this->info['post']['address1']);\n\t\t$address2 = urlencode($this->info['post']['address2']);\n\t\t$city = urlencode($this->info['post']['city']);\n\t\t$state =urlencode($this->info['post']['state']);\n\t\t$zip = urlencode($this->info['post']['zip']);\n\t\t$amount = urlencode($this->info['post']['amount']);\n\t\t// $currencyCode=urlencode($_POST['currency']);\n\t\t$currencyCode=\"USD\";\n\t\t// Hardcoding sale. Other possible variables are Authorization and Sale.\n\t\t// $paymentType=urlencode($_POST['paymentType']);\n\t\t$paymentType=\"sale\";\n\n\t\t/* Construct the request string that will be sent to PayPal.\n\t\t The variable $nvpstr contains all the variables and is a\n\t\t name value pair string with & as a delimiter */\n\t\t$nvpstr=\"&PAYMENTACTION=$paymentType&AMT=$amount&CREDITCARDTYPE=$creditCardType&ACCT=$creditCardNumber&EXPDATE=\". $padDateMonth.$expDateYear.\"&CVV2=$cvv2Number&FIRSTNAME=$firstName&LASTNAME=$lastName&STREET=$address1&CITY=$city&STATE=$state\".\n\t\t\"&ZIP=$zip&COUNTRYCODE=US&CURRENCYCODE=$currencyCode\";\n\n\n\n\t\t/* Make the API call to PayPal, using API signature.\n\t\t The API response is stored in an associative array called $resArray */\n\t\t$resArray=$this->hash_call(\"doDirectPayment\",$nvpstr);\n\n\t\t/* Display the API response back to the browser.\n\t\t If the response from PayPal was a success, display the response parameters'\n\t\t If the response was an error, display the errors received using APIError.php.\n\t\t */\n\t\t$ack = strtoupper($resArray[\"ACK\"]);\n\n\t\tif($ack!=\"SUCCESS\") {\n\t\t\t$_SESSION['reshash']=$resArray;\n\t\t\t$this->APIerror();\n\t\t\t//$location = \"APIError.php\";\n\t\t\t\t //header(\"Location: $location\");\n\t\t\t\t return false;\n\t\t }\n\n\t\treturn true;\n\t}", "public function makePayment($amountTobePaid)\n {\n\n $this->transactionId = uniqid();\n $encodedAuth = base64_encode($this->apiUser . \":\" . $this->apiPassword);\n $postRequest = array(\n \"total_amount\" => $amountTobePaid,\n \"return_url\" => $this->returnUrl,\n \"notify_url\" => $this->notifyUrl,\n \"transaction_id\" => $this->transactionId,\n \"description\"=> \"PayUnit web payments\"\n );\n $cURLConnection = curl_init();\n if($this->mode === \"test\"){\n curl_setopt($cURLConnection, CURLOPT_URL, \"https://app-payunit.sevengps.net/sandbox/gateway/initialize\");\n }else{\n curl_setopt($cURLConnection, CURLOPT_URL, \"https://app-payunit.sevengps.net/api/gateway/initialize\");\n }\n curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, json_encode($postRequest)); \n $secArr = array(\n \"x-api-key: {$this->apiKey}\",\n \"authorization: Basic: {$encodedAuth}\",\n 'Accept: application/json',\n 'Content-Type: application/json',\n \"mode: {$this->mode}\"\n );\n $all = array_merge($postRequest,$secArr);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER,$all);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = curl_exec($cURLConnection);\n curl_close($cURLConnection);\n $jsonArrayResponse = json_decode($apiResponse);\n echo(isset($jsonArrayResponse));\n if(isset($jsonArrayResponse->body->transaction_url)){\n echo(\"dfdgdg\");\n //die();\n header(\"Location: {$jsonArrayResponse->body->transaction_url}\");\n exit(); \n }\n else{\n echo($apiResponse);\n }\n }", "static function init()\n\t\t{\n\t\t\t//make sure PayPal Express is a gateway option\n\t\t\tadd_filter('pmpro_gateways', array('PMProGateway_paypalexpress', 'pmpro_gateways'));\n\n\t\t\t//add fields to payment settings\n\t\t\tadd_filter('pmpro_payment_options', array('PMProGateway_paypalexpress', 'pmpro_payment_options'));\n\n\t\t\t/*\n\t\t\t\tFilter pmpro_next_payment to get actual value\n\t\t\t\tvia the PayPal API. This is disabled by default\n\t\t\t\tfor performance reasons, but you can enable it\n\t\t\t\tby copying this line into a custom plugin or\n\t\t\t\tyour active theme's functions.php and uncommenting\n\t\t\t\tit there.\n\t\t\t*/\n\t\t\t//add_filter('pmpro_next_payment', array('PMProGateway_paypalexpress', 'pmpro_next_payment'), 10, 3);\n\n\t\t\t/*\n\t\t\t\tThis code is the same for PayPal Website Payments Pro, PayPal Express, and PayPal Standard\n\t\t\t\tSo we only load it if we haven't already.\n\t\t\t*/\n\t\t\tglobal $pmpro_payment_option_fields_for_paypal;\n\t\t\tif(empty($pmpro_payment_option_fields_for_paypal))\n\t\t\t{\n\t\t\t\tadd_filter('pmpro_payment_option_fields', array('PMProGateway_paypalexpress', 'pmpro_payment_option_fields'), 10, 2);\n\t\t\t\t$pmpro_payment_option_fields_for_paypal = true;\n\t\t\t}\n\n\t\t\t//code to add at checkout\n\t\t\t$gateway = pmpro_getGateway();\n\t\t\tif($gateway == \"paypalexpress\")\n\t\t\t{\n\t\t\t\tadd_filter('pmpro_include_billing_address_fields', '__return_false');\n\t\t\t\tadd_filter('pmpro_include_payment_information_fields', '__return_false');\n\t\t\t\tadd_filter('pmpro_required_billing_fields', array('PMProGateway_paypalexpress', 'pmpro_required_billing_fields'));\n\t\t\t\tadd_filter('pmpro_checkout_new_user_array', array('PMProGateway_paypalexpress', 'pmpro_checkout_new_user_array'));\n\t\t\t\tadd_filter('pmpro_checkout_confirmed', array('PMProGateway_paypalexpress', 'pmpro_checkout_confirmed'));\n\t\t\t\tadd_action('pmpro_checkout_before_processing', array('PMProGateway_paypalexpress', 'pmpro_checkout_before_processing'));\n\t\t\t\tadd_filter('pmpro_checkout_default_submit_button', array('PMProGateway_paypalexpress', 'pmpro_checkout_default_submit_button'));\n\t\t\t\tadd_action('pmpro_checkout_after_form', array('PMProGateway_paypalexpress', 'pmpro_checkout_after_form'));\n\t\t\t\tadd_action('http_api_curl', array('PMProGateway_paypalexpress', 'http_api_curl'), 10, 3);\n\t\t\t}\n\t\t}", "public function store(Request $request)\n {\n \n\n toastr::success ('You have paid Successfully', 'success');\n return redirect()->route('layout');\n\n /*\n $apiContext = new \\PayPal\\Rest\\ApiContext(\n new \\PayPal\\Auth\\OAuthTokenCredential(\n 'AeqdFHXOg-V0nHCfbjIjGNBcvZRIdiYfsUVcg-KlXZCU7YrAXn7kJ95fsRyv3nREmSpZFOfU6uvpY-a6',// ClientID\n 'EGQp7HnroeqRafSbrhZTJ3z7J6MU-Cqx7iUColYQqIa4kaXAfBWpja6Y14K-RNtQ0CCoOhgTiPXc9nuJ'//ClientSecret\n )\n );\n $payer = new Payer();\n $payer->setPaymentMethod(\"paypal\");\n $item1 = new Item();\n $item1->setName('Ground Coffee 40 oz')\n ->setCurrency('USD')\n ->setQuantity(1)\n ->setPrice($request->get('amount'));\n $itemList = new ItemList();\n $itemList->setItems(array($item1));\n $amount = new Amount();\n $amount->setCurrency(\"USD\")\n ->setTotal($request->get('amount'));\n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setItemList($itemList)\n ->setDescription(\"Payment description\")\n ->setInvoiceNumber(uniqid());\n $redirectUrls = new RedirectUrls();\n $redirectUrls->setReturnUrl(\"http://localhost:8000/executePayment\")\n ->setCancelUrl(\"http://localhost:8000/cancel\");\n $payment = new Payment();\n $payment->setIntent(\"sale\")\n ->setPayer($payer)\n ->setRedirectUrls($redirectUrls)\n ->setTransactions(array($transaction));\n $payment->create($apiContext);\n return redirect($payment->getApprovalLink());\n*/\n\n\n }", "public function action_payments() {\n $package = Model::factory('package');\n $postvalue = $errors = array();\n $postvalue = $this->request->post();\n $payment_gateway_id= isset($postvalue['payment_gateway_type'])?$postvalue['payment_gateway_type']:0;\n \n $payment_settings = $package->get_payment_details($payment_gateway_id);\n $paypal_payment_settings=$package->get_paypal_payment_details();\n //echo \"<pre>\"; print_r($payment_settings); exit;\n $this->template->meta_description = CLOUD_SITENAME . \" | Payments \";\n $this->template->meta_keywords = CLOUD_SITENAME . \" | Payments \";\n $this->template->title = CLOUD_SITENAME . \" | \" . __('Payments');\n $this->template->page_title = __('Payments');\n \n if (class_exists('Paymentgateway')) { \n $payment_gateway_list = Paymentgateway::payment_auth_credentials_view();\n \n } else {\n trigger_error(\"Unable to load class: Paymentgateway\", E_USER_WARNING);\n }\n \n $form_top_fields= isset($payment_gateway_list[1])?$payment_gateway_list[1]:[];\n $form_fields= isset($payment_gateway_list[2])?$payment_gateway_list[2]:[];\n $form_live_fields= isset($payment_gateway_list[3])?$payment_gateway_list[3]:[];\n $form_bottom_fields= isset($payment_gateway_list[4])?$payment_gateway_list[4]:[];\n\n $this->template->content = View::factory(\"admin/package_plan/payments\")\n ->bind('payment_settings', $payment_settings)\n ->bind('paypal_payment_settings',$paypal_payment_settings)\n ->bind('form_top_fields', $form_top_fields)\n ->bind('form_fields', $form_fields)\n ->bind('form_live_fields', $form_live_fields)\n ->bind('form_bottom_fields', $form_bottom_fields)\n ->bind('payment_gateway_list',$payment_gateway_list[0])\n ->bind('postvalue', $postvalue)\n ->bind('errors', $errors);\n }", "public static function create_paypal_button() {\r\n\t\trequire_once(\"class-tpg-pp-donate-button.php\");\r\n\t\t$obj = new tpg_pp_donate_button();\r\n\t\treturn $obj;\r\n\t}", "function take_payment_details()\r\n\t\t{\r\n\t\t\tglobal $ecom_siteid,$db,$ecom_hostname,$Settings_arr,$ecom_themeid,$default_layout,\r\n\t\t\t\t\t$Captions_arr,$inlineSiteComponents,$sitesel_curr,$default_Currency_arr,$ecom_testing,\r\n\t\t\t\t\t$ecom_themename,$components,$ecom_common_settings,$vImage,$alert,$protectedUrl;\r\n\t\t\t$customer_id \t\t\t\t\t\t= get_session_var(\"ecom_login_customer\"); // get the id of current customer from session\r\n\t\t\t\r\n if($_REQUEST['pret']==1) // case if coming back from PAYPAL with token.\r\n {\r\n if($_REQUEST['token'])\r\n {\r\n $address = GetShippingDetails($_REQUEST['token']);\r\n $ack = strtoupper($address[\"ACK\"]);\r\n if($ack == \"SUCCESS\" ) // case if address details obtained correctly\r\n {\r\n $_REQUEST['payer_id'] = $address['PAYERID'];\r\n $_REQUEST['rt'] = 5;\r\n }\r\n else // case if address not obtained from paypay .. so show the error msg in cart\r\n {\r\n $msg = 4;\r\n echo \"<form method='post' action='http://$ecom_hostname/mypayonaccountpayment.html' id='cart_invalid_form' name='cart_invalid_form'><input type='hidden' name='rt' value='\".$msg.\"' size='1'/><div style='position:absolute; left:0;top:0;padding:5px;background-color:#CC0000;color:#FFFFFF;font-size:12px;font-weight:bold'>Loading...</div></form><script type='text/javascript'>document.cart_invalid_form.submit();</script>\";\r\n exit;\r\n }\r\n } \r\n }\r\n // Get the zip code for current customer\r\n\t\t\t$sql_cust = \"SELECT customer_postcode \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tcustomers \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tcustomer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_cust = $db->query($sql_cust);\r\n\t\t\tif ($db->num_rows($ret_cust))\r\n\t\t\t{\r\n\t\t\t\t$row_cust \t\t\t\t\t= $db->fetch_array($ret_cust);\r\n\t\t\t\t$cust_zipcode\t\t\t\t= stripslashes($row_cust['customer_postcode']);\r\n\t\t\t}\t\r\n\t\t\t$Captions_arr['PAYONACC'] \t= getCaptions('PAYONACC'); // Getting the captions to be used in this page\r\n\t\t\t$sess_id\t\t\t\t\t\t\t\t= session_id();\r\n\t\t\t\r\n\t\t\tif($protectedUrl)\r\n\t\t\t\t$http = url_protected('index.php?req=payonaccountdetails&action_purpose=payment',1);\r\n\t\t\telse \t\r\n\t\t\t\t$http = url_link('payonaccountpayment.html',1);\t\r\n\t\t\t\r\n\t\t\t// Get the details from payonaccount_cartvalues for current site in current session \r\n\t\t\t$pay_cart = payonaccount_CartDetails($sess_id);\t\t\t\t\t\t\t\r\n\t\t\tif($_REQUEST['rt']==1) // This is to handle the case of returning to this page by clicking the back button in browser\r\n\t\t\t\t$alert = 'PAYON_ERROR_OCCURED';\t\t\t\r\n\t\t\telseif($_REQUEST['rt']==2) // case of image verification failed\r\n\t\t\t\t$alert = 'PAYON_IMAGE_VERIFICATION_FAILED';\r\n elseif($_REQUEST['rt']==3) // case of image verification failed\r\n $alert = 'PAYON_IMAGE_VERIFICATION_FAILED';\r\n\t\t\telseif($_REQUEST['rt']==4) // case if paypal address verification failed\r\n $alert = 'PAYON_PAYPAL_EXP_NO_ADDRESS_RET';\r\n elseif($_REQUEST['rt']==5) // case if paypal address verification successfull need to click pay to make the payment \r\n $alert = 'PAYON_PAYPAL_EXP_ADDRESS_DON';\r\n\t\t\t$sql_comp \t\t\t= \"SELECT customer_title,customer_fname,customer_mname,customer_surname,customer_email_7503,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_status,customer_payonaccount_maxlimit,customer_payonaccount_usedlimit,\r\n\t\t\t\t\t\t\t\t\t\t(customer_payonaccount_maxlimit - customer_payonaccount_usedlimit) as remaining,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_billcycle_day,customer_payonaccount_rejectreason,customer_payonaccount_laststatementdate,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_billcycle_day \r\n\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\tcustomers \r\n\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\tcustomer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_cust = $db->query($sql_comp);\r\n\t\t\tif ($db->num_rows($ret_cust)==0)\r\n\t\t\t{\t\r\n\t\t\t\techo \"Sorry!! Invalid input\";\r\n\t\t\t\texit;\r\n\t\t\t}\t\r\n\t\t\t$row_cust \t\t= $db->fetch_array($ret_cust);\r\n\t\t\t// Getting the previous outstanding details from orders_payonaccount_details \r\n\t\t\t$sql_payonaccount = \"SELECT pay_id,pay_date,pay_amount \r\n\t\t\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\t\t\torder_payonaccount_details \r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tcustomers_customer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND pay_transaction_type ='O' \r\n\t\t\t\t\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tpay_id DESC \r\n\t\t\t\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_payonaccount = $db->query($sql_payonaccount);\r\n\t\t\tif ($db->num_rows($ret_payonaccount))\r\n\t\t\t{\r\n\t\t\t\t$row_payonaccount \t= $db->fetch_array($ret_payonaccount);\r\n\t\t\t\t$prev_balance\t\t\t\t= $row_payonaccount['pay_amount'];\r\n\t\t\t\t$prev_id\t\t\t\t\t\t= $row_payonaccount['pay_id'];\r\n\t\t\t\t$prev_date\t\t\t\t\t= $row_payonaccount['pay_date'];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$prev_balance\t\t\t\t= 0;\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t$prev_id\t\t\t\t\t\t= 0;\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t$paying_amt \t\t= ($_REQUEST['pay_amt'])?$_REQUEST['pay_amt']:$pay_cart['pay_amount'];\r\n\t\t\t$additional_det\t= ($_REQUEST['pay_additional_details'])?$_REQUEST['pay_additional_details']:$pay_cart['pay_additional_details'];\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t // Check whether google checkout is required\r\n\t\t\t$sql_google = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n\t\t\t\t\t\t\t\t\t\t a.paymethod_takecarddetails,a.payment_minvalue,\r\n\t\t\t\t\t\t\t\t\t\t b.payment_method_sites_caption \r\n\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\tpayment_methods a,\r\n\t\t\t\t\t\t\t\t\t\tpayment_methods_forsites b \r\n\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\ta.paymethod_id=b.payment_methods_paymethod_id \r\n\t\t\t\t\t\t\t\t\t\tAND a.paymethod_showinpayoncredit=1 \r\n\t\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\t\tAND b.payment_method_sites_active = 1 \r\n\t\t\t\t\t\t\t\t\t\tAND paymethod_key='GOOGLE_CHECKOUT' \r\n\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_google = $db->query($sql_google);\r\n\t\t\tif($db->num_rows($ret_google))\r\n\t\t\t{\r\n\t\t\t\t$google_exists = true;\r\n\t\t\t}\r\n\t\t\telse \t\r\n\t\t\t\t$google_exists = false;\r\n\t\t\t// Check whether google checkout is set for current site\r\n\t\t\tif($ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['paymethod_key'] == \"GOOGLE_CHECKOUT\")\r\n\t\t\t{\r\n\t\t\t\t$google_prev_req \t\t= $ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['payment_method_preview_req'];\r\n\t\t\t\t$google_recommended\t\t= $ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['payment_method_google_recommended'];\r\n\t\t\t\tif($google_recommended ==0) // case if google checkout is set to work in the way google recommend\r\n\t\t\t\t\t$more_pay_condition = \" AND paymethod_key<>'GOOGLE_CHECKOUT' \";\r\n\t\t\t\telse\r\n\t\t\t\t\t$more_pay_condition = '';\r\n\t\t\t}\r\n\t\t\t$sql_paymethods = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n a.paymethod_takecarddetails,a.payment_minvalue,a.paymethod_ssl_imagelink,\r\n b.payment_method_sites_caption \r\n FROM \r\n payment_methods a,\r\n payment_methods_forsites b \r\n WHERE \r\n a.paymethod_id=b.payment_methods_paymethod_id \r\n AND a.paymethod_showinpayoncredit = 1 \r\n AND b.payment_method_sites_active = 1 \r\n $more_pay_condition \r\n AND b.sites_site_id=$ecom_siteid \r\n AND a.paymethod_key<>'PAYPAL_EXPRESS'\";\r\n\t\t\t$ret_paymethods = $db->query($sql_paymethods);\r\n\t\t\t$totpaycnt = $totpaymethodcnt = $db->num_rows($ret_paymethods);\t\t\t\r\n\t\t\tif ($totpaycnt==0)\r\n\t\t\t{\r\n\t\t\t\t$paytype_moreadd_condition = \" AND a.paytype_code <> 'credit_card'\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$paytype_moreadd_condition = '';\r\n\t\t\t$cc_exists \t\t\t= 0;\r\n\t\t\t$cc_seq_req \t\t= check_Paymethod_SSL_Req_Status('payonaccount');\r\n\t\t\t$sql_paytypes \t= \"SELECT a.paytype_code,b.paytype_forsites_id,a.paytype_id,a.paytype_name,b.images_image_id,\r\n\t\t\t\t\t\t\t\tb.paytype_caption \r\n\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\tpayment_types a, payment_types_forsites b \r\n\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\tb.sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\t\t\tAND paytype_forsites_active=1 \r\n\t\t\t\t\t\t\t\t\t\t\tAND paytype_forsites_userdisabled=0 \r\n\t\t\t\t\t\t\t\t\t\t\tAND a.paytype_id=b.paytype_id \r\n\t\t\t\t\t\t\t\t\t\t\tAND a.paytype_showinpayoncredit=1 \r\n\t\t\t\t\t\t\t\t\t\t\t$paytype_moreadd_condition \r\n\t\t\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\t\t\ta.paytype_order\";\r\n\t\t\t$ret_paytypes = $db->query($sql_paytypes);\r\n\t\t\t$paytypes_cnt = $db->num_rows($ret_paytypes);\t\r\n\t\t\tif($paytypes_cnt==1 && $totpaymethodcnt>=1)\r\n\t\t\t\t$card_req = 1;\r\n\t\t\telse\r\n\t\t\t\t$card_req = '';\t\t\t\r\n\t\t?>\r\n\t\t<script type=\"text/javascript\">\r\n\t\t/* Function to be triggered when selecting the credit card type*/\r\nfunction sel_credit_card_payonaccount(obj)\r\n{\r\n\tif (obj.value!='')\r\n\t{\r\n\t\tobjarr = obj.value.split('_');\r\n\t\tif(objarr.length==4) /* if the value splitted to exactly 4 elements*/\r\n\t\t{\r\n\t\t\tvar key \t\t\t= objarr[0];\r\n\t\t\tvar issuereq \t= objarr[1];\r\n\t\t\tvar seccount \t= objarr[2];\r\n\t\t\tvar cc_count \t= objarr[3];\r\n\t\t\tif (issuereq==1)\r\n\t\t\t{\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.className = 'inputissue_normal';\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.disabled\t= false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.className = 'inputissue_disabled';\t\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.disabled\t= true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\nfunction handle_paytypeselect_payonaccount(obj)\r\n{\r\n\tvar curpaytype = paytype_arr[obj.value];\r\n\tvar ptypecnts = <?php echo $totpaycnt?>;\r\n\tif (curpaytype=='credit_card')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = '';\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\t\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = 1;\r\n\t\tif (document.getElementById('payonaccount_paymethod'))\r\n\t\t{\r\n\t\t\tvar lens = document.getElementById('payonaccount_paymethod').length;\t\r\n\t\t\tif(lens==undefined && ptypecnts==1)\r\n\t\t\t{\r\n\t\t\t\tvar curval\t = document.getElementById('payonaccount_paymethod').value;\r\n\t\t\t\tcur_arr \t\t= curval.split('_');\r\n\t\t\t\tif ((cur_arr[0]=='SELF' || cur_arr[0]=='PROTX') && cur_arr.length<=2)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\t\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= '';\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= 'none';\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t}\t\r\n\t}\r\n\telse if(curpaytype=='cheque')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = '';\t\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\t\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse if(curpaytype=='invoice')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse if(curpaytype=='pay_on_phone')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse \r\n\t{\r\n\t\tcur_arr = obj.value.split('_');\r\n\t\tif ((cur_arr[0]=='SELF' || cur_arr[0]=='PROTX') && cur_arr.length<=2)\r\n\t\t{\r\n\t\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= '';\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= 'none';\r\n\t\t}\t\r\n\t}\r\n}\r\n</script>\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t<div class=\"treemenu\"><a href=\"<? url_link('');?>\"><?=$Captions_arr['COMMON']['TREE_MENU_HOME_LINK'];?></a> >> <?=\"Pay on Account Payment\"?></div>\r\n\t\t\r\n\t\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" class=\"emailfriendtable\">\r\n\t\t\t<form method=\"post\" action=\"<?php echo $http?>\" name='frm_payonaccount_payment' id=\"frm_payonaccount_payment\" class=\"frm_cls\" onsubmit=\"return validate_payonaccount(this)\">\r\n\t\t\t<input type=\"hidden\" name=\"paymentmethod_req\" id=\"paymentmethod_req\" value=\"<?php echo $card_req?>\" />\r\n\t\t\t<input type=\"hidden\" name=\"payonaccount_unique_key\" id=\"payonaccount_unique_key\" value=\"<?php echo uniqid('')?>\" />\r\n\t\t\t<input type=\"hidden\" name=\"save_payondetails\" id=\"save_payondetails\" value=\"\" />\r\n\t\t\t<input type=\"hidden\" name=\"nrm\" id=\"nrm\" value=\"1\" />\r\n\t\t\t<input type=\"hidden\" name=\"action_purpose\" id=\"action_purpose\" value=\"buy\" />\r\n\t\t\t<input type=\"hidden\" name=\"checkout_zipcode\" id=\"checkout_zipcode\" value=\"<?php echo $cust_zipcode?>\" />\r\n\t\t\t<?php \r\n\t\t\tif($alert){ \r\n\t\t\t?>\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan=\"4\" class=\"errormsg\" align=\"center\">\r\n\t\t\t\t<?php \r\n\t\t\t\t\t\tif($Captions_arr['PAYONACC'][$alert])\r\n\t\t\t\t\t\t\techo $Captions_arr['PAYONACC'][$alert];\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t \t\techo $alert;\r\n\t\t\t\t?>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t<?php } ?>\r\n <tr>\r\n <td colspan=\"4\" class=\"emailfriendtextheader\"><?=$Captions_arr['EMAIL_A_FRIEND']['EMAIL_FRIEND_HEADER_TEXT']?> </td>\r\n </tr>\r\n <tr>\r\n <td width=\"33%\" align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CURRENTACC_BALANCE']?> </td>\r\n <td width=\"22%\" align=\"left\" class=\"regiconent\">:<?php echo print_price($row_cust['customer_payonaccount_usedlimit'])?> </td>\r\n <td width=\"27%\" align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CREDIT_LIMIT']?></td>\r\n <td width=\"18%\" align=\"left\" class=\"regiconent\">:<?php echo print_price($row_cust['customer_payonaccount_maxlimit'])?> </td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['LAST_STATE_BALANCE']?> </td>\r\n <td align=\"left\" class=\"regiconent\">:<?php echo print_price($prev_balance)?> </td>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CREDIT_REMAINING']?> </td>\r\n <td align=\"left\" class=\"regiconent\">: <?php echo print_price(($row_cust['customer_payonaccount_maxlimit']-$row_cust['customer_payonaccount_usedlimit']))?></td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['AMT_BEING_PAID']?> </td>\r\n <td align=\"left\" class=\"regiconent\">: <?php echo get_selected_currency_symbol()?><?php echo $paying_amt?> <input name=\"pay_amt\" id=\"pay_amt\" type=\"hidden\" size=\"10\" value=\"<?php echo $paying_amt?>\" /></td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n <?php\r\n \tif($additional_det!='')\r\n\t{\r\n ?>\r\n\t\t<tr>\r\n\t\t<td align=\"left\" class=\"regiconent\" valign=\"top\"><?php echo $Captions_arr['PAYONACC']['ADDITIONAL_DETAILS']?> </td>\r\n\t\t<td align=\"left\" class=\"regiconent\">: <?php echo nl2br($additional_det)?> <input name=\"pay_additional_details\" id=\"pay_additional_details\" type=\"hidden\" value=\"<?php echo $additional_det?>\" /></td>\r\n\t\t<td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n\t\t<td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n\t </tr>\r\n <?php\r\n }\r\n ?>\r\n <tr>\r\n <td colspan=\"4\" align=\"center\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n\t <? if($Settings_arr['imageverification_req_payonaccount'] and $_REQUEST['pret']!=1)\r\n\t \t {\r\n\t ?>\r\n <tr>\r\n <td colspan=\"4\" align=\"center\" class=\"emailfriendtextnormal\"><img src=\"<?php url_verification_image('includes/vimg.php?size=4&pass_vname=payonaccountpayment_Vimg')?>\" border=\"0\" alt=\"Image Verification\"/>&nbsp;\t</td>\r\n </tr>\r\n <tr>\r\n <td colspan=\"6\" align=\"center\" class=\"emailfriendtextnormal\"><?=$Captions_arr['PAYONACC']['PAYON_VERIFICATION_CODE']?>&nbsp;<span class=\"redtext\">*</span><span class=\"emailfriendtext\">\r\n\t <?php \r\n\t\t// showing the textbox to enter the image verification code\r\n\t\t$vImage->showCodBox(1,'payonaccountpayment_Vimg','class=\"inputA_imgver\"'); \r\n\t?>\r\n\t</span> </td>\r\n </tr>\r\n <? }?>\r\n <?php\r\n \tif($google_exists && $Captions_arr['PAYONACC'] ['PAYON_PAYMENT_MULTIPLE_MSG'] && google_recommended==0 && $totpaymethodcnt>1 && $_REQUEST['pret']!=1)\r\n\t{\t\r\n ?>\r\n <tr>\r\n \t<td colspan=\"4\" align=\"left\" class=\"google_header_text\"><?php echo $Captions_arr['PAYONACC'] ['PAYON_PAYMENT_MULTIPLE_MSG']?>\r\n \t</td>\r\n </tr>\r\n <?php\r\n }\r\n ?> \r\n <tr>\r\n <td colspan=\"4\">\r\n <table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n <?php\r\nif($_REQUEST['pret']!=1)\r\n{\r\n?>\r\n \r\n <tr>\r\n <td colspan=\"2\">\r\n\t\t\t<?php\r\n\t\t\t\tif ($db->num_rows($ret_paytypes))\r\n\t\t\t\t{\r\n\t\t\t\t\tif($db->num_rows($ret_paytypes)==1 && $totpaymethodcnt<=1)// Check whether there are more than 1 payment type. If no then dont show the payment option to user, just use hidden field\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\techo '<script type=\"text/javascript\">\r\n\t\t\t\t\t\t\tpaytype_arr = new Array();\t\t\r\n\t\t\t\t\t\t\t\t</script>';\r\n\t\t\t\t\t\t$row_paytypes = $db->fetch_array($ret_paytypes);\r\n\t\t\t\t\t\techo '<script type=\"text/javascript\">';\r\n\t\t\t\t\t\techo \"paytype_arr[\".$row_paytypes['paytype_id'].\"] = '\".$row_paytypes['paytype_code'].\"';\";\r\n\t\t\t\t\t\techo '</script>';\r\n\t\t\t\t\t\tif($row_paytypes['paytype_code']=='credit_card')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//if($row_paytypes['paytype_id']==$row_cartdet['paytype_id'])\r\n\t\t\t\t\t\t\t\t$cc_exists = true;\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t$single_curtype = $row_paytypes['paytype_code'];\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"payonaccount_paytype\" id=\"payonaccount_paytype\" value=\"<?php echo $row_paytypes['paytype_id']?>\" />\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$pay_maxcnt = 2;\r\n\t\t\t\t\t\t\t$pay_cnt\t= 0;\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t <div class=\"shoppaymentdiv\">\r\n\t\t\t\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t\t\t\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t\t\t\t<td colspan=\"<?php echo $pay_maxcnt?>\" class=\"cart_payment_header\"><?php echo $Captions_arr['PAYONACC']['PAYON_SEL_PAYTYPE']?></td>\r\n\t\t\t\t\t\t\t\t </tr>\r\n\t\t\t\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t\t\t <?php\r\n\t\t\t\t\t\t\t\t\techo '<script type=\"text/javascript\">\r\n\t\t\t\t\t\t\t\t\t\t\tpaytype_arr = new Array();\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t</script>';\r\n\t\t\t\t\t\t\t\t\twhile ($row_paytypes = $db->fetch_array($ret_paytypes))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif($row_paytypes['paytype_code']=='credit_card')\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tif($row_paytypes['paytype_id']==$row_cartdet['paytype_id'])\r\n\t\t\t\t\t\t\t\t\t\t\t\t$cc_exists = true;\r\n\t\t\t\t\t\t\t\t\t\t\tif (($protectedUrl==true and $cc_seq_req==false) or ($protectedUrl==false and $cc_seq_req==true))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\t\t\telse // if pay type is not credit card.\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tif ($protectedUrl==true)\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\techo '<script type=\"text/javascript\">';\r\n\t\t\t\t\t\t\t\t\t\techo \"paytype_arr[\".$row_paytypes['paytype_id'].\"] = '\".$row_paytypes['paytype_code'].\"';\";\r\n\t\t\t\t\t\t\t\t\t\techo '</script>';\r\n\t\t\t\t\t\t\t\t ?>\r\n\t\t\t\t\t\t\t\t\t\t<td width=\"25%\" align=\"left\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t\t// image to shown for payment types\r\n\t\t\t\t\t\t\t\t\t\t\t$pass_type = 'image_thumbpath';\r\n\t\t\t\t\t\t\t\t\t\t\t// Calling the function to get the image to be shown\r\n\t\t\t\t\t\t\t\t\t\t\t$img_arr = get_imagelist('paytype',$row_paytypes['paytype_forsites_id'],$pass_type,0,0,1);\r\n\t\t\t\t\t\t\t\t\t\t\tif(count($img_arr))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tshow_image(url_root_image($img_arr[0][$pass_type],1),$row_paytypes['paytype_name'],$row_paytypes['paytype_name']);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<img src=\"<?php url_site_image('cash.gif')?>\" alt=\"Payment Type\"/>\r\n\t\t\t\t\t\t\t\t\t\t\t<?php\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t<input class=\"shoppingcart_radio\" type=\"radio\" name=\"payonaccount_paytype\" id=\"payonaccount_paytype\" value=\"<?php echo $row_paytypes['paytype_id']?>\" onclick=\"<?php echo $paytype_onclick?>\" <?php echo ($_REQUEST['payonaccount_paytype']==$row_paytypes['paytype_id'])?'checked=\"checked\"':''?> /><?php echo stripslashes($row_paytypes['paytype_caption'])?>\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t$pay_cnt++;\r\n\t\t\t\t\t\t\t\t\t\tif ($pay_cnt>=$pay_maxcnt)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\techo \"</tr><tr>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$pay_cnt = 0;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif ($pay_cnt<$pay_maxcnt)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\techo \"<td colspan=\".($pay_maxcnt-$pay_cnt).\">&nbsp;</td>\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t?>\t\r\n\t\t\t\t\t\t\t\t </tr>\r\n\t\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t?>\t\t</td>\r\n </tr>\r\n \t<?php \r\n\t$self_disp = 'none';\r\n\tif($_REQUEST['payonaccount_paytype'])\r\n\t{\r\n\t\t// get the paytype code for current paytype\r\n\t\t$sql_pcode = \"SELECT paytype_code \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tpayment_types \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tpaytype_id = \".$_REQUEST['payonaccount_paytype'].\" \r\n\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t1\";\r\n\t\t$ret_pcode = $db->query($sql_pcode);\r\n\t\tif ($db->num_rows($ret_pcode))\r\n\t\t{\r\n\t\t\t$row_pcode \t= $db->fetch_array($ret_pcode);\r\n\t\t\t$sel_ptype \t= $row_pcode['paytype_code'];\r\n\t\t}\r\n\t}\r\n\tif($sel_ptype=='credit_card' or $single_curtype=='credit_card')\r\n\t\t$paymethoddisp_none = '';\r\n\telse\r\n\t\t$paymethoddisp_none = 'none';\r\n\tif($sel_ptype=='cheque')\r\n\t\t$chequedisp_none = '';\r\n\telse\r\n\t\t$chequedisp_none = 'none';\t\r\n\t$sql_paymethods = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n a.paymethod_takecarddetails,a.payment_minvalue,a.paymethod_secured_req,a.paymethod_ssl_imagelink,\r\n b.payment_method_sites_caption \r\n FROM \r\n payment_methods a,\r\n payment_methods_forsites b \r\n WHERE \r\n b.sites_site_id = $ecom_siteid \r\n AND paymethod_showinpayoncredit =1 \r\n AND b.payment_method_sites_active = 1 \r\n $more_pay_condition \r\n AND a.paymethod_id=b.payment_methods_paymethod_id \r\n AND a.paymethod_key<>'PAYPAL_EXPRESS'\";\r\n\t$ret_paymethods = $db->query($sql_paymethods);\r\n\tif ($db->num_rows($ret_paymethods))\r\n\t{\r\n\t\tif ($db->num_rows($ret_paymethods)==1)\r\n\t\t{\r\n\t\t\t$row_paymethods = $db->fetch_array($ret_paymethods);\r\n\t\t\tif ($row_paymethods['paymethod_key']=='SELF' or $row_paymethods['paymethod_key']=='PROTX')\r\n\t\t\t{\r\n\t\t\t\tif($paytypes_cnt==1 or $sel_ptype =='credit_card')\r\n\t\t\t\t\t$self_disp = '';\r\n\t\t\t}\t\r\n\t\t\t?>\r\n\t\t\t<input type=\"hidden\" name=\"payonaccount_paymethod\" id=\"payonaccount_paymethod\" value=\"<?php echo $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id']?>\" />\r\n\t\t\t<?php\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/*if($db->num_rows($ret_paytypes)==1 and $cc_exists == true)\r\n\t\t\t\t$disp = '';\r\n\t\t\telse\r\n\t\t\t\t$disp = 'none';\r\n\t\t\t*/\t\t\r\n\t\t\t?>\r\n\t\t\t<tr id=\"payonaccount_paymethod_tr\" style=\"display:<?php echo $paymethoddisp_none?>\">\r\n\t\t\t\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\r\n\t\t\t\t<div class=\"shoppayment_type_div\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t$pay_maxcnt = 2;\r\n\t\t\t\t\t\t$pay_cnt\t= 0;\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t<td colspan=\"<?php echo $pay_maxcnt?>\" class=\"cart_payment_header\"><?php echo $Captions_arr['PAYONACC']['PAYON_SEL_PAYGATEWAY']?></td>\r\n\t\t\t\t\t </tr>\r\n\t\t\t\t\t <tr>\r\n\t\t\t\t\t <?php\r\n\t\t\t\t\t\twhile ($row_paymethods = $db->fetch_array($ret_paymethods))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$caption = ($row_paymethods['payment_method_sites_caption'])?$row_paymethods['payment_method_sites_caption']:$row_paymethods['paymethod_name'];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif($row_paymethods['paymethod_secured_req']==1 and $protectedUrl==true) // if secured is required for current pay method and currently in secured. so no reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==1 and $protectedUrl==false) // case if secured is required and current not is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==0 and $protectedUrl==false) // case if secured is required and current not is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==0 and $protectedUrl==true) // case if secured is not required and current is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$curname = $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id'];\r\n\t\t\t\t\t\t\tif($curname==$_REQUEST['payonaccount_paymethod'])\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif (($row_paymethods['paymethod_key']=='SELF' or $row_paymethods['paymethod_key']=='PROTX') and $sel_ptype=='credit_card')\r\n\t\t\t\t\t\t\t\t\t$self_disp = '';\r\n\t\t\t\t\t\t\t\tif($sel_ptype=='credit_card')\t\r\n\t\t\t\t\t\t\t\t\t$sel = 'checked=\"checked\"';\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t$sel = '';\r\n\t\t\t\t\t\t\t$img_path=\"./images/\".$ecom_hostname.\"/site_images/payment_methods_images/\".$row_paymethods['paymethod_ssl_imagelink'];\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t if(file_exists($img_path))\r\n\t\t\t\t\t\t\t\t$caption = '<img src=\"'.$img_path.'\" border=\"0\" alt=\"'.$caption.'\" />';\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t ?>\r\n\t\t\t\t\t\t\t<td width=\"25%\" align=\"left\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t\t\t<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td align=\"left\" valign=\"top\" width=\"2%\">\r\n\t\t\t\t\t\t\t\t<input class=\"shoppingcart_radio\" type=\"radio\" name=\"payonaccount_paymethod\" id=\"payonaccount_paymethod\" value=\"<?php echo $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id']?>\" <?php echo $sel ?> onclick=\"<?php echo $on_paymethod_click?>\" />\r\n\t\t\t\t\t\t\t\t<td align=\"left\">\r\n\t\t\t\t\t\t\t\t<?php echo stripslashes($caption)?>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t$pay_cnt++;\r\n\t\t\t\t\t\t\tif ($pay_cnt>=$pay_maxcnt)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\techo \"</tr><tr>\";\r\n\t\t\t\t\t\t\t\t$pay_cnt = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ($pay_cnt<$pay_maxcnt)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\techo \"<td colspan=\".($pay_maxcnt-$pay_cnt).\">&nbsp;</td>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t?>\t\r\n\t\t\t\t\t </tr>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t</div>\t\t\t\t</td>\r\n\t\t\t</tr>\t\r\n\t\t\t<?php\r\n\t\t}\r\n\t}\r\n\tif($paytypes_cnt==1 && $totpaymethodcnt==0 && $single_curtype=='cheque')\r\n\t{\r\n\t\t$chequedisp_none = '';\r\n\t}\t\r\n\t?>\r\n\t<tr id=\"payonaccount_cheque_tr\" style=\"display:<?php echo $chequedisp_none?>\">\r\n\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\t\r\n\t\t<table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"left\" class=\"shoppingcartheader\"><?php echo $Captions_arr['PAYONACC']['PAY_ON_CHEQUE_DETAILS']?></td>\r\n\t\t</tr>\r\n\t\t<?php\r\n\t\t\t// Get the list of credit card static fields to be shown in the checkout out page in required order\r\n\t\t\t$sql_checkout = \"SELECT field_det_id,field_key,field_name,field_req,field_error_msg \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tgeneral_settings_site_checkoutfields \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tsites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tAND field_hidden=0 \r\n\t\t\t\t\t\t\t\t\tAND field_type='CHEQUE' \r\n\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\tfield_order\";\r\n\t\t\t$ret_checkout = $db->query($sql_checkout);\r\n\t\t\tif($db->num_rows($ret_checkout))\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\twhile($row_checkout = $db->fetch_array($ret_checkout))\r\n\t\t\t\t{\t\t\t\r\n\t\t\t\t\t// Section to handle the case of required fields\r\n\t\t\t\t\tif($row_checkout['field_req']==1)\r\n\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\t$chkoutadd_Req[]\t\t= \"'\".$row_checkout['field_key'].\"'\";\r\n\t\t\t\t\t\t$chkoutadd_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t}\t\t\t\r\n\t\t?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\" valign=\"top\">\r\n\t\t\t\t\t<?php echo stripslashes($row_checkout['field_name']); if($row_checkout['field_req']==1) { echo '&nbsp;<span class=\"redtext\">*</span>';}?>\t\t\t\t\t</td>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\" valign=\"top\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\techo get_Field($row_checkout['field_key'],$saved_checkoutvals,$cartData);\r\n\t\t\t\t\t?>\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t?>\r\n\t\t\t</table>\t\t</td>\r\n\t </tr>\t\r\n\t<tr id=\"payonaccount_self_tr\" style=\"display:<?php echo $self_disp?>\">\r\n\t\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\t\r\n\t\t<table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"left\" class=\"shoppingcartheader\"><?php echo $Captions_arr['PAYONACC']['PAYON_CREDIT_CARD_DETAILS']?></td>\r\n\t\t</tr>\r\n\t\t<?php\r\n\t\t\t$cur_form = 'frm_payonaccount_payment';\r\n\t\t\t// Get the list of credit card static fields to be shown in the checkout out page in required order\r\n\t\t\t$sql_checkout = \"SELECT field_det_id,field_key,field_name,field_req,field_error_msg \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tgeneral_settings_site_checkoutfields \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tsites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tAND field_hidden=0 \r\n\t\t\t\t\t\t\t\t\tAND field_type='CARD' \r\n\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\tfield_order\";\r\n\t\t\t$ret_checkout = $db->query($sql_checkout);\r\n\t\t\tif($db->num_rows($ret_checkout))\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\twhile($row_checkout = $db->fetch_array($ret_checkout))\r\n\t\t\t\t{\t\t\t\r\n\t\t\t\t\t// Section to handle the case of required fields\r\n\t\t\t\t\tif($row_checkout['field_req']==1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($row_checkout['field_key']=='checkoutpay_expirydate' or $row_checkout['field_key']=='checkoutpay_issuedate')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"_month'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"_year'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\t\t\t\r\n\t\t?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t<?php echo stripslashes($row_checkout['field_name']); if($row_checkout['field_req']==1) { echo '&nbsp;<span class=\"redtext\">*</span>';}?>\t\t\t\t\t</td>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\techo get_Field($row_checkout['field_key'],$saved_checkoutvals,$cartData,$cur_form);\r\n\t\t\t\t\t?>\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t?> \r\n\t\t</table>\t</td>\r\n\t</tr>\r\n\t<?php\r\n $google_displayed = false;\r\n\tif(!($google_exists && $google_recommended ==0) or $paytypes_cnt>0)\r\n\t{\r\n\t?>\t\r\n\t\t<tr>\r\n\t\t<td colspan=\"4\" align=\"right\" class=\"emailfriendtext\"><input name=\"payonaccount_payment_Submit\" type=\"submit\" class=\"buttongray\" id=\"payonaccount_payment_Submit\" value=\"<?=\"Make Payment\"?>\"/></td>\r\n\t\t</tr>\r\n\t<?php\r\n\t}\r\n }\r\n if($ecom_common_settings['paymethodKey']['PAYPAL_EXPRESS']['paymethod_key'] == \"PAYPAL_EXPRESS\" and $_REQUEST['pret']!=1) // case if paypal express is active in current website\r\n {\r\n ?>\r\n <tr>\r\n <td colspan=\"2\">\r\n <table width='100%' cellpadding='0' cellspacing='0' border='0' class=\"shoppingcarttable\">\r\n <?php\r\n if($totpaycnt>0 or $google_displayed==true)\r\n {\r\n ?>\r\n <tr>\r\n <td align=\"right\" valign=\"middle\" class=\"google_or\" colspan=\"2\">\r\n <img src=\"<?php echo url_site_image('gateway_or.gif')?>\" alt=\"Or\" border=\"0\" />\r\n </td>\r\n </tr> \r\n <?php\r\n }\r\n ?>\r\n <tr>\r\n <td align=\"left\" valign=\"top\" class=\"google_td\" width=\"60%\"><?php echo stripslashes($Captions_arr['CART']['CART_PAYPAL_HELP_MSG']);?></td>\r\n <td align=\"right\" valign=\"middle\" class=\"google_td\">\r\n <input type='hidden' name='for_paypal' id='for_paypal' value='0'/>\r\n <input type='button' name='submit_express' style=\"background:url('https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif'); width:145px;height:42px;cursor:pointer\" border='0' align='top' alt='PayPal' onclick=\"validate_payonaccount_paypal(document.frm_payonaccount_payment)\"/>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n <?php\r\n }\r\n elseif($_REQUEST['pret']==1) // case if returned from paypal so creating input types to hold the payment type and payment method ids\r\n {\r\n ?>\r\n <tr>\r\n <td colspan=\"2\">\r\n <table width='100%' cellpadding='0' cellspacing='0' border='0'>\r\n <tr>\r\n <td colspan=\"2\" align=\"right\" class=\"gift_mid_table_td\">\r\n <input type='hidden' name='payonaccount_paytype' id = 'payonaccount_paytype' value='<?php echo $ecom_common_settings['paytypeCode']['credit_card']['paytype_id']?>'/>\r\n <input type='hidden' name='payonaccount_paymethod' id = 'payonaccount_paymethod' value='PAYPAL_EXPRESS_<?php echo $ecom_common_settings['paymethodKey']['PAYPAL_EXPRESS']['paymethod_id']?>'/>\r\n <input type='hidden' name='override_paymethod' id = 'override_paymethod' value='1'/>\r\n <input type='hidden' name='token' id = 'token' value='<?php echo $_REQUEST['token']?>'/>\r\n <input type='hidden' name='payer_id' id = 'payer_id' value='<?php echo $_REQUEST['payer_id']?>'/>\r\n <input type='hidden' name='for_paypal' id='for_paypal' value='0'/>\r\n <input name=\"buypayonaccountpayment_Submit\" type=\"button\" class=\"buttongray\" id=\"buypayonaccountpayment_Submit\" value=\"<?=$Captions_arr['PAYONACC']['PAYON_PAY']?>\" onclick=\"validate_payonaccount(document.frm_payonaccount_payment)\" /></td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n \r\n <?php\r\n }\r\n\t?>\r\n\t\t\t</form>\r\n\t<?php\r\n\t\t \t// Check whether the google checkout button is to be displayed\r\n\t\tif($google_exists && $google_recommended ==0 && $_REQUEST['pret']!=1)\r\n\t\t{\r\n\t\t\t$row_google = $db->fetch_array($ret_google);\r\n\t?>\r\n\t<tr>\r\n\t<td colspan=\"2\">\r\n\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"shoppingcarttable\">\r\n\t\t<?php \r\n\t\tif($paytypes_cnt>0)\r\n\t\t{\r\n $google_displayed = true;\r\n\t\t?>\t\r\n\t\t<tr>\r\n\t\t\t<td align=\"right\" valign=\"middle\" class=\"google_or\">\r\n\t\t\t <img src=\"<?php echo url_site_image('gateway_or.gif')?>\" alt=\"Or\" border=\"0\" />\r\n\t\t\t</td>\r\n\t\t</tr>\t\r\n\t\t<?php\r\n\t\t}\r\n\t\t?>\t\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"6\" align=\"right\" valign=\"middle\" class=\"google_td\">\r\n\t\t\t<?php\r\n\t\t\t\t$display_option = 'ALL';\r\n\t\t\t\t// Get the details of current customer to pass to google checkout\r\n\t\t\t\t$pass_type \t= 'payonaccount';\r\n\t\t\t\t$cust_details \t= stripslashes($row_cust['customer_title']).stripslashes($row_cust['customer_fname']).' '.stripslashes($row_cust['customer_surname']).' - '.stripslashes($row_cust['customer_email_7503']).' - '.$ecom_hostname;\r\n\t\t\t\t$cartData[\"totals\"][\"bonus_price\"] = $paying_amt;\r\n\t\t\t\trequire_once('includes/google_library/googlecart.php');\r\n\t\t\t\trequire_once('includes/google_library/googleitem.php');\r\n\t\t\t\trequire_once('includes/google_library/googleshipping.php');\r\n\t\t\t\trequire_once('includes/google_library/googletax.php');\r\n\t\t\t\tinclude(\"includes/google_checkout.php\");\r\n\t\t\t?>\t\r\n\t\t\t</td>\r\n\t\t</tr>\t\r\n\t\t</table>\r\n\t</td>\r\n\t</tr>\r\n\t<?php\r\n\t\t\t}\r\n\t?>\t\r\n\t</table>\t</td>\r\n\t</tr>\r\n</table>\r\n\r\n\t\t<script type=\"text/javascript\">\r\n\t\tfunction validate_payonaccount(frm)\r\n\t\t{\r\n if(document.getElementById('for_paypal').value!=1)\r\n {\r\n\t\t<?php\r\n\t\t\tif(count($chkoutadd_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\t\treqadd_arr \t\t\t= new Array(<?php echo implode(\",\",$chkoutadd_Req)?>);\r\n\t\t\t\treqadd_arr_str\t\t= new Array(<?php echo implode(\",\",$chkoutadd_Req_Desc)?>);\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif(count($chkoutcc_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\t\treqcc_arr \t\t\t= new Array(<?php echo implode(\",\",$chkoutcc_Req)?>);\r\n\t\t\t\treqcc_arr_str\t\t= new Array(<?php echo implode(\",\",$chkoutcc_Req_Desc)?>);\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\t?>\r\n\t\t\tfieldRequired\t\t= new Array();\r\n\t\t\tfieldDescription\t= new Array();\r\n\t\t\tvar i=0;\r\n\t\t\t<?php\r\n\t\t\tif($Settings_arr['imageverification_req_payonaccount'])\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tfieldRequired[i] \t\t= 'payonaccountpayment_Vimg';\r\n\t\t\tfieldDescription[i]\t = 'Image Verification Code';\r\n\t\t\ti++;\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif (count($chkoutadd_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tif(document.getElementById('payonaccount_cheque_tr').style.display=='') /* do the following only if checque is selected */\r\n\t\t\t{\r\n\t\t\t\tfor(j=0;j<reqadd_arr.length;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfieldRequired[i] \t= reqadd_arr[j];\r\n\t\t\t\t\tfieldDescription[i] = reqadd_arr_str[j];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif (count($chkoutcc_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tif(document.getElementById('payonaccount_self_tr').style.display=='') /* do the following only if protx or self is selected */\r\n\t\t\t{\r\n\t\t\t\tfor(j=0;j<reqcc_arr.length;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfieldRequired[i] \t= reqcc_arr[j];\r\n\t\t\t\t\tfieldDescription[i] = reqcc_arr_str[j];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\t<?php\r\n\t\t\t}\t\r\n\t\t\tif (count($chkout_Email))\r\n\t\t\t{\r\n\t\t\t$chkout_Email_Str \t\t= implode(\",\",$chkout_Email);\r\n\t\t\techo \"fieldEmail \t\t= Array(\".$chkout_Email_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\techo \"fieldEmail \t\t= Array();\";\r\n\t\t\t// Password checking\r\n\t\t\tif (count($chkout_Confirm))\r\n\t\t\t{\r\n\t\t\t$chkout_Confirm_Str \t= implode(\",\",$chkout_Confirm);\r\n\t\t\t$chkout_Confirmdesc_Str\t= implode(\",\",$chkout_Confirmdesc);\r\n\t\t\techo \"fieldConfirm \t\t= Array(\".$chkout_Confirm_Str.\");\";\r\n\t\t\techo \"fieldConfirmDesc \t= Array(\".$chkout_Req_Desc_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\techo \"fieldConfirm \t\t= Array();\";\r\n\t\t\techo \"fieldConfirmDesc \t= Array();\";\r\n\t\t\t}\t\r\n\t\t\tif (count($chkout_Numeric))\r\n\t\t\t{\r\n\t\t\t\t$chkout_Numeric_Str \t\t= implode(\",\",$chkout_Numeric);\r\n\t\t\t\techo \"fieldNumeric \t\t\t= Array(\".$chkout_Numeric_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\techo \"fieldNumeric \t\t\t= Array();\";\r\n\t\t\t?>\r\n\t\t\tif(Validate_Form_Objects(frm,fieldRequired,fieldDescription,fieldEmail,fieldConfirm,fieldConfirmDesc,fieldNumeric))\r\n\t\t\t{\r\n\t\t\t/* Check whether atleast one payment type is selected */\r\n\t\t\tvar atleastpay = false;\r\n\t\t\tfor(k=0;k<frm.elements.length;k++)\r\n\t\t\t{\r\n\t\t\t\tif(frm.elements[k].name=='payonaccount_paytype')\r\n\t\t\t\t{\r\n\t\t\t\t\tif(frm.elements[k].type=='hidden')\r\n\t\t\t\t\t\tatleastpay = true; /* Done to handle the case of only one payment type */\r\n\t\t\t\t\telse if(frm.elements[k].checked==true)\r\n\t\t\t\t\t\tatleastpay = true;\t\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t\tif(atleastpay==false)\r\n\t\t\t{\r\n\t\t\t\talert('Please select payment type');\r\n\t\t\t\treturn false;\t\r\n\t\t\t}\r\n\t\t\tif (document.getElementById('paymentmethod_req').value==1)\r\n\t\t\t{\r\n\t\t\t\tvar atleast = false;\r\n\t\t\t\tfor(k=0;k<frm.elements.length;k++)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(frm.elements[k].name=='payonaccount_paymethod')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(frm.elements[k].type=='hidden')\r\n\t\t\t\t\t\t\tatleast = true; /* Done to handle the case of only one payment method */\r\n\t\t\t\t\t\telse if(frm.elements[k].checked==true)\r\n\t\t\t\t\t\t\tatleast = true;\t\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\t\r\n\t\t\t\tif(atleast ==false)\r\n\t\t\t\t{\r\n\t\t\t\t\talert('Please select a payment method');\r\n\t\t\t\t\treturn false;\t\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t\telse\r\n\t\t\t{\r\n if(document.getElementById('override_paymethod'))\r\n {\r\n if(document.getElementById('override_paymethod').value!=1)\r\n {\r\n if (document.getElementById('payonaccount_paymethod'))\r\n document.getElementById('payonaccount_paymethod').value = 0; \r\n }\r\n }\r\n else\r\n {\r\n if (document.getElementById('payonaccount_paymethod'))\r\n\t\t\t\t\tdocument.getElementById('payonaccount_paymethod').value = 0;\r\n }\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/* Handling the case of credit card related sections*/\r\n\t\t\tif(frm.checkoutpay_cardtype)\r\n\t\t\t{\r\n\t\t\t\tif(frm.checkoutpay_cardtype.value)\r\n\t\t\t\t{\r\n\t\t\t\t\tobjarr = frm.checkoutpay_cardtype.value.split('_');\r\n\t\t\t\t\tif(objarr.length==4) /* if the value splitted to exactly 4 elements*/\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar key \t\t= objarr[0];\r\n\t\t\t\t\t\tvar issuereq \t= objarr[1];\r\n\t\t\t\t\t\tvar seccount \t= objarr[2];\r\n\t\t\t\t\t\tvar cc_count \t= objarr[3];\r\n\t\t\t\t\t\tif (isNaN(frm.checkoutpay_cardnumber.value))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Credit card number should be numeric');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_cardnumber.focus();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (frm.checkoutpay_cardnumber.value.length>cc_count)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Credit card number should not contain more than '+cc_count+' digits');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_cardnumber.focus();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (frm.checkoutpay_securitycode.value.length>seccount)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Security Code should not contain more than '+seccount+' digits');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_securitycode.focus();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t\t/* If reached here then everything is valid \r\n\t\t\t\tchange the action of the form to the desired value\r\n\t\t\t*/\r\n\t\t\t\tif(document.getElementById('save_payondetails'))\r\n\t\t\t\t\tdocument.getElementById('save_payondetails').value \t= 1;\r\n if(document.getElementById('payonaccount_payment_Submit'))\r\n\t\t\t\tshow_wait_button(document.getElementById('payonaccount_payment_Submit'),'Please wait...');\r\n\t\t\t\t/*frm.action = 'payonaccount_payment_submit.php?bsessid=<?php //echo base64_encode($ecom_hostname)?>';*/\r\n\t\t\t\tfrm.action = 'payonaccount_payment_submit.php';\r\n\t\t\t\tfrm.submit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\t\r\n\t\t\telse\r\n\t\t\treturn false;\r\n }\r\n else\r\n {\r\n if(document.getElementById('save_payondetails'))\r\n document.getElementById('save_payondetails').value = 1;\r\n show_wait_button(document.getElementById('payonaccount_payment_Submit'),'Please wait...');\r\n /*frm.action = 'payonaccount_payment_submit.php?bsessid=<?php //echo base64_encode($ecom_hostname)?>';*/\r\n frm.action = 'payonaccount_payment_submit.php';\r\n frm.submit();\r\n return true;\r\n }\r\n\t\t}\r\n function validate_payonaccount_paypal(frm)\r\n {\r\n if(document.getElementById('for_paypal'))\r\n document.getElementById('for_paypal').value = 1;\r\n validate_payonaccount(frm);\r\n }\r\n\t\t</script>\t\r\n\t\t<?php\t\r\n\t\t}", "public function process_payment($nvpstr) {\n\t // Getting settings.\n\t $settings = $this->pex_settings;\n\t\t// call api with nvp string andset checkout request.\n\t $resarray = $this->hash_call(\"SetExpressCheckout\",$nvpstr);\n\t\t$ack = strtoupper($resarray[\"ACK\"]);\n if($ack==\"SUCCESS\") {\n\t\t $token = trim($resarray[\"TOKEN\"]);\n\t $payurl = $settings['api_url'].$token;\n\t\t // redirect user to paypal url.\n\t\t header(\"Location: \".$payurl);\n\t\t} \n\t\telse {\n\t\t return $resarray;\n\t\t}\n\t}", "private function _proceedPayment()\n {\n $paymentInitModel = $this->_modelFactory->getModel(\n new Shopware_Plugins_Frontend_RpayRatePay_Component_Model_PaymentInit()\n );\n\n $result = $this->_service->xmlRequest($paymentInitModel->toArray());\n if (Shopware_Plugins_Frontend_RpayRatePay_Component_Service_Util::validateResponse(\n 'PAYMENT_INIT',\n $result\n )\n ) {\n Shopware()->Session()->RatePAY['transactionId'] = $result->getElementsByTagName('transaction-id')->item(\n 0\n )->nodeValue;\n $this->_modelFactory->setTransactionId(Shopware()->Session()->RatePAY['transactionId']);\n $paymentRequestModel = $this->_modelFactory->getModel(\n new Shopware_Plugins_Frontend_RpayRatePay_Component_Model_PaymentRequest()\n );\n $result = $this->_service->xmlRequest($paymentRequestModel->toArray());\n if (Shopware_Plugins_Frontend_RpayRatePay_Component_Service_Util::validateResponse(\n 'PAYMENT_REQUEST',\n $result\n )\n ) {\n $uniqueId = $this->createPaymentUniqueId();\n $orderNumber = $this->saveOrder(Shopware()->Session()->RatePAY['transactionId'], $uniqueId, 17);\n $paymentConfirmModel = $this->_modelFactory->getModel(\n new Shopware_Plugins_Frontend_RpayRatePay_Component_Model_PaymentConfirm()\n );\n $matches = array();\n preg_match(\"/<descriptor.*>(.*)<\\/descriptor>/\", $this->_service->getLastResponse(), $matches);\n $dgNumber = $matches[1];\n $result = $this->_service->xmlRequest($paymentConfirmModel->toArray());\n if (Shopware_Plugins_Frontend_RpayRatePay_Component_Service_Util::validateResponse(\n 'PAYMENT_CONFIRM',\n $result\n )\n ) {\n if (Shopware()->Session()->sOrderVariables['sBasket']['sShippingcosts'] > 0) {\n $this->initShipping($orderNumber);\n }\n try {\n $orderId = Shopware()->Db()->fetchOne(\n 'SELECT `id` FROM `s_order` WHERE `ordernumber`=?',\n array($orderNumber)\n );\n Shopware()->Db()->update(\n 's_order_attributes',\n array(\n 'RatePAY_ShopID' => Shopware()->Shop()->getId(),\n 'attribute5' => $dgNumber,\n 'attribute6' => Shopware()->Session()->RatePAY['transactionId']\n ),\n 'orderID=' . $orderId\n );\n } catch (Exception $exception) {\n Shopware()->Log()->Err($exception->getMessage());\n }\n\n //set payments status to payed\n $this->savePaymentStatus(\n Shopware()->Session()->RatePAY['transactionId'],\n $uniqueId,\n 155\n );\n\n /**\n * unset DFI token\n */\n if (Shopware()->Session()->RatePAY['devicefinterprintident']['token']) {\n unset(Shopware()->Session()->RatePAY['devicefinterprintident']['token']);\n }\n\n /**\n * if you run into problems with the redirect method then use the forwarding\n * return $this->forward('finish', 'checkout', null, array('sUniqueID' => $uniqueId));\n **/\n \n $this->redirect(\n Shopware()->Front()->Router()->assemble(\n array(\n 'controller' => 'checkout',\n 'action' => 'finish',\n 'forceSecure' => true\n )\n )\n );\n } else {\n $this->_error();\n }\n } else {\n $this->_error();\n }\n } else {\n $this->_error();\n }\n }", "public function paypalItem(){\n \treturn \\PaypalPayment::item()->setNAme($this->title)->setDescription($this->description)->setCurrency('USD')->setQuantity(1)->setPrice($this->pricing);\n }", "public function execute(){\n $paymentId = $_GET['paymentId'];\n $payment = Payment::get($paymentId, $this->_apiContext);\n $payerId = $_GET['PayerID'];\n\n // Execute payment with payer ID\n $execution = new PaymentExecution();\n $execution->setPayerId($payerId);\n \n $transaction = new Transaction();\n $amount = new Amount();\n\n $details = new Details();\n $details->setShipping(0)\n ->setTax(0)\n ->setSubtotal(Cart::subtotal());\n\n $amount->setCurrency('BRL');\n $amount->setTotal(Cart::total());\n $amount->setDetails($details);\n\n $transaction->setAmount($amount);\n\n $execution->addTransaction($transaction);\n\n try{\n // Execute payment\n $result = $payment->execute($execution, $this->_apiContext);\n \n try{\n\n $payment = Payment::get($paymentId, $this->_apiContext);\n }catch(Exception $ex){\n\n die($ex);\n }\n }catch(PayPalConnectionException $ex){\n\n echo $ex->getCode();\n echo $ex->getData();\n die($ex);\n }catch(Exception $ex){\n\n die($ex);\n }\n\n Session::flash('status', 'Pagamento realizado');\n Session::put('token-paypal', $_GET['token']);\n return redirect('/paypal/transaction/complete');\n }", "function PPHttpPost($methodName_, $nvpStr_) {\n\tglobal $environment;\n\n\t$API_UserName = urlencode('tuhins_1351114574_biz_api1.gmail.com');\n\t$API_Password = urlencode('1351114606');\n\t$API_Signature = urlencode('AdfcyT4sNBLU3ISgRRnYiJXaGd4hAjDiSEgVQesi8ykS-6Sp5pC4c5bM');\n\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\n\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment) {\n\t\t$API_Endpoint = \"https://api-3t.$environment.paypal.com/nvp\";\n\t}\n\t$version = urlencode('58.0');\n\n\t// setting the curl parameters.\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n\t// turning off the server and peer verification(TrustManager Concept).\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t// NVPRequest for submitting to server\n\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\t\n\n\t// setting the nvpreq as POST FIELD to curl\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n\t// getting response from server\n\t$httpResponse = curl_exec($ch);\n\n\tif(!$httpResponse) {\n\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t}\n\n\t// Extract the RefundTransaction response details\n\t$httpResponseAr = explode(\"&\", $httpResponse);\n\n\t$httpParsedResponseAr = array();\n\tforeach ($httpResponseAr as $i => $value) {\n\t\t$tmpAr = explode(\"=\", $value);\n\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t}\n\t}\n\n\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t}\n\n\treturn $httpParsedResponseAr;\n}", "function submit_paypal_post() {\n // a form with hidden elements which is submitted to paypal via the \n // BODY element's onLoad attribute. We do this so that you can validate\n // any POST vars from you custom form before submitting to paypal. So \n // basically, you'll have your own form which is submitted to your script\n // to validate the data, which in turn calls this function to create\n // another hidden form and submit to paypal.\n \n // The user will briefly see a message on the screen that reads:\n // \"Please wait, your order is being processed...\" and then immediately\n // is redirected to paypal.\n\n echo \"<html>\\n\";\n echo \"<head><title>Inoltro Pagamento...</title></head>\\n\";\n echo \"<body onLoad=\\\"document.forms['paypal_form'].submit();\\\">\\n\";\n echo \"<center><h2>Attendere, l'ordine &egrave; in fase di inoltro a paypal\";\n echo \" e sarete reindirizzati a breve.</h2></center>\\n\";\n echo \"<form method=\\\"post\\\" name=\\\"paypal_form\\\" \";\n echo \"action=\\\"\".$this->paypal_url.\"\\\">\\n\";\n\n foreach ($this->fields as $name => $value) {\n echo \"<input type=\\\"hidden\\\" name=\\\"$name\\\" value=\\\"$value\\\"/>\\n\";\n }\n echo \"<center><br/><br/>Se non venite reindirizzati al sito \";\n echo \"paypal entro 5 secondi...<br/><br/>\\n\";\n echo \"<input type=\\\"submit\\\" value=\\\"Cliccare qui\\\"></center>\\n\";\n \n echo \"</form>\\n\";\n echo \"</body></html>\\n\";\n\t exit;\n\n }", "function complete($postcard_id = null){\n\t\t$paypal_config = array('Sandbox' => $this->sandbox);\n\t\t$paypal = new PayPal($paypal_config);\n\t\t\n\t\t#####[ CALL GET EXPRESS CHECKOUT DETAILS ]###########################\n\t\t\n\t\t#echo \"<pre>\";\n\t\t#print_r($_SESSION);\n\t\t#echo \"</pre>\";\n\t\t#exit;\n\t\t\n\t\t$GECDResult = $paypal -> GetExpressCheckoutDetails($this->session->userdata('Token'));\n\t\t$this->session->set_userdata('paypal_errors', $GECDResult['ERRORS']);\n\t\tif(strtolower($GECDResult['ACK']) != 'success' && strtolower($GECDResult['ACK']) != 'successwithwarning')\n\t\t{\n\t\t\tredirect('payment/error');\n\t\t\texit();\n\t\t}\n\t\t\n\t\t#####[ SET EXPRESS CHECKOUT ]#######################################\n\t\t\n\t\t// DoExpressCheckout\n\t\t$DECPFields = array(\n\t\t\t\t\t\t\t'token' => $this->session->userdata('Token'), \t\t\t\t\t\t\t\t// Required. A timestamped token, the value of which was returned by a previous SetExpressCheckout call.\n\t\t\t\t\t\t\t'paymentaction' => 'Sale', \t\t\t\t\t\t// Required. How you want to obtain payment. Values can be: Authorization, Order, Sale. Auth indiciates that the payment is a basic auth subject to settlement with Auth and Capture. Order indiciates that this payment is an order auth subject to settlement with Auth & Capture. Sale indiciates that this is a final sale for which you are requesting payment.\n\t\t\t\t\t\t\t'payerid' => isset($GECDResult['PAYERID']) ? $GECDResult['PAYERID'] : '', \t\t\t\t\t\t\t// Required. Unique PayPal customer id of the payer. Returned by GetExpressCheckoutDetails, or if you used SKIPDETAILS it's returned in the URL back to your RETURNURL.\n\t\t\t\t\t\t\t'payerid' => isset($GECDResult['PAYERID']) ? $GECDResult['PAYERID'] : '',\n\t\t\t\t\t\t\t'returnfmfdetails' => '1' \t\t\t\t\t// Flag to indiciate whether you want the results returned by Fraud Management Filters or not. 1 or 0.\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\n\t\t$PaymentDetails = array(\n\t\t\t\t\t\t\t\t'amt' => $this->session->userdata('amount'), \t\t\t\t\t\t\t// Required. Total amount of the order, including shipping, handling, and tax.\n\t\t\t\t\t\t\t\t'currencycode' => $this->session->userdata('currency'), \t\t\t\t\t// A three-character currency code. Default is USD.\n\t\t\t\t\t\t\t\t'itemamt' => '', \t\t\t\t\t\t// Required if you specify itemized L_AMT fields. Sum of cost of all items in this order. \n\t\t\t\t\t\t\t\t'shippingamt' => '', \t\t\t\t\t// Total shipping costs for this order. If you specify SHIPPINGAMT you mut also specify a value for ITEMAMT.\n\t\t\t\t\t\t\t\t'handlingamt' => '', \t\t\t\t\t// Total handling costs for this order. If you specify HANDLINGAMT you mut also specify a value for ITEMAMT.\n\t\t\t\t\t\t\t\t'taxamt' => '', \t\t\t\t\t\t// Required if you specify itemized L_TAXAMT fields. Sum of all tax items in this order. \n\t\t\t\t\t\t\t\t'desc' => 'Epic Thanks, 501(c)(3) Epic Change', \t\t\t\t\t\t\t// Description of items on the order. 127 char max.\n\t\t\t\t\t\t\t\t'custom' => $this->session->userdata('postcard_id'), \t\t\t\t\t\t// Free-form field for your own use. 256 char max.\n\t\t\t\t\t\t\t\t'invnum' => $this->session->userdata('invoice'), \t\t\t\t\t\t// Your own invoice or tracking number. 127 char max.\n\t\t\t\t\t\t\t\t//'notifyurl' => site_url() .\"/payment/ipn\" \t\t\t\t\t\t// URL for receiving Instant Payment Notifications\n\t\t\t\t\t\t\t\t);\n\t\t\n\t\t$OrderItems = array();\n\t\t\n\t\t$Item\t\t = array(\n\t\t\t\t\t\t'l_name' => $this->session->userdata('item_name'), \t\t\t\t\t\t// Item name. 127 char max.\n\t\t\t\t\t\t'l_amt' => $this->session->userdata('amount'), \t\t\t\t\t\t// Cost of item.\n\t\t\t\t\t\t'l_number' => $this->session->userdata('postcard_id'), \t\t\t\t\t\t// Item number. 127 char max.\n\t\t\t\t\t\t'l_qty' => '1' \t\t\t\t\t\t// Item qty on order. Any positive integer.\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\tarray_push($OrderItems, $Item);\n\t\t\n\t\t$DECPData = array(\n\t\t\t\t\t\t 'DECPFields' => $DECPFields, \n\t\t\t\t\t\t 'PaymentDetails' => $PaymentDetails,\n\t\t\t\t\t\t 'OrderItems' => $OrderItems\n\t\t\t\t\t\t );\n\t\t\n\t\t#####[ CALL DO EXPRESS CHECKOUT PAYMENT ]#############################\n\t\t\n\t\t$DECPResult = $paypal -> DoExpressCheckoutPayment($DECPData);\n\t\t$this->session->set_userdata('paypal_errors', $DECPResult['ERRORS']);\n\t\t\n\t\t#####[ REDIRECT DEPENDING ON RESPONSE ]###############################\n\t\t\n\t\tif(strtolower($DECPResult['ACK']) != 'success' && strtolower($DECPResult['ACK']) != 'successwithwarning')\n\t\t{\n\t\t\tredirect('payment/error?type=2');\n\t\t\texit();\n\t\t}\n\t\t\n\t\t/*\n\t\t$_SESSION['PayerEmailAddress'] = isset($GECDResult['EMAIL']) ? $GECDResult['EMAIL'] : '';\n\t\t$_SESSION['FirstName'] = isset($GECDResult['FIRSTNAME']) ? $GECDResult['FIRSTNAME'] : '';\n\t\t$_SESSION['LastName'] = isset($GECDResult['LASTNAME']) ? $GECDResult['LASTNAME'] : '';\n\t\t$_SESSION['Street'] = isset($GECDResult['SHIPTOSTREET']) ? $GECDResult['SHIPTOSTREET'] : '';\n\t\t$_SESSION['City'] = isset($GECDResult['SHIPTOCITY']) ? $GECDResult['SHIPTOCITY'] : '';\n\t\t$_SESSION['State'] = isset($GECDResult['SHIPTOSTATE']) ? $GECDResult['SHIPTOSTATE'] : '';\n\t\t$_SESSION['Zip'] = isset($GECDResult['SHIPTOZIP']) ? $GECDResult['SHIPTOZIP'] : '';\n\t\t$_SESSION['Country'] = isset($GECDResult['SHIPTOCOUNTRYNAME']) ? $GECDResult['SHIPTOCOUNTRYNAME'] : '';\n\t\t$_SESSION['transaction_id'] = isset($DECPResult['TRANSACTIONID']) ? $DECPResult['TRANSACTIONID'] : '';\n\t\t$_SESSION['CustomerNotes'] = isset($DECPResult['NOTE']) ? $DECPResult['NOTE'] : '';\n\t\t$_SESSION['PaymentStatus'] = isset($DECPResult['PAYMENTSTATUS']) ? $DECPResult['PAYMENTSTATUS'] : '';\n\t\t$_SESSION['PendingReason'] = isset($DECPResult['PENDINGREASON']) ? $DECPResult['PENDINGREASON'] : '';\n\t\t$_SESSION['payment_type'] = isset($DECPResult['PAYMENTTYPE']) ? $DECPResult['PAYMENTTYPE'] : '';\n\t\t\n\t\t*/\n\t\t\n\t\t#echo \"<pre>\";\n\t\t#print_r($_SESSION);\n\t\t#echo \"</pre>\";\n\t\t#exit;\n\t\t\n\t\t// Everything went fine, so redirect to completed page.\n\t\t$type = $this->session->userdata('payment_source');\n\t\t$d = new Donations();\n\t\t$d->donation_amount = $this->session->userdata('amount');\n\t\t$d->type = $type;\n\t\t$d->save();\n\t\t$session_data = array(\n\t\t\t\t\t\t\t\t'donor_name' => $GECDResult['FIRSTNAME'] . ' ' . $GECDResult['LASTNAME'],\n\t\t\t\t\t\t\t\t'donation_id' => $d->donation_id\n\t\t\t\t\t\t\t);\n\t\t$this->session->set_userdata($session_data);\n\t\t\n\t\tif( $type == 'postcard'){\n\t\t\t$r = new PostDonationRel();\n\t\t\t$r->post_id = $postcard_id;\n\t\t\t$r->donation_id = $d->donation_id;\n\t\t\t$r->save();\n\t\t\tif($this->session->userdata('amount') >= PARADE_CUTOFF){\n\t\t\t\t$g = new GratitudeParade();\n\t\t\t\t$g->donation_id = $d->donation_id;\n\t\t\t\t$g->name = Users::user()->username;\n\t\t\t\t$g->image_url = Users::user()->profile_avatar;\n\t\t\t\t$g->url = 'http://www.' . Users::user()->oauth_provider . '.com/' . Users::user()->username;\n\t\t\t\t$g->save();\n\t\t\t\t$this->session->set_flashdata('added_to_parade', true);\n\t\t\t}\n\t\t\t$this->session->set_flashdata('added_to_parade', false);\n\t\t\tredirect('postcard/send/' . $postcard_id . '/'. md5($postcard_id));\n\t\t}\n\t\telse \n\t\t\tredirect('payment/thankyou');\n\t}", "public function payment_paypal($key = null, $urlVar = null)\n\t{\n\t\tself::save($key, $urlVar);\n\t}", "public function PaypalGetAndDoExpressCheckout($oPaypal){\n if (!isset($_GET['token'])){\n header('Location:'.'http://localhost/PHPScripts_website/live_demo/buy_ticket.php?c=cancel'); \n }\n\n // *** Checkout process (get and do expresscheckout) \n $totalOrder = number_format($_SESSION['total_order'], 2, '.', '');\n\n // GetExpressCheckoutDetails (get orders, buyer, transaction informations)\n $response = $oPaypal->request('GetExpressCheckoutDetails', array(\n 'TOKEN' => $_GET['token']\n ));\n\n //Store buyer information\n $oPaypal->RecordPaypalPayer($response); \n\n // Store order\n $oOrder = new Order();\n\n //Record order\n $id_cat = 1;\n $sIdOrder = $oOrder->RecordOrder($response, $id_cat);\n\n if($response){\n // if checkout success\n if($response['CHECKOUTSTATUS'] == 'PaymentActionCompleted'){\n die('This payment has already been validated');\n }\n }else{\n $oPaypal->recordErrorOrder($oPaypal->errors, $sIdOrder);\n die();\n }\n\n // DoExpressCheckoutPayment setting\n $params = array(\n 'TOKEN' => $response['TOKEN'],\n 'PAYERID'=> $response['PAYERID'],\n 'PAYMENTREQUEST_0_PAYMENTACTION'=>'Sale',\n 'PAYMENTREQUEST_0_AMT' => $response['AMT'],\n 'PAYMENTREQUEST_0_CURRENCYCODE' => $oPaypal->money_code,\n 'PAYMENTREQUEST_0_ITEMAMT' => $response['ITEMAMT'],\n );\n\n foreach($_SESSION['tickets'] as $k => $ticket){\n // Send again order informations to paypal for the history buyer purchases.\n $params[\"L_PAYMENTREQUEST_0_NAME$k\"] = $ticket['name'];\n $params[\"L_PAYMENTREQUEST_0_DESC$k\"] = '';\n $params[\"L_PAYMENTREQUEST_0_AMT$k\"] = $ticket['price'];\n $params[\"L_PAYMENTREQUEST_0_QTY$k\"] = $ticket['nbseat'];\n }\n\n // DoExpressCheckoutPayment\n $response = $oPaypal->request('DoExpressCheckoutPayment',$params );\n\n if($response){\n // DoExpressCheckoutPayment is success then update order in database ('Transaction ID', 'paymentstatus'...=\n $oOrder->updateOrder($sIdOrder, $response);\n\n if ($response['PAYMENTINFO_0_PAYMENTSTATUS'] == 'Completed'){\n // Send mail confirmation (with order information and ticket pdf link). A FAIRE\n echo \"<br>the transaction n°{$response['PAYMENTINFO_0_TRANSACTIONID']} was successful\";\n } \n }else{\n $oPaypal->recordErrorOrder($oPaypal->errors, $sIdOrder);\n }\n\n if (isset($_SESSION['tickets'])) unset($_SESSION['tickets']);\n\n}", "public function admin_add_paypal_payment() {\n\t\t$this->request->data['PaypalPaymentModule']['name'] = 'Paypal ' . $this->request->data['PaypalPaymentModule']['name'];\n\t\t\n\t\t$this->request->data['ShopsPaymentModule']['payment_module_id'] = PAYPAL_PAYMENT_MODULE;\n\t\t$this->request->data['ShopsPaymentModule']['shop_id'] = Shop::get('Shop.id');\n\t\t$this->request->data['ShopsPaymentModule']['display_name'] = $this->request->data['PaypalPaymentModule']['name'];\n\t\t\n\t\t$paymentModuleInShop = $this->Payment->ShopsPaymentModule;\n\t\t$paymentModule = $paymentModuleInShop->PaymentModule;\n\t\t\n\t\t$paymentModule->create();\n\t\t$paymentModuleInShop->create();\n\t\t\n\t\t\n\t\tif ($paymentModuleInShop->saveAll($this->request->data)) {\n\t\t\t$this->Session->setFlash(__('Paypal payment has been activated'), 'default', array('class'=>'flash_success'));\n\t\t} else {\n\t\t\t$this->Session->setFlash(__('Paypal payment could not be saved. Please, try again.'), 'default', array('class'=>'flash_failure'));\n\t\t}\n\t\t\n\t\t$this->redirect(array('action'=>'index'));\n\t}", "public function make_payment($token) {\n\t // Getting settings.\n\t $settings = $this->pex_settings;\n\t\t $nvpstr=\"&TOKEN=\".$token;\n\t\t // call api with token and getting result.\n\t\t $resarray = $this->hash_call(\"GetExpressCheckoutDetails\",$nvpstr);\n\t\t $ack = strtoupper($resarray[\"ACK\"]);\n\t\t if($ack == 'SUCCESS' || $ack == 'SUCCESSWITHWARNING'){\n\t\t\tini_set('session.bug_compat_42',0);\n\t\t\tini_set('session.bug_compat_warn',0);\n\t\t\t$token = trim($resarray['TOKEN']);\n\t\t\t$payment_amount = trim($resarray['AMT']);\n\t\t\t$payerid = trim($resarray['PAYERID']);\n\t\t\t$server_name = trim($_SERVER['SERVER_NAME']);\n\t\t\t$nvpstr='&TOKEN='.$token.'&PAYERID='.$payerid.'&PAYMENTACTION='.$settings['payment_type'].'&AMT='.$payment_amount.'&CURRENCYCODE='.$settings['currency'].'&IPADDRESS='.$server_name ;\n\t\t\t$resarray = $this->hash_call(\"DoExpressCheckoutPayment\",$nvpstr);\n\t\t\t$ack = strtoupper($resarray[\"ACK\"]);\n\t\t\t// checking response for success.\n\t\t\tif($ack != 'SUCCESS' && $ack != 'SUCCESSWITHWARNING'){\n\t\t\t\treturn $resarray;\n\t\t\t}\n\t\t\telse {\n\t\t\t return $resarray;\n\t\t\t}\n\t\t } \n\t\t else \n\t\t {\n\t\t\treturn $resarray;\n\t\t }\n\t}", "public function createOfferPurchaseUrl($amount, $user_id, $connect_transaction_id, $return_url, $cancel_url) {\n $this->__createLog('Entering into class [SixthContinent\\SixthContinentConnectBundle\\Services\\SixthcontinentOfferTransactionService] and function [createOfferPurchaseUrl] with transaction id:'.$connect_transaction_id);\n // code for chiave \n $prod_payment_mac_key = $this->container->getParameter('prod_payment_mac_key');\n // code for alias\n $prod_alias = $this->container->getParameter('prod_alias');\n $payment_type_send = self::TAMOIL_OFFER_CODE;; //TAMOIL OFFER\n $payment_type = ApplaneConstentInterface::TAMOIL_OFFER_CARTISI_PURCHASE_CODE;\n //$amount = 1;\n //amount is coming in multiple of 100 already.\n $dec_amount = (float)sprintf(\"%01.2f\", $amount);\n $amount = 1 ;\n// $amount = $dec_amount;\n //code for codTrans\n $codTrans = \"6THCH\" . time() . $user_id . $payment_type_send;\n // code for divisa\n $currency_code = ApplaneConstentInterface::TAMOIL_OFFER_CURRENCY;\n //code for string for live\n $string = \"codTrans=\" . $codTrans . \"divisa=\" . $currency_code . \"importo=\" . $amount . \"$prod_payment_mac_key\";\n //code for sting for test - fix\n //$string = \"codTrans=\" . $codTrans . \"divisa=\" . $currency_code . \"importo=\" . $amount . \"$test_payment_mac_key\";\n //code for mac\n $mac = sha1($string);\n //$prod_alias = $test_alias;\n //code for symfony url hit by payment gateway\n $base_url = $this->container->getParameter('symfony_base_url');\n $urlpost = $base_url.self::OFFER_PURCHASE_POST_URL;\n //$urlpost = 'http://php-sg1234.rhcloud.com/ipn_test.php';\n $urlpost = $this->createUrls($urlpost, $connect_transaction_id);\n //get entity manager object\n $em = $this->container->get('doctrine')->getManager();\n \n \n $contract_number = ApplaneConstentInterface::TAMOIL_CONTRACT_CONSTANT.$user_id.'_'.time();\n $cancel_url = $this->createUrls($cancel_url, $connect_transaction_id);\n \n $return_url = $this->createUrls($return_url, $connect_transaction_id);\n //code for session id\n $session_id = $user_id;\n //code for descrizione\n $description_amount = $amount/100;\n $description = \"payment_for_\".$description_amount.\"_euro_with_type_\".$payment_type.\"_to_Sixthcontinent\";\n //code for url that is angular js url for payment success and failure\n $url = $return_url;\n //code for tipo_servizio (type service)\n $type_service = self::PAYMENT_SERVICE;\n //code for final url to return\n $final_url = $this->container->getParameter('oneclick_pay_url').\"?session_id=$session_id&alias=$prod_alias&urlpost=$urlpost&tipo_servizio=$type_service&mac=$mac&divisa=$currency_code&importo=$amount&codTrans=$codTrans&url=$url&url_back=$cancel_url&num_contratto=$contract_number&descrizione=$description\";\n $result_data = array('url'=>$final_url, 'transaction_code'=>$codTrans, 'mac'=>$mac, 'description'=>$description, 'url_back'=>$cancel_url, 'url_post'=>$urlpost, 'return_url'=>$return_url);\n $this->__createLog('Exiting from class [SixthContinent\\SixthContinentConnectBundle\\Services\\SixthcontinentOfferTransactionService] and function [createOfferPurchaseUrl] with transaction id:'.Utility::encodeData($result_data));\n return $result_data;\n }", "private function _expressCheckoutPayment()\r\n\t{\r\n\t\t/* Verifying the Payer ID and Checkout tokens (stored in the customer cookie during step 2) */\r\n\t\tif (isset($this->context->cookie->paypal_express_checkout_token) && !empty($this->context->cookie->paypal_express_checkout_token))\r\n\t\t{\r\n\t\t\t/* Confirm the payment to PayPal */\r\n\t\t\t$currency = new Currency((int)$this->context->cart->id_currency);\r\n\t\t\t$result = $this->paypal_usa->postToPayPal('DoExpressCheckoutPayment', '&TOKEN='.urlencode($this->context->cookie->paypal_express_checkout_token).'&PAYERID='.urlencode($this->context->cookie->paypal_express_checkout_payer_id).'&PAYMENTREQUEST_0_PAYMENTACTION=Sale&PAYMENTREQUEST_0_AMT='.$this->context->cart->getOrderTotal(true).'&PAYMENTREQUEST_0_CURRENCYCODE='.urlencode($currency->iso_code).'&IPADDRESS='.urlencode($_SERVER['SERVER_NAME']));\r\n\r\n\t\t\tif (strtoupper($result['ACK']) == 'SUCCESS' || strtoupper($result['ACK']) == 'SUCCESSWITHWARNING')\r\n\t\t\t{\r\n\t\t\t\t/* Prepare the order status, in accordance with the response from PayPal */\r\n\t\t\t\tif (strtoupper($result['PAYMENTINFO_0_PAYMENTSTATUS']) == 'COMPLETED')\r\n\t\t\t\t\t$order_status = (int)Configuration::get('PS_OS_PAYMENT');\r\n\t\t\t\telseif (strtoupper($result['PAYMENTINFO_0_PAYMENTSTATUS']) == 'PENDING')\r\n\t\t\t\t\t$order_status = (int)Configuration::get('PS_OS_PAYPAL');\r\n\t\t\t\telse\r\n\t\t\t\t\t$order_status = (int)Configuration::get('PS_OS_ERROR');\r\n\r\n\t\t\t\t/* Prepare the transaction details that will appear in the Back-office on the order details page */\r\n\t\t\t\t$message =\r\n\t\t\t\t\t\t'Transaction ID: '.$result['PAYMENTINFO_0_TRANSACTIONID'].'\r\n\t\t\t\tTransaction type: '.$result['PAYMENTINFO_0_TRANSACTIONTYPE'].'\r\n\t\t\t\tPayment type: '.$result['PAYMENTINFO_0_PAYMENTTYPE'].'\r\n\t\t\t\tOrder time: '.$result['PAYMENTINFO_0_ORDERTIME'].'\r\n\t\t\t\tFinal amount charged: '.$result['PAYMENTINFO_0_AMT'].'\r\n\t\t\t\tCurrency code: '.$result['PAYMENTINFO_0_CURRENCYCODE'].'\r\n\t\t\t\tPayPal fees: '.$result['PAYMENTINFO_0_FEEAMT'];\r\n\r\n\t\t\t\tif (isset($result['PAYMENTINFO_0_EXCHANGERATE']) && !empty($result['PAYMENTINFO_0_EXCHANGERATE']))\r\n\t\t\t\t\t$message .= 'Exchange rate: '.$result['PAYMENTINFO_0_EXCHANGERATE'].'\r\n\t\t\t\tSettled amount (after conversion): '.$result['PAYMENTINFO_0_SETTLEAMT'];\r\n\r\n\t\t\t\t$pending_reasons = array(\r\n\t\t\t\t\t'address' => 'Customer did not include a confirmed shipping address and your Payment Receiving Preferences is set such that you want to manually accept or deny each of these payments.',\r\n\t\t\t\t\t'echeck' => 'The payment is pending because it was made by an eCheck that has not yet cleared.',\r\n\t\t\t\t\t'intl' => 'You hold a non-U.S. account and do not have a withdrawal mechanism. You must manually accept or deny this payment from your Account Overview.',\r\n\t\t\t\t\t'multi-currency' => 'You do not have a balance in the currency sent, and you do not have your Payment Receiving Preferences set to automatically convert and accept this payment. You must manually accept or deny this payment.',\r\n\t\t\t\t\t'verify' => 'You are not yet verified, you have to verify your account before you can accept this payment.',\r\n\t\t\t\t\t'other' => 'Unknown, for more information, please contact PayPal customer service.');\r\n\r\n\t\t\t\tif (isset($result['PAYMENTINFO_0_PENDINGREASON']) && !empty($result['PAYMENTINFO_0_PENDINGREASON']) && isset($pending_reasons[$result['PAYMENTINFO_0_PENDINGREASON']]))\r\n\t\t\t\t\t$message .= \"\\n\".'Pending reason: '.$pending_reasons[$result['PAYMENTINFO_0_PENDINGREASON']];\r\n\r\n\t\t\t\t/* Creating the order */\r\n\t\t\t\t$customer = new Customer((int)$this->context->cart->id_customer);\r\n\t\t\t\tif ($this->paypal_usa->validateOrder((int)$this->context->cart->id, (int)$order_status, (float)$result['PAYMENTINFO_0_AMT'], $this->paypal_usa->displayName, $message, array(), null, false, $customer->secure_key))\r\n\t\t\t\t{\r\n\t\t\t\t\t/* Store transaction ID and details */\r\n\t\t\t\t\t$this->paypal_usa->addTransactionId((int)$this->paypal_usa->currentOrder, $result['PAYMENTINFO_0_TRANSACTIONID']);\r\n\t\t\t\t\t$this->paypal_usa->addTransaction('payment', array('source' => 'express', 'id_shop' => (int)$this->context->cart->id_shop, 'id_customer' => (int)$this->context->cart->id_customer, 'id_cart' => (int)$this->context->cart->id,\r\n\t\t\t\t\t\t'id_order' => (int)$this->paypal_usa->currentOrder, 'id_transaction' => $result['PAYMENTINFO_0_TRANSACTIONID'], 'amount' => $result['PAYMENTINFO_0_AMT'],\r\n\t\t\t\t\t\t'currency' => $result['PAYMENTINFO_0_CURRENCYCODE'], 'cc_type' => '', 'cc_exp' => '', 'cc_last_digits' => '', 'cvc_check' => 0,\r\n\t\t\t\t\t\t'fee' => $result['PAYMENTINFO_0_FEEAMT']));\r\n\r\n\t\t\t\t\t/* Reset the PayPal's token so the customer will be able to place a new order in the future */\r\n\t\t\t\t\tunset($this->context->cookie->paypal_express_checkout_token, $this->context->cookie->paypal_express_checkout_payer_id);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/* Redirect the customer to the Order confirmation page */\r\n\t\t\t\tif (_PS_VERSION_ < 1.4)\r\n\t\t\t\t\tTools::redirect('order-confirmation.php?id_cart='.(int)$this->context->cart->id.'&id_module='.(int)$this->paypal_usa->id.'&id_order='.(int)$this->paypal_usa->currentOrder.'&key='.$customer->secure_key);\r\n\t\t\t\telse\r\n\t\t\t\t\tTools::redirect('index.php?controller=order-confirmation&id_cart='.(int)$this->context->cart->id.'&id_module='.(int)$this->paypal_usa->id.'&id_order='.(int)$this->paypal_usa->currentOrder.'&key='.$customer->secure_key);\r\n\t\t\t\texit;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tforeach ($result as $key => $val)\r\n\t\t\t\t\t$result[$key] = urldecode($val);\r\n\r\n\t\t\t\t/* If PayPal is returning an error code equal to 10486, it means either that:\r\n\t\t\t\t *\r\n\t\t\t\t * - Billing address could not be confirmed\r\n\t\t\t\t * - Transaction exceeds the card limit\r\n\t\t\t\t * - Transaction denied by the card issuer\r\n\t\t\t\t * - The funding source has no funds remaining\r\n\t\t\t\t *\r\n\t\t\t\t * Therefore, we are displaying a new PayPal Express Checkout button and a warning message to the customer\r\n\t\t\t\t * He/she will have to go back to PayPal to select another funding source or resolve the payment error\r\n\t\t\t\t */\r\n\t\t\t\tif (isset($result['L_ERRORCODE0']) && (int)$result['L_ERRORCODE0'] == 10486)\r\n\t\t\t\t{\r\n\t\t\t\t\tunset($this->context->cookie->paypal_express_checkout_token, $this->context->cookie->paypal_express_checkout_payer_id);\r\n\t\t\t\t\t$this->context->smarty->assign('paypal_usa_action', $this->context->link->getModuleLink('paypalusa', 'expresscheckout', array('pp_exp_initial' => 1)));\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$this->context->smarty->assign('paypal_usa_errors', $result);\r\n\t\t\t\t$this->setTemplate('express-checkout-messages.tpl');\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function curlPost($encoded_data) {\n\n if ($this->use_ssl) {\n $uri = 'https://'.$this->getPaypalHost().'/cgi-bin/webscr';\n $this->post_uri = $uri;\n } else {\n $uri = 'http://'.$this->getPaypalHost().'/cgi-bin/webscr';\n $this->post_uri = $uri;\n }\n \n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, $uri);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $encoded_data);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n// curl_setopt($ch, CURLOPT_CAINFO, \n// dirname(__FILE__).\"/cert/cert_key.pem\");\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\"Host: \".$this->getPaypalHost()));\n \n \n// curl_setopt($ch, CURLOPT_FOLLOWLOCATION, $this->follow_location);\n curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);\n \n// curl_setopt($ch, CURLOPT_HEADER, true);\n \n// if ($this->force_tls_v1) {\n// curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);\n// }\n \n $this->response = curl_exec($ch);\n $this->response_status = strval(curl_getinfo($ch, CURLINFO_HTTP_CODE));\n \n if ($this->response === false || $this->response_status == '0') {\n $errno = curl_errno($ch);\n $errstr = curl_error($ch);\n throw new \\Exception(\"cURL error: [$errno] $errstr\");\n }\n }", "function PPHttpPost($methodName_, $nvpStr_) {\n $submit_data = array(\n\t\t'METHOD' => $methodName_,\n\t\t'VERSION' => '52.0',\n\t\t'PWD' => MODULE_PAYMENT_PAYPAL_NVP_PW,\n\t\t'USER' => MODULE_PAYMENT_PAYPAL_NVP_USER_ID,\n\t\t'SIGNATURE' => MODULE_PAYMENT_PAYPAL_NVP_SIG,\n\t\t'IPADDRESS' => get_ip_address(),\n\t);\n\n\t$data = ''; // initiate XML string\n while(list($key, $value) = each($submit_data)) {\n \tif ($value <> '') $data .= '&' . $key . '=' . urlencode($value);\n }\n\t$data .= substr($data, 1) . $nvpStr_; // build the submit string\n\n\tif(\"sandbox\" === MODULE_PAYMENT_PAYPAL_NVP_TESTMODE || \"beta-sandbox\" === MODULE_PAYMENT_PAYPAL_NVP_TESTMODE) {\n\t\t$API_Endpoint = MODULE_PAYMENT_PAYPAL_NVP_SANDBOX_SIG_URL;\n\t} else {\n\t\t$API_Endpoint = MODULE_PAYMENT_PAYPAL_NVP_LIVE_SIG_URL;\n\t}\n\t// Set the curl parameters.\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t// Turn off the server and peer verification (TrustManager Concept).\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n//echo 'string = ' . $data . '<br>';\n\t$httpResponse = curl_exec($ch);\n\n\tif(!$httpResponse) {\n\t\t$messageStack->add('XML Read Error (cURL) #' . curl_errno($ch) . '. Description = ' . curl_error($ch),'error');\n\t\treturn false;\n//\t\texit(\"$methodName_ failed: \" . curl_error($ch) . '(' . curl_errno($ch) . ')');\n\t}\n\t// Extract the response details.\n\t$httpResponseAr = explode(\"&\", $httpResponse);\n\t$httpParsedResponseAr = array();\n\tforeach ($httpResponseAr as $i => $value) {\n\t\t$tmpAr = explode(\"=\", $value);\n\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t}\n\t}\n\tif (0 == sizeof($httpParsedResponseAr) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\t$messageStack->add('PayPal Response Error.','error');\n\t\treturn false;\n//\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t}\n\treturn $httpParsedResponseAr;\n }", "function ipn(){\n\t\t$paypalInfo\t= $this->input->post();\n\n\t\t$data['user_id'] = $paypalInfo['custom'];\n\t\t$data['product_id']\t= $paypalInfo[\"item_number\"];\n\t\t$data['txn_id']\t= $paypalInfo[\"txn_id\"];\n\t\t$data['payment_gross'] = $paypalInfo[\"payment_gross\"];\n\t\t$data['currency_code'] = $paypalInfo[\"mc_currency\"];\n\t\t$data['payer_email'] = $paypalInfo[\"payer_email\"];\n\t\t$data['payment_status']\t= $paypalInfo[\"payment_status\"];\n\n\t\t$paypalURL = $this->paypal_lib->paypal_url;\t\t\n\t\t$result\t= $this->paypal_lib->curlPost($paypalURL,$paypalInfo);\n\t\t\n\t\t//redirect(base_url());\n\t\t//check whether the payment is verified\n\t\tif(preg_match(\"/VERIFIED/i\",$result)){\n\t\t //insert the transaction data into the database\n\t\t\t//$this->product->insertTransaction($data);\n\t\t \n\t\t}\n }", "public function createPayment(Request $request) {\n //Setup Payer\n $payer = new Payer();\n $payer->setPaymentMethod('paypal');\n //Setup Amount\n $amount = new Amount();\n $amount->setCurrency('USD');\n $amount->setTotal($request->amount);\n //Setup Transaction\n $transaction = new Transaction();\n $transaction->setAmount($amount);\n $transaction->setDescription('Your awesome\n Product!');\n //List redirect URLS\n $redirectUrls = new RedirectUrls();\n $redirectUrls->setReturnUrl($request->return_url);\n $redirectUrls->setCancelUrl($request->return_url);\n //And finally set all the prerequisites and create the payment\n $payment = new Payment();\n\n $payment->setIntent('sale');\n $payment->setPayer($payer);\n $payment->setRedirectUrls($redirectUrls);\n $payment->setTransactions(array($transaction));\n\n $response = $payment->create($this->api_context);\n //Return our payment info to the user\n return $response;\n\n }", "function checkPaypalIps($test_ipn) {\n return;\n // Get the list of IP addresses for www.commbank.com and notify.commbank.com\n $commbank_iplist = array();\n $commbank_iplist = gethostbynamel('www.commbank.com');\n $commbank_iplist2 = array();\n $commbank_iplist2 = gethostbynamel('notify.commbank.com');\n $commbank_iplist3 = array();\n $commbank_iplist3 = array('216.113.188.202', '216.113.188.203', '216.113.188.204', '66.211.170.66');\n $commbank_iplist = array_merge($commbank_iplist, $commbank_iplist2, $commbank_iplist3);\n\n $commbank_sandbox_hostname = 'ipn.sandbox.commbank.com';\n $remote_hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);\n\n $valid_ip = false;\n\n if ($commbank_sandbox_hostname == $remote_hostname) {\n $valid_ip = true;\n $hostname = 'www.sandbox.commbank.com';\n } else {\n $ips = \"\";\n // Loop through all allowed IPs and test if the remote IP connected here\n // is a valid IP address\n if (in_array($_SERVER['REMOTE_ADDR'], $commbank_iplist)) {\n $valid_ip = true;\n }\n $hostname = 'www.commbank.com';\n }\n\n if (!$valid_ip) {\n\n\n $mailsubject = \"PayPal IPN Transaction on your site: Possible fraud\";\n $mailbody = \"Error code 506. Possible fraud. Error with REMOTE IP ADDRESS = \" . $_SERVER['REMOTE_ADDR'] . \".\n The remote address of the script posting to this notify script does not match a valid PayPal ip address\\n\n These are the valid IP Addresses: $ips\n\n The Order ID received was: $invoice\";\n $this->sendEmailToVendorAndAdmins($mailsubject, $mailbody);\n\n\n exit();\n }\n\n if (!($hostname == \"www.sandbox.commbank.com\" && $test_ipn == 1 )) {\n $res = \"FAILED\";\n $mailsubject = \"PayPal Sandbox Transaction\";\n $mailbody = \"Hello,\n A fatal error occured while processing a commbank transaction.\n ----------------------------------\n Hostname: $hostname\n URI: $uri\n A Paypal transaction was made using the sandbox without your site in Paypal-Debug-Mode\";\n //vmMail($mosConfig_mailfrom, $mosConfig_fromname, $debug_email_address, $mailsubject, $mailbody );\n $this->sendEmailToVendorAndAdmins($mailsubject, $mailbody);\n }\n }", "function submit_paypal_post() \n \t{\n // a form with hidden elements which is submitted to paypal via the \n // BODY element's onLoad attribute. We do this so that you can validate\n // any POST vars from you custom form before submitting to paypal. So \n // basically, you'll have your own form which is submitted to your script\n // to validate the data, which in turn calls this function to create\n // another hidden form and submit to paypal.\n \n // The user will briefly see a message on the screen that reads:\n // \"Please wait, your order is being processed...\" and then immediately\n // is redirected to paypal.\n\n echo \"<html>\\n\";\n echo \"<head><title>Processing Payment...</title></head>\\n\";\n echo \"<body onLoad=\\\"document.forms['paypal_form'].submit();\\\">\\n\";\n // echo \"<center><h2>Please wait, your order is being processed and you\";\n //echo \" will be redirected to the paypal website.</h2></center>\\n\";\n echo \"<form method=\\\"post\\\" name=\\\"paypal_form\\\" \";\n echo \"action=\\\"\".$this->paypal_url.\"\\\">\\n\";\n\n foreach ($this->fields as $name => $value) \n\t {\n echo \"<input type=\\\"hidden\\\" name=\\\"$name\\\" value=\\\"$value\\\"/>\\n\";\n }\n // echo \"<center><br/><br/>If you are not automatically redirected to \";\n // echo \"paypal within 5 seconds...<br/><br/>\\n\";\n // echo \"<input type=\\\"submit\\\" value=\\\"Click Here\\\"></center>\\n\";\n \n echo \"</form>\\n\";\n echo \"</body></html>\\n\";\n \n \t}", "protected function setContext()\n {\n $gateway = Omnipay::create('PayPal_Rest');\n $gateway->setClientId(Config::get('services.paypal.client_id'));\n $gateway->setSecret(Config::get('services.paypal.secret'));\n $gateway->setTestMode(Config::get('services.paypal.sandbox'));\n\n $this->apiContext = $gateway;\n }", "function get_ipn_url()\n\t{\n\t\treturn ecommerce_test_mode()?'https://www.sandbox.paypal.com/cgi-bin/webscr':'https://www.paypal.com/cgi-bin/webscr';\n\t}", "public static function processIPNrequest()\n {\n\n// STEP 1: read POST data\n// Reading POSTed data directly from $_POST causes serialization issues with array data in the POST.\n// Instead, read raw POST data from the input stream. \n $raw_post_data = file_get_contents('php://input');\n $raw_post_array = explode('&', $raw_post_data);\n $myPost = array();\n foreach ($raw_post_array as $keyval)\n {\n $keyval = explode('=', $keyval);\n if (count($keyval) == 2)\n $myPost[$keyval[0]] = urldecode($keyval[1]);\n }\n// read the IPN message sent from PayPal and prepend 'cmd=_notify-validate'\n $req = 'cmd=_notify-validate';\n if (function_exists('get_magic_quotes_gpc'))\n {\n $get_magic_quotes_exists = true;\n }\n foreach ($myPost as $key => $value)\n {\n if ($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1)\n {\n $value = urlencode(stripslashes($value));\n }\n else\n {\n $value = urlencode($value);\n }\n $req .= \"&$key=$value\";\n }\n\n\n// Step 2: POST IPN data back to PayPal to validate\n\n $ch = curl_init('https://www.paypal.com/cgi-bin/webscr');\n curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $req);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));\n\n// In wamp-like environments that do not come bundled with root authority certificates,\n// please download 'cacert.pem' from \"http://curl.haxx.se/docs/caextract.html\" and set \n// the directory path of the certificate as shown below:\n// curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem');\n if (!($res = curl_exec($ch)))\n {\n error_log(\"Got \" . curl_error($ch) . \" when processing IPN data\");\n curl_close($ch);\n exit;\n }\n curl_close($ch);\n\n $status = array();\n $status['verified'] = null;\n\n if (strcmp($res, \"VERIFIED\") == 0)\n {\n // The IPN is verified, process it\n error_log('IPN VERIFIED (NOT ERROR):' . print_r($_POST,true)); \n\n // IPN message values depend upon the type of notification sent.\n // To loop through the &_POST array and print the NV pairs to the screen:\n foreach ($_POST as $key => $value)\n {\n $status[$key] = $value; \n }\n $status['verified'] = true;\n }\n else if (strcmp($res, \"INVALID\") == 0)\n {\n // IPN invalid, log for manual investigation\n error_log('INVALID VERIFIED:' . print_r($_POST,true));\n $status['verified'] = false;\n }\n\n return $status;\n }", "abstract public function initializePayment($request_body);", "public function __construct($params, $config = array())\n {\n parent::__construct($params, $config);\n $this->mode = $params->get('paypal_mode');\n if ($this->mode)\n {\n $this->url = 'https://www.paypal.com/cgi-bin/webscr';\n }\n else\n {\n $this->url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';\n }\n $this->setParameter('business', $params->get('paypal_id'));\n $this->setParameter('rm', 2);\n $this->setParameter('cmd', '_xclick');\n $this->setParameter('no_shipping', 1);\n $this->setParameter('no_note', 1);\n $locale = $params->get('paypal_locale','');\n\n if ($locale == '')\n {\n if (JLanguageMultilang::isEnabled())\n {\n $locale = JFactory::getLanguage()->getTag();\n $locale = str_replace(\"-\",\"_\",$locale);\n }\n else\n {\n $locale = 'en_US';\n }\n }\n\n $this->setParameter('lc', $locale);\n $this->setParameter('charset', 'utf-8');\n }", "public function setupPayment($order){\r\n $response = array(\r\n 'success'=> false,\r\n 'msg'=> __('Payment failed!', ET_DOMAIN)\r\n );\r\n // write session\r\n et_write_session('order_id', $order->ID);\r\n et_write_session('processType', 'buy');\r\n $arg = apply_filters('ae_payment_links', array(\r\n 'return' => et_get_page_link('process-payment') ,\r\n 'cancel' => et_get_page_link('process-payment')\r\n ));\r\n /**\r\n * process payment\r\n */\r\n $paymentType_raw = $order->payment_type;\r\n $paymentType = strtoupper($order->payment_type);\r\n /**\r\n * factory create payment visitor\r\n */\r\n $order_data = array(\r\n 'payer' => $order->post_author,\r\n 'total' => '',\r\n 'status' => 'draft',\r\n 'payment' => $paymentType,\r\n 'paid_date' => '',\r\n 'post_parent' => $order->post_parent,\r\n 'ID'=> $order->ID,\r\n 'amount'=> $order->amount\r\n );\r\n $order_temp = new mJobOrder($order_data);\r\n $order_temp->add_product($order);\r\n $order = $order_temp;\r\n $visitor = AE_Payment_Factory::createPaymentVisitor($paymentType, $order, $paymentType_raw);\r\n // setup visitor setting\r\n $visitor->set_settings($arg);\r\n // accept visitor process payment\r\n $nvp = $order->accept($visitor);\r\n if ($nvp['ACK']) {\r\n $response = array(\r\n 'success' => $nvp['ACK'],\r\n 'data' => $nvp,\r\n 'paymentType' => $paymentType\r\n );\r\n } else {\r\n $response = array(\r\n 'success' => false,\r\n 'paymentType' => $paymentType,\r\n 'msg' => __(\"Invalid payment gateway!\", ET_DOMAIN)\r\n );\r\n }\r\n /**\r\n * filter $response send to client after process payment\r\n *\r\n * @param Array $response\r\n * @param String $paymentType The payment gateway user select\r\n * @param Array $order The order data\r\n *\r\n * @package AE Payment\r\n * @category payment\r\n *\r\n * @since 1.0\r\n * @author Dakachi\r\n */\r\n $response = apply_filters('mjob_setup_payment', $response, $paymentType, $order);\r\n return $response;\r\n }", "function makePayment($arr) {\n\t$accessToken = \"eYgzn2wfvScb1aIf3QLs\";\n\t$merchantNumber = \"T511564901\";\n\t$secretToken = \"1qcvgmCNmSvP1ikAG38uSoAPr7ePByuMcWuMWKsa\";\n\n\t$apiKey = base64_encode(\n\t\t$accessToken . \"@\" . $merchantNumber . \":\" . $secretToken\n\t);\n\n\t$checkoutUrl = \"https://api.v1.checkout.bambora.com/sessions\";\n\n\t$request = array();\n\t$request[\"order\"] = array();\n\t$request[\"order\"][\"id\"] = $arr['orderID'];\n\t$request[\"order\"][\"amount\"] = $arr['amount'];\n\t$request[\"order\"][\"currency\"] = \"NOK\";\n\n\t$request[\"url\"] = array();\n\t$request[\"url\"][\"accept\"] = $arr['acceptURL'];\n\t$request[\"url\"][\"cancel\"] = $arr['cancelURL'];\n\t$request[\"url\"][\"callbacks\"] = array();\n\t$request[\"url\"][\"callbacks\"][] = array(\"url\" => $arr['callbackURL']);\n\n\t$requestJson = json_encode($request);\n\n\t$contentLength = isset($requestJson) ? strlen($requestJson) : 0;\n\n\t$headers = array(\n\t\t'Content-Type: application/json',\n\t\t'Content-Length: ' . $contentLength,\n\t\t'Accept: application/json',\n\t\t'Authorization: Basic ' . $apiKey\n\t);\n\n\t$curl = curl_init();\n\n\tcurl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\n\tcurl_setopt($curl, CURLOPT_POSTFIELDS, $requestJson);\n\tcurl_setopt($curl, CURLOPT_URL, $checkoutUrl);\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n\tcurl_setopt($curl, CURLOPT_FAILONERROR, false);\n\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n\t$rawResponse = curl_exec($curl);\n\t$response = json_decode($rawResponse);\n\t\n\treturn $response;\n}", "public function PaypalExpressCheckout($amount)\n {\n if ( Session::get('subs_status') !== config('constants.STATUS_ACTIVE') ) {\n $return = Redirect::to('app')->with(\"failed_message\", \"Please verify account first.\");\n } else {\n $provider = new ExpressCheckout; \n\n $add_trans_query = \"SELECT pgc_halo.fn_insert_ewallet_transaction(?,?,?) as trans_id;\";\n $subscriber_id = Crypt::decrypt(Session::get('subscriber_id'));\n $add_trans_values = array($subscriber_id, $amount, \"PAYPAL\");\n $add_trans_result = DB::select($add_trans_query, $add_trans_values);\n $transaction_id = $add_trans_result[0]->trans_id;\n\n $data = [];\n $data['items'] = [\n [\n 'name' => 'E-wallet load',\n 'price' => $amount,\n 'qty' => 1\n ]\n ];\n\n $data['invoice_id'] = $transaction_id;\n $data['invoice_description'] = \"Order #\".$data['invoice_id'].\"Invoice\";\n $data['return_url'] = url('paypal/success');\n $data['cancel_url'] = url('/');\n\n $total = 0;\n\n foreach($data['items'] as $item) {\n $total += $item['price'];\n }\n\n $data['total'] = $total;\n\n $response = $provider->setExpressCheckout($data);\n if ( $response['ACK'] === \"Success\" ) {\n // Here you store it in session with session helper, with the key as transaction token.\n session()->put($response['TOKEN'], $data);\n\n $return = redirect($response['paypal_link']);\n } else {\n $upd_trans_query = \"SELECT pgc_halo.fn_update_ewallet_transaction(?,?,?,?) as trans_id;\";\n $upd_trans_values = array($transaction_id, config('constants.RESULT_ERROR'), $response['CORRELATIONID'], $response['L_ERRORCODE0']);\n DB::select($upd_trans_query, $upd_trans_values);\n $return = redirect('/');\n }\n }\n return $return;\n }", "function apiContext(){\r\n\t$apiContext = new PayPal\\Rest\\ApiContext(new PayPal\\Auth\\OAuthTokenCredential(CLIENT_ID, CLIENT_SECRET));\r\n\treturn $apiContext;\r\n}", "abstract protected function handlePayment();", "private function createPaymentRequest()\n {\n $helper = Mage::helper('pagseguro');\n\n // Get references that stored in the database\n $reference = $helper->getStoreReference();\n\n $paymentRequest = new PagSeguroPaymentRequest();\n $paymentRequest->setCurrency(PagSeguroCurrencies::getIsoCodeByName(self::REAL));\n $paymentRequest->setReference($reference . $this->order->getId()); //Order ID\n $paymentRequest->setShipping($this->getShippingInformation()); //Shipping\n $paymentRequest->setSender($this->getSenderInformation()); //Sender\n $paymentRequest->setItems($this->getItensInformation()); //Itens\n $paymentRequest->setShippingType(SHIPPING_TYPE);\n $paymentRequest->setShippingCost(number_format($this->order->getShippingAmount(), 2, '.', ''));\n $paymentRequest->setNotificationURL($this->getNotificationURL());\n $helper->getDiscount($paymentRequest);\n\n //Define Redirect Url\n $redirectUrl = $this->getRedirectUrl();\n\n if (!empty($redirectUrl) and $redirectUrl != null) {\n $paymentRequest->setRedirectURL($redirectUrl);\n } else {\n $paymentRequest->setRedirectURL(Mage::getUrl() . 'checkout/onepage/success/');\n }\n\n //Define Extra Amount Information\n $paymentRequest->setExtraAmount($this->extraAmount());\n\n try {\n $paymentUrl = $paymentRequest->register($this->getCredentialsInformation());\n } catch (PagSeguroServiceException $ex) {\n Mage::log($ex->getMessage());\n $this->redirectUrl(Mage::getUrl() . 'checkout/onepage');\n }\n\n return $paymentUrl;\n }", "function redirect_form()\n{\n global $pxpay;\n \n $request = new PxPayRequest();\n \n $http_host = getenv(\"HTTP_HOST\");\n $request_uri = getenv(\"SCRIPT_NAME\");\n $server_url = \"http://$http_host\";\n #$script_url = \"$server_url/$request_uri\"; //using this code before PHP version 4.3.4\n #$script_url = \"$server_url$request_uri\"; //Using this code after PHP version 4.3.4\n $script_url = (version_compare(PHP_VERSION, \"4.3.4\", \">=\")) ?\"$server_url$request_uri\" : \"$server_url/$request_uri\";\n $EnableAddBillCard = 1;\n \n # the following variables are read from the form\n $Quantity = $_REQUEST[\"Quantity\"];\n $MerchantReference = sprintf('%04x%04x-%04x-%04x',mt_rand(0, 0xffff),mt_rand(0, 0xffff),mt_rand(0, 0xffff),mt_rand(0, 0x0fff) | 0x4000);\n $Address1 = $_REQUEST[\"Address1\"];\n $Address2 = $_REQUEST[\"Address2\"];\n $Address3 = $_REQUEST[\"Address3\"];\n \n #Calculate AmountInput\n $AmountInput = 21.50;\n \n #Generate a unique identifier for the transaction\n $TxnId = uniqid(\"ID\");\n \n #Set PxPay properties\n $request->setMerchantReference($MerchantReference);\n $request->setAmountInput($AmountInput);\n $request->setTxnData1($Address1);\n $request->setTxnData2($Address2);\n $request->setTxnData3($Address3);\n $request->setTxnType(\"Purchase\");\n $request->setCurrencyInput(\"NZD\");\n $request->setEmailAddress(\"[email protected]\");\n $request->setUrlFail($script_url);\t\t\t# can be a dedicated failure page\n $request->setUrlSuccess($script_url);\t\t\t# can be a dedicated success page\n $request->setTxnId($TxnId);\n $request->setRecurringMode(\"recurringinitial\");\n #The following properties are not used in this case\n $request->setEnableAddBillCard($EnableAddBillCard);\n # $request->setBillingId($BillingId);\n # $request->setOpt($Opt);\n\n \n #Call makeRequest function to obtain input XML\n $request_string = $pxpay->makeRequest($request);\n #Obtain output XML\n $response = new MifMessage($request_string);\n \n #Parse output XML\n $url = $response->get_element_text(\"URI\");\n $valid = $response->get_attribute(\"valid\");\n \n #Redirect to payment page\n header(\"Location: \".$url);\n}" ]
[ "0.65956295", "0.64738125", "0.63749576", "0.63374555", "0.6289728", "0.62746257", "0.6235353", "0.61924744", "0.6148227", "0.6088291", "0.60764647", "0.5979528", "0.5969788", "0.59593517", "0.5957", "0.5949696", "0.5925887", "0.5916817", "0.59025186", "0.5896135", "0.5893855", "0.58917755", "0.58853585", "0.5883483", "0.5864426", "0.58375186", "0.5810837", "0.57749176", "0.577392", "0.57653666", "0.5759533", "0.5757359", "0.5757359", "0.57569015", "0.5719342", "0.568604", "0.56854504", "0.56683195", "0.5660013", "0.56533426", "0.56495416", "0.5646257", "0.56372887", "0.5630751", "0.5624595", "0.5620585", "0.5602289", "0.5601421", "0.55767465", "0.55748665", "0.55401164", "0.55387753", "0.5536906", "0.5531582", "0.55166644", "0.5490774", "0.54890907", "0.54882836", "0.5475387", "0.54567355", "0.5448798", "0.54438436", "0.5434028", "0.5425446", "0.5423322", "0.54218584", "0.5414107", "0.5404336", "0.5396066", "0.5392652", "0.5388099", "0.53877765", "0.538657", "0.5378396", "0.5372994", "0.53703344", "0.5369971", "0.5362011", "0.53536826", "0.5352201", "0.5339285", "0.53314644", "0.53281146", "0.53245604", "0.53201425", "0.5317895", "0.5307825", "0.5299558", "0.5284717", "0.52830863", "0.52725255", "0.5271786", "0.52693236", "0.52638113", "0.52630293", "0.5255373", "0.5245912", "0.52427804", "0.5235095", "0.5214829", "0.5213938" ]
0.0
-1
prepere & execute the payment
public function createPayment() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function processPayment();", "public function execute(){\n $paymentId = $_GET['paymentId'];\n $payment = Payment::get($paymentId, $this->_apiContext);\n $payerId = $_GET['PayerID'];\n\n // Execute payment with payer ID\n $execution = new PaymentExecution();\n $execution->setPayerId($payerId);\n \n $transaction = new Transaction();\n $amount = new Amount();\n\n $details = new Details();\n $details->setShipping(0)\n ->setTax(0)\n ->setSubtotal(Cart::subtotal());\n\n $amount->setCurrency('BRL');\n $amount->setTotal(Cart::total());\n $amount->setDetails($details);\n\n $transaction->setAmount($amount);\n\n $execution->addTransaction($transaction);\n\n try{\n // Execute payment\n $result = $payment->execute($execution, $this->_apiContext);\n \n try{\n\n $payment = Payment::get($paymentId, $this->_apiContext);\n }catch(Exception $ex){\n\n die($ex);\n }\n }catch(PayPalConnectionException $ex){\n\n echo $ex->getCode();\n echo $ex->getData();\n die($ex);\n }catch(Exception $ex){\n\n die($ex);\n }\n\n Session::flash('status', 'Pagamento realizado');\n Session::put('token-paypal', $_GET['token']);\n return redirect('/paypal/transaction/complete');\n }", "protected function doExecutePayment() {\n // This method is empty so child classes can override it and provide their\n // own implementation.\n }", "public function execute(){\n return $this->payment(); \n }", "public function payment(){\n\n\t}", "private function _proceedPayment()\n {\n $paymentInitModel = $this->_modelFactory->getModel(\n new Shopware_Plugins_Frontend_RpayRatePay_Component_Model_PaymentInit()\n );\n\n $result = $this->_service->xmlRequest($paymentInitModel->toArray());\n if (Shopware_Plugins_Frontend_RpayRatePay_Component_Service_Util::validateResponse(\n 'PAYMENT_INIT',\n $result\n )\n ) {\n Shopware()->Session()->RatePAY['transactionId'] = $result->getElementsByTagName('transaction-id')->item(\n 0\n )->nodeValue;\n $this->_modelFactory->setTransactionId(Shopware()->Session()->RatePAY['transactionId']);\n $paymentRequestModel = $this->_modelFactory->getModel(\n new Shopware_Plugins_Frontend_RpayRatePay_Component_Model_PaymentRequest()\n );\n $result = $this->_service->xmlRequest($paymentRequestModel->toArray());\n if (Shopware_Plugins_Frontend_RpayRatePay_Component_Service_Util::validateResponse(\n 'PAYMENT_REQUEST',\n $result\n )\n ) {\n $uniqueId = $this->createPaymentUniqueId();\n $orderNumber = $this->saveOrder(Shopware()->Session()->RatePAY['transactionId'], $uniqueId, 17);\n $paymentConfirmModel = $this->_modelFactory->getModel(\n new Shopware_Plugins_Frontend_RpayRatePay_Component_Model_PaymentConfirm()\n );\n $matches = array();\n preg_match(\"/<descriptor.*>(.*)<\\/descriptor>/\", $this->_service->getLastResponse(), $matches);\n $dgNumber = $matches[1];\n $result = $this->_service->xmlRequest($paymentConfirmModel->toArray());\n if (Shopware_Plugins_Frontend_RpayRatePay_Component_Service_Util::validateResponse(\n 'PAYMENT_CONFIRM',\n $result\n )\n ) {\n if (Shopware()->Session()->sOrderVariables['sBasket']['sShippingcosts'] > 0) {\n $this->initShipping($orderNumber);\n }\n try {\n $orderId = Shopware()->Db()->fetchOne(\n 'SELECT `id` FROM `s_order` WHERE `ordernumber`=?',\n array($orderNumber)\n );\n Shopware()->Db()->update(\n 's_order_attributes',\n array(\n 'RatePAY_ShopID' => Shopware()->Shop()->getId(),\n 'attribute5' => $dgNumber,\n 'attribute6' => Shopware()->Session()->RatePAY['transactionId']\n ),\n 'orderID=' . $orderId\n );\n } catch (Exception $exception) {\n Shopware()->Log()->Err($exception->getMessage());\n }\n\n //set payments status to payed\n $this->savePaymentStatus(\n Shopware()->Session()->RatePAY['transactionId'],\n $uniqueId,\n 155\n );\n\n /**\n * unset DFI token\n */\n if (Shopware()->Session()->RatePAY['devicefinterprintident']['token']) {\n unset(Shopware()->Session()->RatePAY['devicefinterprintident']['token']);\n }\n\n /**\n * if you run into problems with the redirect method then use the forwarding\n * return $this->forward('finish', 'checkout', null, array('sUniqueID' => $uniqueId));\n **/\n \n $this->redirect(\n Shopware()->Front()->Router()->assemble(\n array(\n 'controller' => 'checkout',\n 'action' => 'finish',\n 'forceSecure' => true\n )\n )\n );\n } else {\n $this->_error();\n }\n } else {\n $this->_error();\n }\n } else {\n $this->_error();\n }\n }", "public function success_payment() {\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Require the Payments interface\n require_once APPPATH . 'interfaces/Payments.php';\n\n // Verify if the get param pay-return exits\n if ( get_instance()->input->get('pay-return', TRUE) ) {\n \n $pay = get_instance()->input->get('pay-return', TRUE);\n\n if ( file_exists(APPPATH . 'payments/' . ucfirst($pay) . '.php') ) {\n\n require_once APPPATH . 'payments/' . ucfirst($pay) . '.php';\n\n // Call the class\n $pay_class = ucfirst(str_replace('-', '_', $pay));\n\n $get = new $pay_class;\n\n $get->save();\n\n } else {\n\n display_mess(47);\n\n }\n \n }\n \n }", "public function payAction()\n\t{\n\t\t$paylanedirectdebit = Mage::getSingleton(\"paylanedirectdebit/standard\");\n\t\t$data = $paylanedirectdebit->getPaymentData();\n\t\t\n\t\tif (is_null($data))\n\t\t{\n\t\t\tMage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl(\"/\"));\n\t\t}\n\t\t\n\t\techo \"Your payment is being processed...\";\n\t\t\n\t\t// connect to PayLane Direct System\t\t\n\t\t$paylane_client = new PayLaneClient();\n\t\t\n\t\t// get login and password from store config\n\t\t$direct_login = Mage::getStoreConfig('payment/paylanedirectdebit/direct_login');\n\t\t$direct_password = Mage::getStoreConfig('payment/paylanedirectdebit/direct_password');\n\t\t\n\t\t$status = $paylane_client->connect($direct_login, $direct_password);\n\t\tif ($status == false)\n\t\t{\n\t\t\t// an error message\n\t \t$paylanedirectdebit->addComment(\"Error processing your payment... Please try again later.\", true);\n\n\t \t$this->_redirect('checkout/onepage/failure');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$result = $paylane_client->multiSale($data);\n\t\tif ($result == false)\n\t\t{\n\n\t\t\t// an error message\n\t \t$paylanedirectdebit->addComment(\"Error processing your payment... Please try again later.\", true);\n\t\n\t \t$this->_redirect('checkout/onepage/failure');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (isset($result->ERROR))\n\t\t{\n\t\t\t// an error message\n\t \t$paylanedirectdebit->addComment($result->ERROR->error_description, true);\n\t\n\t \t$this->_redirect('checkout/onepage/failure');\n\t \treturn;\n\t\t}\n\t\t\n\t\tif (isset($result->OK))\n\t\t{\n\t\t\t$paylanedirectdebit->setPendingStatus($result->OK->id_sale);\n\t\n\t \tsession_write_close(); \n\t \t$this->_redirect('checkout/onepage/success');\n\t \treturn;\n\t\t}\n\t}", "function pay() {\n if($this->active_invoice->isLoaded()) {\n\n if($this->request->isSubmitted()) {\n try {\n $payment_data = $this->request->post('payment');\n $payment_gateway_id = $this->request->post('payment_gateway_id');\n\n $payment_data['payment_gateway_id'] = $payment_gateway_id;\n\n $payer_email = $payment_data['payer_email'];\n if($payer_email && is_valid_email($payer_email)) {\n $payer = Users::findByEmail($payer_email);\n if(!$payer instanceof User) {\n $payer = new AnonymousUser($payer_email, $payer_email);\n } //if\n } //if\n\n if(!$payer instanceof IUser) {\n throw new Error('Please enter valid Email address');\n } //if\n\n $this->response->assign(array(\n 'payment_data'\t=> $payment_data,\n ));\n\n $cc_number = trim($payment_data['credit_card_number']);\n if($cc_number) {\n $response = is_valid_cc($cc_number);\n if($response !== true) {\n throw new Error($response);\n }//if\n }//if\n\n $payment_data['amount'] = str_replace(\",\",\"\",$payment_data['amount']);\n\n if(!is_numeric($payment_data['amount'])) {\n throw new Error('Total amount must be numeric value');\n }//if\n\n //check if this payment can proceed\n $this->active_invoice->payments()->canMarkAsPaid($payment_data['amount']);\n\n DB::beginWork('Creating new payment @ ' . __CLASS__);\n\n if($payment_gateway_id && $payment_gateway_id > 0) {\n $active_payment_gateway = PaymentGateways::findById($payment_gateway_id);\n if(!$active_payment_gateway instanceof PaymentGateway) {\n $this->response->notFound();\n }//if\n } else {\n throw new Error('Please select preferred payment option');\n }//if\n\n //if this method exists, please check is all necessery extension loaded\n if(method_exists($active_payment_gateway, 'checkEnvironment')) {\n $active_payment_gateway->checkEnvironment();\n }//if\n\n $active_payment = $active_payment_gateway->makePayment($payment_data, $this->active_invoice->getCurrency(), $this->active_invoice);\n\n if(!$active_payment->getIsError() && $active_payment instanceof Payment) {\n\n $active_payment->setIsPublic(true);\n $active_payment->setCreatedBy($payer);\n $active_payment->setParent($this->active_invoice);\n $active_payment->setAttributes($payment_data);\n $active_payment->setStatus(Payment::STATUS_PAID);\n $active_payment->setCurrencyId($this->active_invoice->getCurrency()->getId());\n\n //if we do express checkout\n if($active_payment instanceof PaypalExpressCheckoutPayment) {\n $active_payment->setStatus(Payment::STATUS_PENDING);\n $active_payment->setReason(Payment::REASON_OTHER);\n $active_payment->setReasonText(lang('Waiting response from paypal express checkout'));\n } //if\n\n $active_payment->save();\n\n //TO-Do check this\n $this->active_invoice->payments()->changeStatus($payer, $active_payment, $payment_data);\n $this->active_invoice->activityLogs()->logPayment($payer);\n\n // Notify if not gagged\n if(!($active_payment instanceof PaypalExpressCheckoutPayment) && !$this->active_invoice->payments()->isGagged()) {\n AngieApplication::notifications()\n ->notifyAbout(PAYMENTS_FRAMEWORK . '/new_payment', $this->active_invoice)\n ->setPayment($active_payment)\n ->sendToFinancialManagers();\n }//if\n\n if($payer instanceof IUser && !$payer->isFinancialManager()) {\n AngieApplication::notifications()\n ->notifyAbout(PAYMENTS_FRAMEWORK . '/new_payment_to_payer', $this->active_invoice)\n ->setPayment($active_payment)\n ->sendToUsers($payer);\n }//if\n\n $this->active_invoice->payments()->paymentMade($active_payment);\n\n DB::commit('Payment created @ ' . __CLASS__);\n if($active_payment instanceof PaypalExpressCheckoutPayment) {\n $this->response->redirectToUrl($active_payment->getRedirectUrl());\n } //if\n } else {\n throw new Error($active_payment->getErrorMessage());\n } //if\n\n $this->response->assign(array(\n 'active_object'\t=> $this->active_invoice,\n ));\n } catch (Exception $e) {\n DB::rollback('Failed to make payment @ ' . __CLASS__);\n $this->response->assign('errors', $e);\n }//try\n } //if\n } else {\n $this->response->notFound();\n } // if\n }", "public function calculatePayment()\n {\n }", "public function process_payment() {\n\n // Saves a suggestions group\n (new MidrubBasePaymentsCollectionBraintreeHelpers\\Process)->prepare();\n\n }", "public function pay_action ()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$order_id = $_GET['osc_order_id'];\n\n\t\t\t$payment = self::get_api()->payments->create(array(\n\t\t\t\t\"amount\" => $this->get_order_total($order_id),\n\t\t\t\t\"method\" => isset($_GET['method']) ? $_GET['method'] : NULL,\n\t\t\t\t\"description\" => MODULE_PAYMENT_MOLLIE_PAYMENT_DESCRIPTION . \" \" . $order_id,\n\t\t\t\t\"redirectUrl\" => $this->get_return_url($order_id),\n\t\t\t\t\"metadata\" => array(\"order_id\" => $order_id),\n\t\t\t\t\"webhookUrl\" => $this->get_webhook_url($order_id),\n\t\t\t\t\"issuer\" => !empty($_GET['issuer']) ? $_GET['issuer'] : NULL\n\t\t\t));\n\n\t\t\t$this->log($payment->id, $payment->status, $order_id);\n\n\t\t\theader(\"Location: \" . $payment->getPaymentUrl());\n\t\t}\n\t\tcatch (Mollie_API_Exception $e)\n\t\t{\n\t\t\techo \"API call failed: \" . htmlspecialchars($e->getMessage());\n\t\t}\n\t}", "public function processPayment(){\r\n return true;\r\n }", "abstract protected function handlePayment();", "public function pay();", "public function execute()\n {\n $request = $this->getRequest()->getParams();\n $responseContent = [\n 'success' => false,\n 'redirect_url' => 'checkout/#payment',\n 'parameters' => []\n ];\n\n if(empty($request['cf_id']) === false) {\n $resultRedirect = $this->resultRedirectFactory->create();\n $orderIncrementId = $request['cf_id'];\n $order = $this->orderFactory->create()->loadByIncrementId($orderIncrementId);\n $validateOrder = $this->checkRedirectOrderStatus($orderIncrementId, $order);\n if ($validateOrder['status'] == \"SUCCESS\") {\n $mageOrderStatus = $order->getStatus();\n if($mageOrderStatus === 'pending') {\n $this->processPayment($validateOrder['transaction_id'], $order);\n }\n $this->messageManager->addSuccess(__('Your payment was successful'));\n $resultRedirect->setPath('checkout/onepage/success');\n return $resultRedirect;\n\n } else if ($validateOrder['status'] == \"CANCELLED\") {\n $this->messageManager->addWarning(__('Your payment was cancel'));\n $this->checkoutSession->restoreQuote();\n $resultRedirect->setPath('checkout/cart');\n return $resultRedirect;\n } else if ($validateOrder['status'] == \"FAILED\") {\n $this->messageManager->addErrorMessage(__('Your payment was failed'));\n $order->cancel()->save();\n $resultRedirect->setPath('checkout/onepage/failure');\n return $resultRedirect;\n } else if($validateOrder['status'] == \"PENDING\"){\n $this->checkoutSession->restoreQuote();\n $this->messageManager->addWarning(__('Your payment is pending'));\n $resultRedirect->setPath('checkout/cart');\n return $resultRedirect;\n } else{\n $this->checkoutSession->restoreQuote();\n $this->messageManager->addErrorMessage(__('There is an error. Payment status is pending'));\n $resultRedirect->setPath('checkout/cart');\n return $resultRedirect;\n }\n } else {\n $order = $this->checkoutSession->getLastRealOrder();\n $code = 400;\n \n $transactionId = $request['additional_data']['cf_transaction_id'];\n \n if(empty($transactionId) === false && $request['additional_data']['cf_order_status'] === 'PAID')\n {\n $orderId = $order->getIncrementId();\n $validateOrder = $this->validateSignature($request, $order);\n if(!empty($validateOrder['status']) && $validateOrder['status'] === true) {\n $mageOrderStatus = $order->getStatus();\n if($mageOrderStatus === 'pending') {\n $this->processPayment($transactionId, $order);\n }\n\n $responseContent = [\n 'success' => true,\n 'redirect_url' => 'checkout/onepage/success/',\n 'order_id' => $orderId,\n ];\n\n $code = 200;\n } else {\n $responseContent['message'] = $validateOrder['errorMsg'];\n }\n\n $response = $this->resultFactory->create(ResultFactory::TYPE_JSON);\n $response->setData($responseContent);\n $response->setHttpResponseCode($code);\n return $response;\n } else {\n $responseContent['message'] = \"Cashfree Payment details missing.\";\n }\n }\n\n //update/disable the quote\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $quote = $objectManager->get('Magento\\Quote\\Model\\Quote')->load($order->getQuoteId());\n $quote->setIsActive(true)->save();\n $this->checkoutSession->setFirstTimeChk('0');\n \n $response = $this->resultFactory->create(ResultFactory::TYPE_JSON);\n $response->setData($responseContent);\n $response->setHttpResponseCode($code);\n return $response;\n }", "public function execute()\n {\n try {\n $paymentResponse = $this->getRequest()->getPost();\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $messageMessenger = $objectManager->get('Magento\\Framework\\Message\\ManagerInterface');\n\n if ($paymentResponse) {\n $responseCode = (string)$paymentResponse['TURKPOS_RETVAL_Sonuc'];\n $orderId = (string)$paymentResponse['TURKPOS_RETVAL_Siparis_ID'];\n $order = $this->orderFactory->create()->load($orderId, 'increment_id');\n\n if ($this->config->isAllowDebug()) {\n $this->logger->info(__('Response from Param for order id %1', $order->getId()));\n $this->logger->info(__('Response code: %1', $responseCode));\n }\n\n if ($order->getId()) {\n if ($responseCode == self::SUCCESS_STATUS) {\n $transactionId = (string)$paymentResponse['TURKPOS_RETVAL_Islem_ID'];\n $order->getPayment()->addData([\n 'cc_trans_id' => $transactionId, \n 'tranRes' => $paymentResponse['TURKPOS_RETVAL_Sonuc_Str'],\n 'tranDate' => $paymentResponse['TURKPOS_RETVAL_Islem_Tarih'],\n 'tranAmount' => $paymentResponse['TURKPOS_RETVAL_Tahsilat_Tutari'],\n 'docId' => $paymentResponse['TURKPOS_RETVAL_Dekont_ID'],\n 'tranResponseCode' => $paymentResponse['TURKPOS_RETVAL_Banka_Sonuc_Kod'],\n ])->save();\n \n $order->getPayment()->getMethodInstance()->capture($order->getPayment(), $order->getGrandTotal());\n $redirectUrl = $this->frontendUrlBuilder->setScope($order->getStoreId())->getUrl('checkout/onepage/success');\n $messageMessenger->addSuccess($paymentResponse['TURKPOS_RETVAL_Sonuc_Str']);\n return $this->resultRedirectFactory->create()->setUrl($redirectUrl);\n } else {\n $order->getPayment()->addData([\n 'tranRes' => $paymentResponse['TURKPOS_RETVAL_Sonuc_Str'],\n 'tranDate' => $paymentResponse['TURKPOS_RETVAL_Islem_Tarih'],\n 'tranResponseCode' => $paymentResponse['TURKPOS_RETVAL_Banka_Sonuc_Kod'],\n ])->save();\n \n $order->getPayment()->setAdditionalInformation('tranRes', $order->getPayment()->getData('tranRes'));\n $order->getPayment()->setAdditionalInformation('tranDate', $order->getPayment()->getData('tranDate'));\n $order->getPayment()->setAdditionalInformation('tranResponseCode', $order->getPayment()->getData('tranResponseCode'));\n $this->paymentResource->save($order->getPayment());\n \n $redirectUrl = $this->frontendUrlBuilder->setScope($order->getStoreId())->getUrl('checkout/onepage/failure');\n $messageMessenger->addError($paymentResponse['TURKPOS_RETVAL_Sonuc_Str']);\n return $this->resultRedirectFactory->create()->setUrl($redirectUrl);\n }\n }\n }\n } catch (Exception $e) {\n $this->logger->critical($e->getMessage());\n }\n\n if ($checkoutFailPage = $this->config->getCheckoutFailurePage()) {\n $redirectUrl = $this->pageHelper->getPageUrl($checkoutFailPage);\n return $this->resultRedirectFactory->create()->setUrl($redirectUrl);\n }\n\n return $this->resultRedirectFactory->create()->setPath('checkout/onepage/failure');\n }", "public function process_payment(){\n if($this->input->server('REQUEST_METHOD') == 'POST') {\n \n // Get all field values.\n $form_fields = $this->input->post(NULL);\n \n //Set Requiered parameter to be pass to merchant payment process\n $parameter = array(\n 'schedule_id' => $form_fields['schedule_id'],\n 'exception_id' => $form_fields['exception_id'],\n 'school_id' => $form_fields['school_id'],\n 'percentage' => $form_fields['percentage'],\n 'schedule_type' => $form_fields['schedule_type'],\n 'session_name' => $form_fields['session_name'],\n 'session_id' => $form_fields['session_id'],\n 'penalty' => $form_fields['penalty'],\n 'user_id' => $form_fields['user_id'],\n 'amount' => $form_fields['amount'],\n 'revenue_head' => $form_fields['revhead']\n );\n \n //initiate pay process : Send the parameter to pay merchant\n $this->pay->process($parameter);\n \n \n }else{\n \n //Set error message for any request other than POST\n $error_msg = $this->lang->line('invalid_req_method'); \n $this->main->set_notification_message(MSG_TYPE_ERROR, $error_msg);\n \n // Redirect to payment set, showing notifiction messages if there are.\n redirect(site_url('payment/myschedule'));\n } \n \n }", "public function callbackhostedpaymentAction()\n {\n $boError = false;\n $formVariables = array();\n $model = Mage::getModel('paymentsensegateway/direct');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n $checkout = Mage::getSingleton('checkout/type_onepage');\n $session = Mage::getSingleton('checkout/session');\n $szPaymentProcessorResponse = '';\n $order = Mage::getModel('sales/order');\n $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());\n $nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\n $boCartIsEmpty = false;\n \n try\n {\n $hmHashMethod = $model->getConfigData('hashmethod');\n $szPassword = $model->getConfigData('password');\n $szPreSharedKey = $model->getConfigData('presharedkey');\n \n $formVariables['HashDigest'] = $this->getRequest()->getPost('HashDigest');\n $formVariables['MerchantID'] = $this->getRequest()->getPost('MerchantID');\n $formVariables['StatusCode'] = $this->getRequest()->getPost('StatusCode');\n $formVariables['Message'] = $this->getRequest()->getPost('Message');\n $formVariables['PreviousStatusCode'] = $this->getRequest()->getPost('PreviousStatusCode');\n $formVariables['PreviousMessage'] = $this->getRequest()->getPost('PreviousMessage');\n $formVariables['CrossReference'] = $this->getRequest()->getPost('CrossReference');\n $formVariables['Amount'] = $this->getRequest()->getPost('Amount');\n $formVariables['CurrencyCode'] = $this->getRequest()->getPost('CurrencyCode');\n $formVariables['OrderID'] = $this->getRequest()->getPost('OrderID');\n $formVariables['TransactionType'] = $this->getRequest()->getPost('TransactionType');\n $formVariables['TransactionDateTime'] = $this->getRequest()->getPost('TransactionDateTime');\n $formVariables['OrderDescription'] = $this->getRequest()->getPost('OrderDescription');\n $formVariables['CustomerName'] = $this->getRequest()->getPost('CustomerName');\n $formVariables['Address1'] = $this->getRequest()->getPost('Address1');\n $formVariables['Address2'] = $this->getRequest()->getPost('Address2');\n $formVariables['Address3'] = $this->getRequest()->getPost('Address3');\n $formVariables['Address4'] = $this->getRequest()->getPost('Address4');\n $formVariables['City'] = $this->getRequest()->getPost('City');\n $formVariables['State'] = $this->getRequest()->getPost('State');\n $formVariables['PostCode'] = $this->getRequest()->getPost('PostCode');\n $formVariables['CountryCode'] = $this->getRequest()->getPost('CountryCode');\n \n if(!PYS_PaymentFormHelper::compareHostedPaymentFormHashDigest($formVariables, $szPassword, $hmHashMethod, $szPreSharedKey))\n {\n $boError = true;\n $szNotificationMessage = \"The payment was rejected for a SECURITY reason: the incoming payment data was tampered with.\";\n Mage::log(\"The Hosted Payment Form transaction couldn't be completed for the following reason: [\".$szNotificationMessage. \"]. Form variables: \".print_r($formVariables, 1));\n }\n else\n {\n $paymentsenseOrderId = Mage::getSingleton('checkout/session')->getPaymentsensegatewayOrderId();\n $szOrderStatus = $order->getStatus();\n $szStatusCode = $this->getRequest()->getPost('StatusCode');\n $szMessage = $this->getRequest()->getPost('Message');\n $szPreviousStatusCode = $this->getRequest()->getPost('PreviousStatusCode');\n $szPreviousMessage = $this->getRequest()->getPost('PreviousMessage');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n \n if($szOrderStatus != 'pys_paid' &&\n $szOrderStatus != 'pys_preauth')\n {\n $checkout->saveOrderAfterRedirectedPaymentAction(true,\n $this->getRequest()->getPost('StatusCode'),\n $this->getRequest()->getPost('Message'),\n $this->getRequest()->getPost('PreviousStatusCode'),\n $this->getRequest()->getPost('PreviousMessage'),\n $this->getRequest()->getPost('OrderID'),\n $this->getRequest()->getPost('CrossReference'));\n }\n else \n {\n // cart is empty\n $boCartIsEmpty = true;\n $szPaymentProcessorResponse = null;\n \n // chek the StatusCode as the customer might have just clicked the BACK button and re-submitted the card details\n // which can cause a charge back to the merchant\n $this->_fixBackButtonBug($szOrderID, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage);\n }\n }\n }\n catch (Exception $exc)\n {\n $boError = true;\n $szNotificationMessage = Paymentsense_Paymentsensegateway_Model_Common_GlobalErrors::ERROR_183;\n Mage::logException($exc);\n }\n \n $szPaymentProcessorResponse = $session->getPaymentprocessorresponse();\n if($boError)\n {\n if($szPaymentProcessorResponse != null &&\n $szPaymentProcessorResponse != '')\n {\n $szNotificationMessage = $szNotificationMessage.'<br/>'.$szPaymentProcessorResponse;\n }\n \n $model->setPaymentAdditionalInformation($order->getPayment(), $this->getRequest()->getPost('CrossReference'));\n //$order->getPayment()->setTransactionId($this->getRequest()->getPost('CrossReference'));\n \n if($nVersion >= 1410)\n {\n if($order)\n {\n $orderState = 'pending_payment';\n $orderStatus = 'pys_failed_hosted_payment';\n $order->setCustomerNote(Mage::helper('paymentsensegateway')->__('Hosted Payment Failed'));\n $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);\n $order->save();\n }\n }\n if($nVersion == 1324 || $nVersion == 1330)\n {\n Mage::getSingleton('checkout/session')->addError($szNotificationMessage);\n }\n else \n {\n Mage::getSingleton('core/session')->addError($szNotificationMessage);\n }\n $order->save();\n \n $this->_clearSessionVariables();\n $this->_redirect('checkout/onepage/failure');\n }\n else\n {\n // set the quote as inactive after back from paypal\n Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();\n\n if($boCartIsEmpty == false)\n {\n // send confirmation email to customer\n if($order->getId())\n {\n $order->sendNewOrderEmail();\n }\n \n if($nVersion >= 1410)\n {\n // TODO : no need to remove stock item as the system will do it in 1.6 version\n if($nVersion < 1600)\n {\n $model->subtractOrderedItemsFromStock($order);\n }\n $this->_updateInvoices($order, $szPaymentProcessorResponse);\n }\n \n if($nVersion != 1324 && $nVersion != 1330)\n {\n if($szPaymentProcessorResponse != '')\n {\n Mage::getSingleton('core/session')->addSuccess($szPaymentProcessorResponse);\n }\n }\n }\n \n $this->_redirect('checkout/onepage/success', array('_secure' => true));\n }\n }", "function _postPayment($data)\n {\n $vars = new JObject();\n //\n $order_id = $data['order_id'];\n JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_k2store/tables');\n $orderpayment = JTable::getInstance('Orders', 'Table');\n @$orderpayment->load(array('order_id' => $order_id));\n //\n try {\n if (!$orderpayment)\n throw new Exception('order_not_found');\n\n if ($data['Status'] != 'OK')\n throw new Exception('cancel_return', 1); // 1 == payment failed exception\n\n $MerchantID = $this->params->get('merchant_id');\n $Amount = $this->zarinpalAmount($orderpayment->get('orderpayment_amount'));\n $Authority = $data['Authority'];\n\n $verifyContext = compact('MerchantID', 'Amount', 'Authority');\n $verify = $this->zarinpalRequest('verification', $verifyContext);\n\n if (!$verify)\n throw new Exception('connection_error');\n\n $status = $verify->Status;\n if ($status != 100)\n throw new Exception('status_' . $status);\n\n // status == 100\n $RefID = $verify->RefID;\n\n $orderpayment->transaction_id = $RefID;\n $orderpayment->order_state = JText::_('K2STORE_CONFIRMED'); // CONFIRMED\n $orderpayment->order_state_id = 1; // CONFIRMED\n $orderpayment->transaction_status = 'Completed';\n\n $vars->RefID = $RefID;\n $vars->orderID = $order_id;\n $vars->id = $orderpayment->id;\n if ($orderpayment->save()) {\n JLoader::register('K2StoreHelperCart', JPATH_SITE . '/components/com_k2store/helpers/cart.php');\n // remove items from cart\n K2StoreHelperCart::removeOrderItems($order_id);\n\n // let us inform the user that the payment is successful\n require_once(JPATH_SITE . '/components/com_k2store/helpers/orders.php');\n try{\n @K2StoreOrdersHelper::sendUserEmail(\n $orderpayment->user_id,\n $orderpayment->order_id,\n $orderpayment->transaction_status,\n $orderpayment->order_state,\n $orderpayment->order_state_id\n );\n } catch (Exception $e) {\n // do nothing\n // prevent phpMailer exception\n }\n }\n } catch (Exception $e) {\n $orderpayment->order_state = JText::_('K2STORE_PENDING'); // PENDING\n $orderpayment->order_state_id = 4; // PENDING\n if ($e->getCode() == 1) { // 1 => trnsaction canceled\n $orderpayment->order_state = JText::_('K2STORE_FAILED'); // FAILED\n $orderpayment->order_state_id = 3; //FAILED\n }\n $orderpayment->transaction_status = 'Denied';\n $orderpayment->save();\n $vars->error = $this->zarinpalTranslate($e->getMessage());\n }\n\n $html = $this->_getLayout('postpayment', $vars);\n return $html;\n }", "public function payment(){\n\t\t$_POST['reference'] = date('NWHis');\n\t\techo json_encode($this->pagseguro->doPayment($_POST));\n\t}", "public function execute()\n {\n try{\n $order = $this->checkoutSession->getLastRealOrder();\n if(!$order){\n $msg = __('Order not found.');\n $this->redpayPayHelper->addTolog('error', $msg);\n $this->_redirect('checkout/cart');\n return;\n }\n $payment = $order->getPayment();\n if(!isset($payment) || empty($payment)){\n $this->redpayPayHelper->addTolog('error', 'Order Payment is empty');\n $this->_redirect('checkout/cart');\n return;\n }\n $method = $order->getPayment()->getMethod();\n $methodInstance = $this->paymentHelper->getMethodInstance($method);\n if($methodInstance instanceof \\Redpayments\\Magento2\\Model\\AbstractPayment){\n $redirectUrl = $methodInstance->startTransaction($order);\n /**\n * @var Http $response\n */\n if('redpayments_alipay' === $method){\n echo $redirectUrl;\n }else if('redpayments_wechatpay' === $method){\n if(Utils::isMobile()){\n if(Utils::isWeixin() === false){\n die('Please open the page within Wechat');\n }\n $response = $this->getResponse();\n $response->setRedirect($redirectUrl);\n }else{\n $response = $this->getResponse();\n $wechatWebUrl = '';\n if ($this->redpayPayHelper->getIsDev()) {\n $wechatWebUrl = 'https://dev-web.redpayments.com.au/';\n } else {\n $wechatWebUrl = 'https://web.redpayments.com.au/';\n }\n $wechatWebUrl = $wechatWebUrl . '?mchNo=' . $this->redpayPayHelper->getMchNo();\n $wechatWebUrl = $wechatWebUrl . '&mchOrderNo=' . $order->getId();\n $wechatWebUrl = $wechatWebUrl . '&qrCode=' . \\urlencode($redirectUrl);\n $response->setRedirect($wechatWebUrl);\n }\n }else{\n echo 'Unsupported payment method';\n }\n }else{\n $msg = __('Paymentmethod not found.');\n $this->messageManager->addErrorMessage($msg);\n $this->redpayPayHelper->addTolog('error', $msg);\n $this->checkoutSession->restoreQuote();\n $this->_redirect('checkout/cart');\n }\n }catch(\\Exception $e){\n $this->messageManager->addExceptionMessage(\n $e, __($e->getMessage())\n );\n $this->redpayPayHelper->addTolog('error', $e->getMessage());\n $this->checkoutSession->restoreQuote();\n $this->_redirect('checkout/cart');\n }\n }", "public function executeSubmit()\n {\n echo \"OK\";\n\n //compare security token\n //$security_code = \"paymentasia\";\n $security_code = \"sayyestomaximtrader\";\n If (md5($_POST[\"orderRef\"] . $_POST[\"successcode\"] . $_POST[\"amount\"] . $security_code) == $_POST[\"token\"]) {\n if ($_POST[\"successcode\"] == \"0\") {\n // Transaction Accepted\n // *** Add the Security Control here, to check the currency, amount with the merchant's order\n // reference from your database, if the order exist then accepted.\n // Update your database for Transaction Accepted and send email or notify your customer .\n echo \"success\";\n } else {\n // Transaction Rejected\n // Update your database for Transaction Rejected\n echo \"rejected\";\n }\n }\n }", "public function payment_scripts() {\n \n\t\t\n \n\t \t}", "function successpayment()\n {\n\n /* Check for allowed IP */\n if ($this->config['allow_ip']) {\n $allowed_ip = explode(',', $this->config['allow_ip']);\n $valid_ip = in_array($_SERVER['REMOTE_ADDR'], $allowed_ip);\n if (!$valid_ip) {\n // TODO log\n return false;\n }\n }\n\n $response['orderId'] = $_POST['orderId'];\n $response['serviceName'] = $_POST['serviceName'];\n $response['eshopAccount'] = $_POST['eshopAccount'];\n $response['paymentStatus'] = $_POST['paymentStatus'];\n $response['userName'] = $_POST['userName'];\n $response['userEmail'] = $_POST['userEmail'];\n $response['paymentData'] = $_POST['paymentData'];\n $response['hash'] = $_POST['hash'];\n\n if (!empty($response['hash'])) {\n\n $order = uc_order_load($response['orderId']);\n if (!count($order))\n trigger_error('RBK Money : Полученный orderId (' . $response['orderId'] . ') не найден в базе', E_USER_WARNING);\n\n $string = $this->config['eshopId'] . '::' . $response['orderId'] . '::' . $response['serviceName'] . '::' . $response['eshopAccount'] . '::' . number_format($order->order_total, 2, '.', '') . '::' . $this->config['recipientCurrency'] . '::' . $response['paymentStatus'] . '::' . $response['userName'] . '::' . $response['userEmail'] . '::' . $response['paymentData'] . '::' . $this->config['secretKey'];\n $crc = md5($string);\n\n if ($response['hash'] == $crc) {\n list($dataBill) = $this->qs('*', array('id' => $response['orderId']));\n switch ($response['paymentStatus']) {\n case self::STATUS_PROCESS:\n $this->owner->payTransaction($dataBill['owner_id'], PAY_PAID);\n /*uc_order_update_status($response['orderId'], 'processing');\n uc_order_comment_save($response['orderId'], $order->uid, t('RBK Money: payment processing'), $type = 'admin', $status = 1, $notify = FALSE);*/\n break;\n case self::STATUS_SUCCESS:\n $this->owner->payTransaction($dataBill['owner_id'], PAY_PAID);\n /*uc_payment_enter($response['orderId'], 'RBK Money', $order->order_total, $order->uid, NULL, NULL);\n uc_cart_complete_sale($order);\n uc_order_comment_save($response['orderId'], $order->uid, t('RBK Money: payment successful'), $type = 'admin', $status = 1, $notify = FALSE);*/\n break;\n }\n } elseif ($response['hash'] !== $crc) {\n /*uc_order_update_status($response['orderId'], 'canceled');\n uc_order_comment_save($response['orderId'], $order->uid, t('MD5 checksum fail, possible fraud. Order canceled'), $type = 'admin', $status = 1, $notify = FALSE);\n watchdog('uc_rbkmoney', 'MD5 checksum fail, possible fraud. Order canceled');*/\n trigger_error('RBK Money : Полученный hash не верный', E_USER_WARNING);\n }\n }\n }", "protected function processPayment() {\n\t\t$this->renderResponse( $this->adapter->doPayment() );\n\t}", "protected function processPayment() {\n\t\t$this->renderResponse( $this->adapter->doPayment() );\n\t}", "function toPay()\r\n {\r\n try {\r\n $this->mKart->setPaidKart();\r\n }catch(Exception $e){\r\n $this->error->throwException('310', 'No s`ha pogut realitzar el pagament.', $e);\r\n }\r\n }", "public function process_payment() {\n\n\n global $admin_settings;\n\n check_ajax_referer( 'kp-korapay-pay-nonce', 'kp_sec_code' );\n\n $tx_ref = $_POST['reference'];\n $status = $_POST['status'];\n $secret_key = $admin_settings->get_option_value( 'secret_key' );\n $amount=$_POST['amount'];\n $args = array(\n 'post_type' => 'payment_list',\n 'post_status' => 'publish',\n 'post_title' => $tx_ref,\n );\n\n $payment_record_id = wp_insert_post( $args, true );\n\n if ( ! is_wp_error( $payment_record_id )) {\n\n $post_meta = array(\n '_kp_korapay_payment_amount' => 'NGN'.' '.$_POST['amount'],\n '_kp_korapay_payment_fullname' => $_POST['first_name'].' '.$_POST['last_name'],\n '_kp_korapay_payment_customer' => $_POST['email'],\n '_kp_korapay_payment_status' => $status,\n '_kp_korapay_payment_tx_ref' => $tx_ref,\n );\n\n $this->_add_post_meta( $payment_record_id, $post_meta );\n\n }\n $redirect_url_key = $status === 'success' ? 'success_redirect_url' : 'failed_redirect_url';\n\n echo json_encode( array( 'status' => $status, 'redirect_url' => $admin_settings->get_option_value( $redirect_url_key ) ) );\n\n die();\n\n }", "public function success_payment(){\n\n\t\tif ( !empty( $_GET['paymentId'] ) && !empty( $_GET['PayerID'] ) ) {\n\n\t\t\ttry{\n\t\t\t\t$result = $this->paypal->execute_payment( $_GET['paymentId'], $_GET['PayerID'] );\n\t\t\t\t$result = json_decode($result, true);\n\t\t\t\t$paidAmount = $result['transactions'][0]['amount']['total'];\n\t\t\t\t\n\t\t\t\tif ($this->advertiser_model->check_exist($paymentId) == FALSE)\n\t\t\t\t{\n\t\t\t\t\t$user=$this->advertiser_model->get_advertiser_by_id($_SESSION['id']);\n\t\t\t\t\t$previous_bal = $user['account_bal'];\n\t\t\t\t\t$new_bal = $paidAmount+$previous_bal;\n\t\t\t\t\t$this->advertiser_model->credit_balance(array('account_bal' =>$new_bal ));\n\t\t\t\t\t$this->advertiser_model->insert_to_payment_record(array('method'=>'paypal',\n\t\t\t\t\t'payment_type'=>'deposit','amount'=> $paidAmount,'user_type'=>'advertiser','user_id' => $_SESSION['id'],\n\t\t\t\t\t'time'=>time(), 'txn_id'=>$_GET['paymentId'], 'payer_id'=>$_GET['PayerID'], 'payment_token'=>$_GET['token']));\n\n\n\t\t\t\t\t$_SESSION['action_status_report'] =\"<span class='w3-text-green'>Payment Successfully Processed</span>\";\n\t\t\t\t\t$this->session->mark_as_flash('action_status_report');\n\t\t\t\t\tshow_page(\"advertiser_dashboard/payment\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$_SESSION['action_status_report'] =\"<span class='w3-text-red'>Payment Failed. The transaction already exist.</span>\";\n\t\t\t\t\t$this->session->mark_as_flash('action_status_report');\n\t\t\t\t\tshow_page(\"advertiser_dashboard/payment\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t$_SESSION['action_status_report'] =\"<span class='w3-text-red'>Payment Failed. Error is: \" . $e->getMessage() . \"</span>\";\n\t\t\t\t$this->session->mark_as_flash('action_status_report');\n\t\t\t\tshow_page(\"advertiser_dashboard/payment\");\n\t\t\t}\n\n\t\t}\n\n\t\treturn;\n\n\t}", "public function execute() {\r\n \r\n $resultRedirect = $this->getResultRedirect();\r\n $paymentToken = $this->getRequest()->getParam('cko-payment-token');\r\n $quote = $this->session->getQuote();\r\n \r\n try {\r\n $response = $this->verifyPaymentService->verifyPayment($paymentToken);\r\n $cardToken = $response['card']['id'];\r\n \r\n if(isset($response['description']) && $response['description'] == 'Saving new card'){\r\n return $this->vaultCardAfterThreeDSecure( $response );\r\n }\r\n \r\n $this->validateQuote($quote);\r\n $this->assignGuestEmail($quote, $response['email']);\r\n\r\n if($response['status'] === 'Declined') {\r\n throw new LocalizedException(__('The transaction has been declined.'));\r\n }\r\n\r\n $this->orderService->execute($quote, $cardToken, []);\r\n\r\n return $resultRedirect->setPath('checkout/onepage/success', ['_secure' => true]);\r\n } catch (\\Exception $e) {\r\n $this->messageManager->addExceptionMessage($e, $e->getMessage());\r\n }\r\n \r\n return $resultRedirect->setPath('checkout/cart', ['_secure' => true]);\r\n }", "public function processPayment() {\n\n\t\t//create the GTPayConnector instance\n\t\t$gtpayConnector = new GTPayConnector();\n\n\t\t//create the VpcConfig instance\n\t\t$vpcConfig = new VpcConfig();\n\n\t\t//get the vpc xml object\n\t\t$vpcXMLConf = \"\";\n\t\t$vpcXMLConf = $vpcConfig->loadVpcConfig();\n\n\t\t// confirm that the configurations of vpc were loaded;\n\t\tif($vpcXMLConf == null) {\n\n\t\t\t//go to the error interface\n\t\t\t$data['error_msg'] = \"Could not Load the Virtual Payment client Details\";\n\t\t\t$data['page_titile'] = \"xxOnline shoe | error\";\n\t\t\t$data['responseData'] = \"\";\n\n\t\t\t$this->load->view(\"error-page\", $data);\n\t\t\t$this->load->view(\"partials/footer\");\n\t\t\treturn;\n\t\t}\n\n\t\t//get the vpc details\n\t\t$vpcUrl = $vpcConfig->getVpcURL($vpcXMLConf);\n\t\t$vpcSalt = $vpcConfig->getVpvSalt($vpcXMLConf);\n\t\t$vpcSaltType = $vpcConfig->getVpcSaltType($vpcXMLConf);\n\t\t$marchantcode = $vpcConfig->getCustomerCode($vpcXMLConf);\n\n\t\t//the transaction log\n\t\t$transactionLog = array();\n\n\t\t// set the salt\n\t\t$gtpayConnector->setSalt($vpcSalt);\n\n\t\t//remove the data that you dont need to send to the payment client\n\t\tunset($_POST['shoeimage']);\n\t\tunset($_POST['submit']);\n\t\t// add the customer code to the post data\n\t\t$_POST['gtp_CustomerCode'] = $marchantcode;\n\n\t\t//sort the post data before encrypting\n\t\tksort($_POST);\n\n\t\t//add the Virtual Payment Client post data to the transaction data\n\t\tforeach ($_POST as $key => $value) {\n\t\t\t\n\t\t\tif(strlen($value) > 0) {\n\t\t\t\t$gtpayConnector->addTransactionFields($key, $value);\n\n\t\t\t\t// add the post data to the transactionLog\n\t\t\t\t$transactionLog[$key] = $value;\n\t\t\t}\n\t\t}\n\t\t//get the date and time when the payment request is made\n\t\t$date = new DateTime();\n\t\t$date->setTimeZone(new DateTimeZone('UTC'));\n\t\t$transactionDate = $date->format('Y-m-d\\TH-i-s\\Z');\n\n\t\t//add the date of the transaction\n\t\t$transactionLog[\"transactDate\"] = $transactionDate;\n\n\t\t//log the trasaction on your database\n\t\t$this->transactions->logTransaction($transactionLog);\n\n\t\t// set the salt type\n\t\t$gtpayConnector->setSaltType($vpcSaltType);\n\n\t\t// make oneway hash of the Transaction and add it to the digital order\n\t\t$transactionHash = $gtpayConnector->hashAllTransactionData();\n\n\t\t$gtpayConnector->addTransactionFields(\"gtp_TransDate\", $transactionDate);\n\t\t$gtpayConnector->addTransactionFields(\"gtp_SecureHash\", $transactionHash);\n\t\t$gtpayConnector->addTransactionFields(\"gtp_SecureHashType\", $vpcSaltType);\n\n\t\t//obtain the redirection url\n\t\t$vpcUrl = $gtpayConnector->getDigitalOrderURL($vpcUrl);\n\n\t\t// send the payment request\n\t\theader(\"Location: \".$vpcUrl);\n\t}", "function execute() {\n\t\t$guest = false;\n\t\t$this->defineProperties();\n\t\tif (!df_checkout_h()->canOnepageCheckout()) {\n\t\t\techo json_encode(['error' => 0, 'msg' => '', 'redirect' => $this->_url->getUrl('quotation/quote')]);\n\t\t\texit;\n\t\t}\n\t\t// Validate checkout\n\t\t$quote = $this->getOnepage()->getQuote();\n\t\tif (!$quote->hasItems() || $quote->getHasError() || !$quote->validateMinimumAmount()) {\n\t\t\techo json_encode(['error' => 0, 'msg' => '', 'redirect' => $this->_url->getUrl('quotation/quote')]);\n\t\t\texit;\n\t\t}\n\t\t$isLoggedIn = $this->_customerSession->isLoggedIn();\n\t\tif (!$isLoggedIn) {\n\t\t\tif (isset($_POST['register_new_account'])) {\n\t\t\t\t$isGuest = $this->getRequest()->getPost('register_new_account');\n\t\t\t\tif ($isGuest == '1' || $this->_dataHelper->haveProductDownloadable()) {\n\t\t\t\t\t// If checkbox register_new_account checked or exist downloadable product, create new account\n\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('register');\n\t\t\t\t\t$storeManager = $this->_objectManager->get('Magento\\Store\\Model\\StoreManagerInterface');\n\t\t\t\t\t// Preparing data for new customer\n\t\t\t\t\t$customer = $this->_objectManager->get('Magento\\Customer\\Model\\CustomerFactory')->create();\n\t\t\t\t\t$customer->setWebsiteId($storeManager->getWebsite()->getId())\n\t\t\t\t\t\t->setEmail(isset($_POST['billing']['email']) ? $_POST['billing']['email'] : '')\n\t\t\t\t\t\t->setPrefix(isset($_POST['billing']['prefix']) ? $_POST['billing']['prefix'] : '')\n\t\t\t\t\t\t->setFirstname(isset($_POST['billing']['firstname']) ? $_POST['billing']['firstname'] : '')\n\t\t\t\t\t\t->setLastname(isset($_POST['billing']['lastname']) ? $_POST['billing']['lastname'] : '')\n\t\t\t\t\t\t->setMiddlename(isset($_POST['billing']['middlename']) ? $_POST['billing']['middlename'] : '')\n\t\t\t\t\t\t->setSuffix(isset($_POST['billing']['suffix']) ? $_POST['billing']['suffix'] : '')\n\t\t\t\t\t\t->setDob(isset($_POST['dob']) ? $_POST['dob'] : '')\n\t\t\t\t\t\t->setTaxvat(isset($_POST['billing']['taxvat']) ? $_POST['billing']['taxvat'] : '')\n\t\t\t\t\t\t->setGender(isset($_POST['billing']['gender']) ? $_POST['billing']['gender'] : '')\n\t\t\t\t\t\t->setPassword(isset($_POST['billing']['customer_password']) ? $_POST['billing']['customer_password'] : '');\n\t\t\t\t\t// Set customer information to quote\n\t\t\t\t\t$quote->setCustomer($customer->getDataModel())->setPasswordHash($customer->getPasswordHash());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('guest');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Fix for persistent\n\t\t\t\tif (\n\t\t\t\t\t$this->getCheckout()->getPersistentRegister() && $this->getCheckout()->getPersistentRegister() == \"register\"\n\t\t\t\t) {\n\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('register');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!$this->_dataHelper->getStoreConfig('onestepcheckout/general/allowguestcheckout')\n\t\t\t\t\t\t|| !$this->_dataHelper->getStoreConfig('checkout/options/guest_checkout')\n\t\t\t\t\t\t|| $this->_dataHelper->haveProductDownloadable()\n\t\t\t\t\t) {\n\t\t\t\t\t\t$storeManager = $this->_objectManager->get('Magento\\Store\\Model\\StoreManagerInterface');\n\t\t\t\t\t\t// Preparing data for new customer\n\t\t\t\t\t\t$customer = $this->_objectManager->get(\n\t\t\t\t\t\t\t'Magento\\Customer\\Model\\CustomerFactory'\n\t\t\t\t\t\t)->create();\n\t\t\t\t\t\t$guest = false;\n\t\t\t\t\t\t$email = isset($_POST['billing']['email']) ? $_POST['billing']['email'] : '';\n\t\t\t\t\t\tif ($email) {\n\t\t\t\t\t\t\t$customer1 = $this->_objectManager->get(\n\t\t\t\t\t\t\t\t'Magento\\Customer\\Model\\CustomerFactory'\n\t\t\t\t\t\t\t)->create();\n\t\t\t\t\t\t\t$customer1->loadByEmail($email);\n\t\t\t\t\t\t\tif ($customer1->getId()) {\n\t\t\t\t\t\t\t\t$customer->setEntityId($customer1->getEntityId());\n\t\t\t\t\t\t\t\tif (!$customer1->getPasswordHash()) {\n\t\t\t\t\t\t\t\t\t$customer->setEntityId($customer1->getEntityId());\n\t\t\t\t\t\t\t\t\t$this->_customerSession->setCustomerId($customer1->getEntityId());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t$password = isset($_POST['billing']['customer_password']) ? $_POST['billing']['customer_password'] : '';\n\t\t\t\t\t\t\t\t\t$accountManagement = $this->_objectManager->get('Magento\\Customer\\Api\\AccountManagementInterface');\n\t\t\t\t\t\t\t\t\t$accountManagement->authenticate($email, $password);\n\t\t\t\t\t\t\t\t\t$guest = true;\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\tif (!$guest) {\n\t\t\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('register');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('guest');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$customer->setWebsiteId($storeManager->getWebsite()->getId())\n\t\t\t\t\t\t\t->setEmail(isset($_POST['billing']['email']) ? $_POST['billing']['email'] : '')\n\t\t\t\t\t\t\t->setPrefix(isset($_POST['billing']['prefix']) ? $_POST['billing']['prefix'] : '')\n\t\t\t\t\t\t\t->setFirstname(isset($_POST['billing']['firstname']) ? $_POST['billing']['firstname'] : '')\n\t\t\t\t\t\t\t->setLastname(isset($_POST['billing']['lastname']) ? $_POST['billing']['lastname'] : '')\n\t\t\t\t\t\t\t->setMiddlename(isset($_POST['billing']['middlename']) ? $_POST['billing']['middlename'] : '')\n\t\t\t\t\t\t\t->setSuffix(isset($_POST['billing']['suffix']) ? $_POST['billing']['suffix'] : '')\n\t\t\t\t\t\t\t->setDob(isset($_POST['dob']) ? $_POST['dob'] : '')\n\t\t\t\t\t\t\t->setTaxvat(isset($_POST['billing']['taxvat']) ? $_POST['billing']['taxvat'] : '')\n\t\t\t\t\t\t\t->setGender(isset($_POST['billing']['gender']) ? $_POST['billing']['gender'] : '')\n# 2021-05-26 Dmitry Fedyuk https://www.upwork.com/fl/mage2pro\n# @todo \"«empty password in vendor/magento/framework/Encryption/Encryptor.php on line 591»\n# on a quotecheckout/index/updateordermethod request\": https://github.com/canadasatellite-ca/site/issues/127\n\t\t\t\t\t\t\t->setPassword(isset($_POST['billing']['customer_password']) ? $_POST['billing']['customer_password'] : '');\n\t\t\t\t\t\t// Set customer information to quote\n\t\t\t\t\t\t$quote->setCustomer($customer->getDataModel())->setPasswordHash($customer->getPasswordHash());\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('guest');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Save billing address\n\t\tif ($this->getRequest()->isPost()) {\n\t\t\t$billingData = $this->_dataHelper->filterdata(\n\t\t\t\t$this->getRequest()->getPost('billing', []),\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tif ($isLoggedIn) {\n\t\t\t\t$this->saveAddress('billing', $billingData);\n\t\t\t}\n\t\t\t$customerAddressId = $this->getRequest()->getPost('billing_address_id', false);\n\t\t\tif ($this->getRequest()->getPost('billing_address_id') != \"\"\n\t\t\t\t&& (!isset($billingData['save_in_address_book'])\n\t\t\t\t\t|| (isset($billingData['save_in_address_book']) && $billingData['save_in_address_book']) == 0)\n\t\t\t) {\n\t\t\t\t$customerAddressId = \"\";\n\t\t\t}\n\t\t\tif ($isLoggedIn\n\t\t\t\t&& (isset($billingData['save_in_address_book']) && $billingData['save_in_address_book'] == 1)\n\t\t\t\t&& !$this->_dataHelper->getStoreConfig('onestepcheckout/addfield/addressbook')\n\t\t\t) {\n\t\t\t\t$customerAddressId = $this->getDefaultAddress('billing');\n\t\t\t}\n\t\t\tif (isset($billingData['email'])) {\n\t\t\t\t$billingData['email'] = trim($billingData['email']);\n\t\t\t\tif ($this->_dataHelper->isSubscriberByEmail($billingData['email'])) {\n\t\t\t\t\tif ($this->getRequest()->getParam('subscribe_newsletter') == '1') {\n\t\t\t\t\t\tif ($isLoggedIn) {\n\t\t\t\t\t\t\t$customer = $this->_customerSession->getCustomer();\n\t\t\t\t\t\t\t$this->_objectManager->get(\n\t\t\t\t\t\t\t\t'Magento\\Newsletter\\Model\\SubscriberFactory'\n\t\t\t\t\t\t\t)->create()->subscribeCustomerById($customer->getId());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->saveSubscriber($billingData['email']);\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$address = $this->_objectManager->get('Magento\\Quote\\Model\\Quote\\Address');\n\t\t\tif ($customerAddressId) {\n\t\t\t\t$addressData = $this->_objectManager->get('Magento\\Customer\\Api\\AddressRepositoryInterface')\n\t\t\t\t\t->getById($customerAddressId)\n\t\t\t\t\t->__toArray();\n\t\t\t\t$billingData = array_merge($billingData, $addressData);\n\t\t\t}\n\t\t\t$address->setData($billingData);\n\t\t\t$this->getOnepage()->getQuote()->setBillingAddress($address);\n\t\t\tif (isset($billingData['save_into_account'])\n\t\t\t\t&& intval($billingData['save_into_account']) == 1\n\t\t\t\t&& $isLoggedIn\n\t\t\t) {\n\t\t\t\t$this->setAccountInfoSession($billingData);\n\t\t\t}\n\t\t}\n\t\t// Save shipping address\n\t\t$isclick = $this->getRequest()->getPost('ship_to_same_address');\n\t\t$ship = \"billing\";\n\t\tif ($isclick != '1') {\n\t\t\t$ship = \"shipping\";\n\t\t}\n\t\tif ($this->getRequest()->getPost()) {\n\t\t\t$shippingData = $this->_dataHelper->filterdata($this->getRequest()->getPost($ship, []), false);\n\t\t\tif ($isLoggedIn && !$isclick) {\n\t\t\t\t$this->saveAddress('shipping', $shippingData);\n\t\t\t}\n\t\t\tif ($isclick == '1') {\n\t\t\t\t$shippingData['same_as_billing'] = 1;\n\t\t\t}\n\t\t\t// Change address if user change infomation\n\t\t\t// Reassign customeraddressid and save to shipping\n\t\t\t$customeraddressid = $this->getRequest()->getPost($ship . '_address_id', false);\n\t\t\t// If user chage shipping, billing infomation but not save to database\n\t\t\tif ($isclick || ($this->getRequest()->getPost('shipping_address_id') != \"\"\n\t\t\t\t\t&& (!isset($shippingData['save_in_address_book']) || (isset($shippingData['save_in_address_book']) && $shippingData['save_in_address_book'] == 0)))\n\t\t\t) {\n\t\t\t\t$customeraddressid = \"\";\n\t\t\t}\n\t\t\tif (!$isclick && $isLoggedIn\n\t\t\t\t&& (isset($shippingData['save_in_address_book']) && $shippingData['save_in_address_book'] == 1)\n\t\t\t\t&& !$this->_dataHelper->getStoreConfig('onestepcheckout/addfield/addressbook')\n\t\t\t) {\n\t\t\t\t$customeraddressid = $this->getDefaultAddress('shipping');\n\t\t\t}\n\t\t\t$this->getOnepage()->saveShipping($shippingData, $customeraddressid);\n\t\t}\n\t\tif ($customer_note = $this->getRequest()->getPost('onestepcheckout_comments')) {\n\t\t\t$quote->setCustomerNote($customer_note);\n\t\t}\n\t\tif ($this->getRequest()->isPost()) {\n\t\t\t$shippingMethodData = $this->getRequest()->getPost('shipping_method', '');\n\t\t\t$resultSaveShippingMethod = $this->getOnepage()->saveShippingMethod($shippingMethodData);\n\t\t\tif (!$resultSaveShippingMethod) {\n\t\t\t\t$eventManager = $this->_objectManager->get('Magento\\Framework\\Event\\ManagerInterface');\n\t\t\t\t$eventManager->dispatch('checkout_controller_onepage_save_shipping_method', [\n\t\t\t\t\t'request' => $this->getRequest(),\n\t\t\t\t\t'quote' => $this->getOnepage()->getQuote()\n\t\t\t\t]);\n\t\t\t}\n\t\t\t$this->getOnepage()->getQuote()->collectTotals();\n\t\t}\n\t\t$result = new \\Magento\\Framework\\DataObject();\n\t\ttry {\n\t\t\tif (!$quote->getCustomerId() && !$guest) {\n\t\t\t\tdf_quote_customer_m()->populateCustomerInfo($quote);\n\t\t\t}\n\t\t\t$quote->setIsActive(false);\n\t\t\t$cQuote = df_new_om(CQuote::class); /** @var CQuote $cQuote */\n\t\t\t$quotation = $cQuote->create($quote)->load($quote->getId());\n\t\t\t$cHelper = df_o(CHelper::class); /** @var CHelper $cHelper */\n\t\t\t$isAutoProposalEnabled = $cHelper->isAutoConfirmProposalEnabled();\n\t\t\t$qtyBreak = false;\n\t\t\t$price = true;\n\t\t\t$totalItems = 0;\n\t\t\tforeach ($quote->getAllItems() as $item) {\n\t\t\t\tif (!$item->getParentItemId()) {\n\t\t\t\t\t$totalItems++;\n\t\t\t\t\tif ($item->getQty() > 1) {\n\t\t\t\t\t\t$qtyBreak = true;\n\t\t\t\t\t}\n\t\t\t\t\tif ($item->getProduct()->getFinalPrice() == 0 || $item->getProduct()->getPrice() == 0) {\n\t\t\t\t\t\t$price = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($quote->getCustomerNote() || $qtyBreak || !$price || $totalItems > 1) {\n\t\t\t\t$isAutoProposalEnabled = false;\n\t\t\t}\n\t\t\tif ($isAutoProposalEnabled) {\n\t\t\t\t$quotation->setProposalSent((new \\DateTime())->getTimestamp());\n\t\t\t\t$quotation->setState(\\Cart2Quote\\Quotation\\Model\\Quote\\Status::STATE_PENDING)\n\t\t\t\t\t->setStatus(\\Cart2Quote\\Quotation\\Model\\Quote\\Status::STATUS_AUTO_PROPOSAL_SENT);\n\t\t\t\t$qProposalSender = df_o(QuoteProposalSender::class); /** @var QuoteProposalSender $qProposalSender */\n\t\t\t\t$qProposalSender->send($quotation);\n\t\t\t\t$quotation->save();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$qRequestSender = df_o(QuoteRequestSender::class); /** @var QuoteRequestSender $qRequestSender */\n\t\t\t\t$qRequestSender->send($quotation, false);\n\t\t\t}\n\t\t\tif (true || $this->getRequest()->getParam('clear_quote', false)) {\n\t\t\t\t$qs = df_o(CSession::class); /** @var CSession $qs */\n\t\t\t\t$qs->fullSessionClear();\n\t\t\t\t$qs->updateLastQuote($quotation);\n\t\t\t}\n\t\t\t$redirectUrl = $this->getOnepage()->getCheckout()->getRedirectUrl();\n\t\t\t$result->setData('success', true);\n\t\t\t$result->setData('error', false);\n\t\t}\n\t\tcatch (\\Exception $e) {\n\t\t\t$data = ['error' => 1, 'msg' => $e->getMessage(),];\n\t\t\t$reloadcheckoutpage = $quote->getData('reloadcheckoutpage');\n\t\t\tif ($reloadcheckoutpage) {\n\t\t\t\t$data['redirect'] = $this->_url->getUrl('checkout');\n\t\t\t}\n\t\t\techo json_encode($data);\n\t\t\texit;\n\t\t}\n\t\tif (isset($redirectUrl)) {\n\t\t\t$result->setData('redirect', $redirectUrl);\n\t\t}\n\t\t$this->_eventManager->dispatch('checkout_controller_onepage_saveOrder', ['result' => $result, 'action' => $this]);\n\t\tif (isset($redirectUrl)) {\n\t\t\techo json_encode([\n\t\t\t\t'error' => 0,\n\t\t\t\t'msg' => '',\n\t\t\t\t'redirect' => $redirectUrl\n\t\t\t]);\n\t\t\texit;\n\t\t}\n\t\techo json_encode([\n\t\t\t'error' => 0,\n\t\t\t'msg' => '',\n\t\t\t'redirect' => $this->_url->getUrl('quotation/quote/success', array('id' => $quote->getId()))\n\t\t]);\n\t\texit;\n\t\treturn;\n\t}", "public function paymentAction()\r\n {\r\n if($this->Request()->getParam('confimOffer',false)) {\r\n return $this->redirect(array(\r\n 'controller' => 'sKUZOOffer',\r\n 'action' => 'finish'\r\n ));\r\n }\r\n\r\n try{\r\n $agbChecked = $this->Request()->getParam('sAGB', false);\r\n $offerCheckAGB = Shopware()->Plugins()->Backend()->sKUZOOffer()->Config()->offerCheckAGB;\r\n if(!$agbChecked && (isset($offerCheckAGB) && !empty($offerCheckAGB))) {\r\n return $this->forward('offers');\r\n }\r\n\r\n $this->prepareBasket();\r\n if (empty($this->session['sOrderVariables'])) {\r\n return $this->forward('offers');\r\n }\r\n\r\n $offerId = $this->Request()->getParam('offerId');\r\n Shopware()->Session()->offerId = $offerId;\r\n\r\n if (empty($this->View()->sPayment['embediframe'])\r\n && empty($this->View()->sPayment['action'])) {\r\n $this->redirect(array(\r\n 'controller' => 'checkout',\r\n 'action' => 'finish',\r\n 'sAGB' => 1,\r\n 'offerAcception' => 1\r\n ));\r\n\r\n } else {\r\n $this->redirect(array(\r\n 'controller' => 'checkout',\r\n 'action' => 'payment',\r\n 'sAGB' => 1\r\n ));\r\n }\r\n\r\n } catch (Exception $e) {\r\n $order = Shopware()->Modules()->Order();\r\n $order->sDeleteTemporaryOrder();\r\n $this->sDeleteBasketOrder();\r\n throw new Enlight_Exception(\"Error making Order:\" . $e->getMessage(), 0, $e);\r\n }\r\n\r\n }", "public function processPaypal(){\r\n\t// and redirect to thransaction details page\r\n\t}", "public function execute()\r\n\t{\r\n\t\t\t\t\r\n\t\t$src = $this->request->getParam('src');\r\n\t\t$prc = $this->request->getParam('prc');\r\n\t\t$ord = $this->request->getParam('Ord');\r\n\t\t$holder = $this->request->getParam('Holder');\r\n\t\t$successCode = $this->request->getParam('successcode');\r\n\t\t$ref = $this->request->getParam('Ref');\r\n\t\t$payRef = $this->request->getParam('PayRef');\r\n\t\t$amt = $this->request->getParam('Amt');\r\n\t\t$cur = $this->request->getParam('Cur');\r\n\t\t$remark = $this->request->getParam('remark');\r\n\t\t$authId = $this->request->getParam('AuthId');\r\n\t\t$eci = $this->request->getParam('eci');\r\n\t\t$payerAuth = $this->request->getParam('payerAuth');\r\n\t\t$sourceIp = $this->request->getParam('sourceIp');\r\n\t\t$ipCountry = $this->request->getParam('ipCountry');\r\n\t\t//explode reference number and get the value only\r\n\t\t$flag = preg_match(\"/-/\", $ref);\r\n\t\t\r\n\t\techo \"OK! \" . \"Order Ref. No.: \". $ref . \" | \";\r\n\t\t\t\r\n\t\tif ($flag == 1){\r\n\t\t\t$orderId = explode(\"-\",$ref);\r\n\t\t\t$orderNumber = $orderId[1];\r\n\t\t}else{\r\n\t\t\t$orderNumber = $ref;\r\n\t\t}\r\n\r\n\t\tdate_default_timezone_set('Asia/Hong_Kong');\r\n\t\t$phperrorPath = 'log'.$ord.'.txt';\r\n\t\tif($this->request->getParam('secureHash')!=null){\r\n\t\t\t$secureHash = $this->request->getParam('secureHash');\r\n\t\t}else{\r\n\t\t\t$secureHash = \"\";\r\n\t\t}\r\n\t\t\r\n\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\r\n\t\t\r\n\t\t$order_object = $objectManager->create('\\Magento\\Sales\\Model\\Order')->loadByIncrementId($orderNumber);\r\n\r\n\t\t$logger = $objectManager->create('\\Psr\\Log\\LoggerInterface');\r\n\t\t\r\n\t\t$secureHashSecret = \"\";\r\n\t\tif(!empty($orderNumber)){\r\n\t\t\t$payment_method = $order_object->getPayment()->getMethodInstance();\r\n\t\t\t$secureHashSecret = $payment_method->getConfigData('secure_hash_secret');\r\n\t\t}else{\r\n\t\t\texit;\r\n\t\t}\r\n\t\t\r\n\t\t$dbCurrency = $order_object->getBaseCurrencyCode();\r\n\t\t/* convert currency type into numerical ISO code start*/\r\n\r\n\t\t$dbCurrencyIso = $this->_getIsoCurrCode($dbCurrency);\r\n\t\t/* convert currency type into numerical ISO code end*/\r\n\t\t\t\r\n\t\t//get grand total amount from Magento's sales order data for this order id (for comparison with the gateway's POSTed amount)\r\n\t\t$dbAmount = sprintf('%.2f', $order_object->getBaseGrandTotal());\r\n\t\t\r\n\t\tif(trim($secureHashSecret) != \"\"){\t\r\n\t\t\t$secureHashs = explode ( ',', $secureHash );\r\n\t\t\t// while ( list ( $key, $value ) = each ( $secureHashs ) ) {\r\n\t\t\tforeach($secureHashs as $key => $value) {\r\n\t\t\t\t$verifyResult = $this->_verifyPaymentDatafeed($src, $prc, $successCode, $ref, $payRef, $cur, $amt, $payerAuth, $secureHashSecret, $value);\r\n\t\t\t\tif ($verifyResult) {\r\n\t\t\t\t\tbreak ;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\tif (! $verifyResult) {\r\n\t\t\t\texit(\"Secure Hash Validation Failed\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* secureHash validation end*/ \r\n\t\tif ($successCode == 0 && $prc == 0 && $src == 0){\r\n\t\t\tif ($dbAmount == $amt && $dbCurrencyIso == $cur){\t\r\n\t\t\t\t$error = \"\";\r\n\t\t\t\ttry {\t\r\n\t\t\t\t\t//update order status to processing\r\n\t\t\t\t\t\t$comment = \"Payment was Accepted. Payment Ref: \" . $payRef ;\r\n\t\t\t\t\t\t$order_object->setState(\\Magento\\Sales\\Model\\Order::STATE_PROCESSING); \r\n\t\t\t\t\t\t$order_object->setStatus(\\Magento\\Sales\\Model\\Order::STATE_PROCESSING); \r\n\t\t\t\t\t\t$order_object->addStatusToHistory(\\Magento\\Sales\\Model\\Order::STATE_PROCESSING, $comment, true)->save();\r\n\t\t\t\t\t\t$orderCommentSender = $objectManager->create('Magento\\Sales\\Model\\Order\\Email\\Sender\\OrderCommentSender');\r\n\t\t\t\t\t\t$orderCommentSender->send($order_object, $notify='1' , $comment);// $comment yout comment\r\n\t\t\t\t\t\t//add payment record for the order\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t$payment = $order_object->getPayment()\r\n\t\t\t\t\t\t\t\t\t\t\t\t->setMethod('pdcptb')\r\n\t\t\t\t\t\t\t\t\t\t\t\t->setTransactionId($payRef)\r\n\t\t\t\t\t\t\t\t\t\t\t\t->setIsTransactionClosed(true);\r\n\t\t\t\t\t\t$order_object->setPayment($payment);\r\n\t\t\t\t\t\t$payment->addTransaction(\\Magento\\Sales\\Model\\Order\\Payment\\Transaction::TYPE_PAYMENT);\r\n\t\t\t\t\t\t$order_object->save();\r\n\t\t\t\t\t\t//create invoice\r\n\t\t\t\t\t\t//Instantiate ServiceOrder class and prepare the invoice \r\n\t\t\t\t\t\tif($order_object->canInvoice()){\r\n\t\t\t\t\t\t\t$invoice_object = $objectManager->create('Magento\\Sales\\Model\\Service\\InvoiceService')->prepareInvoice($order_object);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Make sure there is a qty on the invoice\t\t\t\r\n\t\t\t\t\t\t\tif (!$invoice_object->getTotalQty()) {\r\n\t\t\t\t\t\t\t\tthrow new \\Magento\\Framework\\Exception\\LocalizedException(\r\n\t\t\t\t\t\t\t\t__('You can\\'t create an invoice without products.'));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// Register as invoice item\r\n\t\t\t\t\t\t\t$invoice_object->setRequestedCaptureCase(\\Magento\\Sales\\Model\\Order\\Invoice::CAPTURE_OFFLINE);\r\n\t\t\t\t\t\t\t$invoice_object->register();\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Save the invoice to the order\r\n\t\t\t\t\t\t\t$transaction = $objectManager->create('Magento\\Framework\\DB\\Transaction')\r\n\t\t\t\t\t\t\t\t\t\t\t\t->addObject($invoice_object)\r\n\t\t\t\t\t\t\t\t\t\t\t\t->addObject($invoice_object->getOrder());\r\n\r\n\t\t\t\t\t\t\t$transaction->save();\r\n\t\t\t\t\t\t\t// Magento\\Sales\\Model\\Order\\Email\\Sender\\InvoiceSender\r\n\t\t\t\t\t\t\t//$this->\r\n\t\t\t\t\t\t\t$objectManager->create('Magento\\Sales\\Model\\Order\\Email\\Sender\\InvoiceSender')->send($invoice_object);\r\n\t\t\t\t\t\t\t$comment = \"Invoice sent.\" ;\r\n\t\t\t\t\t\t\t$order_object->addStatusHistoryComment(\r\n\t\t\t\t\t\t\t\t\t\t\t\t__($comment, $invoice_object->getId()))\r\n\t\t\t\t\t\t\t\t\t\t\t\t->setIsCustomerNotified(true)\r\n\t\t\t\t\t\t\t\t\t\t\t\t->save();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tcatch (\\Exception $e){\r\n\t\t\t\t\techo $e->getMessage();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (!$error){\r\n\t\t\t\t\techo \"Order status (processing) update successful\";\r\n\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif (($dbAmount != $amt)){ \r\n\t\t\t\t\t\techo \"Amount value: DB \" . (($dbAmount == '') ? 'NULL' : $dbAmount) . \" is not equal to POSTed \" . $amt . \" | \";\r\n\t\t\t\t\t\techo \"Possible tamper - Update failed\";\r\n\t\t\t\t\t}else if (($dbCurrencyIso != $cur)){\r\n\t\t\t\t\t\techo \"Currency value: DB \" . (($dbCurrency == '') ? 'NULL' : $dbCurrency) . \" (\".$dbCurrencyIso.\") is not equal to POSTed \" . $cur . \" | \";\r\n\t\t\t\t\t\techo \"Possible tamper - Update failed\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\techo \"Other unknown error - Update failed\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t/* WRAPPED WITH IF/ELSE STATEMENT TO PREVENT CHANGING OF STATUS TO CANCELED WHEN ALREADY GOT ACCEPTED TRANSACTION */\r\n\t\t\t$dbState = $order_object->getData('state');\r\n\t\t\tif($dbState == \\Magento\\Sales\\Model\\Order::STATE_PROCESSING || $dbState == \\Magento\\Sales\\Model\\Order::STATE_COMPLETE){\r\n\t\t\t\t//do nothing here\r\n\t\t\t\techo \"The order state is already set to \\\"\".dbState.\"\\\", so we cannot set it to \\\"\".\\Magento\\Sales\\Model\\Order::STATE_CANCELED.\"\\\" anymore\";\r\n\t\t\t}else{\r\n\t\t\t\t//update order status to canceled\r\n\t\t\t\t$comment = \"Payment was Rejected. Payment Ref: \" . $payRef ;\t\r\n\t\t\t\t$order_object->cancel()->save();\r\n\t\t\t\t$order_object->addStatusToHistory(\\Magento\\Sales\\Model\\Order::STATE_CANCELED, $comment, true)->save();\r\n\t\t\t\techo \"Order Status (cancelled) update successful \";\r\n\t\t\t\techo \"Transaction Rejected / Failed.\";\r\n\t\t\t}\t\r\n\t\t}\r\n\t}", "private function processPayment($data){\n $p_cust_id_cliente = env('EPAYCO_P_CUST_ID_CLIENTE');\n $p_key = env('EPAYCO_P_KEY');\n $x_ref_payco = $data->x_ref_payco;\n $x_transaction_id = $data->x_transaction_id;\n $x_amount = $data->x_amount;\n $x_currency_code = $data->x_currency_code;\n $x_signature = $data->x_signature;\n $signature = hash('sha256', $p_cust_id_cliente . '^' . $p_key . '^' . $x_ref_payco . '^' . $x_transaction_id . '^' . $x_amount . '^' . $x_currency_code);\n $x_response = $data->x_response;\n $x_response_reason_text = $data->x_response_reason_text;\n $x_id_invoice = $data->x_id_invoice;\n $x_autorizacion = $data->x_approval_code;\n\n //Validamos la firma\n if ($x_signature != $signature) {\n die(\"Firma no valida\");\n }\n\n $this->saveTransaction($data);\n NotificationController::notify('delivery', $data->x_extra3, $x_amount,$data->x_extra5,\"0\");\n\n return response()->json([\n 'success' => true,\n 'message' => 'transacción procesada'\n ],200);\n\n }", "function _prePayment( $data )\n {\n\t\t// prepare the payment form\n $vars = new JObject();\n \n $vars->ssl_merchant_id = $this->params->get('ssl_merchant_id', '');\n $vars->ssl_user_id = $this->params->get('ssl_user_id', '');\n $vars->ssl_pin = $this->params->get('ssl_pin', '');\n $vars->test_mode = $this->params->get('test_mode', '0');\n\t\t$vars->merchant_demo_mode = $this->params->get('merchant_demo_mode', '0');\n\t\t$vars->inline_creditcard_form = $this->params->get('inline_creditcard_form', '0');\n \n\t\t$vars->ssl_customer_code = JFactory::getUser()->id;\n $vars->ssl_invoice_number = $data['orderpayment_id'];\n $vars->ssl_description = JText::_('Order Number: ').$data['order_id'];\n \n // Billing Info\n $vars->first_name = $data['orderinfo']->billing_first_name;\n $vars->last_name = $data['orderinfo']->billing_last_name;\n $vars->email = $data['orderinfo']->user_email;\n $vars->address_1 = $data['orderinfo']->billing_address_1;\n $vars->address_2 = $data['orderinfo']->billing_address_2;\n $vars->city = $data['orderinfo']->billing_city;\n $vars->country = $data['orderinfo']->billing_country_name;\n $vars->state = $data['orderinfo']->billing_zone_name;\n $vars->zip \t\t= $data['orderinfo']->billing_postal_code;\n \n $vars->amount = @$data['order_total'];\n\n\t\tif ($vars->merchant_demo_mode == 1)\n\t\t{\n\t\t\t$vars->payment_url = \"https://demo.myvirtualmerchant.com/VirtualMerchantDemo/process.do\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$vars->payment_url = \"https://www.myvirtualmerchant.com/VirtualMerchant/process.do\";\n\t\t}\n\n\t\tif ( $vars->inline_creditcard_form == 0)\n\t\t{\n\t\t\t$vars->receipt_url = JURI::root().\"index.php?option=com_tienda&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element;\n\t\t\t$vars->failed_url = JURI::root().\"index.php?option=com_tienda&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element;\n\t\t\t$html = $this->_getLayout('prepayment', $vars);\n\t\t}\n\t\telseif ( $vars->inline_creditcard_form == 1)\n\t\t{\n\t\t\t$vars->action_url = JURI::root().\"index.php?option=com_tienda&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element;\n\t\t\t$vars->order_id\t = $data['order_id'];\n\t\t\t$html = $this->_getLayout('paymentcreditcard', $vars);\n\t\t}\n\n return $html;\n }", "public function _prePayment( $data )\n {\n // prepare the payment form\n $vars = new JObject();\n\n $params = JComponentHelper::getParams('com_j2store');\n $currency_code = $params->get('currency_code');\n $curr_type = \"764\";\n $lang = \"t\";\n\n // Convert to thai Baht before send to Paysbuy\n if($currency_code===\"USD\"){\n $xml = JFactory::getXML( 'http://www2.bot.or.th/RSS/fxrates/fxrate-usd.xml' );\n $pre_usd = (float)$xml->item->children('cb', true)->value;\n $data['orderpayment_amount'] = $data['orderpayment_amount']*$pre_usd;\n }\n\n switch ($data['paytype']) {\n case 'cash':\n $paytype = \"cs=true\";\n break;\n \n case 'credit':\n $paytype = \"c=true\";\n break;\n\n case 'bank':\n $paytype = \"ob=true\";\n break;\n\n case 'paysbuy':\n default:\n $paytype = \"psb=true\";\n break;\n }\n\n $vars->form_url = $this->_getPaysbuyUrl().\"?\".$paytype.\"&lang=$lang\";\n $vars->username = $this->params->get('username','');\n $vars->inv = $data['orderpayment_id'];\n $vars->itm = $data['order_id'];\n $vars->amt = $data['orderpayment_amount'];\n $vars->curr_type = $curr_type;\n\n //Change to your URL\n $vars->resp_front_url = JURI::root().\"index.php?option=com_j2store&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element.\"&paction=success_payment\";\n $vars->resp_back_url = JURI::root().\"index.php?option=com_j2store&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element.\"&paction=success_payment\";\n\n //lets check the values submitted\n $html = $this->_getLayout('prepayment', $vars);\n return $html;\n }", "public function payment_scripts() {\n \n\t \t}", "function do_pr_invoice($data){\n\t$client_id=$data['Clientpayment']['client_id'];\n\t$amount=$data['Clientpayment']['amount'];\n\t$invoice_number=$data['Clientpayment']['invoice_number'];\n \t$list=$this->query(\"select invoice_id, total_amount from invoice where invoice_number='$invoice_number' limit 1;\");\n \t$invoice_amount=isset($list[0][0]['total_amount'])?$list[0][0]['total_amount']:0;\n \t#付清\n \tif($invoice_amount<$amount){\n\t\t\t$this->paid_true_invoice($data,$invoice_amount);\n \t}\n \tif($invoice_amount<$amount)\n \t{\n \t#未付清\n\t\t$this->paid_false_invoice($data,$invoice_number,$invoice_amount);\n \t}\n\t \tif($invoice_amount==$amount)\n \t{\n \t\n \t#刚刚付清\n \t$this->do_pay_for_invoice($data);\n\t$this->query(\"update invoice set paid=true,pay_amount=pay_amount::numeric+$invoice_amount where invoice_number='$invoice_number'\");\n \t\n \t}\n \t$this->commit();\n\t}", "public function payment_scripts() {\n\n \t}", "public function paymentAction()\n {\n try {\n $session = $this->_getCheckout();\n\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId($session->getLastRealOrderId());\n if (!$order->getId()) {\n Mage::throwException('No order for processing found');\n }\n $order->setState(Paw_Payanyway_Model_Abstract::STATE_PAYANYWAY_PENDING, Paw_Payanyway_Model_Abstract::STATE_PAYANYWAY_PENDING,\n Mage::helper('payanyway')->__('The customer was redirected to Payanyway.')\n );\n $order->save();\n\n $session->setPayanywayQuoteId($session->getQuoteId());\n $session->setPayanywayRealOrderId($session->getLastRealOrderId());\n $session->getQuote()->setIsActive(false)->save();\n $session->clear();\n\n $this->loadLayout();\n $this->renderLayout();\n } catch (Exception $e){\n Mage::logException($e);\n parent::_redirect('checkout/cart');\n }\n }", "public function submitPayment()\n {\n return array('error'=>0, 'transactionReference'=>'');\n \n }", "public function execute()\r\n {\r\n \t\r\n\t\t$session = ObjectManager::getInstance()->get('Magento\\Checkout\\Model\\Session');\r\n\t\t\r\n $session->setPdcptbQuoteId($session->getQuoteId());\r\n //$this->_resultRawFactory->create()->setContents($this->_viewLayoutFactory->create()->createBlock('Asiapay\\Pdcptb\\Block\\Redirect')->toHtml());\r\n $session->unsQuoteId(); \r\n\r\n //get all parameters.. \r\n /*$param = [\r\n 'merchantid' => $this->getConfigData('merchant_id')\r\n \r\n ];*/\r\n //echo $this->_modelPdcptb->getUrl();\r\n $html = '<html><body>';\r\n $html.= 'You will be redirected to the payment gateway in a few seconds.';\r\n //$html.= $form->toHtml();\r\n $html.= '<script type=\"text/javascript\">\r\nrequire([\"jquery\", \"prototype\"], function(jQuery) {\r\ndocument.getElementById(\"pdcptb_checkout\").submit();\r\n});\r\n</script>';\r\n $html.= '</body></html>';\r\n echo $html;\r\n //$this->_modelPdcptb->getCheckoutFormFields();\r\n //$this->resultPageFactory->create();\r\n $params = $this->_modelPdcptb->getCheckoutFormFields();\r\n //return $resultPage;\r\n //sleep(25);\r\n //echo \"5 sec up. redirecting begin\";\r\n $result = $this->resultRedirectFactory->create();\r\n\t\t//$result = $this->resultRedirectFactory;\r\n \t$result->setPath($this->_modelPdcptb->getUrl().\"?\".http_build_query($params));\r\n \t//echo($this->_modelPdcptb->getUrl().http_build_query($params));\r\n \t//return $result;\r\n header('Refresh: 4; URL='.$this->_modelPdcptb->getUrl().\"?\".http_build_query($params));\r\n\t\t//$this->_redirect($this->_modelPdcptb->getUrl(),$params);\r\n\t\t//header('Refresh: 10; URL=https://test.paydollar.com/b2cDemo/eng/payment/payForm.jsp');\r\n \r\n}", "function _postPayment( $data )\n {\n\t\t$vars->inline_creditcard_form = $this->params->get('inline_creditcard_form', '0');\n\t\t\n\t\tif ($vars->inline_creditcard_form == 1) \n\t\t{\n\t\t\t$data = $this->_getInlinePaymentResponse($data);\n\t\t\t$result = $data['ssl_result'];\n\t\t} \n\t\telse \n\t\t{\n\t\t\t// Process the payment\n\t\t\t$result = JFactory::getApplication()->input->getString('ssl_result');\n\t\t}\n\n $vars = new JObject();\n\n switch ($result)\n {\n case \"0\":\n \t$errors = $this->_process( $data );\n\n \t// No errors\n \tif($errors == '')\n \t{\n\t $vars->message = JText::_('VIRTUALMERCHANT PAYMENT OK');\n\t $html = $this->_getLayout('message', $vars);\n\t $html .= $this->_displayArticle();\n \t}\n \t// Errors\n \telse\n \t{\n \t\t$vars->message = $errors;\n\t $html = $this->_getLayout('message', $vars);\n\t $html .= $this->_displayArticle();\n \t}\n break;\n default:\n case \"1\":\n $vars->message = JText::_('VIRTUALMERCHANT PAYMENT FAILED').': '.$data['ssl_result_message'];\n $html = $this->_getLayout('message', $vars);\n $html .= $this->_displayArticle();\n break;\n }\n\n return $html;\n }", "public function makePaymentAction()\n {\n if ($_SESSION['actionAvailable']) {\n try {\n $id = $_SESSION['id'];\n $account = new BankAccountModel(null, $id);\n $toAccountID = $_POST['accountTo'];\n\n\n $fromAccountID = $account->findID($_POST['accountFrom']);\n $transaction = new TransactionModel();\n $transaction->validateTransfer($toAccountID, $fromAccountID);\n $transaction->makeTransfer();\n $transaction->save();\n\n $view = new View('transactionComplete');\n echo $view->render();\n $_SESSION['actionAvailable'] = false;\n } catch (\\UnexpectedValueException $e) {\n $_SESSION['emptyField'] = true;\n $this->redirect('paymentPage');\n } catch (\\LogicException $e) {\n $_SESSION['validTransaction'] = false;\n $this->redirect('paymentPage');\n }\n }\n }", "public function complete(){\n\n\t\tif (isset($_GET[\"paymentId\"]) && $_GET[\"paymentId\"] == session('paypal_payment_id')) {\n\t\t\t$result = $this->paypal->execute_payment($_GET[\"paymentId\"], $_GET[\"PayerID\"], $this->mode);\n \n\t\t\t// get amount\n\t\t\t$amount = $result->transactions[0]->amount;\n\t\t\t$amount = $amount->total;\n\n\t\t\t// get Transaction Id\n\t\t\t$transactions = $result->getTransactions();\n\t\t\t$related_resources = $transactions[0]->getRelatedResources();\n\t\t\t$sale = $related_resources[0]->getSale();\n\t\t\t$get_transaction_fee = $sale->getTransactionFee();\n\t\t\t$sale_id = $sale->getId();\n\n\n\t\t\tif(!empty($result) && $result->state == 'approved'){\n\n\t\t\t\trequire_once 'orders.php';\n\t\t\t\t$data_order = (object)array(\n\t\t\t\t\t'payment_type' => $this->payment_type,\n\t\t\t\t\t'amount' => $amount,\n\t\t\t\t\t'txt_id' => $sale_id,\n\t\t\t\t\t'transaction_fee' => $get_transaction_fee->getValue(),\n\t\t\t\t\t'order_details' => session('order_details'),\n\t\t\t\t);\n\t\t\t\tunset_session('order_details');\n\t\t\t\tunset_session('paypal_payment_id');\t\n\t\t\t\t$order = new orders();\n\t\t\t\tif(!$order->save_order($data_order)){\n\t\t\t\t\tredirect(cn(\"checkout/unsuccess\"));\n\t\t\t\t};\n\t\t\t\t/*---------- Add funds to user balance ----------*/\n\t\t\t\tredirect(cn(\"checkout/success\"));\n\t\t\t}else{\n\t\t\t\tredirect(cn(\"checkout/unsuccess\"));\n\t\t\t}\n\n\t\t}else{\n\t\t\tredirect(cn(\"checkout/unsuccess\"));\n\t\t}\n\t}", "public function compliteAction()\n {\n\n $config = $this->get('plugins')->Frontend()->PilibabaPilipaySystem()->Config();\n $merchantNO = $this->Request()->getParam('merchantNO');\n $orderNo = $this->Request()->getParam('orderNo');\n $orderAmount = $this->Request()->getParam('orderAmount');\n $signType = $this->Request()->getParam('signType');\n $payResult = $this->Request()->getParam('payResult');\n $signMsg = $this->Request()->getParam('signMsg');\n $dealId = $this->Request()->getParam('dealId');\n $fee = $this->Request()->getParam('fee');\n $sendTime = $this->Request()->getParam('sendTime');\n\n\n if ($config->get('merchantNo') == $merchantNO\n && md5($merchantNO . $orderNo . $orderAmount . $sendTime . $config->get('appSecrect')) == $signMsg\n ) {\n $repository = Shopware()->Models()->getRepository('Shopware\\Models\\Order\\Order');\n $builder = $repository->createQueryBuilder('orders');\n $builder->addFilter(array('number' => $orderNo));\n $order = $builder->getQuery()->getOneOrNullResult();\n\n if ($payResult == 10) {\n\n $this->setPaymentStatus($order->getTransactionId(), 12);\n $url = $this->basePathUrl . '/paymentpilipay/finish?orderNo='.$orderNo;\n\n echo '<result>1</result><redirecturl>' . $url . '</redirecturl>';\n $this->Front()->Plugins()->ViewRenderer()->setNoRender();\n\n if ($order->getOrderStatus() && $order->getOrderStatus()->getId() == 0) {\n $this->setOrderStatus($order->getTransactionId(), 0); // in process\n }\n } elseif ($payResult == 11) {\n $this->setPaymentStatus($order->getTransactionId(), 21);\n\n }\n }\n\n }", "public function payAction()\n\t{\n\t\t$paylanecreditcard = Mage::getSingleton(\"paylanecreditcard/standard\");\n\t\t$data = $paylanecreditcard->getPaymentData();\n\n\t\tif (is_null($data))\n\t\t{\n\t\t\tMage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl(\"/\"));\n\t\t}\n\n\t\t// connect to PayLane Direct System\n\t\t$paylane_client = new PayLaneClient();\n\n\t\t// get login and password from store config\n\t\t$direct_login = Mage::getStoreConfig('payment/paylanecreditcard/direct_login');\n\t\t$direct_password = Mage::getStoreConfig('payment/paylanecreditcard/direct_password');\n\n\t\t$status = $paylane_client->connect($direct_login, $direct_password);\n\t\tif ($status == false)\n\t\t{\n\t\t\t// an error message\n\t \t$paylanecreditcard->addComment(\"Error processing your payment... Please try again later.\", true);\n\n\t \tsession_write_close();\n\t \t$this->_redirect('checkout/onepage/failure');\n\t\t\treturn;\n\t\t}\n\n\t\t$secure3d = Mage::getStoreConfig('payment/paylanecreditcard/secure3d');\n\n\t\tif ($secure3d == true)\n\t\t{\n\t\t\t$back_url = Mage::getUrl('paylanecreditcard/standard/back', array('_secure' => true));\n\n\t\t\t$result = $paylane_client->checkCard3DSecureEnrollment($data, $back_url);\n\n\t\t\tif ($result == false)\n\t\t\t{\n\t\t\t\t// an error message\n\t\t \t$paylanecreditcard->addComment(\"Error processing your payment... Please try again later.\", true);\n\n\t\t \tsession_write_close();\n\t\t \t$this->_redirect('checkout/onepage/failure');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (isset($result->ERROR))\n\t\t\t{\n\t\t\t\t// an error message\n\t\t \t$paylanecreditcard->addComment($result->ERROR->error_description, true);\n\n\t\t \tsession_write_close();\n\t\t \t$this->_redirect('checkout/onepage/failure');\n\t\t \treturn;\n\t\t\t}\n\n\t\t\tif (isset($result->OK))\n\t\t\t{\n\t\t\t\t$paylanecreditcard->setIdSecure3dAuth($result->OK->secure3d_data->id_secure3d_auth);\n\n\t\t\t\tif (isset($result->OK->is_card_enrolled))\n\t\t\t\t{\n\t\t\t\t\t$is_card_enrolled = $result->OK->is_card_enrolled;\n\n\t\t\t\t\t// card is enrolled in 3-D Secure\n\t\t\t\t\tif (true == $is_card_enrolled)\n\t\t\t\t\t{\n\t\t\t\t\t\tMage::app()->getFrontController()->getResponse()->setRedirect($result->OK->secure3d_data->paylane_url);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// card is not enrolled, perform normal sale\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$data['secure3d'] = array();\n\t\t\t\t\t\t$data['id_secure3d_auth'] = $result->OK->secure3d_data->id_secure3d_auth;\n\n\t\t\t\t\t\t$result = $paylane_client->multiSale($data);\n\t\t\t\t\t\tif ($result == false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// an error message\n\t\t\t\t\t \t$paylanecreditcard->addComment(\"Error processing your payment... Please try again later.\", true);\n\n\t\t\t\t\t \tsession_write_close();\n\t\t\t\t\t \t$this->_redirect('checkout/onepage/failure');\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (isset($result->ERROR))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// an error message\n\t\t\t\t\t \t$paylanecreditcard->addComment($result->ERROR->error_description, true);\n\n\t\t\t\t\t \tsession_write_close();\n\t\t\t\t\t \t$this->_redirect('checkout/onepage/failure');\n\t\t\t\t\t \treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (isset($result->OK))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$paylanecreditcard->setCurrentOrderPaid();\n\t\t\t\t\t\t\t$paylanecreditcard->addComment('id_sale=' . $result->OK->id_sale);\n\t\t\t\t\t\t\t$paylanecreditcard->addTransaction($result->OK->id_sale);\n\n\t\t\t\t\t \tsession_write_close();\n\t\t\t\t\t \t$this->_redirect('checkout/onepage/success');\n\t\t\t\t\t \treturn;\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\tMage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl(\"/\"));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tMage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl(\"/\"));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tMage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl(\"/\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $paylane_client->multiSale($data);\n\t\t\tif ($result == false)\n\t\t\t{\n\t\t\t\t// an error message\n\t\t \t$paylanecreditcard->addComment(\"Error processing your payment... Please try again later.\", true);\n\n\t\t \tsession_write_close();\n\t\t \t$this->_redirect('checkout/onepage/failure');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (isset($result->ERROR))\n\t\t\t{\n\t\t\t\t// an error message\n\t\t \t$paylanecreditcard->addComment($result->ERROR->error_description, true);\n\n\t\t \tsession_write_close();\n\t\t \t$this->_redirect('checkout/onepage/failure');\n\t\t \treturn;\n\t\t\t}\n\n\t\t\tif (isset($result->OK))\n\t\t\t{\n\t\t\t\t$paylanecreditcard->setCurrentOrderPaid($result->OK->id_sale);\n\n\t\t \tsession_write_close();\n\t\t \t$this->_redirect('checkout/onepage/success');\n\t\t \treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tMage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl(\"/\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "public function execute()\n {\n // debug mode\n $this->_helper->debug('Start \\Afterpay\\Afterpay\\Controller\\Payment\\Response::execute() with request ' . $this->_jsonHelper->jsonEncode($this->getRequest()->getParams()));\n\n $query = $this->getRequest()->getParams();\n $order = $this->_checkoutSession->getLastRealOrder();\n\n // Check if not fraud detected not doing anything (let cron update the order if payment successful)\n if ($this->_afterpayConfig->getPaymentAction() == AbstractMethod::ACTION_AUTHORIZE_CAPTURE) {\n //Steven - Bypass the response and do capture\n $redirect = $this->_processAuthCapture($query);\n } elseif (!$this->response->validCallback($order, $query)) {\n $this->_helper->debug('Request redirect url is not valid.');\n }\n // debug mode\n $this->_helper->debug('Finished \\Afterpay\\Afterpay\\Controller\\Payment\\Response::execute()');\n\n // Redirect to cart\n $this->_redirect($redirect);\n }", "public function execute()\n {\n if (!empty($_GET[\"responseid\"]) && !empty($_GET[\"requestid\"])) {\n $order_id = base64_decode($_GET[\"requestid\"]);\n $response_id = base64_decode($_GET[\"responseid\"]);\n\n $mode = $this->_paymentMethod->getMerchantConfig('modes');\n\n if ($mode == 'Test') {\n $mid = $this->_paymentMethod->getMerchantConfig('test_mid');\n $mkey = $this->_paymentMethod->getMerchantConfig('test_mkey');\n $client = new SoapClient(\"https://testpti.payserv.net/Paygate/ccservice.asmx?WSDL\");\n } elseif ($mode == 'Live') {\n $mid = $this->_paymentMethod->getMerchantConfig('live_mid');\n $mkey = $this->_paymentMethod->getMerchantConfig('live_mkey');\n $client = new SoapClient(\"https://ptipaygate.paynamics.net/ccservice/ccservice.asmx?WSDL\");\n }\n\n $request_id = '';\n $length = 8;\n $characters = '0123456789';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $request_id .= $characters[rand(0, $charactersLength - 1)];\n }\n\n $merchantid = $mid;\n $requestid = $request_id;\n $org_trxid = $response_id;\n $org_trxid2 = \"\";\n $cert = $mkey;\n $data = $merchantid . $requestid . $org_trxid . $org_trxid2;\n $data = utf8_encode($data . $cert);\n\n // create signature\n $sign = hash(\"sha512\", $data);\n\n $params = array(\"merchantid\" => $merchantid,\n \"request_id\" => $requestid,\n \"org_trxid\" => $org_trxid,\n \"org_trxid2\" => $org_trxid2,\n \"signature\" => $sign);\n\n $result = $client->query($params);\n $response_code = $result->queryResult->txns->ServiceResponse->responseStatus->response_code;\n $response_message = $result->queryResult->txns->ServiceResponse->responseStatus->response_message;\n\n switch ($response_code) {\n case 'GR001':\n case 'GR002':\n case 'GR033':\n $this->getResponse()->setRedirect(\n $this->_getUrl('checkout/onepage/success')\n );\n break;\n default:\n $this->messageManager->addErrorMessage(\n __($response_message)\n );\n /** @var \\Magento\\Framework\\Controller\\Result\\Redirect $resultRedirect */\n $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);\n return $resultRedirect->setPath('checkout/cart');\n break;\n }\n\n// $this->getResponse()->setRedirect(\n// $this->_getUrl('checkout/onepage/success')\n// );\n }\n }", "public function processPayment(Payment $payment): void\n {\n }", "public function run()\n {\n $this->checkoutOnepage->getVaultPaymentBlock()->saveCreditCard(\n $this->payment['method'],\n $this->creditCardSave\n );\n }", "public function execute()\n {\n $pre = __METHOD__ . \" : \";\n $this->_logger->debug($pre . 'bof');\n\n try\n {\n // NOTE: 支付成功,把订单状态改为paid [start]\n $this->_order = $this->_checkoutSession->getLastRealOrder();\n $this->generateInvoice($this->_order->getId());\n // [end]\n $this->_redirect('checkout/onepage/success');\n\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\n $this->_logger->error($pre . $e->getMessage());\n\n $this->messageManager->addExceptionMessage($e, $e->getMessage());\n $this->_redirect('checkout/cart');\n } catch (\\Exception $e) {\n $this->_logger->error($pre . $e->getMessage());\n $this->messageManager->addExceptionMessage($e, __('We can\\'t start PayFast Checkout.'));\n $this->_redirect('checkout/cart');\n }\n\n return '';\n }", "public function execute() {\n\n $id = trim((string)$this->getRequest()->getParam('transId', NULL));\n $refId = (int)trim((string)$this->getRequest()->getParam('refId', NULL));\n\n if (!$id || !$refId) {\n http_response_code(400);\n die('Invalid response');\n }\n\n $service = $this->config->getComGateService();\n try {\n $status = $service->getStatus($id);\n }\n catch(\\Exception $e) {\n $status = false;\n }\n\n if (!$status) {\n http_response_code(400);\n die('Malformed response');\n }\n\n $order_id = (int)@$status['refId'];\n $order = $this->getOrder($order_id);\n if (!$order->getId()) {\n http_response_code(400);\n\n //trigger_error('No Order [' . $order_id . ']');\n die('No Order');\n }\n\n $response = $this->createResponse();\n\n if (!in_array($order->getStatus() , array(\n \\Magento\\Sales\\Model\\Order::STATE_NEW,\n \\Magento\\Sales\\Model\\Order::STATE_HOLDED,\n \\Magento\\Sales\\Model\\Order::STATE_PENDING_PAYMENT,\n \\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW\n ))) {\n\n $response->setHttpResponseCode(200);\n return $response;\n }\n\n if (!empty($status['code'])) {\n http_response_code(400);\n die('Payment error');\n }\n\n if (($status['price'] != round($order->getGrandTotal() * 100)) || ($status['curr'] != $order->getOrderCurrency()->getCurrencyCode())) {\n http_response_code(400);\n die('Payment sum or currency mismatch');\n }\n\n $invoice = $order->getInvoiceCollection()->getFirstItem();\n $payment = $order->getPayment();\n\n if (($status['status'] == 'CANCELLED') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_HOLDED)) {\n\n $payment->getMethodInstance()->cancel($payment);\n\n $order->addStatusHistoryComment('ComGate (notification): Payment failed');\n $order->save();\n }\n else if (($status['status'] == 'PAID') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_PROCESSING)) {\n \n \\ComGate\\ComGateGateway\\Api\\AgmoPaymentsHelper::updatePaymentTransaction($payment, array(\n 'id' => $id,\n 'state' => $status['status']\n ));\n\n $payment->capture();\n\n $order->addStatusHistoryComment('ComGate (notification): Payment success');\n $order->save();\n }\n else if (($status['status'] == 'AUTHORIZED') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW)) {\n\n \\ComGate\\ComGateGateway\\Api\\AgmoPaymentsHelper::updatePaymentTransaction($payment, array(\n 'id' => $id,\n 'state' => $status['status']\n ));\n\n $payment->getMethodInstance()->authorize($payment, $order->getGrandTotal());\n\n $order->addStatusHistoryComment('ComGate (notification): Payment authorized');\n $order->save();\n }\n\n $response->setHttpResponseCode(200);\n return $response;\n }", "function CallOrder()\n {\n global $USER, $CONF, $UNI;\n\n $this->amount = str_replace(\".\",\"\",HTTP::_GP('amount',0));\n $this->amountbis = HTTP::_GP('amount',0);\n\t\t\t\t\n\t\t\t\tif($this->amount < 10000){\n\t\t\t\t$this->printMessage('You have to buy minimum 10.000 AM!', true, array('game.php?page=donate', 3)); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($this->amount >= 10000 && $this->amount < 20000)\t\t$this->amount *= 1.05;\n\t\t\t\telseif($this->amount >= 20000 && $this->amount < 50000) $this->amount *= 1.10;\n\t\t\t\telseif($this->amount >= 50000 && $this->amount < 100000) $this->amount *= 1.20;\n\t\t\t\telseif($this->amount >= 100000 && $this->amount < 150000) $this->amount *= 1.30;\n\t\t\t\telseif($this->amount >= 150000 && $this->amount < 200000) $this->amount *= 1.40;\n\t\t\t\telseif($this->amount >= 200000) $this->amount *= 1.50;\n\t\t\t\t\n\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->amount = round($this->amount + ($this->amount / 100 * 0));\n\t\t\t\t$this->amount = $this->amount + ($this->amount / 100 * 0);\n\t\t\t\t$this->cost = round($this->amountbis * 0.00011071);\n \n\n \n\t\t\t\t\n\t\t\t\t$this_p = new paypal_class;\n\t\t\t\t\n \n $this_p->add_field('business', $this::MAIL);\n \n\t\t\t\t\n\t\t\t $this_p->add_field('return', 'http://'.$_SERVER['HTTP_HOST'].'/game.php?page=overview');\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this_p->add_field('cancel_return', 'http://'.$_SERVER['HTTP_HOST'].'/ipns.php');\n $this_p->add_field('notify_url', 'http://'.$_SERVER['HTTP_HOST'].'/ipns.php');\n\t\t\t\t\n $this_p->add_field('item_name', $this->amount.' AM-User('.$USER['username'].').');\n $this_p->add_field('item_number', $this->amount.'_AM');\n $this_p->add_field('amount', $this->cost);\n //$this_p->add_field('action', $action); ?\n $this_p->add_field('currency_code', 'EUR');\n $this_p->add_field('custom', $USER['id']);\n $this_p->add_field('rm', '2');\n //$this_p->dump_fields(); \n\t\t\t\t foreach ($this_p->fields as $name => $value) {\n\t\t\t\t\t$field[] = array('text'=>'<input type=\"hidden\" name=\"'.$name.'\" value=\"'.$value.'\">');\n\t\t\t\t}\n\t\t\t $this->tplObj->assign_vars(array(\n\t\t\t\t'fields' => $field,\n\t\t\t ));\n\t\t\t$this->display('paypal_class.tpl');\n }", "function processPayment() {\n \n if ($this->creditPayment != 0.00){\n$fieldParse = new parseGatewayFields(); \n$fieldParse-> setCardName($this->cardName);\n$fieldParse-> setAchName($this->accountName);\n$fieldParse-> setCardType($this->cardType);\n$fieldParse-> setAccountType($this->accountType);\n$fieldParse-> setCardExpDate($this->cardYear);\n$fieldParse-> parsePaymentFields();\n\n //reassign vars for CS Credit Cards\n$ccFirstName = $fieldParse-> getCredtCardFirstName();\n$ccLastName = $fieldParse-> getCredtCardLastName();\n$ccCardType = $fieldParse-> getCardType();\n$ccCardYear = $fieldParse-> getCardYear(); \n$ccCardMonth = $this->cardMonth;\n$ccCardNumber = $this->cardNumber;\n$ccCardCvv = $this->cardCvv;\n\n\n \n$club_id = $_SESSION['location_id'];\n \n$dbMain = $this->dbconnect();\n\n\n$stmt = $dbMain->prepare(\"SELECT MIN(club_id) FROM club_info WHERE club_name != ''\");//>=\n$stmt->execute(); \n$stmt->store_result(); \n$stmt->bind_result($club_id); \n$stmt->fetch();\n$stmt->close();\n \n$stmt = $dbMain ->prepare(\"SELECT gateway_id, passwordfd FROM billing_gateway_fields WHERE club_id= '$club_id'\");\n$stmt->execute(); \n$stmt->store_result(); \n$stmt->bind_result($userName, $password);\n$stmt->fetch();\n$stmt->close();\n \n$amount = $this->creditPayment;\n \n //credit\"\";//\n$ccnumber = $ccCardNumber;//\"4111111111111111\";\n$ccexp = \"$this->cardMonth$this->cardYear\";//\"1010\";\n$cvv = \"$this->cardCvv\";\n //==================\n$reference = \"CMP Balance\";\n$vaultFunction = \"\";//'add_customer';//'add_customer' or 'update_customer'\n$orderId = \"$this->contractKey\";\n$merchField1 = \"$reference $this->contractKey\";\n$payTypeFlag = \"creditcard\";//\"creditcard\"; // '' or 'check'\nif(isset($_SESSION['track1'])){\n $track1 = $_SESSION['track1'];\n}else{\n $track1 = \"\";\n}\nif(isset($_SESSION['track2'])){\n $track2 = $_SESSION['track2'];\n}else{\n $track2 = \"\";\n}\n\n \n$gw = new gwapi;\n$gw->setLogin(\"$userName\", \"$password\");\n$r = $gw->doSale($amount, $ccnumber, $ccexp, $cvv, $payTypeFlag, $orderId, $merchField1, $track1, $track2, $ccFirstName, $ccLastName);\n$ccAuthDecision = $gw->responses['responsetext'];\n$vaultId = $gw->responses['customer_vault_id'];\n$authCode = $gw->responses['authcode']; \n$transactionId = $gw->responses['transactionid'];\n$ccAuthReasonCode = $gw->responses['response_code'];\n//echo \"fubar $ccAuthReasonCode\";\n // exit;\n\n if($ccAuthReasonCode != 100) {\n \n $this->paymentStatus = \"$ccAuthDecision: $ccAuthDecision\";\n //$this->transactionId = $ccAuthReasonCode; \n }else{ \n $_SESSION['cc_request_id'] = $authCode;\n $this->paymentStatus = 1;\n //$this->transactionId = $ccAuthRequestId;\n }\n }\n if ($this->creditPayment == 0.00){\n $this->paymentStatus = 1;\n }\n}", "public function execute(){\n\n $body = '{\"payer_id\":\"' . $this->payer_id . '\"}';\n $client = new Client();\n try{\n $paymentInfo = $client->request('POST', $this->execute_url, ['headers' => [\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->accessKey,\n ],\n 'body' => $body\n ]);\n }\n catch (\\Exception $ex) {\n $error = json_encode($ex->getMessage());\n return($error);\n }\n $this->parsePaymentBody($paymentInfo);\n return $this->paymentBody;\n\n }", "public function _postPayment( $data )\n {\n // Process the payment\n $vars = new JObject();\n\n $app =JFactory::getApplication();\n $paction = JRequest::getVar( 'paction' );\n\n switch ($paction)\n {\n case \"display_message\":\n $session = JFactory::getSession();\n $session->set('j2store_cart', array());\n $vars->message = JText::_($this->params->get('onafterpayment', ''));\n $html = $this->_getLayout('message', $vars);\n $html .= $this->_displayArticle();\n\n break;\n case \"success_payment\":\n \n // Check User loged in\n $user = JFactory::getUser();\n if($user->id > 0){\n $jinput = JFactory::getApplication()->input;\n include(\"lib/nusoap.php\");\n $url = $this->_getPaysbuyUrl(true);\n $client = new nusoap_client($url, true);\n\n // Get this post from Paysbuy\n $inv = $jinput->post->get('apCode', 0);\n $params = array(\n \"psbID\"=>$this->params->get('psbid',''),\n \"biz\"=>$this->params->get('username',''),\n \"secureCode\"=>$this->params->get('secureCode',''),\n \"invoice\"=>$inv,\n \"flag\"=>\"\"\n );\n\n $result = $client->call(\n 'getTransactionByInvoiceCheckPost',\n array('parameters' => $params),\n 'http://tempuri.org/',\n 'http://tempuri.org/getTransactionByInvoiceCheckPost',\n false,\n true\n );\n\n $result = $result[\"getTransactionByInvoiceCheckPostResult\"];\n $info = $result[\"getTransactionByInvoiceReturn\"];\n\n JTable::addIncludePath(JPATH_ADMINISTRATOR.'/components/com_j2store/tables');\n $tOrder = JTable::getInstance('Orders', 'Table');\n $tOrder->load($inv);\n $order_id = intval($tOrder->id);\n\n // Check $inv from Paysbuy and owner orderinfo\n if($info['result']===\"00\" && !is_null($tOrder->id) && $tOrder->user_id==$user->id){\n \n // Update Status from Paysbuy\n $tOrder->order_state = \"Confirmed\";\n $tOrder->order_state_id = 1;\n $tOrder->store();\n }\n\n }\n\n break;\n \n default:\n $vars->message = JText::_( 'J2STORE_SAGEPAY_MESSAGE_INVALID_ACTION' );\n $html = $this->_getLayout('message', $vars);\n break;\n }\n\n return $html;\n }", "public function payAction()\n {\n try {\n $orderId = $this->getRequest()->getParam('id');\n $hash = $this->getRequest()->getParam('hash');\n $this->setSession();\n $this->setOrder($orderId);\n $this->_payment = $this->_order->getPayment();\n $this->checkHash($hash);\n // First time\n if ($this->_payment->getAdditionalInformation('payuplpro_try_number') == 0) {\n $this->forceNewOrderStatus(true);\n $this->setPayment(true);\n }\n $this->_forward('repeat', null, null, array(\n 'id' => $orderId,\n 'hash' => $hash\n ));\n } catch (Mage_Core_Exception $e) {\n Mage::log('Error with pay link: ' . $e->getMessage(), null, 'payuplpro.log');\n $this->_redirect('/');\n }\n }", "public function execute()\n { //load model\n /* @var $paymentMethod \\Magento\\Authorizenet\\Model\\DirectPost */\n $paymentMethod = $this->_objectManager->create('Sslwireless\\Sslcommerz\\Model\\Sslcommerz');\n if(!empty($this->getRequest()->getPostValue()))\n {\n $data = $this->getRequest()->getPostValue();\n $resp = $paymentMethod->ipnAction($data);\n \n $ipn_log = fopen(\"SSLCOM_IPN_LOG.txt\", \"a+\") or die(\"Unable to open file!\");\n $ipn_result = array('Transaction ID:' => $data['tran_id'],'Date Time:' => $data['tran_date'],'Val ID:' => isset($data['val_id']) ? $data['val_id'] : '','Amount:' => $data['amount'],'Card Type:' => $data['card_type'],'Card Type:' => $data['card_type'],'Currency:' => $data['currency'],'Card Issuer:' => $data['card_issuer'],'Store ID:' => $data['store_id'],'Status:' => $data['status'],'IPN Response:'=>$resp);\n\n fwrite($ipn_log, json_encode($ipn_result).PHP_EOL);\n fclose($ipn_log);\n }\n else\n {\n echo \"<span align='center'><h2>IPN only accept POST request!</h2><p>Remember, We have set an IPN URL in first step so that your server can listen at the right moment when payment is done at Bank End. So, It is important to validate the transaction notification to maintain security and standard.As IPN URL already set in script. All the payment notification will reach through IPN prior to user return back. So it needs validation for amount and transaction properly.</p></span>\";\n }\n }", "public function run() {\n\t\t//\n\n\n\t\t//\n\t\t// Let's clear the users table first\n\t\tPaymentMethod::truncate();\n\n\n\t\t$inputs = [\n\t\t\t['name' => 'Bank Deposit'],\n\t\t\t['name' => 'PayPal - Checkout'],\n\t\t];\n\t\tPaymentMethod::insert($inputs);\n\t}", "public function actionPayment() {\n\t if(!Yii::app()->session['isLogin'])\n\t {\n\t $this->redirect(\"index.php?r=users/registration\");\n\t }\n\t $quoteId = $_GET['quotes_id'];\n $model = Quotes::model()->findByPk($quoteId);\n if($model->payment_status==\"pending\")\n {\n $store_id = $this->storeID;\n\n $storeData = $this->helper->getStoreData($store_id);\n\n if($storeData[\"merchant_id\"]==\"\" || $storeData[\"public_key\"]==\"\" || (($storeData[\"private_key\"]==\"\" || $storeData[\"clientside_key\"]==\"\") && $storeData[\"payment_gateway\"]==\"braintree\") )\n\n $this->render('error',array('message'=>\"A problem found on Merchant Account Setup\"));\n\n\n else\n\n {\n Yii::import('ext.BraintreeApi.models.BraintreeCCForm');\n $payment = new BraintreeCCForm('charge',$storeData[\"merchant_id\"],$storeData[\"public_key\"],$storeData[\"private_key\"],$storeData[\"clientside_key\"]); //also option for 'customer', 'address', and 'creditcard'\n\n //Yii::app()->params[\"braintree\"][\"merchant_id\"] = $storeData[\"merchant_id\"];\n\n if(isset($_POST['BraintreeCCForm']))\n {\n if($storeData[\"payment_gateway\"]!=\"braintree\")\n {\n if($payment->validate())\n {\n $rest= $this->processAuthorize($storeData[\"merchant_id\"],$storeData[\"public_key\"]);\n if($rest==1)\n {\n $model->payment_status=\"partial\";\n $model->save();\n $this->render('success');\n return;\n }\n }\n }\n\n else {\n\n\n\n $payment->setAttributes($_POST['BraintreeCCForm']);\n //$payment->customerId = Yii::app()->session['id']; //needed for 'address' and 'creditcard' scenarios\n if($payment->validate()) {\n $result = $payment->send();\n if($result) {\n $model->payment_status=\"partial\";\n $model->save();\n $this->render('success');\n return;\n }\n\n }\n\n }\n }\n $method = $storeData[\"payment_gateway\"]==\"braintree\"?\"Braintree.net\":\"Authorized.net\";\n\n\n $customerInfo = Users::model()->findByPk(Yii::app()->session['id']);\n //var_dump($expression)\n $name= explode(\" \", $customerInfo->full_name);\n $payment->customer_email = $customerInfo->user_email;\n $payment->customer_firstName = $name[0];\n $payment->customer_lastName = $name[1];\n $payment->amount = number_format($model->upfront_payment,2);\n $payment->orderId = $name[0].\"-\".$model->id.\"-\".date('d-m-y h:i:s');\n $this->render('payment',array('model'=>$model,'payment'=>$payment,'method'=>$method,'customer'=>$customerInfo));\n }\n }\n else\n $this->redirect('index.php?r=index');\n }", "public function run()\n {\n $payinfo = $this->request->post('payinfo');\n\n try{\n $postdata = Json::decode(CryptHelper::authcode($payinfo, 'DECODE', env('WECHAT_APP_KEY')));\n } catch(\\Exception $e){\n FileLogHelper::xlog($e->getMessage(), 'payment');\n } finally{\n if(!$postdata){\n $postdata = [\n 'uid' => -1\n ];\n }\n }\n\n if($postdata['uid'] != $this->account['uid']){\n return MessageHelper::error('对不起,您提交的订单不是由您自己创建的', [gHomeUrl()]);\n }\n\n if(OrderList::findBySource($postdata['source_type'], $postdata['source_uuid'])){\n // return MessageHelper::error('订单已成功提交,请不要重复提交');\n }\n\n if($postdata['total_fee'] <= 0){//代表全是免费的,直接入库\n $trans = \\Yii::$app->db->beginTransaction();\n $order = OrderList::create($postdata);\n if($order->hasErrors()){\n FileLogHelper::xlog(['order' => $postdata, 'order-error' => $order->getErrors()], 'payment/error');\n $trans->rollBack();\n return MessageHelper::error('订单提交失败,请检查后重新提交,如多次失败,请联系管理员');\n }\n $detailErrors = OrderList::createOrderDetail($order['uuid'], Json::decode($postdata['goods_list']));\n if($detailErrors){\n $trans->rollBack();\n FileLogHelper::xlog(['order' => $postdata, 'order-detail-error' => $detailErrors], 'payment/error');\n return MessageHelper::error('订单提交失败,请检查后重新提交,如多次失败,请联系管理员');\n }\n $trans->commit();\n return MessageHelper::success('订单提交成功', [gHomeUrl()]);\n }\n //开始接入支付\n $sHtml = \"<form id='payForm' name='payForm' action='\" . env('WECHAT_PAY_URL') . \"' method='post'>\";\n $sHtml .= \"<input type='hidden' name='json_payinfo' value='{$payinfo}' /></form>\";\n $sHtml = $sHtml . \"<script>document.forms['payForm'].submit();</script>\";\n return $sHtml;\n }", "public function payAction()\n\t{\n\t\tif (empty($_GET[\"command\"])) {\n\t\t\techo Common::packData(\"unknown error\", \"\", 0);\n\t\t\treturn;\n\t\t}\n\t\t$cmd = $_GET[\"command\"];\n\t\tswitch($cmd) {\n\t\t\tcase \"ask\":\n\t\t\t\t$this->commandAsk();\n\t\t\t\tbreak;\n\t\t\tcase \"addqr\":\n\t\t\t\t$this->commandAddqr();\n\t\t\t\tbreak;\n\t\t\tcase \"do\":\n\t\t\t\t$this->commandDo();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\techo Common::packData(\"unknown error\", \"\", 0);\n\t\t}\n\t}", "public function PaymentCredit()\n {\n\n $condition = array('id' => $this->checkLogin('U'));\n $userDetails = $this->checkout_model->get_all_details(USERS, $condition);\n $currency_code = $this->input->post('currencycode');\n\t\t\t$user_currencycode = $this->input->post('user_currencycode');\n if ($this->input->post('creditvalue') == 'authorize') {\n $Auth_Details = unserialize(API_LOGINID);\n $Auth_Setting_Details = unserialize($Auth_Details['settings']);\n error_reporting(-1);\n define(\"AUTHORIZENET_API_LOGIN_ID\", $Auth_Setting_Details['merchantcode']);\n define(\"AUTHORIZENET_TRANSACTION_KEY\", $Auth_Setting_Details['merchantkey']);\n define(\"API_MODE\", $Auth_Setting_Details['mode']);\n if (API_MODE == 'sandbox') {\n define(\"AUTHORIZENET_SANDBOX\", true);\n } else {\n define(\"AUTHORIZENET_SANDBOX\", false);\n }\n \n define(\"TEST_REQUEST\", \"FALSE\");\n require_once './authorize/autoload.php';\n\n $transaction = new AuthorizeNetAIM;\n $transaction->setSandbox(AUTHORIZENET_SANDBOX);\n\n\t\t\t\t$payable_amount = currency_conversion($this->input->post('user_currencycode'), 'USD', $this->input->post('total_price'),$this->input->post('currency_cron_id'));\n //echo $payable_amount;exit();\n $transaction->setFields(array('amount' => $payable_amount, 'card_num' => $this->input->post('cardNumber'), 'exp_date' => $this->input->post('CCExpMonth') . '/' . $this->input->post('CCExpYear'), 'first_name' => $userDetails->row()->firstname, 'last_name' => $userDetails->row()->lastname, 'address' => $this->input->post('address'), 'city' => $this->input->post('city'), 'state' => $this->input->post('state'), 'country' => $userDetails->row()->country, 'phone' => $userDetails->row()->phone_no, 'email' => $userDetails->row()->email, 'card_code' => $this->input->post('creditCardIdentifier'),));\n\n $response = $transaction->authorizeAndCapture();\n //print_r($response);exit();\n\n // echo $this->input->post('total_price');exit();\n if ($response->approved != '') {\n $product_id = $this->input->post('booking_rental_id');\n $product = $this->checkout_model->get_all_details(PRODUCT, array('id' => $product_id));\n $totalAmnt = $this->input->post('total_price');\n $enquiryid = $this->input->post('enquiryid');\n $loginUserId = $this->checkLogin('U');\n // echo $totalAmnt;exit();\n if ($this->session->userdata('randomNo') != '') {\n $delete = 'delete from ' . PAYMENT . ' where dealCodeNumber = \"' . $this->session->userdata('randomNo') . '\" and user_id = \"' . $loginUserId . '\" ';\n $this->checkout_model->ExecuteQuery($delete, 'delete');\n $dealCodeNumber = $this->session->userdata('randomNo');\n } else {\n $dealCodeNumber = mt_rand();\t\n }\n $insertIds = array();\n $now = date(\"Y-m-d H:i:s\");\n $paymentArr = array('product_id' => $product_id, 'sell_id' => $product->row()->user_id, 'price' => $totalAmnt, 'indtotal' => $product->row()->price, 'sumtotal' => $totalAmnt, 'user_id' => $loginUserId, 'created' => $now, 'dealCodeNumber' => $dealCodeNumber, 'status' => 'Paid', 'shipping_status' => 'Pending', 'total' => $totalAmnt, 'EnquiryId' => $enquiryid, 'inserttime' => NOW(), 'currency_code' => $user_currencycode);\n /* referal user commission payment starts */\n $referred_user = $this->checkout_model->get_all_details(USERS, array('id' => $loginUserId));\n $refered_user = $referred_user->row()->referId;\n $user_booked = $this->checkout_model->get_all_details(PAYMENT, array('user_id' => $loginUserId, 'status' => 'Paid'));\n if ($user_booked->num_rows() == 0) {\n $totalAmount = $totalAmnt;\n $currencyCode = $currency_code;\n $book_commission_query = 'SELECT * FROM ' . INVITE . ' WHERE email = \"'.$userDetails->row()->email.'\"';\n $book_commission = $this->checkout_model->ExecuteQuery($book_commission_query);\n if ($book_commission->num_rows() > 0) {\n // if ($book_commission->row()->promotion_type == 'flat') {\n // $referal_commission = round($totalAmount - $book_commission->row()->commission_percentage, 2);\n // } else {\n // $commission = round(($book_commission->row()->commission_percentage / 100), 2);\n // $referal_commission = ($totalAmount * $commission);\n // }\n $commission = round(($book_commission->row()->commission_persent / 100), 2);\n $referal_commission = ($totalAmount * $commission);\n if ($currencyCode != 'USD') {\n // ,$this->input->post('currency_cron_id')\n $referal_commission = convertCurrency($currencyCode, 'USD', $referal_commission);\n }\n $referred_userData = $this->checkout_model->get_all_details(USERS, array('id' => $refered_user));\n $existAmount = $referred_userData->row()->referalAmount;\n $exit_totalReferalAmount = $referred_userData->row()->totalReferalAmount;\n $existAmountCurrenctCode = $referred_userData->row()->referalAmount_currency;\n if ($existAmountCurrenctCode != 'USD') {\n $existAmount = convertCurrency($existAmountCurrenctCode, 'USD', $existAmount);\n $exit_totalReferalAmount = convertCurrency($existAmountCurrenctCode, 'USD', $exit_totalReferalAmount);\n }\n $tot_commission = $existAmount + $referal_commission;\n $new_totalReferalAmount = $exit_totalReferalAmount + $referal_commission;\n $inputArr_ref = array('totalReferalAmount' => $new_totalReferalAmount, 'referalAmount' => $tot_commission, 'referalAmount_currency' => 'USD');\n $this->checkout_model->update_details(USERS, $inputArr_ref, array('id' => $refered_user));\n }\n }\n $this->checkout_model->simple_insert(PAYMENT, $paymentArr);\n $insertIds[] = $this->db->insert_id();\n $paymtdata = array('randomNo' => $dealCodeNumber, 'randomIds' => $insertIds);\n $this->session->set_userdata($paymtdata, $currency_code);\n $this->product_model->edit_rentalbooking(array('booking_status' => 'Booked'), array('id' => $enquiryid));\n $lastFeatureInsertId = $this->session->userdata('randomNo');\n\t\t\t\t\t\n redirect('order/success/' . $loginUserId . '/' . $lastFeatureInsertId . '/' . $response->transaction_id);\n } else {\n // echo $this->input->post('total_price');exit();\n $this->session->set_userdata('payment_error', $response->response_reason_text);\n redirect('order/failure');\n }\n }\n }", "public function setupPayment($order){\r\n $response = array(\r\n 'success'=> false,\r\n 'msg'=> __('Payment failed!', ET_DOMAIN)\r\n );\r\n // write session\r\n et_write_session('order_id', $order->ID);\r\n et_write_session('processType', 'buy');\r\n $arg = apply_filters('ae_payment_links', array(\r\n 'return' => et_get_page_link('process-payment') ,\r\n 'cancel' => et_get_page_link('process-payment')\r\n ));\r\n /**\r\n * process payment\r\n */\r\n $paymentType_raw = $order->payment_type;\r\n $paymentType = strtoupper($order->payment_type);\r\n /**\r\n * factory create payment visitor\r\n */\r\n $order_data = array(\r\n 'payer' => $order->post_author,\r\n 'total' => '',\r\n 'status' => 'draft',\r\n 'payment' => $paymentType,\r\n 'paid_date' => '',\r\n 'post_parent' => $order->post_parent,\r\n 'ID'=> $order->ID,\r\n 'amount'=> $order->amount\r\n );\r\n $order_temp = new mJobOrder($order_data);\r\n $order_temp->add_product($order);\r\n $order = $order_temp;\r\n $visitor = AE_Payment_Factory::createPaymentVisitor($paymentType, $order, $paymentType_raw);\r\n // setup visitor setting\r\n $visitor->set_settings($arg);\r\n // accept visitor process payment\r\n $nvp = $order->accept($visitor);\r\n if ($nvp['ACK']) {\r\n $response = array(\r\n 'success' => $nvp['ACK'],\r\n 'data' => $nvp,\r\n 'paymentType' => $paymentType\r\n );\r\n } else {\r\n $response = array(\r\n 'success' => false,\r\n 'paymentType' => $paymentType,\r\n 'msg' => __(\"Invalid payment gateway!\", ET_DOMAIN)\r\n );\r\n }\r\n /**\r\n * filter $response send to client after process payment\r\n *\r\n * @param Array $response\r\n * @param String $paymentType The payment gateway user select\r\n * @param Array $order The order data\r\n *\r\n * @package AE Payment\r\n * @category payment\r\n *\r\n * @since 1.0\r\n * @author Dakachi\r\n */\r\n $response = apply_filters('mjob_setup_payment', $response, $paymentType, $order);\r\n return $response;\r\n }", "public function handlePayment ()\n {\n /**\n * Die $baseUrl können wir weit nach oben ziehen, weil wir sie weiter unten an mehreren Stellen verwenden und\n * sie nicht unten jedes Mal definieren möchten, sondern einmal und dann wiederverwenden.\n */\n $baseUrl = Config::get('app.baseUrl');\n\n /**\n * Wir verzichten der Übersichtlichkeit halber auf eine Validierung. Eigentlich müsste hier eine Daten-\n * validierung durchgeführt werden und etwaige Fehler an den User zurückgespielt werden. Im Login machen wir das\n * beispielsweise und auch bei der Bearbeitung eines Produkts. Der nachfolgende Code dürfte gar nicht mehr\n * ausgeführt werden, wenn Validierungsfehler aufgetreten sind.\n */\n\n /**\n * Eingeloggten User abfragen\n */\n $user = User::getLoggedInUser();\n\n /**\n * Wurde das linke Formular abgeschickt und ein Wert ausgewählt?\n */\n if (isset($_POST['payment']) && $_POST['payment'] !== '_default') {\n /**\n * Ausgefüllte PaymentId in die Session speichern, damit wir sie in einem weiteren Checkout-Schritt wieder\n * verwenden können.\n */\n Session::set(self::PAYMENT_KEY, (int)$_POST['payment']);\n }\n\n /**\n * Wurde das rechte Formular abgeschickt und ein Wert in das Name-Feld eingegeben?\n */\n if (isset($_POST['name']) && !empty($_POST['name'])) {\n /**\n * Neue Payment Methode erstellen und in die Datenbank speichern.\n */\n $payment = new Payment();\n $payment->name = $_POST['name'];\n $payment->number = $_POST['number'];\n $payment->expires = $_POST['expires'];\n $payment->ccv = $_POST['ccv'];\n $payment->user_id = $user->id;\n $payment->save();\n\n /**\n * ID der neu erstellten Zahlungsmethode in die Session speichern, damit wir sie in einem weiteren Checkout-\n * Schritt wieder verwenden können.\n */\n Session::set(self::PAYMENT_KEY, (int)$payment->id);\n }\n\n /**\n * Oben sind folgende Fälle abgedeckt:\n * + Ein existierendes Payment wurde aus dem Dropdown gewählt\n * + Ein neues Payment wurde in das Formular eingegeben\n * Was noch nicht abgedeckt ist, wenn weder ein Payment ausgewählt wurde noch ein neues Payment angelegt wurde.\n *\n * Hier prüfen wir also, ob KEIN payment geschickt wurde oder der Standard Wert aus dem Formular übergeben wurde\n * UND ob das Namens feld NICHT oder LEER übergeben wurde. Das ist eine relativ komplexe Bedingung, daher habe\n * ich sie zur besseren Übersicht in mehrere Zeilen aufgeteilt.\n */\n if (\n (\n !isset($_POST['payment']) ||\n $_POST['payment'] === '_default'\n )\n &&\n (\n !isset($_POST['name']) ||\n empty($_POST['name'])\n )\n ) {\n /**\n * Wurde weder ein Payment ausgewählt noch ein neues eingegeben, so schreiben wir einen Error und leiten zu\n * dem Formular zurück, von dem wir gekommen sind.\n */\n Session::set('errors', [\n 'Payment auswählen ODER ein neues anlegen.'\n ]);\n\n header(\"Location: {$baseUrl}checkout\");\n exit;\n }\n\n /**\n * Weiterleiten auf den nächsten Schritt im Checkout Prozess.\n */\n header(\"Location: {$baseUrl}checkout/address\");\n exit;\n }", "public function takePayment() {\r\n if ($this->payment instanceof PayPal) {\r\n $this->payment->payByPayPal();\r\n }elseif ($this->payment instanceof SagePay) {\r\n $this->payment->payBySagePay();\r\n } elseif ($this->payment instanceof WorldPay) {\r\n $this->payment->payByWorldPay();\r\n }\r\n }", "public function buy(){\n\n $id=89025555; //id di connessione\n $password=\"test\"; //password di connessione\n\n //è necessario foramttare il totale in NNNNNN.NN\n $importo= number_format(StadiumCart::total(),2,'.','');//importo da pagare\n\n $trackid=\"STDRX\".time(); //id transazione\n\n $urlpositivo=\"http://stadium.reexon.net/cart/receipt\";\n $urlnegativo=\"http://stadium.reexon.net/cart/error\";\n $codicemoneta=\"978\"; //euro\n //prelevo i dati inseriti durante la fase acquisto\n $user = (object)Session::get('user');\n\n $data=\"id=$id\n &password=$password\n &action=4\n &langid=ITA\n &currencycode=$codicemoneta\n &amt=$importo\n &responseURL=$urlpositivo\n &errorURL=$urlnegativo\n &trackid=$trackid\n &udf1=\".$user->email.\"\n &udf2=\".$user->mobile.\"\n &udf3=\".$user->firstname.\"\n &udf4=\".$user->lastname.\"\n &udf5=EE\";\n $curl_handle=curl_init();\n //curl_setopt($curl_handle,CURLOPT_URL,'https://www.constriv.com:443/cg/servlet/PaymentInitHTTPServlet');\n curl_setopt($curl_handle,CURLOPT_URL,'https://test4.constriv.com/cg301/servlet/PaymentInitHTTPServlet');\n curl_setopt($curl_handle, CURLOPT_VERBOSE, true);\n curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,5);\n curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);\n curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl_handle, CURLOPT_POST, 1);\n curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $data);\n $buffer = curl_exec($curl_handle);\n\n if (empty($buffer))\n {\n return curl_error($curl_handle);\n }\n else\n {\n //print $buffer;\n $url=explode(\":\",$buffer);\n $transaction_id=$url[0];\n curl_close($curl_handle);\n //prepara il link per il pagamento\n if(strlen($transaction_id)>0){\n $redirectURL = $url[1].\":\".$url[2].\"?PaymentID=$transaction_id\";\n echo \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=$redirectURL\\\">\";\n }\n }\n\n }", "public function processPayment()\n {\n $paymentMethod = $this\n ->methodFactory\n ->create();\n\n /**\n * At this point, order must be created given a card, and placed in\n * PaymentBridge.\n *\n * So, $this->paymentBridge->getOrder() must return an object\n */\n $this\n ->paymentEventDispatcher\n ->notifyPaymentOrderLoad(\n $this->paymentBridge,\n $paymentMethod\n );\n\n /**\n * Order exists right here.\n */\n $this\n ->paymentEventDispatcher\n ->notifyPaymentOrderCreated(\n $this->paymentBridge,\n $paymentMethod\n );\n\n /**\n * Payment paid done.\n *\n * Paid process has ended (No matters result)\n */\n $this\n ->paymentEventDispatcher\n ->notifyPaymentOrderDone(\n $this->paymentBridge,\n $paymentMethod\n );\n\n /**\n * Payment paid successfully.\n *\n * Paid process has ended successfully\n */\n $this\n ->paymentEventDispatcher\n ->notifyPaymentOrderSuccess(\n $this->paymentBridge,\n $paymentMethod\n );\n\n return $this;\n }", "public function payments() {\n \n PageContext::$response->activeLeftMenu = 'Settings';\n $this->view->setLayout(\"home\");\n\n $epaypal=($this->post('p_paypal')=='on') ? 'Y' : 'N';\n $sandbox=($this->post('p_sandbox')=='on') ? 'Y' : 'N';\n\n $e_auth=($this->post('e_auth')=='on') ? 'Y' : 'N';\n $a_test=($this->post('a_test')=='on') ? 'Y' : 'N';\n\n $error = NULL;\n\n // Paypal Settings\n if($this->isPost()) {\n\n $arrUpdate = array(\"value\"=>addslashes($epaypal));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='enablepaypal'\");\n\n $arrUpdate = array(\"value\"=>addslashes($sandbox));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='enablepaypalsandbox'\");\n\n $arrUpdate = array(\"value\"=>addslashes($this->post('p_tocken')));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='paypalidentitytoken'\");\n\n $arrUpdate = array(\"value\"=>addslashes($this->post('p_email')));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='paypalemail'\");\n \n $arrUpdate = array(\"value\"=>addslashes($e_auth));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='authorize_enable'\");\n\n $arrUpdate = array(\"value\"=>addslashes($this->post('a_logid')));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='authorize_loginid'\");\n\n $arrUpdate = array(\"value\"=>addslashes($this->post('a_tkey')));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='authorize_transkey'\");\n\n $arrUpdate = array(\"value\"=>addslashes($this->post('a_email')));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='authorize_email'\");\n\n $arrUpdate = array(\"value\"=>addslashes($a_test));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='authorize_test_mode'\");\n\n\n $arrUpdate = array(\"value\"=>addslashes($this->post('currency')));\n\n $this->dbObj->updateFields(\"Settings\",$arrUpdate,\"settingfield='admin_currency'\");\n\n // Success Message\n // $this->view->message = (empty($error)) ? \"Changes Saved Successfully\" : $error;\n PageContext::$response->success_message = \"Changes Saved Successfully\" ;\n PageContext::addPostAction('successmessage');\n\n\n } // End isPost\n\n $this->view->authEnable = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='authorize_enable'\");\n\n $this->view->authLoginId = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='authorize_loginid'\");\n\n $this->view->authtransKey = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='authorize_transkey'\");\n\n $this->view->authEmail = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='authorize_email'\");\n\n $this->view->authTestMode = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='authorize_test_mode'\");\n\n\n //**************** PAYPAL\n\n\n $this->view->enablePaypal = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='enablepaypal'\");\n\n $this->view->enableSandBox = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='enablepaypalsandbox'\");\n\n $this->view->paypalTocken = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='paypalidentitytoken'\");\n\n $this->view->paypalEmail = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='paypalemail'\");\n\n $this->view->currency = $this->dbObj->selectRow(\"Settings\",\"value\",\"settingfield='admin_currency'\");\n\n }", "private function payOrder($order){\r\n $this->log('Paying order #'.$order->get_order_number());\r\n $this->addOrderNote($order, 'Pagado con flow');\r\n $order->payment_complete();\r\n }", "public function actionPaynow()\n\t{ \n\t // Duration is for subscription\n\t\t$duration = Yii::app()->request->getParam(\"duration\", \"0\");\n\t\t// subscription or pre-authorization\n\t\t$type = Yii::app()->request->getParam(\"type\", \"0\");\n\t\t \n\t\tif( isset($_SESSION['invoice_id']) )\n\t\t{\n\t\t \n\t\t$invoiceModel = new Invoices;\n\t $payment\t\t= $invoiceModel->getInvoicePayment( $_SESSION['invoice_id'] );\n\t\t// Sandbox\n\t\tGoCardless::$environment = 'sandbox';\n\t\t\n\t\t// Config vars\n\t\t$account_details = array(\n\t\t 'app_id' => 'HXC009A5B8B2AX6A0C6HY4950B0JXM1Y8HEGZB9Q6CD51TDG1RR34BTG6N6H1PVK',\n\t\t 'app_secret' => 'V7MTFFF67K4SEH0AWWTHEEXWRKK7JQ4MJ0QWTZ3EP0YMG65XG9S1TCA77R2PMDYC',\n\t\t 'merchant_id' => '07N2GAPV0D',\n\t\t 'access_token' => '0T6JYNA5B1S6H2DWWA6SJ43CBTG7QVMSZR79Z1ENTWZWK59Z8616H5GWBHDDTX02'\n\t\t);\n\t\t\n\t\t// Fail nicely if no account details set\n\t\tif ( ! $account_details['app_id'] && ! $account_details['app_secret']) {\n\t\t echo '<p>First sign up to <a href=\"http://gocardless.com\">GoCardless</a> and\n\t\tcopy your sandbox API credentials from the \\'Developer\\' tab into the top of\n\t\tthis script.</p>';\n\t\t exit();\n\t\t}\n\t\t\n\t\t// Initialize GoCardless\n\t\tGoCardless::set_account_details($account_details);\n\t\t\n\t\tif (isset($_GET['resource_id']) && isset($_GET['resource_type'])) {\n\t\t // Get vars found so let's try confirming payment\n\t\t\n\t\t $confirm_params = array(\n\t\t\t'resource_id' => $_GET['resource_id'],\n\t\t\t'resource_type' => $_GET['resource_type'],\n\t\t\t'resource_uri' => $_GET['resource_uri'],\n\t\t\t'signature' => $_GET['signature']\n\t\t );\n\t\t \n\t\t // State is optional\n\t\t if (isset($_GET['state'])) {\n\t\t\t$confirm_params['state'] = $_GET['state'];\n\t\t }\n\t\t\n\t\t $confirmed_resource = GoCardless::confirm_resource($confirm_params);\n\t \n\t\t if( isset($confirmed_resource->id)) { // Successfull\n\t\t \n\t\t\t$invoiceId = $_SESSION['invoice_id']; \n\t\t \n\t\t\t// Set to paid\n\t\t $invoiceModel->updateGocardlessPayment( $confirmed_resource, $_SESSION['invoice_id']); \n\t\t\t$this->sendInvoice( $invoiceId );\n \t\t\t$this->render(\"paynow\");\n\t\t\t unset($_SESSION['invoice_id']);\n\t\t }\n\t\t else {\n\t\t \t$this->redirect(array(\"invoice/index/\".$_SESSION['invoice_id']));\n\t\t \t\n\t\t }exit;\n\t\t}\n\t\t\n /*************** *****************\n\t\t Payments Arrays \n\t\t *********************************/\t\n\t\t\t// Onetime Payment\n\t\t\tif($duration == 0) \n\t\t\t{\n\t\t\t\t$payment_details = array(\n\t\t\t\t 'amount' => $payment[0]['payment_amount'],\n\t\t\t\t 'name' => 'Invoice Payment'\n\t\t\t\t \n\t\t\t\t);\n\t\t\t\t\n\t\t\t $payment_url = GoCardless::new_bill_url($payment_details);\n\t\t\t}\n\t\t\t//Need a subscription\n\t\t\telseif($duration > 0 && $type == 'subscription') \n\t\t\t{\n\t\t\t\t$payment_details = array(\n\t\t\t\t 'amount' => $payment[0]['payment_amount'],\n\t\t\t\t 'interval_length' => $duration, \n\t\t\t\t 'interval_unit' => 'month',\n\t\t\t\t 'name' => 'Monthly Subscription',\n\t\t\t\t);\n\t\t\t\t$payment_url = GoCardless::new_subscription_url($payment_details);\n\t\t\t}\n\t\t\t//Need a Pre Authorization\n\t\t\telseif($duration > 0 && $type == 'authorization') \n\t\t\t{\n\t\t\t\t# - Amount Taken from Customer\n\t\t\t\t$authorization_amount = Yii::app()->request->getParam('amount','0');\n\t\t\t\tif($authorization_amount >= $payment[0]['payment_amount'])\n\t\t\t\t\t$amount = $authorization_amount;\n\t\t\t\telse\n\t\t\t\t\t$amount = $payment[0]['payment_amount'];\n\t\t\t\t\t\n\t\t\t\t$payment_details = array(\n\t\t\t\t 'max_amount' => $amount,\n\t\t\t\t 'interval_length' => $duration, \n\t\t\t\t 'interval_unit' => 'month',\n\t\t\t\t 'name' => 'Pre-Authorization',\n\t\t\t\t);\n\t\t\t\t$payment_url = GoCardless::new_pre_authorization_url($payment_details);\n\t\t\t}\t\n\t\t\t\t# - Redirecting it to Payment Gateway - GoCardless\n\t\t\t\t$this->redirect( $payment_url );\n\t\t}\n\t\t\n\t}", "function add_payment_pr($data){\n\t\tif($this->check_money($data['Clientpayment']['amount'])){\n\t\t\t\t$this->do_pr_invoice($data);\n\t\t}\n\t}", "public function savePaymentAction()\n {\n if ($this->_expireAjax()) {\n return;\n }\n try {\n if (!$this->getRequest()->isPost()) {\n $this->_ajaxRedirectResponse();\n return;\n }\n\n // set payment to quote\n $result = array();\n $data = $this->getRequest()->getPost('payment', array());\n\n $paymentMethod = Payiteasy_Onlinepayment_Model_Method_Abstract::factory($data['method']);\n if (null !== $paymentMethod) {\n $data['onlinepayment_action_mode'] = $paymentMethod->getActionMode();\n }\n\n if ($data['method'] == Payiteasy_Onlinepayment_Model_Method_Creditcard::METHOD_CODE) {\n $data['cc_number_enc'] = Mage::getModel('onlinepayment/method_creditcard')->buildRequestCreatePanalias($data);\n } elseif ($data['method'] == Payiteasy_Onlinepayment_Model_Method_Debit::METHOD_CODE) {\n Mage::getSingleton('checkout/session')->paymentData = $data;\n }\n $result = $this->getOnepage()->savePayment($data);\n\n // get section and redirect data\n $redirectUrl = $this->getOnepage()->getQuote()->getPayment()->getCheckoutRedirectUrl();\n if (empty($result['error']) && !$redirectUrl) {\n $this->loadLayout('checkout_onepage_review');\n $result['goto_section'] = 'review';\n $result['update_section'] = array(\n 'name' => 'review',\n 'html' => $this->_getReviewHtml()\n );\n }\n if ($redirectUrl) {\n $result['redirect'] = $redirectUrl;\n }\n } catch (Mage_Payment_Exception $e) {\n if ($e->getFields()) {\n $result['fields'] = $e->getFields();\n }\n $result['error'] = $e->getMessage();\n } catch (Mage_Core_Exception $e) {\n $result['error'] = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $result['error'] = $this->__('Unable to set Payment Method.');\n }\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }", "public static function geoCart_payment_choicesProcess()\n {\n //get the cart\n $cart = geoCart::getInstance();\n\n //get the gateway since this is a static function\n $gateway = geoPaymentGateway::getPaymentGateway(self::gateway_name);\n\n //get invoice on the order\n $invoice = $cart->order->getInvoice();\n $invoice_total = $invoice->getInvoiceTotal();\n\n if ($invoice_total >= 0) {\n //DO NOT PROCESS! Nothing to process, no charge (or returning money?)\n return ;\n }\n //BUILD DATA TO SEND TO GATEWAY TO COMPLETE THE TRANSACTION\n $info = parent::_getInfo();\n\n //create initial transaction\n try {\n //let parent create a new transaction, since it does all that common stuff for us.\n //(including encrypting CC data)\n $transaction = self::_createNewTransaction($cart->order, $gateway, $info, false, true);\n\n //Add the transaction to the invoice\n $transaction->setInvoice($invoice);\n $invoice->addTransaction($transaction);\n\n //save it so there is an id\n $transaction->save();\n } catch (Exception $e) {\n //catch any error thrown by _createNewTransaction\n trigger_error('ERROR TRANSACTION CART PAYFLOW_PRO: Exception thrown when attempting to create new transaction.');\n return;\n }\n\n\n $cart->order->processStatusChange('pending_admin');\n }", "public function _prePayment( $data )\n{\n\t$jinput = JFactory::getApplication()->input;\n\n\t// Prepare the payment form\n\t$vars->order_id = $data['order_id'];\n\t$vars->orderpayment_id = $data['orderpayment_id'];\n\t$vars->orderpayment_amount = $data['orderpayment_amount'];\n\t$vars->orderpayment_type = $this->_element;\n\n\t$vars->cardholder = $jinput->get(\"cardholder\");\n\t$vars->payment_mode = $jinput->get(\"payment_mode\");\n\n\t// Credit card\n\t$vars->cardnum = $jinput->get(\"cardnum\");\n\t$month = $jinput->get(\"month\");\n\t$year = $jinput->get(\"year\");\n\t$card_exp = $month . ' / ' . $year;\n\t$vars->cardexp = $card_exp;\n\n\t$vars->cardcvv = $jinput->get(\"cardcvv\");\n\t$vars->cardnum_last4 = substr($jinput->get(\"cardnum\"), -4);\n\n\t// Debit card\n\t$vars->accnum = $jinput->get(\"accnum\");\n\t$vars->accnum_last4 = substr($jinput->get(\"accnum\"), -4);\n\t$vars->banknum = $jinput->get(\"banknum\");\n\t$vars->country = $jinput->get(\"country\");\n\n\t// Token\n\t$vars->token12 = $jinput->get(\"token12\");\n\n\t// Lets check the values submitted\n\t$html = $this->_getLayout('prepayment', $vars);\n\n\treturn $html;\n}", "function execute()\n{\n\t\n\n\n\n\n\t$arr = array_merge($this->amount,$this->customer,$this->creditCard,$this->options);\n\t\n\t$collection = Braintree_Transaction::search(array(\n Braintree_TransactionSearch::customerId()->is($arr['customer']['id']),\n));\nif($collection->maximumCount() > 0)\n{\n\n$result = Braintree_Transaction::sale(\n array(\n 'customerId' => $arr['customer']['id'],\n 'amount' => $arr['amount']\n )\n);\nif ($result->success) {\necho json_encode(array('type'=>'success','response'=>'payment amount: '.$arr['amount'].' Your transaction id : '.$result->transaction->id));\n\tdo_action('payment_made',array('message'=>'payment amount: '.$arr['amount'].' transaction id : '.$result->transaction->id));\n\n}elseif ($result->transaction) \n{\n\techo json_encode(array('type'=>'error','response'=>$result->message));\n\n} else {\n\techo json_encode(array('type'=>'error','response'=>$result->message));\n\n\t\n}\n}else{\n\n$result = Braintree_Transaction::sale($arr);\n\nif ($result->success) {\n\tdo_action('payment_made',array('message'=>'payment amount: '.$arr['amount'].' transaction id : '.$result->transaction->id));\n\t\necho json_encode(array('type'=>'success','response'=>'Payment Amount : '.$arr['amount'].'Your transaction id : '.$result->transaction->id));\n}elseif ($result->transaction) \n{\n\techo json_encode(array('type'=>'error','response'=>$result->message));\n\n} else {\n\techo json_encode(array('type'=>'error','response'=>$result->message));\n\n\t\n}\n\n\n\n\t\n}\n\t\n}", "public function makePayment() {\n\t\tLoggerRegistry::debug('CustomerModule::makePayment()');\n\t\t// TODO Payment gateway integration\n\t}", "public function savePaymentAction()\n {\n\t\tif( !Mage::helper('repay/checkout')->enabled() )\n\t\t\treturn parent::savePaymentAction();\n\t\t\n\t\t\n\t\tif ($this->_expireAjax()) {\n return;\n }\n try {\n if (!$this->getRequest()->isPost()) {\n $this->_ajaxRedirectResponse();\n return;\n }\n\n // set payment to quote\n $result = array();\n $data = $this->getRequest()->getPost('payment', array());\n $result = $this->getOnepage()->savePayment($data);\n if( !Mage::getSingleton('checkout/session')->getLastRealOrderId() ){\n\t\t\t\t$this->saveOrder();\n }\n\t\t\t$order = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());\n // get section and redirect data\n $redirectUrl = $this->getOnepage()->getQuote()->getPayment()->getCheckoutRedirectUrl();\n if (empty($result['error']) && !$redirectUrl) {\n $this->loadLayout('checkout_onepage_review');\n $result['goto_section'] = 'review';\n $result['update_section'] = array(\n 'name' => 'review',\n 'html' => '<div class=\"order-tips\">'.Mage::Helper('repay/checkout')->getOrderCreateDesc($order).'</div>'.$this->_getReviewHtml()\n );\n }\n if ($redirectUrl) {\n $result['redirect'] = $redirectUrl;\n }\n\t\t\t\n } catch (Mage_Payment_Exception $e) {\n if ($e->getFields()) {\n $result['fields'] = $e->getFields();\n }\n $result['error'] = $e->getMessage();\n } catch (Mage_Core_Exception $e) {\n $result['error'] = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $result['error'] = $this->__('Unable to set Payment Method.');\n }\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }", "public function paymentAction() {\n\n $br = new bookingRecord();\n\n // check the session is still around\n if ($br->expired()) {\n $this->redirect($this->url('booking/expired'));\n }\n\n // resave session just to bump its time\n $br->save();\n\n // Get the purchase record\n $purchase = $this->bm->getPurchase($br);\n\n // work out final fare\n $fares = \\ORM::forTable('fares')->findOne(1);\n\n // Line up Sagepay class\n $sagepay = new sagepayserverlib();\n $sagepay->setController($this);\n $sagepay->setPurchase($purchase);\n $sagepay->setFare($this->bm->calculateFares($br));\n\n // anything submitted?\n if ($data = $this->getRequest()) {\n\n // Anything other than 'next' jumps back\n if (empty($data['next'])) {\n $this->redirect($this->Url('booking/contact'));\n }\n\n // If we get here we can process SagePay stuff\n // Register payment with Sagepay\n $sr = $sagepay->register();\n\n // If false is returned then it went wrong\n if ($sr === false) {\n $this->View('booking_fail', array(\n 'status' => 'N/A',\n 'diagnostic' => $sagepay->getError(),\n ));\n }\n\n // check status of registration from SagePay\n $status = $sr['Status'];\n if (($status != 'OK') && ($status != 'OK REPEATED')) {\n $this->View('booking_fail', array(\n 'status' => $status,\n 'diagnostic' => $sr['StatusDetail'],\n ));\n }\n\n // update purchase\n $purchase->securitykey = $sr['SecurityKey'];\n $purchase->regstatus = $status;\n $purchase->VPSTxId = $sr['VPSTxId'];\n $purchase->save();\n\n // redirect to Sage\n $url = $sr['NextURL'];\n header(\"Location: $url\");\n die;\n }\n }", "public function paymentPay(PaymentPayRequest $request)\n\t{\n\t //load file thanh phan\n\t $url = $this->setting('url');\n\t\t$return_url = $request->url_result;\n\t\t$tran_id = $request->tran->id;\n\t\t$amount = $request->amount;\n\t\t$payment_method = $this->setting('payment_method');\n\t\t$payment_method = (!in_array($payment_method, array(1, 2))) ? 2 : $payment_method;\n\t\t\n\t\t$language = $this->setting('language');\n\t\t$language = (!in_array($language, array('vi', 'en'))) ? 'vi' : $language;\n\t\t\n\t\t// Tao cac bien gui den payment\n\t\t$params = array();\n\t\t$params['website_id'] \t\t\t= $this->setting('website_id');\n\t\t$params['payment_method'] \t\t= $payment_method; // 1 = VND, 2 = USD\n\t\t$params['order_code'] \t\t\t= $tran_id;\n\t\t$params['amount']\t\t = $amount;\n\t\t$params['receiver_acc'] \t = $this->setting('receiver_acc');\n\t\t$params['param_extend'] \t = '';//'PaymentType:Visa;Direct:Master';\n\t\t$params['urlreturn'] = $return_url;\n\t\n\t\t//new version\n\t\t$plaintext = $params['website_id'] . \"-\"\n\t\t\t\t . $params['payment_method'] . \"-\"\n\t\t\t\t . $params['order_code'] . \"-\"\n\t\t\t\t . $params['amount'] . \"-\"\n\t\t\t\t . $params['receiver_acc'] . \"-\"\n\t\t\t\t . $params['param_extend'] . \"-\"\n\t\t\t\t . $this->setting('secret_key'). \"-\"\n\t\t\t\t . $params['urlreturn'];\n\t\t\n\t\t$customer_mobile = '';\n\t\t$sign = strtoupper(hash('sha256', $plaintext));\n\t\t$data = \"?website_id=\" . $params['website_id']\n\t\t. \"&l=\".$language\n\t\t//. \"&customer_mobile=\".$params['receiver_acc']\n\t\t. \"&payment_method=\" . $params['payment_method']\n\t\t. \"&order_code=\" . $params['order_code']\n\t\t. \"&amount=\" . $params['amount']\n\t\t. \"&receiver_acc=\" . $params['receiver_acc']\n\t\t. \"&urlreturn=\" . $params['urlreturn']\n\t\t. \"&param_extend=\" . $params['param_extend']\n\t\t. \"&sign=\" . $sign;\n\t\t\n\t\t// Chuyen den merchant\n\t\t$url = $url.$data;\n\t\t\n return PaymentPayResponse::redirect($url);\n\t}", "public function execute() {\n\t\t/**\n\t\t * @var PaymentProvider\n\t\t */\n\t\t$adyen = PaymentProviderFactory::getProviderForMethod( $this->getOption( 'method' ) );\n\n\t\t$savedDetailsResponse = $adyen->getSavedPaymentDetails( $this->getOption( 'pcid' ) );\n\t\tLogger::info( \"Tokenize result: \" . print_r( $savedDetailsResponse, true ) );\n\t}", "public function PaymentProcess()\n { \n $currency_result = $this->session->userdata('currency_result');\n $product_id = $this->input->post('product_id');\n $enquiryid = $this->input->post('enquiryid');\n $product = $this->checkout_model->get_all_details(PRODUCT, array('id' => $product_id));\n $this->load->library('paypal_class');\n $item_name = $this->input->post('product_name');\n $totalAmount = $this->input->post('price');\n //echo $totalAmount;exit();\n $currencyCode = $this->input->post('currencycode'); \n $user_currencycode = $this->input->post('user_currencycode');\n $loginUserId = $this->checkLogin('U');\n\t\t\t$currency_cron_id = $this->input->post('currency_cron_id');\n $quantity = 1;\n if ($this->session->userdata('randomNo') != '') {\n $delete = 'delete from ' . PAYMENT . ' where dealCodeNumber = \"' . $this->session->userdata('randomNo') . '\" and user_id = \"' . $loginUserId . '\" and status != \"Paid\" ';\n $this->checkout_model->ExecuteQuery($delete, 'delete');\n $dealCodeNumber = $this->session->userdata('randomNo');\n } else {\n $dealCodeNumber = mt_rand();\n }\n $insertIds = array();\n $now = date(\"Y-m-d H:i:s\");\n $paymentArr = array('product_id' => $product_id, 'price' => $totalAmount, 'indtotal' => $product->row()->price, 'sumtotal' => $totalAmount, 'user_id' => $loginUserId, 'sell_id' => $product->row()->user_id, 'created' => $now, 'dealCodeNumber' => $dealCodeNumber, 'status' => 'Pending', 'shipping_status' => 'Pending', 'total' => $totalAmount, 'EnquiryId' => $enquiryid, 'inserttime' => NOW(), 'currency_code' => $user_currencycode);\n $this->checkout_model->simple_insert(PAYMENT, $paymentArr);\n $insertIds[] = $this->db->insert_id(); \n $paymtdata = array('randomNo' => $dealCodeNumber, 'randomIds' => $insertIds);\n $lastFeatureInsertId = $dealCodeNumber;\n $this->session->set_userdata($paymtdata);\n $paypal_settings = unserialize($this->config->item('payment_0'));\n $paypal_settings = unserialize($paypal_settings['settings']);\n if ($paypal_settings['mode'] == 'sandbox') {\n $this->paypal_class->paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';\n } else {\n $this->paypal_class->paypal_url = 'https://www.paypal.com/cgi-bin/webscr'; // paypal url\n }\n if ($paypal_settings['mode'] == 'sandbox') {\n $ctype = 'USD';\n } else {\n $ctype = 'USD';\n }\n $logo = base_url() . 'images/logo/' . $this->data['logo_img'];\n $CurrencyType = $this->checkout_model->get_all_details(CURRENCY, array('currency_type' => $ctype));\n $this->paypal_class->add_field('currency_code', $CurrencyType->row()->currency_type);\n $this->paypal_class->add_field('image_url', $logo);\n $this->paypal_class->add_field('business', $paypal_settings['merchant_email']); // Business Email\n $this->paypal_class->add_field('return', base_url() . 'order/success/' . $loginUserId . '/' . $lastFeatureInsertId); // Return URL\n $this->paypal_class->add_field('cancel_return', base_url() . 'order/failure'); // Cancel URL\n $this->paypal_class->add_field('notify_url', base_url() . 'order/ipnpayment'); // Notify url\n $this->paypal_class->add_field('custom', 'Product|' . $loginUserId . '|' . $lastFeatureInsertId); // Custom Values\n $this->paypal_class->add_field('item_name', $item_name); // Product Name\n $this->paypal_class->add_field('user_id', $loginUserId);\n $this->paypal_class->add_field('quantity', $quantity); // Quantity\n if ($user_currencycode != 'USD') {\n /*if ($currency_result->$currencyCode) {\n $totalAmount = $totalAmount / $currency_result->$currencyCode;\n } else {\n $totalAmount = currency_conversion($currencyCode, 'USD', $totalAmount);\n }*/\n\t\t\t\t$totalAmount = currency_conversion($user_currencycode, 'USD', $totalAmount,$currency_cron_id);\n // echo $totalAmount;exit();\n }\n\t\t\t\n $this->paypal_class->add_field('amount', $totalAmount); // Price\n $this->paypal_class->submit_paypal_post();\n }", "public function paid(){\n \n $result = $this->pay->paid();\n \n $result['usertypeid'] = $this->main->get('usertypeid');\n $result['usertype'] = $this->main->get('usertype');\n $result['amount2word'] = convert_number_to_words((double)$result['amt']);\n\n $page_name = 'paid';\n \n $data['result'] = $result;\n \n //build view page for successfull Payment \n $page_content = $this->load->view($this->folder_name.'/'.$page_name, $data, true);\n $this->page->build($page_content, $this->folder_name, $page_name, $this->page_title ); \n \n }", "public function paymentAction()\n {\n\n $this->initUnipagosPaymentStep();\n $this->loadLayout(); \n $this->getLayout()->getBlock(\"head\")->setTitle($this->__(\"Unipagos Payment\"));\n $this->renderLayout(); \n }", "public function preparePayment() {\n\n $order = $this->getOrder();\n $payment = $this->getPaymentModule();\n\n $amount = $order->getTotalAmount();\n $amount = (int) round($amount * 100);\n $orderId = $order->get(\"id\");\n\n $payment->setId($orderId);\n $payment->setCurrency($this->modules->get(\"PadCart\")->currency);\n\n $url = $this->page->httpUrl;\n $payment->setProcessUrl($url . \"process/\" . $orderId . \"/\");\n $payment->setFailureUrl($url . \"fail/\");\n $payment->setCancelUrl($url . \"cancel/\");\n\n $customer = Array();\n $customer['givenName'] = $order->pad_firstname;\n $customer['familyName'] = $order->pad_lastname;\n $customer['streetAddress'] = $order->pad_address;\n $customer['streetAddress2'] = $order->pad_address2;\n $customer['locality'] = $order->pad_city;\n $customer['postalCode'] = $order->pad_postcode;\n $customer['country'] = $order->pad_countrycode;\n $customer['email'] = $order->email;\n $payment->setCustomerData($customer);\n\n foreach ($order->pad_products as $p) {\n $amount = $p->pad_price * 100; // Amount in payment modules always in cents\n if ($this->cart->prices_without_tax) $amount = $amount + ($p->pad_tax_amount * 100 / $p->pad_quantity); // TODO: currently we have only\n $payment->addProduct($p->title, $amount, $p->pad_quantity, $p->pad_percentage, $p->pad_product_id);\n }\n }", "function payment_success()\n {\n\t\t\t/*log_message('INFO', 'Inside order2/payment_success');\n\t\t\t$this->morder->equateProductsQuantities();\n\t\t\tlog_message('INFO', 'end equateProductsQuantities()______________________________________________________');*/\n\t\t\t/* END ADDED BY SHAMMI SHAILAJ */\n\t\t\t\n //print \"<p>inside payments success</p>\";\n include('header_include.php');\n $data['email'] = $this->session->userdata('email');\n $this->session->unset_userdata('email');\n $txnid= $this->session->userdata('e_txn_id');\n $data['transID'] = $txnid;\n //print \"<p>transID = \".$txnid.\"</p>\";\n if(is_null($this->session->userdata('e_txn_id')) || strcmp($this->session->userdata('e_txn_id'), \"\") === 0)\n {\n $data['transID'] = NULL;\n }\n $this->session->unset_userdata('e_txn_id');\n \n //purchase email\n $this->load->model('vc_orders');\n /* following code added by shammi to generate data for sokrati and ecommerce tracking */\n if(!is_null($data['transID']))\n {\n $transDataDB = $this->vc_orders->orderDetails($data['transID']);\n //print \"<pre>\";print_r($transDataDB);print \"</pre>\";\n //exit();\n if($transDataDB !== FALSE)\n {\n $data['prodsCount'] = count($transDataDB);\n $data ['buyerFName'] = $transDataDB[0]->shipping_fname;\n $data ['buyerLName'] = $transDataDB[0]->shipping_lname;\n $data['buyerAddress'] = $transDataDB[0]->shipping_address;\n $data['buyerCity'] = $transDataDB[0]->shipping_city;\n $data['buyerPinCode'] = $transDataDB[0]->shipping_pincode;\n $data['buyerState'] = $transDataDB[0]->shipping_state;\n $data['buyerCountry'] = $transDataDB[0]->shipping_country;\n $data['buyerUserID'] = $transDataDB[0]->user_id;\n $data['tax'] = 0;\n $grandTotal = 0;\n $products = array();\n if(is_array($products))\n {\n for($j=0;$j < $data['prodsCount']; $j++)\n {\n $product = new productInfo;\n $product->storeID = $transDataDB[$j]->store_id;\n $product->storeName = $transDataDB[$j]->store_name;\n $order_no = $transDataDB[$j]->order_id;\n $product->orderID = $transDataDB[$j]->order_id;\n $product->productName = $transDataDB[$j]->product_name;\n $product->vSize = $transDataDB[$j]->vsize;\n $product->vColor = $transDataDB[$j]->vcolor;\n $product->unitPrice = $transDataDB[$j]->amt_paid;\n $product->quantity = $transDataDB[$j]->quantity;\n $grandTotal += $transDataDB[$j]->amt_paid * $transDataDB[$j]->quantity;\n $product->productID = $transDataDB[$j]->product_id; \n $product->cid = $transDataDB[$j]->couponid;\n $products[$j] = $product;\n /* ADDED BY SHAMMI SHAILAJ to keep quantities in the new and old products table EQUAL (NEW METHOD)*/\n\t\t\t\t\t\t\t//log_message('INFO', 'Inside order2/payment_success');\n\t\t\t\t\t\t\t$this->load->model('slog');\n\t\t\t\t\t\t\t$this->slog->write(array('level' => 1, 'msg' => 'Inside order2/payment_success'));\n\t\t\t\t\t\t\t$this->morder->equateProductsQuantities2($product->productID);\n\t\t\t\t\t\t\t//log_message('INFO', 'end equateProductsQuantities2()______________________________________________________');\n\t\t\t\t\t\t\t$this->load->model('slog');\n\t\t\t\t\t\t\t$this->slog->write(array('level' =>1, 'msg' => 'end equateProductsQuantities2()______________________________________________________'));\n /* END ADDED BY SHAMMI SHAILAJ */\n }\n }\n else\n {\n $product = new productInfo;\n $product->storeID = $transDataDB->store_id;\n $product->storeName = $transDataDB->store_name;\n $order_no = $transDataDB->order_id;\n $product->orderID = $transDataDB->order_id;\n $product->productName = $transDataDB->product_name;\n $product->vSize = $transDataDB->vsize;\n $product->vColor = $transDataDB->vcolor;\n $product->unitPrice = $transDataDB->amt_paid;\n $product->quantity = $transDataDB->quantity;\n $product->productID = $transDataDB->product_id;\n $product->cid = $transDataDB->couponid;\n $grandTotal += $transDataDB->amt_paid * $transDataDB->quantity;\n $products[] = $product;\n }\n $data['grandTotal'] = $grandTotal;\n $data['products'] = $products;\n }\n //print \"<pre>\";print_r($transDataDB);print \"</pre>\";\n }\n /* end code added by shammi to generate data for sokrati and ecommerce tracking */\n $base_url = base_url();\n $ip_address = (string)$this->input->ip_address();\n //log_message('Info',\"Ipaddress = $ip_address\");\n $this->load->model('slog');\n $this->slog->write(array('level' => 1, 'msg' => \"Ipaddress = $ip_address\"));\n if($ip_address!='127.0.0.1')\n {\n //log_message('Info',\"Allow mail as the Ip is not 127.0.0.1\");\n $this->load->model('slog');\n $this->slog->write(array('level' =>1, 'msg' => \"Allow mail as the Ip is not 127.0.0.1\"));\n $mail_info = $this->vc_orders->purchaseMailDetails($txnid);\n $this->slog->write(array('level' =>1 ,'msg' => \"mail_info FROM ORDERS2/PAYMENT_SUCCESS_____\".print_r($mail_info, TRUE)));\n if($mail_info!=0)\n {\n $count_prod = count($mail_info);\n $buyer_name = $mail_info[0]['shipping_fname'].' '.$mail_info[0]['shipping_lname'];\n $shipping_address = $mail_info[0]['shipping_address'];\n $shipping_city = $mail_info[0]['shipping_city'];\n $pin_code = $mail_info[0]['shipping_pincode'];\n $couponcode = $mail_info[0]['couponid'];\n $payment_mode = $mail_info[0]['pg_type'];\n if ($payment_mode=='COD')\n {\n $payment_mode = 'Cash on Delivery';\n }\n elseif ($payment_mode=='CC')\n {\n $payment_mode = 'Credit Card';\n }\n elseif ($payment_mode=='DC')\n {\n $payment_mode = 'Debit Card';\n }\n elseif ($payment_mode=='NB')\n {\n $payment_mode = 'Net Banking';\n }\n \n for($j=0;$j<$count_prod;$j++)\n {\n $order_no = $mail_info[$j]['order_id'];\n $product_name = $mail_info[$j]['product_name'];\n $variant_size = \"Size: \".$mail_info[$j]['variant_size'];\n $variant_color = \"Color: \".$mail_info[$j]['variant_color'];\n $variant_details = \"\";\n $this->slog->write(array('level' => 1,'msg' => \"INDEX MAIL VALUE\".print_r($mail_info[$j]['sent_email_id'],TRUE)));\n if ($mail_info[$j]['variant_size']==\"0\" and $mail_info[$j]['variant_color']==\"0\")\n {\n $variant_details = \"\";\n }\n elseif ($mail_info[$j]['variant_size']!=\"0\" and $mail_info[$j]['variant_color']==\"0\")\n {\n $variant_details = \" - (\".$variant_size.\")\";\n }\n elseif ($mail_info[$j]['variant_size']==\"0\" and $mail_info[$j]['variant_color']!=\"0\")\n {\n $variant_details = \" - (\".$variant_color.\")\";\n }\n elseif ($mail_info[$j]['variant_size']!=\"0\" and $mail_info[$j]['variant_color']!=\"0\")\n {\n $variant_details = \" - (\".$variant_size.\",\".$variant_color.\")\";\n }\n $process_days = (int)$mail_info[$j]['process_days'];\n $productImagePath = './assets/images/stores/'.$mail_info[$j]['store_id'].'/'.$mail_info[$j]['product_id'].'/';\n if(file_exists($productImagePath.'fancy3.jpg'))\n {\n $productImage = $productImagePath.'fancy3.jpg';\n }\n elseif(file_exists($productImagePath.'fancy3.JPG'))\n {\n $productImage = $productImagePath.'fancy3.JPG';\n }\n else\n {\n $productImage = '';\n }\n //log_message('INFO', 'NOW queueing buyer EMAIL '.$mail_info[$j]['sent_email_id'].' for order no '.$mail_info[$j]['order_id']);\n $this->load->model('slog');\n $this->slog->write(array('level' => 1 , 'msg' => 'NOW queueing buyer EMAIL '.$mail_info[$j]['sent_email_id'].' for order no '.$mail_info[$j]['order_id']));\n include 'mail_4.php';\n //Buyer Purchase Email\n $this->load->model('automate_model');\n\t\t\t\t\t\t\t$jobType = 1; // an email job\n\t\t\t\t\t\t\t$jobCommand = \"/usr/bin/php5 \".__DIR__.\"/../../index.php automate email\";\n\t\t\t\t\t\t\t/* $jobScheduledTime = mktime(20, 37, 00, 10, 21, 2013); // 4:35:00 pm 12th October 2013 */\n\t\t\t\t\t\t\t$jobScheduledTime = (time() + 66); // current time + 1 minute 6 seconds\n\t\t\t\t\t\t\t$jobDetails = array\n\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t'to' => $mail_info[$j]['sent_email_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t'bcc' => '[email protected],[email protected]',\n\t\t\t\t\t\t\t\t\t\t\t\t'subject' => \"Your order with BuynBrag.com for order ID \".$order_no,\n\t\t\t\t\t\t\t\t\t\t\t\t'msg' => $purchase_message\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->automate_model->createJob($jobType, $jobCommand, $jobScheduledTime, $jobDetails);\n\t\t\t\t\t\t\t$this->slog->write( array('level' => 1, 'msg' => \"<p>An Email job has been created and will be executed on or after \".date('l, F jS, Y', $jobScheduledTime).\" at \".date('g:i:s A (P)', $jobScheduledTime).\" </p>\" ) );\n\n\t\t\t\t\t\t\t$smsMsg = \"Dear \".$mail_info[$j]['shipping_fname'].' '.$mail_info[$j]['shipping_lname'].\", \\r\\n Thank you for placing an order with us. Your order ID \".$mail_info[$j]['order_id'];\n\t\t\t\t\t\t\t$smsMsg .= \" will be dispatched by \".date( \"d-M-Y\", ( strtotime($mail_info[$j]['date_of_pickup']) ) ).\". Once dispatched, it will reach you in 1-5 working days. Contact us on +91-8130878822 or [email protected] \\r\\n Team BuynBrag\";\n\n\t\t\t\t\t\t\t$smsNo = $mail_info[$j]['shipping_phoneno'];\n\t\t\t\t\t\t\tif($smsNo == '' )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$smsNo = NULL;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->load->model('smsc');\n\t\t\t\t\t\t\t$this->smsc->sendSMS($smsNo, $smsMsg);\n\t\t\t\t\t\t\t$this->slog->write( array( 'level' => 1, 'msg' => 'Just sent an SMS to '.json_encode($smsNo).'. The msg sent is <p>'.$smsMsg.'</p>' ) );\n\n\t\t\t\t\t\t\t// now set an email job to be executed only after 24 hours if the seller has not sent the mail\n\t\t\t\t\t\t\t$orderEmail11Data = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$orderEmail11Data['storeOwnerName'] = $mail_info[$j]['owner_name'];\n\t\t\t\t\t\t\t$orderEmail11Data['orderID'] = $mail_info[$j]['order_id'];\n\t\t\t\t\t\t\t$orderEmail11Data['dispatchDate'] = $mail_info[$j]['date_of_pickup'];\n\t\t\t\t\t\t\t$orderEmail11Data['storeOwnerEmail'] = $mail_info[$j]['contact_email'];\n\t\t\t\t\t\t\t$orderEmail11Data['storeName'] = $mail_info[$j]['store_name'];\n\t\t\t\t\t\t\t$orderEmail11Data['productName'] = $mail_info[$j]['product_name'];\n\t\t\t\t\t\t\t$orderEmail11Data['productID'] = $mail_info[$j]['product_id'];\n\t\t\t\t\t\t\t$orderEmail11Data['bnbProductCode'] = $mail_info[$j]['bnb_product_code'];\n\t\t\t\t\t\t\t$orderEmail11Data['amountPaid'] = $mail_info[$j]['amt_paid'] * $mail_info[$j]['quantity'];\n\t\t\t\t\t\t\t$orderEmail11Data['paymentType'] = $mail_info[$j]['pg_type'];\n\t\t\t\t\t\t\t$orderEmail11Data['buyerName'] = $mail_info[$j]['shipping_fname'].\" \".$mail_info[$j]['shipping_lname'];\n\t\t\t\t\t\t\t$orderEmail11Data['buyerAddress'] = $mail_info[$j]['shipping_address'].\"<br/>\".$mail_info[$j]['shipping_city'].\"<br/>\".$mail_info[$j]['shipping_pincode'];\n\t\t\t\t\t\t\t$orderEmail11Data['buyerContactNumber'] = $mail_info[$j]['shipping_phoneno'];\n\t\t\t\t\t\t\t$orderEmail11Data['processingTime'] = $mail_info[$j]['process_days'];\n\n\t\t\t\t\t\t\t$orderEmail11 = $this->load->view('emailers/orderEmail11', $orderEmail11Data, TRUE);\n\n\t\t\t\t\t\t\t$jobType = 4; // a check and then send email job depending upon the result of the check\n\t\t\t\t\t\t\t$jobCommand = \"/usr/bin/php5 \".__DIR__.\"/../../index.php automate index\";\n\t\t\t\t\t\t\t/* $jobScheduledTime = mktime(20, 37, 00, 10, 21, 2013); // 4:35:00 pm 12th October 2013 */\n\t\t\t\t\t\t\t$jobScheduledTime = (time() + 86460); // current time + 1 day (24 hrs 1 minute)\n\t\t\t\t\t\t\t$jobDetails = array\n\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t'orderID' => $order_no,\n\t\t\t\t\t\t\t\t\t\t\t\t'to' => ( (empty($mail_info[$j]['contact_email']) )? $mail_info[$j]['contact_email'] : '[email protected]'),\n\t\t\t\t\t\t\t\t\t\t\t\t'bcc' => '[email protected],[email protected],[email protected]',\n\t\t\t\t\t\t\t\t\t\t\t\t'subject' => \"Your order with BuynBrag.com for order ID \".$order_no,\n\t\t\t\t\t\t\t\t\t\t\t\t'msg' => $orderEmail11\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->automate_model->createJob($jobType, $jobCommand, $jobScheduledTime, $jobDetails);\n\t\t\t\t\t\t\t$this->slog->write( array('level' => 1, 'msg' => \"<p>A check and then email job has been created and will be executed on or after \".date('l, F jS, Y', $jobScheduledTime).\" at \".date('g:i:s A T (P)', $jobScheduledTime).\" </p>\" ) );\n\t\t\t\t\t\t\t/* OLD EMAIL SENDING CODE\n $this->load->library('email');\n $mailArraylog = array();\n $this->email->from('[email protected]','BuynBrag');\n $this->email->to($mail_info[$j]['sent_email_id']);\n $this->email->bcc('[email protected],[email protected]');\n $this->email->subject(\"BuynBrag: Order Success,Order Id:$order_no\");\n\n $this->email->message($purchase_message);\n $this->email->set_newline(\"\\r\\n\");\n if($this->email->send())\n {\n log_message('Info', 'SUCCESSFULLY SENT EMAIL to buyer '.$mail_info[$j]['sent_email_id'].' for order no '.$mail_info[$j]['order_id']);\n $mailArraylog = array('level' => 1, 'send status' => 1,'to' => $mail_info[$j]['sent_email_id'],'bcc' =>'[email protected],[email protected]','From' => '[email protected]','mail content' => $purchase_message);\n $this->load->model('slog');\n $this->slog->write($mailArraylog);\n }\n else\n {\n log_message('Info', 'FAILED SENDING EMAIL to buyer '.$mail_info[$j]['sent_email_id'].' for order no '.$mail_info[$j]['order_id']);\n }*/\n\n //////////////////////////////\n $owner_name = $mail_info[$j]['owner_name'];\n $owner_email = $mail_info[$j]['contact_email'];\n $total_amount = $mail_info[$j]['amt_paid'] * $mail_info[$j]['quantity'];\n include 'mail_7.php';\n\n $sellerSMSMsg = \"Dear \".$mail_info[$j]['owner_name'].\", \\r\\n You have recieved a new order for \".$mail_info[$j]['product_name'].\". The order ID is \".$mail_info[$j]['order_id'];\n\t\t\t\t\t\t\t$sellerSMSMsg .= \" and the quantity ordered is \".$mail_info[$j]['quantity'].\". Please make sure that the product is dispatched by \".date( \"d-M-Y\", ( ( strtotime($mail_info[$j]['date_of_pickup']) ) - 86400) ).\". Contact us on +91-8130878822 or [email protected] \\r\\n Team BuynBrag\";\n\n\t\t\t\t\t\t\t$sellerSMSNo = $mail_info[$j]['contact_number'];\n\t\t\t\t\t\t\tif($sellerSMSNo == '' )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$sellerSMSNo = NULL;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->smsc->sendSMS($sellerSMSNo, $sellerSMSMsg);\n\t\t\t\t\t\t\t$this->slog->write( array( 'level' => 1, 'msg' => 'Just sent seller SMS to '.json_encode($sellerSMSNo).'. The msg sent is <p>'.$sellerSMSMsg.'</p>' ) );\n\n //Seller New Order Email\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/*$config['protocol'] = 'smtp';\n\t\t\t\t\t\t\t$config['smtp_host'] = 'ssl://smtp.googlemail.com';\n\t\t\t\t\t\t\t$config['smtp_port'] = 465;\n\t\t\t\t\t\t\t$config['smtp_user'] = '[email protected]';\n\t\t\t\t\t\t\t$config['smtp_pass'] = '';*/\n\n $this->load->library('email');\n $mailArraylog2 = array();\n $this->email->clear(TRUE);\n $this->email->from('[email protected]','BuynBrag');\n if(empty($owner_email))\n {\n \t//log_message('INFO', 'Seller email ('.$mail_info[$j]['contact_email'].') is empty. Sellers EMAIL will be sent to [email protected]');\n \t$this->load->model('slog');\n \t$this->slog->write(array('level' => 1 , 'msg' => 'Seller email ('.$mail_info[$j]['contact_email'].') is empty. Sellers EMAIL will be sent to [email protected]'));\n $owner_email = '[email protected]';\n }\n\n $this->email->to($owner_email);\n $this->email->bcc('[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]');\n $this->email->subject(\"New Order from BuynBrag,Order Id:\".$order_no);\n $this->email->message($new_order_message);\n $this->email->attach('./invoice/'.$txnid.'/buyer_invoice_order_'.$order_no.'.pdf');\n \n if(!empty($productImage))\n {\n $this->email->attach($productImage);\n }\n\n $this->email->set_newline(\"\\r\\n\");\n \n if($this->email->send())\n {\n //log_message('Info',\"Seller eMail sent to $owner_email for order no: $order_no\");\n $this->load->model('slog');\n $this->slog->write(array('level' => 1 , 'msg' => \"Seller eMail sent to $owner_email for order no: $order_no\" ));\n $mailArraylog2 = array('level' => 1, 'send status' => 1,'to' => $owner_email,'bcc' =>'[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]','From' => '[email protected]','emsg' => $new_order_message);\n $this->load->model('slog');\n $this->slog->write($mailArraylog2);\n if($j==($count_prod-1))\n {\n $this->vc_orders->purchase_mail_success($txnid);\n }\n }\n else\n {\n //log_message('Info',\"ERROR occurred while sending Seller email to $owner_email order no: $order_no\");\n $this->load->model('slog');\n $this->slog->write( array('level' => 1, 'msg' => \"ERROR occurred while sending Seller email to $owner_email order no: \".$order_no, 'debug' => $this->email->print_debugger() ) );\n $mailArraylog2 = array('level' => 1, 'send status' => 0,'to' => $owner_email,'bcc' =>'[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]','From' => '[email protected]','emsg' => $new_order_message);\n $this->load->model('slog');\n $this->slog->write($mailArraylog2);\n \n }\n $this->email->clear(TRUE);\n //end email send\n }//end for\n \n }//end if mail_info !=0\n }\n else\n {\n log_message('Info',\"Don't Allow mail as the Ip is 127.0.0.1\");\n $this->load->model('slog');\n $this->slog->write(array('level' => 1, 'msg' => \"Don't Allow mail as the Ip is 127.0.0.1\"));\n }\n $this->load->view('order_success',$data);\n }", "function submit() {\n\n require_once(dirname(__FILE__) . \"/paycoingateway-php/paycoingateway.php\");\n\n $api_key = get_option(\"paycoingateway_wpe_api_key\");\n $api_secret = get_option(\"paycoingateway_wpe_api_secret\");\n $paycoingateway = PaycoinGateway::withApiKey($api_key, $api_secret);\n\n $callback_secret = get_option(\"paycoingateway_wpe_callbacksecret\");\n if($callback_secret == false) {\n $callback_secret = sha1(openssl_random_pseudo_bytes(20));\n update_option(\"paycoingateway_wpe_callbacksecret\", $callback_secret);\n }\n $callback_url = $this->cart_data['notification_url'];\n $callback_url = add_query_arg('gateway', 'wpsc_merchant_paycoingateway', $callback_url);\n $callback_url = add_query_arg('callback_secret', $callback_secret, $callback_url);\n\n $return_url = add_query_arg( 'sessionid', $this->cart_data['session_id'], $this->cart_data['transaction_results_url'] );\n $return_url = add_query_arg( 'wpsc_paycoingateway_return', true, $return_url );\n $cancel_url = add_query_arg( 'cancelled', true, $return_url );\n\n $params = array (\n 'name' => 'Your Order',\n 'price_string' => $this->cart_data['total_price'],\n 'price_currency_iso' => $this->cart_data['store_currency'],\n 'callback_url' => $callback_url,\n 'custom' => $this->cart_data['session_id'],\n 'success_url' => $return_url,\n 'cancel_url' => $cancel_url\n );\n\n try {\n $code = $paycoingateway->createButtonWithOptions($params)->button->code;\n } catch (Exception $e) {\n $msg = $e->getMessage();\n error_log (\"There was an error creating a PaycoinGateway checkout page: $msg. Make sure you've connected a merchant account in paycoingateway settings.\");\n exit();\n }\n\n wp_redirect(\"https://www.paycoingateway.com/checkouts/$code\");\n exit();\n\n }", "public function finish()\n\t{\n\t\t//first we deactivate the quote\n\t\t$this->_getQuote()->setIsActive(false)->save();\n\t\t\n\t\t//now we add the payment information to the order payment\n\t\t$this->_getMethodInstance()->addRequestData($this->getResponse());\n\t\t\n\t\t//now we authorise the payment\n\t\tif(false === $this->_getMethodInstance()->authPayment($this->getResponse())){\n\t\t\tMage::throwException(\"Payment Failure\");\n\t\t}\n\t\t\n\t\t//now we shift the order to either pending state, \n\t\t// or processing state (with invoice) depending on the capture settings.\n\t\t$this->_getMethodInstance()->process($this->getResponse());\n\t\t\n\t\t//send off the new order email\n\t\t$this->_getOrder()->sendNewOrderEmail();\n\t}", "function processOneTimePlan(&$order,$post_vars)\n {\n $c = &$this->c;\n $PaidTxnLog = ClassRegistry::getClass('PaidTxnLogModel');\n $PaidOrder = ClassRegistry::getClass('PaidOrderModel');\n\n # Begin txn validation\n // Assign posted variables to local variables\n $payment_status = Sanitize::getString($post_vars,'payment_status');\n $receiver_email = $post_vars['receiver_email'];\n $pending_reason = Sanitize::getString($post_vars,'pending_reason',__t(\"N/A\",true));\n\n // Extract custom fields\n $custom = json_decode($post_vars['custom'],true);\n $user_id = $custom['user_id'];\n $order_id = $custom['order_id']; // Local order id\n\n // Check the payment_status is Completed\n if ($payment_status == \"Completed\")\n {\n $result = $this->validateTxn($order,$post_vars);\n }\n else\n {\n $PaidTxnLog->addNote(\"Pending reason: {$pending_reason}.\");\n $result = false;\n }\n # End txn validation\n\n if ($result)\n { // Valid\n $order['PaidOrder']['order_status'] = 'Complete';\n $c->Paidlistings->processSuccessfulOrder($order);\n }\n else\n { // Invalid\n switch($post_vars['payment_status'])\n {\n case 'Pending':\n $order_status = 'Pending';\n break;\n case 'Denied':\n $order_status = 'Failed';\n break;\n case 'Reversed':\n $order_status = 'Fraud';\n break;\n default:\n $order_status = 'Pending';\n break;\n }\n $PaidTxnLog->addNote(\"Payment status: {$order_status}.\");\n $PaidTxnLog->addNote(\"Order active: 0\");\n $PaidOrder->updateOrder($order,array('order_status'=>$order_status,'order_active'=>0));\n }\n return $result;\n }", "public function successAction() {\n\t\t\t$strResult = $_REQUEST['responseXml'];\n\t\t\t$strResult = stripslashes($strResult);\n\n\t\t\t$doc = new DOMDocument();\n\t\t\t$doc->loadXML($strResult);\n \n\t\t\t$result = $doc->getElementsByTagName( \"result\" );\n\t\t\tforeach( $result as $value )\n\t\t\t{\n\t\t\t$resultCode = $value->getElementsByTagName( \"resultCode\" );\n\t\t\t$resCode = $resultCode->item(0)->nodeValue;\n \n\t\t\t$resultMessage = $value->getElementsByTagName( \"resultMessage\" );\n\t\t\t$resMessage = $resultMessage->item(0)->nodeValue;\n \n\t\t\t$resultText = $value->getElementsByTagName( \"resultText\" );\n\t\t\t$resText = $resultText->item(0)->nodeValue;\n\t\t\t}\n\t\t\t\n\t\t\t//forward to failure page if payment is unsuccessful\n\t\t\tif($resMessage != 'Captured'){\n\t\t\t\t$this->_forward('failure');\n\t\t\t}\n\t\t\t//payment successful\n\t\t\telseif($resMessage == 'Captured')\n\t\t\t{\n\t\t\t//retrieve order id\n\t\t\t$event = $this->getRequest()->getParams();\n $transaction_id= $event['transaction_id'];\t\t\t\n\t\t\t\n\t\t\t//add note about successful payment to order in the backoffice\n\t\t\t$order = Mage::getModel('sales/order')->loadByIncrementId($transaction_id);\n\t\t\t\n\t\t\t$order->addStatusToHistory(\n\t\t\t\t$order->getStatus(),\n\t\t\t\tMage::helper('cps')->__(\"Customer's credit card was successfuly charged by CPS.\")\n\t\t\t);\t\n\t\t\t\t\t\t\n\t\t\t//send email about the order to customer\n\t\t\t$order->sendNewOrderEmail()->setEmailSent(true)->save();\n\t\t\t\n\t\t\t//create invoice for successful payment\n\t\t\tif(!$order->canInvoice())\n {\n Mage::throwException(Mage::helper('core')->__('Cannot create an invoice.'));\n }\t\t\t\n\t\t\t$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice(); \n\t\t\tif (!$invoice->getTotalQty()) {\n\t\t\tMage::throwException(Mage::helper('core')->__('Cannot create an invoice without products.'));\n\t\t\t} \n\t\t\t$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);\n\t\t\t$invoice->register();\n\t\t\t$transactionSave = Mage::getModel('core/resource_transaction')\n\t\t\t->addObject($invoice)\n\t\t\t->addObject($invoice->getOrder());\n\t\t\t$transactionSave->save();\n\t\t\t\n\t\t\t//set order status to \"Processing\" and save order\n\t\t\t$order->setStatus(Mage_Sales_Model_Order::STATE_PROCESSING, true);\n\t\t\t$order->save();\n\t\t\t\n\t\t\t//redirect to success page\n\t\t\t$this->_getCheckout()->setLastSuccessQuoteId($order->getQuoteId());\n $this->_redirect('checkout/onepage/success', array('_secure'=>true));\n\t\t\t}\n\t\t\n }", "public function _postPayment( $data )\n{\n\t// Process the payment\n\t$vars = new JObject;\n\t$jinput = JFactory::getApplication()->input;\n\t$app = JFactory::getApplication();\n\t$paction = $jinput->get('paction');\n\n\tswitch ($paction)\n\t{\n\t\tcase 'process_recurring':\n\t\t\t// TODO Complete this\n\t\t\t$app->close();\n\t\tbreak;\n\t\tcase 'process':\n\t\t\t$vars->message = $this->_process();\n\t\t\t$html = $this->_getLayout('message', $vars);\n\t\tbreak;\n\t\tdefault:\n\t\t\t$vars->message = JText::_('COM_TIENDA_INVALID_ACTION');\n\t\t\t$html = $this->_getLayout('message', $vars);\n\t\tbreak;\n\t}\n\n\treturn $html;\n}", "public function record_payment()\r\n {\r\n if (!has_permission('payments', '', 'create')) {\r\n access_denied('Record Payment');\r\n }\r\n if ($this->input->post()) {\r\n $this->load->model('payments_model');\r\n $id = $this->payments_model->process_payment($this->input->post(), '');\r\n if ($id) {\r\n set_alert('success', _l('invoice_payment_recorded'));\r\n redirect(admin_url('payments/payment/' . $id));\r\n } else {\r\n set_alert('danger', _l('invoice_payment_record_failed'));\r\n }\r\n redirect(admin_url('invoices/list_invoices/' . $this->input->post('invoiceid')));\r\n }\r\n }", "function saveOrder()\n\t\t{\n\t\t\tglobal $current_user, $wpdb, $pmpro_checkout_id;\n\n\t\t\t//get a random code to use for the public ID\n\t\t\tif(empty($this->code))\n\t\t\t\t$this->code = $this->getRandomCode();\n\n\t\t\t//figure out how much we charged\n\t\t\tif(!empty($this->InitialPayment))\n\t\t\t\t$amount = $this->InitialPayment;\n\t\t\telseif(!empty($this->subtotal))\n\t\t\t\t$amount = $this->subtotal;\n\t\t\telse\n\t\t\t\t$amount = 0;\n\n\t\t\t//Todo: Tax?!, Coupons, Certificates, affiliates\n\t\t\tif(empty($this->subtotal))\n\t\t\t\t$this->subtotal = $amount;\n\t\t\tif(isset($this->tax))\n\t\t\t\t$tax = $this->tax;\n\t\t\telse\n\t\t\t\t$tax = $this->getTax(true);\n\t\t\t$this->certificate_id = \"\";\n\t\t\t$this->certificateamount = \"\";\n\n\t\t\t//calculate total\n\t\t\tif(!empty($this->total))\n\t\t\t\t$total = $this->total;\n\t\t\telse {\n\t\t\t\t$total = (float)$amount + (float)$tax;\n\t\t\t\t$this->total = $total;\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t//these fix some warnings/notices\n\t\t\tif(empty($this->billing))\n\t\t\t{\n\t\t\t\t$this->billing = new stdClass();\n\t\t\t\t$this->billing->name = $this->billing->street = $this->billing->city = $this->billing->state = $this->billing->zip = $this->billing->country = $this->billing->phone = \"\";\n\t\t\t}\n\t\t\tif(empty($this->user_id))\n\t\t\t\t$this->user_id = 0;\n\t\t\tif(empty($this->paypal_token))\n\t\t\t\t$this->paypal_token = \"\";\n\t\t\tif(empty($this->couponamount))\n\t\t\t\t$this->couponamount = \"\";\n\t\t\tif(empty($this->payment_type))\n\t\t\t\t$this->payment_type = \"\";\n\t\t\tif(empty($this->payment_transaction_id))\n\t\t\t\t$this->payment_transaction_id = \"\";\n\t\t\tif(empty($this->subscription_transaction_id))\n\t\t\t\t$this->subscription_transaction_id = \"\";\n\t\t\tif(empty($this->affiliate_id))\n\t\t\t\t$this->affiliate_id = \"\";\n\t\t\tif(empty($this->affiliate_subid))\n\t\t\t\t$this->affiliate_subid = \"\";\n\t\t\tif(empty($this->session_id))\n\t\t\t\t$this->session_id = \"\";\n\t\t\tif(empty($this->accountnumber))\n\t\t\t\t$this->accountnumber = \"\";\n\t\t\tif(empty($this->cardtype))\n\t\t\t\t$this->cardtype = \"\";\n\t\t\tif(empty($this->expirationmonth))\n\t\t\t\t$this->expirationmonth = \"\";\n\t\t\tif(empty($this->expirationyear))\n\t\t\t\t$this->expirationyear = \"\";\n\t\t\tif(empty($this->ExpirationDate))\n\t\t\t\t$this->ExpirationDate = \"\";\n\t\t\tif (empty($this->status))\n\t\t\t\t$this->status = \"\";\n\n\t\t\tif(empty($this->gateway))\n\t\t\t\t$this->gateway = pmpro_getOption(\"gateway\");\n\t\t\tif(empty($this->gateway_environment))\n\t\t\t\t$this->gateway_environment = pmpro_getOption(\"gateway_environment\");\n\n\t\t\tif(empty($this->datetime) && empty($this->timestamp))\n\t\t\t\t$this->datetime = date(\"Y-m-d H:i:s\", time());\n\t\t\telseif(empty($this->datetime) && !empty($this->timestamp) && is_numeric($this->timestamp))\n\t\t\t\t$this->datetime = date(\"Y-m-d H:i:s\", $this->timestamp);\t//get datetime from timestamp\n\t\t\telseif(empty($this->datetime) && !empty($this->timestamp))\n\t\t\t\t$this->datetime = $this->timestamp;\t\t//must have a datetime in it\n\n\t\t\tif(empty($this->notes))\n\t\t\t\t$this->notes = \"\";\n\n\t\t\tif(empty($this->checkout_id) || intval($this->checkout_id)<1) {\n\t\t\t\t$highestval = $wpdb->get_var(\"SELECT MAX(checkout_id) FROM $wpdb->pmpro_membership_orders\");\n\t\t\t\t$this->checkout_id = intval($highestval)+1;\n\t\t\t\t$pmpro_checkout_id = $this->checkout_id;\n\t\t\t}\n\n\t\t\t//build query\n\t\t\tif(!empty($this->id))\n\t\t\t{\n\t\t\t\t//set up actions\n\t\t\t\t$before_action = \"pmpro_update_order\";\n\t\t\t\t$after_action = \"pmpro_updated_order\";\n\t\t\t\t//update\n\t\t\t\t$this->sqlQuery = \"UPDATE $wpdb->pmpro_membership_orders\n\t\t\t\t\t\t\t\t\tSET `code` = '\" . $this->code . \"',\n\t\t\t\t\t\t\t\t\t`session_id` = '\" . $this->session_id . \"',\n\t\t\t\t\t\t\t\t\t`user_id` = \" . intval($this->user_id) . \",\n\t\t\t\t\t\t\t\t\t`membership_id` = \" . intval($this->membership_id) . \",\n\t\t\t\t\t\t\t\t\t`paypal_token` = '\" . $this->paypal_token . \"',\n\t\t\t\t\t\t\t\t\t`billing_name` = '\" . esc_sql($this->billing->name) . \"',\n\t\t\t\t\t\t\t\t\t`billing_street` = '\" . esc_sql($this->billing->street) . \"',\n\t\t\t\t\t\t\t\t\t`billing_city` = '\" . esc_sql($this->billing->city) . \"',\n\t\t\t\t\t\t\t\t\t`billing_state` = '\" . esc_sql($this->billing->state) . \"',\n\t\t\t\t\t\t\t\t\t`billing_zip` = '\" . esc_sql($this->billing->zip) . \"',\n\t\t\t\t\t\t\t\t\t`billing_country` = '\" . esc_sql($this->billing->country) . \"',\n\t\t\t\t\t\t\t\t\t`billing_phone` = '\" . esc_sql($this->billing->phone) . \"',\n\t\t\t\t\t\t\t\t\t`subtotal` = '\" . $this->subtotal . \"',\n\t\t\t\t\t\t\t\t\t`tax` = '\" . $this->tax . \"',\n\t\t\t\t\t\t\t\t\t`couponamount` = '\" . $this->couponamount . \"',\n\t\t\t\t\t\t\t\t\t`certificate_id` = \" . intval($this->certificate_id) . \",\n\t\t\t\t\t\t\t\t\t`certificateamount` = '\" . $this->certificateamount . \"',\n\t\t\t\t\t\t\t\t\t`total` = '\" . $this->total . \"',\n\t\t\t\t\t\t\t\t\t`payment_type` = '\" . $this->payment_type . \"',\n\t\t\t\t\t\t\t\t\t`cardtype` = '\" . $this->cardtype . \"',\n\t\t\t\t\t\t\t\t\t`accountnumber` = '\" . $this->accountnumber . \"',\n\t\t\t\t\t\t\t\t\t`expirationmonth` = '\" . $this->expirationmonth . \"',\n\t\t\t\t\t\t\t\t\t`expirationyear` = '\" . $this->expirationyear . \"',\n\t\t\t\t\t\t\t\t\t`status` = '\" . esc_sql($this->status) . \"',\n\t\t\t\t\t\t\t\t\t`gateway` = '\" . $this->gateway . \"',\n\t\t\t\t\t\t\t\t\t`gateway_environment` = '\" . $this->gateway_environment . \"',\n\t\t\t\t\t\t\t\t\t`payment_transaction_id` = '\" . esc_sql($this->payment_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t`subscription_transaction_id` = '\" . esc_sql($this->subscription_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t`timestamp` = '\" . esc_sql($this->datetime) . \"',\n\t\t\t\t\t\t\t\t\t`affiliate_id` = '\" . esc_sql($this->affiliate_id) . \"',\n\t\t\t\t\t\t\t\t\t`affiliate_subid` = '\" . esc_sql($this->affiliate_subid) . \"',\n\t\t\t\t\t\t\t\t\t`notes` = '\" . esc_sql($this->notes) . \"',\n\t\t\t\t\t\t\t\t\t`checkout_id` = \" . intval($this->checkout_id) . \"\n\t\t\t\t\t\t\t\t\tWHERE id = '\" . $this->id . \"'\n\t\t\t\t\t\t\t\t\tLIMIT 1\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set up actions\n\t\t\t\t$before_action = \"pmpro_add_order\";\n\t\t\t\t$after_action = \"pmpro_added_order\";\n\t\t\t\t\n\t\t\t\t//only on inserts, we might want to set the expirationmonth and expirationyear from ExpirationDate\n\t\t\t\tif( (empty($this->expirationmonth) || empty($this->expirationyear)) && !empty($this->ExpirationDate)) {\n\t\t\t\t\t$this->expirationmonth = substr($this->ExpirationDate, 0, 2);\n\t\t\t\t\t$this->expirationyear = substr($this->ExpirationDate, 2, 4);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//insert\n\t\t\t\t$this->sqlQuery = \"INSERT INTO $wpdb->pmpro_membership_orders\n\t\t\t\t\t\t\t\t(`code`, `session_id`, `user_id`, `membership_id`, `paypal_token`, `billing_name`, `billing_street`, `billing_city`, `billing_state`, `billing_zip`, `billing_country`, `billing_phone`, `subtotal`, `tax`, `couponamount`, `certificate_id`, `certificateamount`, `total`, `payment_type`, `cardtype`, `accountnumber`, `expirationmonth`, `expirationyear`, `status`, `gateway`, `gateway_environment`, `payment_transaction_id`, `subscription_transaction_id`, `timestamp`, `affiliate_id`, `affiliate_subid`, `notes`, `checkout_id`)\n\t\t\t\t\t\t\t\tVALUES('\" . $this->code . \"',\n\t\t\t\t\t\t\t\t\t '\" . session_id() . \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->user_id) . \",\n\t\t\t\t\t\t\t\t\t \" . intval($this->membership_id) . \",\n\t\t\t\t\t\t\t\t\t '\" . $this->paypal_token . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql(trim($this->billing->name)) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql(trim($this->billing->street)) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->city) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->state) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->zip) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->country) . \"',\n\t\t\t\t\t\t\t\t\t '\" . cleanPhone($this->billing->phone) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->subtotal . \"',\n\t\t\t\t\t\t\t\t\t '\" . $tax . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->couponamount. \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->certificate_id) . \",\n\t\t\t\t\t\t\t\t\t '\" . $this->certificateamount . \"',\n\t\t\t\t\t\t\t\t\t '\" . $total . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->payment_type . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->cardtype . \"',\n\t\t\t\t\t\t\t\t\t '\" . hideCardNumber($this->accountnumber, false) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->expirationmonth . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->expirationyear . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->status) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->gateway . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->gateway_environment . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->payment_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->subscription_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->datetime) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->affiliate_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->affiliate_subid) . \"',\n\t\t\t\t\t\t\t\t\t\t'\" . esc_sql($this->notes) . \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->checkout_id) . \"\n\t\t\t\t\t\t\t\t\t )\";\n\t\t\t}\n\n\t\t\tdo_action($before_action, $this);\n\t\t\tif($wpdb->query($this->sqlQuery) !== false)\n\t\t\t{\n\t\t\t\tif(empty($this->id))\n\t\t\t\t\t$this->id = $wpdb->insert_id;\n\t\t\t\tdo_action($after_action, $this);\n\t\t\t\treturn $this->getMemberOrderByID($this->id);\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}", "public function executeInitAutoRecharge()\n {\n $sms = new Lib\\SMS();\n $key = $sms->getPreapprovalKey( $this->getParameter( 'amount' ) );\n if ( $key !== false ) {\n wp_send_json_success( array( 'paypal_preapproval' => 'https://www.paypal.com/cgi-bin/webscr?cmd=_ap-preapproval&preapprovalkey=' . $key ) );\n } else {\n wp_send_json_error( array( 'message' => __( 'Auto-Recharge has failed, please replenish your balance directly.', 'bookly' ) ) );\n }\n }", "function _exp_checkout_do_payment() {\n global $event_details;\n $event_id = $event_details['ID'];\n\n if ( is_null( $event_id ) ) {\n return false;\n }\n\n $regis_id = $this->erm->get_regis_id();\n $post_ID = $_SESSION['__epl']['post_ID'];\n $this->ecm->setup_event_details( $event_id );\n $_totals = $this->erm->calculate_totals();\n $total = $_totals['money_totals']['grand_total'];\n\n $this->epl->load_file( 'libraries/gateways/twocheckout/twocheckout.php' );\n $twocheckout_response = new TCO_Payment();\n $twocheckout_response->setAcctInfo();\n $response = $twocheckout_response->getResponse();\n if ( is_array( $response )) {\n $data['post_ID'] = $post_ID;\n $data['_epl_regis_status'] = '5';\n $data['_epl_grand_total'] = $total;\n $data['_epl_payment_amount'] = $response['total'];\n $data['_epl_payment_date'] = current_time( 'mysql' );\n $data['_epl_payment_method'] = '_tco';\n $data['_epl_transaction_id'] = $response['order_number'];\n\n $data = apply_filters( 'epl_tco_response_data', $data, $response );\n\n $this->erm->update_payment_data( $data );\n\n return true;\n } else {\n $error = 'ERROR: ' . 'MD5 Hash does not match! Contact the seller!';\n }\n }", "public function paymentAction()\n {\n try {\n /* @var $session Mage_Checkout_Model_Session */\n $session = Mage::getSingleton('checkout/session');\n\n /**\n * @var $order Mage_Sales_Model_Order\n */\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId($session->getLastRealOrderId());\n\n if (!$order->getId()) {\n Mage::throwException('No order for processing found');\n }\n\n $paymentMethod = $order->getPayment()->getMethodInstance();\n\n $url = $paymentMethod->getGatewayUrl($order);\n\n if(!$order->getEmailSent()) {\n $order->sendNewOrderEmail();\n $order->setEmailSent(true);\n }\n\n /**\n * @var $quote Mage_Sales_Model_Quote\n */\n $quote = Mage::getSingleton('sales/quote');\n $quote->load($order->getQuoteId());\n $quote->setIsActive(true);\n $quote->save();\n\n // redirect customer to the cart (dirty)\n $block = new Mage_Core_Block_Template();\n $block->setTemplate('mcpservice/redirect.phtml');\n $block->assign('url',$url);\n $block->assign('media_url',Mage::getBaseUrl().'../media/micropayment/');\n $block->assign('year',date('Y'));\n $block->assign('payment_method',$order->getPayment()->getMethod());\n $block->assign('payment_title',$order->getPayment()->getMethodInstance()->getConfigData('title'));\n $block->assign('shop_title', Mage::getStoreConfig('general/store_information/name', Mage::app()->getStore()->getId()));\n\n echo $block->renderView();\n } catch (Exception $e) {\n\n }\n }" ]
[ "0.8028149", "0.7617755", "0.76160115", "0.75935125", "0.7412469", "0.7320548", "0.726806", "0.72476226", "0.7215258", "0.717494", "0.7134929", "0.70741564", "0.7068019", "0.7021653", "0.69979405", "0.6994987", "0.69875354", "0.69802296", "0.69729173", "0.6933608", "0.69198865", "0.68830127", "0.6866734", "0.68659055", "0.6865265", "0.68538", "0.68538", "0.68528825", "0.685087", "0.68482655", "0.68288666", "0.681308", "0.6797901", "0.67958415", "0.6779501", "0.67793757", "0.67724115", "0.67498064", "0.67434573", "0.673778", "0.6710364", "0.67059314", "0.67016906", "0.6678478", "0.6677729", "0.6670548", "0.6664587", "0.66568387", "0.6654311", "0.6650368", "0.66454214", "0.66414946", "0.66304857", "0.66226584", "0.6616318", "0.65969074", "0.6581461", "0.6578374", "0.6574579", "0.6564454", "0.6560973", "0.65573937", "0.6547879", "0.6543178", "0.6540214", "0.65349656", "0.653396", "0.6532792", "0.65282655", "0.65253794", "0.65215683", "0.6516067", "0.65071785", "0.6502238", "0.64981925", "0.64873016", "0.6485108", "0.6480269", "0.64795774", "0.6475217", "0.64729863", "0.646733", "0.64586097", "0.6438478", "0.6433634", "0.6419682", "0.6409843", "0.63999593", "0.6356578", "0.6350445", "0.63442546", "0.63434935", "0.6334698", "0.6323096", "0.63117707", "0.6306659", "0.6284261", "0.6282196", "0.62788063", "0.6275296" ]
0.67537826
37
Retrieves the wanted Store, or null
public static function getStore ($name) { if (isset(self::$stores[$name])) { return self::$stores[$name]; } else { return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStore(): Store|null;", "public static function get_store($store_name = 'default')\n {\n }", "public static function get_store($store_name)\n {\n }", "private function getStore()\n {\n return $this->storeManager->getStore($this->retrieveSharedCatalogStoreId());\n }", "public function getStore();", "public function getStore();", "public function getStore()\n {\n if (is_null($this->store)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_STORE);\n if (is_null($data)) {\n return null;\n }\n\n $this->store = StoreResourceIdentifierModel::of($data);\n }\n\n return $this->store;\n }", "public function getStore()\n {\n return $this->store;\n }", "public function getStore()\n {\n return $this->store;\n }", "public function getStore()\n {\n return $this->store;\n }", "public function getStore()\n {\n return $this->store;\n }", "public function getStore()\n {\n return $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store;\n }", "public function getStore(): Store {\n return $this->store;\n }", "public function getStore()\n\t{\n\t\t//\n\t}", "protected function _getStore() {\r\n $storeId = (int) $this->getRequest()->getParam('store', 0);\r\n return Mage::app()->getStore($storeId);\r\n }", "public function getStore () {\n\t\treturn $this->oStore;\n\t}", "public function getStore() { return $this->_store; }", "abstract function getStore(string $storeKey);", "public function getDefaultStore(): Store|null;", "public function getStore() {\n\t\treturn $this->_store;\n\t}", "private function getAnyAccessibleStoreView()\n {\n $store = $this->_storeManager->getDefaultStoreView();\n if ($store && $this->_role->hasStoreAccess($store->getId())) {\n return $store;\n }\n foreach ($this->_storeManager->getStores() as $store) {\n if ($this->_role->hasStoreAccess($store->getId())) {\n return $store;\n }\n }\n return null;\n }", "public function getStore()\n {\n $store = Mage::app()->getStore();\n if ($this->getCategory() && $this->getCategory()->getStoreId()) {\n $storeId = $this->getCategory()->getStoreId();\n $store = Mage::app()->getStore($storeId);\n }\n if ($this->getData('store')) {\n $store = $this->getData('store');\n }\n if ($this->getData('store_id')) {\n $storeId = $this->getData('store_id');\n $store = Mage::app()->getStore($storeId);\n }\n return $store;\n }", "protected function getAnyStoreView()\n {\n $store = $this->_storeManager->getDefaultStoreView();\n if ($store) {\n return $store;\n }\n foreach ($this->_storeManager->getStores() as $store) {\n return $store;\n }\n return null;\n }", "private function getStore() {\n if (NULL === $this->obj_store) {\n $this->obj_store = new Store($this->makeSchema());\n }\n return $this->obj_store;\n }", "public function getStore()\n {\n return $this->_storeManager->getStore();\n }", "protected function getStore() {\n return Mage::app()->getStore();\n }", "public function getStore($storeId = null)\n {\n if (is_null($storeId)) {\n return $this->currentStore;\n }\n \n return $this->stores[$storeId];\n }", "public function getStore()\n {\n if (is_null($this->_store)) {\n $this->setStore(Mage::app()->getStore());\n }\n return $this->_store;\n }", "public function getStore(): Interfaces\\Store\n {\n return $this->store;\n }", "protected function getStoreById($id)\n {\n $store = null;\n $stores = $this->getStores();\n foreach ($stores as $_store) { \n if ($id == $_store->getId()) { \n $store = $_store; \n break; \n } \n }\n return $store;\n }", "public function getStore()\r\n {\r\n return $this;\r\n }", "public function get($store)\n {\n // TODO: Implement get() method.\n }", "public function getStore()\n {\n if (is_null($this->_store)) {\n $this->_store = Mage::app()->getStore();\n }\n return $this->_store;\n }", "public function get_default_store() {\r\n\t\tif(count($this->stores)>1)\r\n\t\t\treturn(0);\r\n\t\telse\r\n\t\t\treturn($this->stores[0]->get_id());\r\n\t}", "public function getStore(): Repository\n {\n return $this->store;\n }", "public static function getStore(){\n return self::$store;\n }", "public function getCacheStore(): Store|null;", "public function &getStore()\n\t{\n\t\treturn $this->store;\n\t}", "public function getFromStore(string $key): mixed\n {\n return $this->store[$key] ?? null;\n }", "function get_associated_store($post_id){\n\t\treturn get_post_meta($post_id, '_store', true);\n\t}", "public static function get_stores()\n {\n }", "public function getStoreName();", "protected function getStoreName(): ?string\n\t{\n\t\tstatic $cache = [];\n\n\t\t$storeId = $this->getStoreId();\n\t\tif (!$storeId)\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\tif (!array_key_exists($storeId, $cache))\n\t\t{\n\t\t\t$cache[$storeId] = null;\n\n\t\t\t$row = StoreTable::getRow([\n\t\t\t\t'select' => [\n\t\t\t\t\t'TITLE',\n\t\t\t\t\t'ADDRESS',\n\t\t\t\t],\n\t\t\t\t'filter' => [\n\t\t\t\t\t'=ID' => $storeId,\n\t\t\t\t],\n\t\t\t]);\n\t\t\tif ($row)\n\t\t\t{\n\t\t\t\t$cache[$storeId] = (string)($row['TITLE'] ?: $row['ADDRESS']);\n\t\t\t}\n\t\t}\n\n\t\treturn $cache[$storeId];\n\t}", "protected function getDefaultStoreCode()\n {\n $store = $this->getVar('defaultStore', 'default');\n $stores = array_keys($this->getStores());\n if (in_array($store, $stores)) {\n return $store;\n } else {\n return array_shift($stores);\n }\n }", "public function getById($storeId)\n {\n $store = $this->storesInterfaceFactory->create();\n $store->getResource()->load($store, $storeId);\n\n if (! $store->getId()) {\n return false;\n }\n return $store;\n }", "public function getStoreInfo( $params = [] )\n {\n if(!config(\"constant.getDataFromApis\")){\n return $this->starrtecUnifiedPosHandler->getSingleStoreDetail( $params );\n }else{\n return $this->starrtecPosApiHandler->getSingleStoreDetail( $params );\n }//..... end if-else() .....//\n }", "protected function getStoreID() {\n\t\treturn $this->store_id;\n\t}", "function acf_get_store($name = '')\n{\n}", "public function getStoreId()\n {\n return $this->store_id;\n }", "public function getStoreId()\n {\n return $this->store_id;\n }", "public function getStoreId()\n {\n return $this->store_id;\n }", "public function getStoreId()\n {\n return $this->store_id;\n }", "public function getStoreByCode($store)\n {\n if (is_null($this->_stores)) {\n $this->_stores = Mage::app()->getStores(true, true);\n }\n if (isset($this->_stores[$store])) {\n return $this->_stores[$store];\n }\n return false;\n }", "public function getStoreId()\n {\n return $this->getRequest()->getParam('store_id');\n }", "private function getStore(?int $customerStoreId): StoreInterface\n {\n return $customerStoreId > 0\n ? $this->_storeManager->getStore($customerStoreId)\n : $this->_website->getDefaultStore();\n }", "protected function get($name)\n\t{\n\t\treturn $this->stores[ $name ] ?? $this->resolve($name);\n\t}", "function get($name) {\n if ($this->exists($name)) {\n return $this->store[$name];\n }\n\n return null;\n }", "public function defaultStore(): string;", "public function getStoreName(): string\n {\n return $this->storeName;\n }", "public function getDefaultCacheStore(): Store|null;", "private function _getCurrentStoreId()\n {\n $storeName = Mage::app()->getRequest()->getParam('store');\n\n if (!$storeName) {\n $website = Mage::app()->getRequest()->getParam('website');\n return $this->_getHelper()->getStoreIdByWebsite($website);\n }\n return $this->_getHelper()->getStoreIdByStoreCode($storeName);\n }", "public function store() {\n return $this->belongsTo('store');\n }", "public function getStoreId()\n {\n return $this->_storeId;\n }", "public function getStoreId(){\n return $this->_getData(self::STORE_ID);\n }", "public function getStoreName()\n {\n return $this->store_name;\n }", "public function getStoreName()\n {\n return $this->store_name;\n }", "public function getStore($storeId, $returnData = false)\n {\n // Retrieve the store from the API\n $http = parent::buildRequest('stores/' . $storeId);\n $store = parent::makeRequest($http);\n\n // If the store loads and isn't false\n if($store) {\n\n // Do we just want the data?\n if($returnData) {\n return $store;\n }\n\n // Add the data into a model and return\n return Mage::getModel('gene_doddle/store')->addData($store);\n }\n\n return false;\n }", "public function store()\n {\n return $this->belongsTo('Store');\n }", "public function store()\n {\n return $this->belongsTo('Store');\n }", "public function store() {\n\t\t# One-to-many relationship between stores and users:\n\t\treturn $this->belongsTo('Store');\n\n\t}", "public function getStoreId()\n\t{\n\t\treturn $this->_storeId;\n\t}", "public function phpunit_get_store_class() {\n return get_class($this->get_store());\n }", "public function phpunit_get_store_class() {\n return get_class($this->get_store());\n }", "public function phpunit_get_store_class() {\n return get_class($this->get_store());\n }", "public function getStore($store_id) {\n\t\t##\n\t\t##\tPARAMETERS\n\t\t##\t\t@store_id (int)\t\t\tThe store ID\n\t\t##\n\t\t##\tRETURN\n\t\t##\t\tThe store object array\n\t\t$sql = <<<EOD\n\t\tSELECT\n\t\t\t{$this->wpdb->prefix}posts.ID AS post_id,\n\t\t\t{$this->wpdb->prefix}posts.post_title AS name,\n\t\t\t{$this->wpdb->prefix}posts.post_name AS slug,\n\t\t\t{$this->wpdb->prefix}topspin_stores.store_id AS id,\n\t\t\t{$this->wpdb->prefix}topspin_stores.status,\n\t\t\t{$this->wpdb->prefix}topspin_stores.created_date,\n\t\t\t{$this->wpdb->prefix}topspin_stores.items_per_page,\n\t\t\t{$this->wpdb->prefix}topspin_stores.show_all_items,\n\t\t\t{$this->wpdb->prefix}topspin_stores.grid_columns,\n\t\t\t{$this->wpdb->prefix}topspin_stores.default_sorting,\n\t\t\t{$this->wpdb->prefix}topspin_stores.default_sorting_by,\n\t\t\t{$this->wpdb->prefix}topspin_stores.items_order,\n\t\t\t{$this->wpdb->prefix}topspin_stores.internal_name\n\t\tFROM {$this->wpdb->prefix}topspin_stores\n\t\tLEFT JOIN\n\t\t\t{$this->wpdb->prefix}posts ON {$this->wpdb->prefix}topspin_stores.post_id = {$this->wpdb->prefix}posts.ID\n\t\tWHERE\n\t\t\t{$this->wpdb->prefix}topspin_stores.store_id = '%d'\nEOD;\n\t\t$data = $this->wpdb->get_row($this->wpdb->prepare($sql,array($store_id)),ARRAY_A);\n\t\tif(is_array($data) && isset($data['id'])) {\n\t\t\t## Get Featured Items\n\t\t\t$data['featured_item'] = $this->getStoreFeaturedItems($data['id']);\n\t\t\t## Get Offer Types\n\t\t\t$data['offer_types'] = $this->getStoreOfferTypes($data['id']);\n\t\t\t## Get Tags\n\t\t\t$data['tags'] = $this->getStoreTags($data['id']);\n\t\t\treturn $data;\n\t\t}\n\t}", "public function getStoreId();", "public function getStoreId();", "public function getStoreId();", "public function store()\n {\n return $this->belongsTo('App\\Store');\n }", "protected function get($name)\n {\n return $this->stores[$name] ?? $this->resolve($name);\n }", "protected function get($name)\n {\n return $this->stores[$name] ?? $this->resolve($name);\n }", "function acf_get_local_store($name = '')\n{\n}", "protected function _getStore()\n {\n $system_configured_store_id = $this->_getSystemConfigurationStoreId();\n if ((!is_null($system_configured_store_id)) && ($system_configured_store_id !== false))\n {\n return $system_configured_store_id;\n }\n\n return false;\n \n }", "public function getStores()\n {\n return $this->hasData('stores')\n ? $this->getData('stores')\n : $this->getData('store_id');\n }", "public function getStoreName()\n {\n return $this->_fields['StoreName']['FieldValue'];\n }", "public function getStore($storeId, $returnData = false)\n {\n // Retrieve an access token from the API\n if ($accessToken = parent::getAccessToken($this->buildScope('stores:read', $this->getStoreId()))) {\n\n // Build up our authorization\n $headers = array(\n 'Authorization' => 'Bearer ' . $accessToken,\n 'Content-Type' => 'application/json'\n );\n\n $call = sprintf(\n 'stores/%s',\n $storeId\n );\n\n // Build our HTTP request\n $http = $this->buildRequest($call, Varien_Http_Client::GET, false, false, $headers);\n\n // Retrieve the store from the API\n $store = parent::makeRequest($http);\n\n // If the store loads and isn't false\n if ($store) {\n // Do we just want the data?\n if ($returnData) {\n return $store;\n }\n\n // Add the data into a model and return\n return Mage::getModel('gene_doddle/store')->addData($store);\n }\n } else {\n Mage::throwException('Unable to retrieve an access token from Doddle, please make sure the module\\'s API settings are correctly configured.');\n }\n\n return false;\n }", "public function getSelectedStore(){\n $data = $this->Stores->find()->contain([\n 'Brands' => function($q){\n return $q->select(['id','client_id','brand_name'])->contain([\n 'Clients' => function($q){\n return $q->select(['name','contact_no']);\n }\n ]);\n }\n ])->select([\n 'id','brand_id','name','is_customer_feedback','is_appdata','is_analytics','is_mall'\n ])->where([\n 'Stores.id' => $this->_appSession->read('App.selectedStoreID')\n ])->first();\n $this->set('data',$data);\n $this->set('_serialize',['data']);\n }", "public function getDefaultStoreForSmartCollections()\n {\n return $this->scopeConfig->getValue(self::XML_PATH_FINDIFY_SMARTCOLLECTIONS_DEFAULT_STORE);\n }", "public function show(Business $business, Store $store)\n {\n return $store;\n }", "public function getALLStore();", "public function getShop()\n {\n return $this->get(self::_SHOP);\n }", "public function getShop()\n {\n return $this->get(self::_SHOP);\n }", "public function getShop()\n {\n return $this->get(self::_SHOP);\n }", "public function getStoreByStoreId($storeId)\r\n {\r\n $queryBuilder = $this->_em->createQueryBuilder();\r\n $queryBuilder->select(\"s\")\r\n ->from(\"YilinkerCoreBundle:Store\", \"s\")\r\n ->where('s.storeId = :storeId')\r\n ->setParameter('storeId', $storeId);\r\n\r\n return $queryBuilder->getQuery()\r\n ->useResultCache(true, 3600)\r\n ->getOneOrNullResult();\r\n }", "protected function getRequestedStoreByCode($storeCode) : \\Magento\\Store\\Api\\Data\\StoreInterface\n {\n try {\n $store = $this->storeRepository->getActiveStoreByCode($storeCode);\n } catch (StoreIsInactiveException $e) {\n throw new \\Magento\\Framework\\Exception\\NoSuchEntityException(__('Requested store is inactive'));\n }\n\n return $store;\n }", "private function _getStoreId() {\n $store_id = 1;\n return $store_id;\n }", "public function getStoreId()\n {\n return Mage::app()->getStore()->getId();\n }", "public function getStoreByID($payload)\n {\n $store_id = $payload['dataPacket']['store_id'];\n $action = $payload['action'];\n\n $requestController = new requestValidationController();\n $checkValidation = $requestController->validateStore($payload);\n\n if ($checkValidation['response']) {\n $store = Stores::where('technify_store_id', $store_id)->first();\n\n $response = array_merge(Helper::constantResponse($action, 200, ''), ['dataPacket' => ['store' => $store]]);\n } else {\n $response = Helper::ifValidationFalse($action, $checkValidation);\n }\n return $response;\n }", "public function getStoreId() {\r\n return Mage::app()->getStore()->getId();\r\n }", "public function index()\n {\n $store = auth('api')->user()->store;\n return $store;\n }" ]
[ "0.8281435", "0.76348305", "0.7601396", "0.75326484", "0.7511196", "0.7511196", "0.75028163", "0.7502539", "0.7502539", "0.7502539", "0.7502539", "0.7501464", "0.74843216", "0.74612355", "0.74096334", "0.7360648", "0.7314811", "0.7299975", "0.7284738", "0.72655016", "0.72337824", "0.7225825", "0.71922594", "0.7024504", "0.70158654", "0.70095426", "0.70038366", "0.6972903", "0.6964226", "0.69515616", "0.69224036", "0.69197506", "0.6912749", "0.6870673", "0.6845008", "0.68061113", "0.668311", "0.66823995", "0.6607533", "0.65921247", "0.6489001", "0.64786726", "0.6469149", "0.6439768", "0.64257836", "0.64188683", "0.6418074", "0.6413101", "0.64081013", "0.64081013", "0.64081013", "0.64081013", "0.6405275", "0.6400422", "0.6386626", "0.636804", "0.63639456", "0.63563913", "0.63545716", "0.63478845", "0.63477206", "0.6346908", "0.63395655", "0.6321799", "0.63070667", "0.63070667", "0.6303982", "0.6296342", "0.6296342", "0.6285335", "0.62801707", "0.6275008", "0.6275008", "0.6275008", "0.62661535", "0.6217673", "0.6217673", "0.6217673", "0.621692", "0.6198426", "0.6198426", "0.6133912", "0.61260366", "0.6125267", "0.6120917", "0.61096776", "0.61026514", "0.6098493", "0.609326", "0.60917133", "0.6082962", "0.60825723", "0.60825723", "0.6080731", "0.6067805", "0.60657793", "0.60616934", "0.60476077", "0.6042496", "0.60422194" ]
0.7194292
22
Run the database seeds.
public function run() { DB::statement('SET FOREIGN_KEY_CHECKS=0;'); App\VisibilityType::truncate(); DB::statement('SET FOREIGN_KEY_CHECKS=1;'); App\VisibilityType::create([ 'type' => 'Prywatny' ]); App\VisibilityType::create([ 'type' => 'Publiczny' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Test Case: Validate that the project has a title.
public function shouldHaveTitle() { // Arrange $attributes = factory(Project::class)->raw([ 'title' => '', ]); // Action $response = $this->post('/projects', $attributes); // Assert $response->assertSessionHasErrors('title'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProjectTitle();", "public function testGettingTheTitle()\n {\n $this->assertEquals('title', $this->revision->getTitle());\n }", "public function testAssignTitle()\n {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }", "public function testTitle()\n {\n $this->visit('/')\n ->see('Site title','title');\n }", "public function set_title($title)\n\t{\n\t\tif (is_null($title)) {\n\t\t\tthrow new InvalidArgumentException(\"Project Title Invalid!\");\n\t\t}\n\t\t$this->title = $title;\n\t}", "public function testTitleErrors() {\n //Check the title is required\n $badData = $this->goodData;\n $badData['title'] = '';\n $this->assertFalse($this->Links->save($this->Links->newEntity($badData)));\n }", "public function testNullTitle()\n {\n $this->browse(function (Browser $browser) {\n //Make a book to add \n $book = factory('App\\Book')->make();\n $book -> title = ' '; \n //Navigate to the create page and send the data\n $browser->visit('/api/books/create')\n ->type('title', $book->title)\n ->type('author', $book->author)\n ->press('Add');\n //Check we remain on the same page and an error is displayed.\n $browser->pause(500);\n $browser->assertPathIs('/api/books/create')->assertSee('The title field is required.');\n\n //Check the new book is not displayed\n $browser->visit('/api/books')\n ->assertDontSee($book->author);\n\n });\n\n }", "public function it_should_have_a_title_that_contains_wizard()\n {\n // for example getTitle() should contain word 'dragon'\n $this->getTitle()->shouldMatch('/dragon/i');\n }", "public function testTitle()\n {\n $this->markTestSkipped();\n }", "public function a_project_require_a_description()\n {\n $project = factory(Project::class)->raw(['description' => '']);\n $this->post('/api/projects', $project)->assertStatus(422)->assertJsonStructure([\n 'errors' => [\n 'description',\n ],\n ]);\n }", "public function testTitle()\n {\n $feed = $this->eventFeed;\n\n // Assert that the feed's title is correct\n $this->assertTrue($feed->getTitle() instanceof Zend_Gdata_App_Extension_Title);\n $this->verifyProperty2(\n $feed,\n \"title\",\n \"text\",\n \"GData Ops Demo's Composite View\"\n );\n\n // Assert that all entry's have an Atom ID object\n foreach ($feed as $entry) {\n $this->assertTrue($entry->getTitle() instanceof Zend_Gdata_App_Extension_Title);\n }\n\n // Assert one of the entry's Titles\n $entry = $feed[2];\n $this->verifyProperty2($entry, \"title\", \"text\", \"all day event may 24\");\n }", "public function a_project_require_a_name()\n {\n $project = factory(Project::class)->raw(['name' => '']);\n $this->post('/api/projects', $project)->assertStatus(422)->assertJsonStructure([\n 'errors' => [\n 'name',\n ],\n ]);\n }", "public function testGetTitle(){\n $this->assertSame(\"Ms./Mrs.\", Customer::getTitle(\"female\"));\n $this->assertSame(\"Mr.\", Customer::getTitle(\"male\"));\n $this->assertSame(\"\", Customer::getTitle(\"\"));\n $this->assertSame(\"\", Customer::getTitle(\"daererer\"));\n }", "public function a_user_can_create_a_project()\n {\n $attributes = [\n \n 'title' => $this->fake->sentence,\n\n ];\n\n }", "public function page_title_should_return_the_base_title_if_the_title_is_empty()\n {\n $this->assertEquals('Laracarte - List of artisans', page_title(''));\n }", "public function validateTitle()\n {\n if (empty($this->_taintedData['title'])) {\n $this->_addErrorMessage(\"Please fill in the title\");\n\n return false;\n }\n\n $title = $this->_cleanData['title'];\n\n if (strlen($title) > 100) {\n $this->_addErrorMessage(\"Your talk title has to be 100 characters or less\");\n\n return false;\n }\n\n return true;\n }", "function testNameAndTitleGeneration() {\n\t\t$file = $this->objFromFixture('File', 'asdf');\n\t\t$this->assertEquals('FileTest.txt', $file->Name);\n\t\t$this->assertNull($file->Title);\n\t\t\n\t\t/* However, if Name is set instead of Filename, then Title is set */\n\t\t$file = $this->objFromFixture('File', 'setfromname');\n\t\t$this->assertEquals(ASSETS_DIR . '/FileTest.png', $file->Filename);\n\t\t$this->assertEquals('FileTest', $file->Title);\n\t}", "public function shouldHaveDescription()\n {\n // Arrange\n $attributes = factory(Project::class)->raw([\n 'description' => ''\n ]);\n\n // Action\n $response = $this->post('/projects', $attributes);\n\n // Assert\n $response->assertSessionHasErrors('description');\n }", "private function check_title($title)\n {\n if(!empty($title))\n return true;\n else\n {\n $this->errors[] = 3; // empty title!\n return false;\n }\n }", "private function validateProjectValues(\n string $title,\n string $url,\n string $folder\n ): bool {\n $valid = true;\n $v = Validator::make([], []);\n\n if (empty($title)) {\n $v->getMessageBag()\n ->add('title', 'Empty title');\n $valid = false;\n }\n if (empty($url)) {\n $v->getMessageBag()\n ->add('url', 'Empty url');\n $valid = false;\n }\n if (empty($folder)) {\n $v->getMessageBag()\n ->add('folder', 'Empty folder');\n $valid = false;\n }\n\n if (!UrlHelper::validate($url)) {\n $v->getMessageBag()\n ->add('url', 'Invalid url');\n $valid = false;\n }\n\n return $valid;\n }", "public function validate_title( $valid, $title, $field, $input_name ) {\r\n\t\tglobal $post_id; //no value on ajax call / has value on submit\r\n\r\n\t\t$post_id_js = $_POST['custom_post_id'];\r\n\r\n\t // Bail early if value is already invalid.\r\n\t if( $valid !== true) {\r\n\t return $valid;\r\n\t }\r\n\r\n\t\t$dir = $this->create_downloads_dir();\r\n\t\t$slug = str_replace(\" \", \"-\", $title);\r\n\r\n\t\t$title_dir = $dir['reports_dir'].'/'.strtolower($slug);\r\n\r\n\t\t$title_exist = $this->check_if_title_exist($slug, $post_id_js);\r\n\r\n\t\tif($title_exist){\r\n\t\t\treturn __(\"Title already exist\");\r\n\t\t}\r\n\r\n\t\tif($post_id){\r\n\t\t\t$old_title = get_the_title($post_id);\r\n\t\t\t$old_title_slug = str_replace(\" \", \"-\", $old_title);\r\n\t\t\t$old_title_dir = $dir['reports_dir'].'/'.strtolower($old_title_slug);\r\n\t\t\t// wp_die($post_id);\r\n\t\t\tif($title != $old_title && $old_title && file_exists($old_title_dir)){\r\n\t\t\t\trename($old_title_dir, $title_dir);\r\n\t\t\t}else{\r\n\t\t\t\tif(!file_exists($title_dir)){ mkdir($title_dir, 0777); }\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t return $valid;\r\n\t}", "public function validateTestCaseIdTitleUniqueness()\n {\n $dupes = [];\n foreach ($this->testCaseToTitleMappings as $newTitle => $files) {\n if (count($files) > 1) {\n $dupes[$newTitle] = \"'\" . implode(\"', '\", $files) . \"'\";\n }\n }\n if (!empty($dupes)) {\n $message = \"TestCaseId and Title pairs must be unique:\\n\\n\";\n foreach ($dupes as $newTitle => $tests) {\n $testCaseTitleArray = explode(\": \", $newTitle);\n $testCaseId = $testCaseTitleArray[0];\n $title = $testCaseTitleArray[1];\n $message .= \"TestCaseId: '{$testCaseId}' Title: '{$title}' in Tests {$tests}\\n\\n\";\n }\n throw new XmlException($message);\n }\n }", "public function testAdminCanNotAddAPageWithBlankTitle()\n {\n $params = [];\n\n $response = $this\n ->actingAs($this->admin)\n ->post('/admin/blog/pages', $params);\n\n $response->assertStatus(302);\n $response->assertSessionHasErrors();\n\n $errors = session('errors');\n\n $this->assertEquals('The title field is required.', $errors->get('title')[0]);\n }", "public function testIndexTitle()\n {\n\n // Add a page called \"title\".\n $page = $this->_simplePage(true, 'title');\n\n // Get the Solr document for the page.\n $document = $this->_getRecordDocument($page);\n\n // Should index title.\n $this->assertEquals('title', $document->title);\n\n }", "public function checkUniqueTitle()\n {\n $this->viewBuilder()->layout(false);\n if($this->request->is('post')) {\n $data = $this->request->data;\n $result = $this->Titles->isTitleExist($data['name']);\n if(!empty($result)){\n echo \"false\";\n } else {\n echo \"true\";\n }\n }\n die;\n }", "public function testEditTitleError() {\n\t\tRolesControllerTest::login($this);\n\n\t\t//データ生成\n\t\t$frameId = '181';\n\t\t$blockId = '181';\n\t\t$blockKey = 'block_' . $blockId;\n\t\t$roomId = '1';\n\n\t\t$data = array(\n\t\t\t'Frame' => array('id' => $frameId),\n\t\t\t'Block' => array('id' => $blockId, 'key' => $blockKey, 'room_id' => $roomId),\n\t\t\t'RssReader' => array(\n\t\t\t\t'key' => 'rss_reader_1',\n\t\t\t\t'url' => APP . 'Plugin' . DS . 'RssReaders' . DS . 'Test' . DS . 'Fixture' . DS . 'rss_v1.xml',\n\t\t\t\t'title' => '',\n\t\t\t\t'summary' => 'Edit summary',\n\t\t\t\t'link' => 'http://example.com',\n\t\t\t),\n\t\t\t'Comment' => array('comment' => 'Edit comment'),\n\t\t\tsprintf('save_%s', NetCommonsBlockComponent::STATUS_APPROVED) => '',\n\t\t);\n\n\t\t//テスト実行\n\t\t$ret = $this->testAction(\n\t\t\t'/rss_readers/rss_readers/edit/' . $frameId . '.json',\n\t\t\tarray(\n\t\t\t\t'method' => 'post',\n\t\t\t\t'data' => $data,\n\t\t\t\t'type' => 'json',\n\t\t\t\t'return' => 'contents'\n\t\t\t)\n\t\t);\n\t\t$result = json_decode($ret, true);\n\n\t\t$this->assertArrayHasKey('code', $result, print_r($result, true));\n\t\t$this->assertEquals(400, $result['code'], print_r($result, true));\n\t\t$this->assertArrayHasKey('name', $result, print_r($result, true));\n\t\t$this->assertArrayHasKey('error', $result, print_r($result, true));\n\t\t$this->assertArrayHasKey('validationErrors', $result['error'], print_r($result, true));\n\t\t$this->assertArrayHasKey('title', $result['error']['validationErrors'], print_r($result, true));\n\n\t\tAuthGeneralControllerTest::logout($this);\n\t}", "public function it_should_have_a_string_as_title()\n {\n // for example method getTitle() should return a string, if not it will be failed.\n $this->getTitle()->shouldBeString();\n }", "public function testTitleExpected($url, $expectedTitle)\r\n {\t\r\n $p = new PageGrabber($url);\r\n\t$result = $p->get_title();\r\n\t\t\r\n\t$this->assertEquals($expectedTitle, $result);\r\n }", "public function testTitleText() {\n // Confirm that the view has the normal title before making the view return\n // no result.\n $this->drupalGet('test-area-title');\n $this->assertSession()->titleEquals('test_title_header | Drupal');\n\n // Change the view to return no result.\n /** @var \\Drupal\\views\\Entity\\View $view */\n $view = View::load('test_area_title');\n $display =& $view->getDisplay('default');\n $display['display_options']['filters']['name'] = [\n 'field' => 'name',\n 'id' => 'name',\n 'table' => 'views_test_data',\n 'relationship' => 'none',\n 'plugin_id' => 'string',\n // Add a value which does not exist. The dataset is defined in\n // \\Drupal\\views\\Tests\\ViewTestData::dataSet().\n 'value' => 'Euler',\n ];\n $view->save();\n\n $this->drupalGet('test-area-title');\n $this->assertSession()->titleEquals('test_title_empty | Drupal');\n\n // Change the view to return a result instead.\n /** @var \\Drupal\\views\\Entity\\View $view */\n $view = View::load('test_area_title');\n $display =& $view->getDisplay('default');\n $display['display_options']['filters']['name'] = [\n 'field' => 'name',\n 'id' => 'name',\n 'table' => 'views_test_data',\n 'relationship' => 'none',\n 'plugin_id' => 'string',\n // Change to a value which does exist. The dataset is defined in\n // \\Drupal\\views\\Tests\\ViewTestData::dataSet().\n 'value' => 'Ringo',\n ];\n $view->save();\n\n $this->drupalGet('test-area-title');\n $this->assertSession()->titleEquals('test_title_header | Drupal');\n }", "public function testTitleMutator()\n {\n $data = [\n 'title' => strtolower($this->faker->sentence(rand(5, 10), $variableNbWords = true)),\n 'author' => strtolower($this->faker->name),\n ];\n\n $record = Book::create($data);\n\n if (ucfirst($data['title']) != $record->title || ucfirst($data['author']) != $record->author) {\n $this->assertTrue(false);\n }\n $this->assertTrue(true);\n }", "public function getTitle() {\n return $this->requirement->title;\n }", "protected function validate_title_value() {\n\t\tif ( empty( $this->field['fields']['title']['value'] ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tif ( empty( $this->field['fields']['key']['value'] ) ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public static function setTitle($projectTitle=\"Default App\")\n {\n global $application_name;\n $application_name = $projectTitle;\n }", "public function it_should_have_a_title_that_starts_with_the_wizard()\n {\n // value is case sensitive\n $this->getTitle()->shouldStartWith('The Wizard');\n }", "public function test_adding_a_title_generates_a_slug()\n {\n //cuando cree un post y le asigne un titulo\n $post=new Post([\n 'title'=>'Como instalar laravel',\n\n ]);\n //en este punto el post deberia tener una propiedad llamada slug que contenga como-instalar-lravel\n $this->assertSame('como-instalar-laravel',$post->slug);\n\n\n\n }", "public function isTitle()\n {\n return $this->getName() === 'title';\n }", "private function updateProjectTitle($project_id, $project_title)\n\t{\n\t\t$db = JFactory::getDBO();\n\t\t$query = $db->getQuery(true)\n\t\t\t->update($db->qn('#__pf_projects'))\n\t\t\t->set($db->qn('title') . ' = ' . $db->q($project_title))\n\t\t\t->where($db->qn('id') .' = '. $db->q($project_id))\n\t\t\t->where($db->qn('title') . ' != '. $db->q($project_title));\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t}", "function isValidTaskTitle($taskTitle){\n if(strlen($taskTitle) <= 74){\n return true;\n }\n else{\n echo \"invalid taskTitle\";\n return false;\n }\n }", "public function hasTaskTitle(){\n return $this->_has(3);\n }", "public function test_create_project()\n {\n $response = $this->post('/project', [\n 'name' => 'Project nae', \n 'description' => 'Project description'\n ]);\n \n $response->assertStatus(302);\n }", "public function get_title( )\n {\n return 'Something went wrong.';\n }", "public function validateStoryTitleUniqueness()\n {\n $dupes = [];\n\n foreach ($this->storyToTitleMappings as $storyTitle => $files) {\n if (count($files) > 1) {\n $dupes[$storyTitle] = \"'\" . implode(\"', '\", $files) . \"'\";\n }\n }\n if (!empty($dupes)) {\n $message = \"Story and Title annotation pairs must be unique:\\n\\n\";\n foreach ($dupes as $storyTitle => $tests) {\n $storyTitleArray = explode(\"/\", $storyTitle);\n $story = $storyTitleArray[0];\n $title = $storyTitleArray[1];\n $message .= \"Story: '{$story}' Title: '{$title}' in Tests {$tests}\\n\\n\";\n }\n throw new XmlException($message);\n }\n }", "public function testQuizRead_Title()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/quizzes')\n ->clickLink('View Quiz')\n ->assertSee('General Knowledge')\n ->screenshot('RoleEdit/QuizRead');\n });\n }", "public function testAdminCanNotAddADuplicatedPageTitle()\n {\n $existPage = Post::factory()->create(['post_type' => Post::PAGE]);\n\n $params = [\n 'title' => $existPage->title,\n ];\n\n $response = $this\n ->actingAs($this->admin)\n ->post('/admin/blog/pages', $params);\n\n $response->assertStatus(302);\n $response->assertSessionHasErrors();\n\n $errors = session('errors');\n $this->assertEquals('The title has already been taken.', $errors->get('title')[0]);\n }", "public function checkTitle($title)\r\n {\r\n $model = new Ynidea_Model_DbTable_Ideas;\r\n $select = $model -> select()->where('title = ?',$title); \r\n $row = $model->fetchRow($select); \r\n if($row)\r\n return true;\r\n else\r\n return false; \r\n }", "public function testGetTitle(array $values) {\n $permission = new GroupPermission($values);\n $this->assertEquals($values['title'], $permission->getTitle());\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 static function setTitle(string $title) {}", "function greenspace_title($title ) {\n\t\treturn '' === $title ? esc_html_x( 'Untitled', 'Added to posts and pages that are missing titles', 'greenspace' ) : $title;\n\t}", "public function hasTitle(){\n return $this->_has(2);\n }", "function validate() {\n\t\tif( !access_has_global_level( config_get( 'create_project_threshold' ) ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Access denied to create projects',\n\t\t\t\tERROR_ACCESS_DENIED\n\t\t\t);\n\t\t}\n\n\t\tif( is_blank( $this->payload( 'name' ) ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Project name cannot be empty',\n\t\t\t\tERROR_EMPTY_FIELD,\n\t\t\t\tarray( 'name' )\n\t\t\t);\n\t\t}\n\n\t\t$t_project = $this->data['payload'];\n\n\t\t$this->name = $this->payload( 'name' );\n\t\t$this->description = $this->payload( 'description', '' );\n\t\t$this->inherit_global = $this->payload( 'inherit_global', true );\n\t\t$this->file_path = $this->payload( 'file_path', '' );\n\t\t$this->view_state = isset( $t_project['view_state'] ) ? mci_get_project_view_state_id( $t_project['view_state'] ) : config_get( 'default_project_view_status' );\n\t\t$this->status = isset( $t_project['status'] ) ? mci_get_project_status_id( $t_project['status'] ) : 10 /* development */;\n\t\t$this->enabled = $this->payload( 'enabled', true );\n\n\t\tif( !project_is_name_unique( $this->name ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Project name is not unique',\n\t\t\t\tERROR_PROJECT_NAME_NOT_UNIQUE,\n\t\t\t\tarray( 'name' )\n\t\t\t);\n\t\t}\n\n\t\t$t_enum_values = MantisEnum::getValues( config_get( 'project_status_enum_string' ) );\n\t\tif( !in_array( $this->status, $t_enum_values ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Invalid project status',\n\t\t\t\tERROR_INVALID_FIELD_VALUE,\n\t\t\t\tarray( 'status' )\n\t\t\t);\n\t\t}\n\n\t\tif( !is_bool( $this->inherit_global ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Invalid project inherit global',\n\t\t\t\tERROR_INVALID_FIELD_VALUE,\n\t\t\t\tarray( 'inherit_global' )\n\t\t\t);\n\t\t}\n\n\t\tif( !is_bool( $this->enabled ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Invalid project enabled',\n\t\t\t\tERROR_INVALID_FIELD_VALUE,\n\t\t\t\tarray( 'enabled' )\n\t\t\t);\n\t\t}\n\t}", "public function hasTitle() {\n return $this->_has(1);\n }", "function tsk_title_placeholder_text ( $title ) {\n\t\tif ( get_post_type() == 'project' ) {\n\t\t\t$title = __( 'Project Name' );\n\t\t} else if ( get_post_type() == 'piece' ) {\n\t $title = __( 'Piece Name' );\n\t\t}\n\t\treturn $title;\n\t}", "public function jobTitle(){\n\t\n\t\t$_error = \"enter the Job Title\";\n\t\treturn $_error;\n\t}", "public function testGetPagesByTitle() : void {\n $expected = 0;\n $this->assertEquals($expected, count($this->dataManager->getPagesByTitle('')));\n }", "public function title()\n {\n if ($this->title === null) {\n $title = null;\n\n $translator = $this->translator();\n\n try {\n $config = $this->dashboardConfig();\n } catch (Exception $e) {\n $this->logger->error($e->getMessage());\n $config = [];\n }\n\n if (isset($config['title'])) {\n $title = $translator->translation($config['title']);\n } else {\n $obj = $this->obj();\n $objId = $this->objId();\n $objType = $this->objType();\n $metadata = $obj->metadata();\n\n if (!$title && isset($metadata['admin']['forms'])) {\n $adminMetadata = $metadata['admin'];\n\n $formIdent = filter_input(INPUT_GET, 'form_ident', FILTER_SANITIZE_STRING);\n if (!$formIdent) {\n $formIdent = (isset($adminMetadata['default_form']) ? $adminMetadata['default_form'] : '');\n }\n\n if (isset($adminMetadata['forms'][$formIdent]['label'])) {\n $title = $translator->translation($adminMetadata['forms'][$formIdent]['label']);\n }\n }\n\n if ($objId) {\n if (!$title && isset($metadata['labels']['edit_item'])) {\n $title = $translator->translation($metadata['labels']['edit_item']);\n }\n\n if (!$title && isset($metadata['labels']['edit_model'])) {\n $title = $translator->translation($metadata['labels']['edit_model']);\n }\n } else {\n if (!$title && isset($metadata['labels']['new_item'])) {\n $title = $translator->translation($metadata['labels']['new_item']);\n }\n\n if (!$title && isset($metadata['labels']['new_model'])) {\n $title = $translator->translation($metadata['labels']['new_model']);\n }\n }\n\n if (!$title) {\n $objType = (isset($metadata['labels']['singular_name'])\n ? $translator->translation($metadata['labels']['singular_name'])\n : null);\n\n if ($objId) {\n $title = $translator->translation('Edit: {{ objType }} #{{ id }}');\n } else {\n $title = $translator->translation('Create: {{ objType }}');\n }\n\n if ($objType) {\n $title = strtr($title, [\n '{{ objType }}' => $objType\n ]);\n }\n }\n }\n\n $this->title = $this->renderTitle($title);\n }\n\n return $this->title;\n }", "static public function checkTitle($title)\n {\n $titleErrs = [];\n if (empty($title))\n {\n $titleErrs[] = 'Prosím zadajte nadpis';\n }\n else\n {\n if (strlen($title) > self::MAX_TITLE_LEN)\n {\n $titleErrs[] = 'Nadpis môže mať maximálne 30 znakov';\n }\n }\n return $titleErrs;\n }", "public function has_title() {\n\t\treturn ! empty( $this->title );\n\t}", "public function testTitle()\n {\n\n $this->assertEquals(\"About|Laracarte\",getTile('About'));\n\n }", "public function testProfileTitle()\n {\n // Create a user with the username 'johndoe'\n $user = factory(User::class)->create(['username'=>'johndoe']);\n // Add a profile record to the user\n $profile = factory(Profile::class)->make(['country_id'=>4]);\n // Save the user\n $user->profile()->save($profile);\n // Goto the profile browse page\n $this->visit(route('profile.view', ['name'=>'johndoe']))\n ->see(trans('profile.title', ['username'=>'johndoe']));\n }", "public function setTitle($title) {\n\t\t// if passed in title is not between 1 and 255 characters\n\t\tif(strlen($title) < 1 || strlen($title) > 255) {\n\t\t\tthrow new TaskException(\"Task title error\");\n\t\t}\n\t\t$this->_title = $title;\n\t}", "public function editTitle(ProjectTitleRequest $request, Project $project)\n {\n if (!$project->isUserAuthor(Auth::user()))\n abort(403);\n\n $project->title = $request->getTitle();\n $project->save();\n\n return redirect('projects');\n }", "protected function _buildTitle()\n\t{\n\t\tif ($this->_task)\n\t\t{\n\t\t\t$title = Lang::txt('COM_MEMBERS_REGISTER_' . strtoupper($this->_task));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$title = Lang::txt('COM_MEMBERS_REGISTER');\n\t\t}\n\t\t\\Document::setTitle($title);\n\t}", "public function setTitle(string $title);", "public function showTestHeadline($title)\n {\n print \"*** \" . $title . \"\\n\";\n }", "function ui_title() {\n if (!isset($this->plugin['ui_title'])) {\n return check_plain($this->plugin['module'] . ':' . $this->plugin['name']);\n }\n return check_plain($this->plugin['ui_title']);\n }", "protected function _buildTitle()\n\t{\n\t\tif (!$this->_title)\n\t\t{\n\t\t\t$this->_title = Lang::txt(strtoupper($this->_option));\n\t\t\tif ($this->_task)\n\t\t\t{\n\t\t\t\tswitch ($this->_task)\n\t\t\t\t{\n\t\t\t\t\tcase 'browse':\n\t\t\t\t\tcase 'submit':\n\t\t\t\t\tcase 'start':\n\t\t\t\t\tcase 'intro':\n\t\t\t\t\t\tif ($this->_task_title)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->_title .= ': ' . $this->_task_title;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'serve':\n\t\t\t\t\tcase 'wiki':\n\t\t\t\t\t\t$this->_title .= ': ' . Lang::txt('COM_PUBLICATIONS_SERVING_CONTENT');\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$this->_title .= ': ' . Lang::txt(strtoupper($this->_option . '_' . $this->_task));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tDocument::setTitle($this->_title);\n\t}", "public function can_create_a_project()\n {\n $this->withoutExceptionHandling();\n\n $data = [\n 'name' => $this->faker->sentence,\n 'description' => $this->faker->paragraph,\n 'status' => $this->faker->randomElement(Project::$statuses),\n ];\n\n $request = $this->post('/api/projects', $data);\n $request->assertStatus(201);\n\n $this->assertDatabaseHas('projects', $data);\n\n $request->assertJsonStructure([\n 'data' => [\n 'name',\n 'status',\n 'description',\n 'id',\n ],\n ]);\n }", "function setTitle( $title )\n {\n $title = trim( $title );\n $this->properties['TITLE'] = $title;\n }", "protected function assertTitle($expected_title) {\n @trigger_error('AssertLegacyTrait::assertTitle() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->titleEquals() instead. See https://www.drupal.org/node/3129738', E_USER_DEPRECATED);\n // Cast MarkupInterface to string.\n $expected_title = (string) $expected_title;\n return $this->assertSession()->titleEquals($expected_title);\n }", "public function addTitle()\n {\n $project = $this->_xml->project;\n $name = 'Coverage';\n\n // Find the name from the XML, either in the project node, or the\n // package node if it exists\n if (isset($project['name'])) {\n $name = (string) $project['name'];\n } else {\n if (isset($project->package) && isset($project->package['name'])) {\n $name = (string) $project->package['name'];\n }\n }\n\n $this->append(str_repeat(\"-\", 64));\n $this->append($name);\n $this->append(str_repeat(\"-\", 64));\n }", "public static function validateTitle()\n{\n return array(\n new Main\\Entity\\Validator\\Length(null, 255),\n );\n}", "public static function retrieveProjectTitle($projectID) {\n try {\n $project = ArmyDB::retrieveProjectInfo($projectID);\n //var_dump($unit);\n return $project['projectname'];\n }\n catch (Exception $e) {\n throw new Exception($e->getMessage());\n }\n }", "public function hasTitle()\n {\n return $this->title !== null;\n }", "public static function title();", "protected function _preSave()\n {\n $titlePhrase = $this->getExtraData(self::DATA_TITLE);\n if ($titlePhrase !== null && strlen($titlePhrase) == 0) {\n $this->error(new XenForo_Phrase('please_enter_valid_title'), 'title');\n }\n }", "private function isTitleValid($title) {\n\t\t// Ensure that the languageCode has a valid value\n\t\t$sql = \t<<<EOD\n\t\t\t\tSELECT *\n\t\t\t\tFROM T_ProductLanguage\n\t\t\t\tWHERE F_ProductCode=? \n\t\t\t\tAND F_LanguageCode=?\nEOD;\n\t\t$rs = $this->db->Execute($sql, array($title->productCode, $title->languageCode));\n\t\t\n\t\tswitch ($rs->RecordCount()) {\n\t\t\tcase 0:\n\t\t\t\t// There is no matching pair, raise an error\n\t\t\t\treturn false;\n\t\t\tdefault:\n\t\t}\n\t\t// Also make sure that Author Plus has a content location\n\t\t// But how to differentiate this from the above error? \n\t\t// Need to return an error code I suppose.\n\t\t// This is left for now. You get a double error message, but that is kind of OK\n\t\t// v3.5 Now dbContentLocation is tied to the field in DMS and is the direct database link\n\t\t//if ($title-> productCode == 1 && ($title->contentLocation == \"\" || $title->contentLocation == null))\n\t\tif ($title-> productCode == 1 && ($title->dbContentLocation == \"\" || $title->dbContentLocation == null))\n\t\t\treturn false;\n\t\t\t\n\t\treturn true;\n\t}", "public function testCreateNoTitle()\n {\n // Do Request\n $this->_request('POST', '/api/1.5.0/news-create',['token' => '123'])\n ->_result(['error' => 'no-title']);\n }", "public function tagSetTitle(UnitTester $I)\n {\n $I->wantToTest('Tag - setTitle()');\n\n Tag::resetInput();\n\n $value = 'This is my title';\n\n Tag::setTitle($value);\n\n $I->assertEquals(\n \"<title>{$value}</title>\" . PHP_EOL,\n Tag::renderTitle()\n );\n\n $I->assertEquals(\n \"{$value}\",\n Tag::getTitle()\n );\n }", "public static function title()\n {\n return 'Untitled module';\n }", "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);", "public function hasTitle(){\n return $this->_has(37);\n }", "public function a_user_can_create_a_project()\n {\n\n $this->withoutExceptionHandling();\n \n //Given\n $this->actingAs(factory('App\\User')->create());\n \n //When\n $this->post('/projects', [\n 'title' => 'ProjectTitle',\n 'description' => 'Description here',\n ]);\n \n \n //Then\n $this->assertDatabaseHas('projects', [\n 'title' => 'ProjectTitle',\n 'description' => 'Description here',\n ]);\n }", "protected function _setIndexDocumentTitle() {\n\n\t\tif ( !isset( $this->imdb_index_body[$this->imdb_language] ) || !isset( $this->imdb_language ) ) {\n\t\t\t$this->_setError( 'Protected_setIndexDocumentTitle_Index_Body_Or_Language_Undefined' );\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( !preg_match_all( '/\\<title\\>[\\x20]*([^\\x20]+[^\\x3c]+[^\\x20]+)[\\x20]*\\<\\/title\\>/', $this->imdb_index_body[$this->imdb_language], $imdb_page_index_document_title_matches[$this->imdb_language] ) ) {\n\t\t\t$this->_setError( 'Protected_setIndexDocumentTitle_Document_Title_Preg_Match_All_False_' . $this->imdb_language );\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( !isset( $imdb_page_index_document_title_matches[$this->imdb_language][1] ) ) {\n\t\t\t$this->_setError( 'Protected_setIndexDocumentTitle_Document_Title_Matches_Undefined_' . $this->imdb_language );\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( count( $imdb_page_index_document_title_matches[$this->imdb_language][1] ) !== 1 ) {\n\t\t\t$this->_setError( 'Protected_setIndexDocumentTitle_Document_Title_Count_Diff_1_' . $this->imdb_language );\n\t\t\treturn false;\n\t\t}\n\n\t\t$imdb_page_index_document_title_matches[$this->imdb_language][1][0] = trim( preg_replace( '/^([^\\x20]+[^\\x28\\x29]+[^\\x20\\]+[^\\x20]+) \\((?:TV Mini\\-Series\\x20|TV Movie\\x20|TV Episode\\x20|TV Short\\x20|Video\\x20)?(?:201[0-5]|200[0-9]|19[0-9][0-9])\\) \\- IMDb$/', '$1', $imdb_page_index_document_title_matches[$this->imdb_language][1][0], -1, $prcount[$this->imdb_language] ) );\n\t\t$imdb_page_index_document_title_matches[$this->imdb_language][1][0] = $prcount[$this->imdb_language] === 1 ? $imdb_page_index_document_title_matches[$this->imdb_language][1][0] : trim( preg_replace( '/^([^\\x20]+.+[^\\x20]+[^\\x20]+) \\((?:Video\\x20)?(?:201[0-5]|200[0-9]|19[0-9][0-9])\\) \\- IMDb$/', '$1', $imdb_page_index_document_title_matches[$this->imdb_language][1][0], -1, $prcount[$this->imdb_language] ) );\n\n\t\tif ( $prcount[$this->imdb_language] === 0 ) {\n\t\t\t$this->_setError( 'Protected_setIndexDocumentTitle_Preg_Replace_Count_Equal_Zero_' . $this->imdb_language );\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->raw->index->document_title[$this->imdb_language] = $imdb_page_index_document_title_matches[$this->imdb_language][1][0];\n\n\t\treturn true;\n\n\t}", "private function checkTitleTooShort($title)\r\n {\r\n return $this->checkTooShort($title, self::$titleMinLength); \r\n }", "public function testName()\n {\n $this->assertEquals('homepage_url', (new UrlField('homepage_url'))->getName());\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() {}" ]
[ "0.71535224", "0.70882756", "0.6800982", "0.6733853", "0.66882277", "0.66729856", "0.66538966", "0.663283", "0.65382916", "0.6493532", "0.6470231", "0.64035076", "0.640006", "0.63973784", "0.6364185", "0.63316715", "0.62585", "0.62511885", "0.62008727", "0.61617523", "0.6118278", "0.61099786", "0.6106584", "0.6094753", "0.6062817", "0.60593456", "0.604611", "0.60382104", "0.60324883", "0.59864134", "0.59695745", "0.5961985", "0.5933795", "0.59318316", "0.59216076", "0.5912412", "0.5890094", "0.5883112", "0.5854207", "0.584504", "0.58279264", "0.5783653", "0.57729596", "0.5772377", "0.576764", "0.57589364", "0.57460445", "0.5740082", "0.573992", "0.5725623", "0.57141376", "0.5701054", "0.5684073", "0.5682234", "0.5680166", "0.5643873", "0.5641518", "0.5633999", "0.56272405", "0.56214505", "0.562076", "0.5610368", "0.5596483", "0.5578557", "0.5578474", "0.55743146", "0.5569936", "0.55694604", "0.55614805", "0.55601007", "0.5559476", "0.55556726", "0.5554916", "0.55520684", "0.5551702", "0.55405784", "0.5537894", "0.552473", "0.5514607", "0.5512861", "0.5503092", "0.5503092", "0.5503092", "0.5503092", "0.5503092", "0.5503092", "0.5503092", "0.55029017", "0.5491805", "0.54869616", "0.54868376", "0.5480037", "0.5478312", "0.5477593", "0.5477593", "0.5477593", "0.5477593", "0.5477593", "0.5477593", "0.5477593" ]
0.7968348
0
Test Case: Validate that the project has a description.
public function shouldHaveDescription() { // Arrange $attributes = factory(Project::class)->raw([ 'description' => '' ]); // Action $response = $this->post('/projects', $attributes); // Assert $response->assertSessionHasErrors('description'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function a_project_require_a_description()\n {\n $project = factory(Project::class)->raw(['description' => '']);\n $this->post('/api/projects', $project)->assertStatus(422)->assertJsonStructure([\n 'errors' => [\n 'description',\n ],\n ]);\n }", "public function validateDescription()\n {\n if (empty($this->_cleanData['description'])) {\n $this->_addErrorMessage(\"Your description was missing\");\n\n return false;\n }\n\n return true;\n }", "public function testCommandHasADescription()\n {\n self::assertNotEmpty($this->command->getDescription());\n }", "public function __validate_description() {\n if (isset($this->initial_data['description'])) {\n $this->validated_data[\"description\"] = $this->initial_data['description'];\n } else {\n $this->validated_data[\"description\"] = \"\";\n }\n }", "public function set_description($description)\n\t{\n\t\tif (is_null($description)) {\n\t\t\tthrow new InvalidArgumentException(\"Project Description Invalid!\");\n\t\t}\n\t\t$this->description = $description;\n\t}", "public function testGetDescription(): void\n {\n $this->class->setDescription($this->value);\n\n self::assertSame($this->value, $this->class->getDescription());\n }", "public function testSetGetDescription()\n {\n $this->item->setDescription('A fine javelin, suitable for throwing at retreating enemies.');\n $this->assertEquals($this->item->getDescription(), 'A fine javelin, suitable for throwing at retreating enemies.');\n }", "public function setProjectDescription($value)\n {\n return $this->set('ProjectDescription', $value);\n }", "public function testAssignDescription()\n {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }", "public function testGetModDescription()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function test_create__with_description()\n {\n\n $testee = new ElementFactory();\n $expected = 'lorum ipsum';\n\n $spec = [\n 'attributes' => [\n 'type' => 'text',\n 'name' => 'test',\n ],\n 'description' => $expected\n ];\n\n $element = $testee->create($spec);\n\n static::assertSame($expected, $element->description());\n }", "function validate() {\n\t\tif( !access_has_global_level( config_get( 'create_project_threshold' ) ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Access denied to create projects',\n\t\t\t\tERROR_ACCESS_DENIED\n\t\t\t);\n\t\t}\n\n\t\tif( is_blank( $this->payload( 'name' ) ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Project name cannot be empty',\n\t\t\t\tERROR_EMPTY_FIELD,\n\t\t\t\tarray( 'name' )\n\t\t\t);\n\t\t}\n\n\t\t$t_project = $this->data['payload'];\n\n\t\t$this->name = $this->payload( 'name' );\n\t\t$this->description = $this->payload( 'description', '' );\n\t\t$this->inherit_global = $this->payload( 'inherit_global', true );\n\t\t$this->file_path = $this->payload( 'file_path', '' );\n\t\t$this->view_state = isset( $t_project['view_state'] ) ? mci_get_project_view_state_id( $t_project['view_state'] ) : config_get( 'default_project_view_status' );\n\t\t$this->status = isset( $t_project['status'] ) ? mci_get_project_status_id( $t_project['status'] ) : 10 /* development */;\n\t\t$this->enabled = $this->payload( 'enabled', true );\n\n\t\tif( !project_is_name_unique( $this->name ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Project name is not unique',\n\t\t\t\tERROR_PROJECT_NAME_NOT_UNIQUE,\n\t\t\t\tarray( 'name' )\n\t\t\t);\n\t\t}\n\n\t\t$t_enum_values = MantisEnum::getValues( config_get( 'project_status_enum_string' ) );\n\t\tif( !in_array( $this->status, $t_enum_values ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Invalid project status',\n\t\t\t\tERROR_INVALID_FIELD_VALUE,\n\t\t\t\tarray( 'status' )\n\t\t\t);\n\t\t}\n\n\t\tif( !is_bool( $this->inherit_global ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Invalid project inherit global',\n\t\t\t\tERROR_INVALID_FIELD_VALUE,\n\t\t\t\tarray( 'inherit_global' )\n\t\t\t);\n\t\t}\n\n\t\tif( !is_bool( $this->enabled ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Invalid project enabled',\n\t\t\t\tERROR_INVALID_FIELD_VALUE,\n\t\t\t\tarray( 'enabled' )\n\t\t\t);\n\t\t}\n\t}", "public function descriptionAction()\n {\n $module = $this->getModule();\n $config = Pi::config('', $module);\n\n if ($this->request->isPost()) {\n $data = $this->request->getPost();\n\n // Set form\n $form = new DescForm('solution-desc-form', 'html');\n $form->setInputFilter(new DescFilter);\n $form->setData($data);\n\n if ($form->isValid()) {\n $values = $form->getData();\n\n // Save\n $description = Pi::user()->data->set(0, 'solutions_description', $values['description']);\n\n } else {\n $message = _a('Invalid data, please check and re-submit.');\n }\n } else {\n $data['description'] = Pi::user()->data->get(0, 'solutions_description');\n if (empty($data['description'])) {\n $data['description'] = '<div style=\"font-size: 20px;\">Content is empty.</div>';\n }\n $form = new DescForm('solution-desc-form', 'html');\n $form->setData($data);\n $message = '';\n }\n\n $this->view()->assign('form', $form);\n $this->view()->assign('title', _a('Solutions Description'));\n $this->view()->assign('message', $message);\n $this->view()->setTemplate('solution-description');\n\n }", "public function getDescriptionAction() {\n\n $project_id = $this->input->post('project_id');\n\n $response = $this->project_model->getDescription($project_id);\n\n echo $response[0]['description'];\n }", "protected function checkDescription(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_string($this->_Description) && $this->_Description !== '' ) {\n\t\t\t$inMessage .= \"{$this->_Description} is not a valid value for Description\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\tif ( $isValid && strlen($this->_Description) > 30 ) {\n\t\t\t$inMessage .= \"Description cannot be more than 30 characters\";\n\t\t\t$isValid = false;\n\t\t}\n\t\tif ( $isValid && strlen($this->_Description) <= 1 ) {\n\t\t\t$inMessage .= \"Description must be more than 1 character\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\t\t\t\n\t\treturn $isValid;\n\t}", "public function testGetDescriptionDefault(): void\n {\n self::assertNull($this->class->getDescription());\n }", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription($description);", "public function testProjectListCanBeGenerated()\n {\n $title = \"Test Name\";\n $description = \"A Test Project\";\n $image = \"TestImage.png\";\n $this->createTestProject($title, $description, $image);\n\n $title2 = \"Test Name2\";\n $description2 = \"A Test Project2\";\n $image2 = \"TestImage.png2\";\n $this->createTestProject($title2, $description2, $image2);\n\n $projectsApi = new ProjectList($this->getDb());\n $answer = $projectsApi->get();\n\n $items = $answer['items'];\n $this->assertCount(2, $items, \"Two projects were created, so there should be 2 entries in the array\");\n\n $project = $items[0];\n $this->assertEquals($title, $project['title']);\n $this->assertEquals($description, $project['description']);\n $this->assertEquals(\"Default\", $project['imageType']);\n }", "public function testSetGetDescription()\n {\n $charge = new Charge();\n $charge->setDescription('Centurion Guarded Delivery via Horse');\n $this->assertEquals($charge->getDescription(), 'Centurion Guarded Delivery via Horse');\n unset($charge);\n }", "public function testSetAndGetDescription()\r\n {\r\n $testObj = $this->_createMockModel();\r\n $baseObj = $this->_createMockModel();\r\n\r\n // Set the Description\r\n $testObj->setDescription('Test Test Test Test');\r\n\r\n // Assert that a change occurred in the test object\r\n $this->assertNotEquals($testObj, $baseObj);\r\n\r\n // Assert that the Description field was updated\r\n $this->assertEquals('Test Test Test Test', $testObj->getDescription());\r\n\r\n // Assert that no other return values were affected\r\n $this->_assertModelsSameExcept($testObj, $baseObj, 'Description');\r\n }", "function isValidTaskDescription($taskDescription){\n if (strlen($taskDescription) <= 200){\n return true;\n }\n else{\n echo \"invalid taskDescription\";\n return false;\n }\n }", "protected function checkDescription(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_string($this->_Description) && $this->_Description !== '' ) {\n\t\t\t$inMessage .= \"{$this->_Description} is not a valid value for Description\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\t\t\t\n\t\treturn $isValid;\n\t}", "public function __construct($description)\n {\n $this->description = $description;\n }", "function checkDescr($descr, $X_langArray) {\n\tglobal $errorField;\n\t\n\t//descr vuoto\n\tif (!isset($descr) || $descr == ''){\n\t\t$errorField .= \"&descrErrMsg=\".urlencode($X_langArray['CREATE_COUNTRY_REV_EMPTY_DS_ERR']);\n\t}\n\telse if (strlen($descr) < 50 || strlen($descr) > 2000) {\n\t\t$errorField .= \"&descrErrMsg=\".urlencode($X_langArray['CREATE_COUNTRY_REV_DS_LENGTH_ERR']);\n\t}\n}", "public function testDescription()\n {\n $description_original = \"This is the original \\\"description\\\".\";\n $description_received =\n MetaTags::setDescription($description_original,0)\n ->getDescription();\n\n // Make sure what we got back is what we put in. (not truncated)\n $this->assertEquals(\n $description_original,\n $description_received,\"The original description was not a match\"\n );\n\n // Do the same test, but with truncation turned on.\n $description_received =\n MetaTags::setDescription($description_original,10)\n ->getDescription();\n\n // Test to make sure truncation is working.\n $this->assertEquals(\n $description_received,\n MetaTags::truncateAtWord($description_original,10)\n );\n\n $tag_text = MetaTags::renderDescription(true)->__toString();\n $this->assertStringStartsWith(\"<meta \",$tag_text);\n $this->assertStringEndsWith(\">\",$tag_text);\n }", "public function editProject($project_id, $project_name, $project_description, $db)\r\n {\r\n $sql = \"UPDATE projects\r\n set project_name = :project_name,\r\n project_description = :project_description\r\n WHERE id = :project_id\";\r\n\r\n $pst = $db->prepare($sql);\r\n $pst->bindParam(':project_name', $project_name);\r\n $pst->bindParam(':project_description', $project_description);\r\n $pst->bindParam(':project_id', $project_id);\r\n\r\n $count = $pst->execute();\r\n return $count;\r\n }", "public function a_user_can_create_a_project()\n {\n $attributes = [\n \n 'title' => $this->fake->sentence,\n\n ];\n\n }", "public function hasDescription() {\n return $this->_has(3);\n }", "public function hasDescription() {\n return $this->_has(3);\n }", "public function shouldHaveTitle()\n {\n // Arrange\n $attributes = factory(Project::class)->raw([\n 'title' => '',\n ]);\n\n // Action\n $response = $this->post('/projects', $attributes);\n\n // Assert\n $response->assertSessionHasErrors('title');\n }", "public function setDesciption($description);", "abstract public function getValidateDesc();", "function hasDescription()\n {\n return !empty($this->description);\n }", "public function testProjectNoReadme()\n {\n // create project to test with\n $project = new Project($this->p4);\n $project->set(\n array(\n 'id' => 'prj',\n 'members' => array('foo-member'),\n 'creator' => 'foo-member',\n 'owners' => array()\n )\n )->save();\n\n $this->dispatch('/project/readme/prj');\n $this->assertRoute('project-readme');\n $this->assertRouteMatch('markdown', 'markdown\\controller\\indexcontroller', 'project');\n $this->assertResponseStatusCode(200);\n $result = $this->getResult();\n\n $this->assertInstanceOf('Zend\\View\\Model\\JsonModel', $result);\n $this->assertSame('', $result->getVariable('readme'));\n }", "public function test_lti_build_request_description() {\n $this->resetAfterTest();\n\n self::setUser($this->getDataGenerator()->create_user());\n $course = $this->getDataGenerator()->create_course();\n $instance = $this->getDataGenerator()->create_module('lti', array(\n 'intro' => \"<p>This</p>\\nhas\\r\\n<p>some</p>\\nnew\\n\\rlines\",\n 'introformat' => FORMAT_HTML,\n 'course' => $course->id,\n ));\n\n $typeconfig = array(\n 'acceptgrades' => 1,\n 'forcessl' => 0,\n 'sendname' => 2,\n 'sendemailaddr' => 2,\n 'customparameters' => '',\n );\n\n $params = lti_build_request($instance, $typeconfig, $course, null);\n\n $ncount = substr_count($params['resource_link_description'], \"\\n\");\n $this->assertGreaterThan(0, $ncount);\n\n $rcount = substr_count($params['resource_link_description'], \"\\r\");\n $this->assertGreaterThan(0, $rcount);\n\n $this->assertEquals($ncount, $rcount, 'The number of \\n characters should be the same as the number of \\r characters');\n\n $rncount = substr_count($params['resource_link_description'], \"\\r\\n\");\n $this->assertGreaterThan(0, $rncount);\n\n $this->assertEquals($ncount, $rncount, 'All newline characters should be a combination of \\r\\n');\n }", "public function setDescription(string $desc) : bool {\n $trimmed = trim($desc);\n\n if (strlen($trimmed) > 0) {\n $this->taskDesc = $trimmed;\n\n return true;\n }\n\n return false;\n }", "public function testValidate()\n {\n $this->todo('stub');\n }", "public function testEditDescription()\n {\n // create review record for change 1\n $this->createChange();\n Review::createFromChange('1')->save();\n\n $postData = new Parameters(\n array('description' => \" I am a\\r\\nMultiline\\nDescription\\rThat's pretty cool\\r\\r\\neh\\r\\n \")\n );\n $this->getRequest()\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setPost($postData);\n\n // dispatch\n $this->dispatch('/reviews/2');\n $this->assertRoute('review');\n $this->assertResponseStatusCode(200);\n\n // check resulting change description\n $change = Change::fetch(2, $this->p4);\n $this->assertSame(\n \"I am a\\nMultiline\\nDescription\\nThat's pretty cool\\n\\neh\\n\",\n $change->getDescription()\n );\n }", "public function has_description(){\n\t\treturn 0 < strlen($this->_description);\n\t}", "public function hasDescription() {\n return $this->_has(4);\n }", "public function hasDescription() {\n return $this->_has(4);\n }", "public function testGetDescription(array $values) {\n $permission = new GroupPermission($values);\n $this->assertEquals($values['description'], $permission->getDescription());\n }", "public function hasDescription(){\n return $this->_has(1);\n }", "public function hasDescription()\n {\n return !empty($this->description);\n }", "public function description(?string $description): static;", "public function canSetDescription();", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function hasDescription() {\n return $this->_has(7);\n }", "public function description()\r\n {\r\n }", "public function testEditGitDescription()\n {\n // create fusion style change and make it a review\n $gitInfo = \"\\n\\nImported from Git\\n\"\n . \" Author: Bob Bobertson <[email protected]> 1381432565 -0700\\n\"\n . \" Committer: Git Fusion Machinery <[email protected]> 1381432572 +0000\\n\"\n . \" sha1: 6a96f259deb6d8567a4d85dce09ae2e707ca7286\\n\"\n . \" push-state: complete\\n\"\n . \" review-status: create\\n\"\n . \" review-id: 1\\n\"\n . \" review-repo: Talkhouse\\n\";\n $shelf = new Change;\n $shelf->setDescription(\"Test git review!\" . $gitInfo)->save();\n $review = GitReview::createFromChange($shelf);\n $review->save()->updateFromChange($shelf)->save();\n\n $postData = new Parameters(\n array('description' => \" I am a\\r\\nMultiline\\nDescription\\rThat's pretty cool\\r\\r\\neh\\r\\n\\n\\n \")\n );\n $this->getRequest()\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setPost($postData);\n\n // dispatch\n $this->dispatch('/reviews/1');\n $this->assertRoute('review');\n $this->assertResponseStatusCode(200);\n\n // check resulting change description\n $change = Change::fetch(1, $this->p4);\n $this->assertSame(\n \"I am a\\nMultiline\\nDescription\\nThat's pretty cool\\n\\neh\" . $gitInfo,\n $change->getDescription()\n );\n }", "public static function getDescription(): string\n {\n }", "public static function getDescription(): string\n {\n }", "public function setDescription($description) \n\t{\n \n $this->description = empty($description) ? \"\" : $description;\t\n\t}", "public function setDescription(/*string*/ $description);", "public static function description($description)\n {\n // Set page description\n self::$data['description'] = $description;\n }", "protected function assignDescription()\n {\n $this->description = 'This is a test for a Template Variable migration class';\n }", "public function test_create_project()\n {\n $response = $this->post('/project', [\n 'name' => 'Project nae', \n 'description' => 'Project description'\n ]);\n \n $response->assertStatus(302);\n }", "public function getDescription()\n {\n \tthrow new Lib_Exception(\"Comments cannot be asked for their description\");\n }", "public function description();", "public function description();", "public function setDescription($description) {\n\t\t// if passed in description is not null and is either 0 chars or is greater than 16777215 characters (mysql mediumtext size), can be null but not empty\n\t\tif(($description !== null) && (strlen($description) == 0 || strlen($description) > 16777215)) {\n\t\t\tthrow new TaskException(\"Task description error\");\n\t\t}\n\t\t$this->_description = $description;\n\t}", "public function updateProject($title, $description){\n $this->update([\n 'title'=>$title,\n 'description'=>$description\n ]);\n }", "public function getDescription(): string\n {\n return 'Se crea el campo anexos del sistema';\n }", "function ui_description() {\n if (isset($this->plugin['ui_description'])) {\n return check_plain($this->plugin['ui_description']);\n }\n }", "function setDescription($description) {\n\t\t$this->description = $description;\n\t}", "public function testSetGetDescription()\n {\n $description = 'Description';\n $event = (new Event())->setDescription($description);\n $this->assertEquals($description, $event->getDescription());\n }", "abstract function getdescription();", "public function setDescription(string $description): bool\n {\n try {\n $this->description = $this->valTextMandMaxCar(\n $description, 200, __METHOD__\n );\n $return = true;\n } catch (AuditFileException $e) {\n $this->description = $description;\n \\Logger::getLogger(\\get_class($this))\n ->error(\\sprintf(__METHOD__.\" '%s'\", $e->getMessage()));\n $this->getErrorRegistor()->addOnSetValue(\"ProductCode_not_valid\");\n $return = false;\n }\n \\Logger::getLogger(\\get_class($this))\n ->debug(\\sprintf(__METHOD__.\" set to '%s'\", $this->description));\n return $return;\n }", "abstract public function getDescription();", "abstract public function getDescription();", "protected function givenAProjectMock()\n {\n return m::mock('phpDocumentor\\Descriptor\\ProjectDescriptor')->shouldIgnoreMissing();\n }", "public function setDescription( $description )\r\n\t{\r\n\t\t$this->description = $description;\r\n\t}", "public abstract function getDescription();", "public function hasDescription(){\n return $this->_has(5);\n }", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();" ]
[ "0.83257455", "0.6658854", "0.6538204", "0.64926475", "0.6483126", "0.6443382", "0.6401218", "0.6279939", "0.62030315", "0.6143676", "0.6071989", "0.60656685", "0.59975594", "0.5943932", "0.5922573", "0.592254", "0.5910526", "0.5910526", "0.5910526", "0.5910526", "0.5910526", "0.5910526", "0.5900232", "0.58841515", "0.58813095", "0.587948", "0.5867373", "0.5840735", "0.583622", "0.5819227", "0.5802756", "0.5802682", "0.57700616", "0.57700616", "0.57683766", "0.5751669", "0.5740904", "0.57233894", "0.5722307", "0.5716085", "0.57059336", "0.56798625", "0.5677157", "0.5668321", "0.5668112", "0.5668112", "0.5664304", "0.56627774", "0.5659027", "0.56541055", "0.564111", "0.5640247", "0.5640247", "0.5640247", "0.5640247", "0.5640247", "0.5640247", "0.5640247", "0.5640247", "0.5640247", "0.56398606", "0.56398606", "0.56398606", "0.5600837", "0.5585581", "0.55809003", "0.5578728", "0.5578728", "0.5575885", "0.5566942", "0.5566146", "0.55553085", "0.55486125", "0.55472463", "0.5545675", "0.5545675", "0.55452746", "0.5544177", "0.5532582", "0.5530173", "0.5513177", "0.5503676", "0.5485656", "0.5477208", "0.5467438", "0.5467438", "0.5462222", "0.5458704", "0.54568565", "0.54549414", "0.5449644", "0.5449644", "0.5449644", "0.5449644", "0.5449644", "0.5449644", "0.5449644", "0.5449644", "0.5449644", "0.5449644" ]
0.8085601
1
give environment variables a higher priority
public function __construct($debug = false) { $this->prestaUrl = $this->getEnv('prestaUrl'); $this->prestaApiKey = $this->getEnv('prestaApiKey'); parent::__construct($this->prestaUrl, $this->prestaApiKey, $debug); $this->mappingsFile = __DIR__ . '/../tmp/mappings.json'; $this->mappings = json_decode(@file_get_contents($this->mappingsFile), true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function apache_getenv($variable, $walk_to_top = false)\n{\n}", "protected function paratestEnvironmentVariables()\n {\n if ($this->option('custom-argument')) {\n return array_merge(\n parent::paratestEnvironmentVariables(),\n [\n 'CUSTOM_ENV_VARIABLE' => 1,\n 'CUSTOM_ENV_VARIABLE_FOR_PARALLEL' => 1,\n ],\n );\n }\n\n return parent::paratestEnvironmentVariables();\n }", "public function getDefaultEnvironment();", "function apache_setenv($variable, $value, $walk_to_top = false)\n{\n}", "function setEnvironment($value){ $_ENV['CURRENT_ENVIRONMENT'] = $value; }", "private function set_environment() {\n $pedestal_env = 'live';\n if ( defined( 'WP_ENV' ) && 'development' == WP_ENV ) {\n $pedestal_env = 'dev';\n } elseif ( isset( $_ENV['PANTHEON_ENVIRONMENT'] ) ) {\n $pedestal_env = $_ENV['PANTHEON_ENVIRONMENT'];\n }\n if ( ! defined( 'PEDESTAL_ENV' ) ) {\n define( 'PEDESTAL_ENV', $pedestal_env );\n }\n }", "function getEnvironmentVariables()\n{\n\tglobal $config_array;\n\n\tif ($customnr = getenv('CUSTOMERNR')) {\n\t\t$config_array['CUSTOMERNR'] = $customnr;\n\t}\n\n\tif ($apikey = getenv('APIKEY')) {\n\t\t$config_array['APIKEY'] = $apikey;\n\t}\n\n\tif ($apipassword = getenv('APIPASSWORD')) {\n\t\t$config_array['APIPASSWORD'] = $apipassword;\n\t}\n\n\tif ($domain = getenv('DOMAIN')) {\n\t\t$config_array['DOMAIN'] = $domain;\n\t}\n\n\tif ($hostipv4 = getenv('HOST_IPv4')) {\n\t\t$config_array['HOST_IPv4'] = $hostipv4;\n\t}\n\n\tif ($hostipv6 = getenv('HOST_IPv6')) {\n\t\t$config_array['HOST_IPv6'] = $hostipv6;\n\t}\n\n\tif ($useipv4 = getenv('USE_IPV4')) {\n\t\t$config_array['USE_IPV4'] = $useipv4;\n\t}\n\n\tif ($usefb = getenv('USE_FRITZBOX')) {\n\t\t$config_array['USE_FRITZBOX'] = $usefb;\n\t}\n\n\tif ($fbip = getenv('FRITZBOX_IP')) {\n\t\t$config_array['FRITZBOX_IP'] = $fbip;\n\t}\n\n\tif ($useipv6 = getenv('USE_IPV6')) {\n\t\t$config_array['USE_IPV6'] = $useipv6;\n\t}\n\n\tif ($ipv6interface = getenv('IPV6_INTERFACE')) {\n\t\t$config_array['IPV6_INTERFACE'] = $ipv6interface;\n\t}\n\n\tif ($ipv6priv = getenv('NO_IPV6_PRIVACY_EXTENSIONS')) {\n\t\t$config_array['NO_IPV6_PRIVACY_EXTENSIONS'] = $ipv6priv;\n\t}\n\n\tif ($changettl = getenv('CHANGE_TTL')) {\n\t\t$config_array['CHANGE_TTL'] = $changettl;\n\t}\n\n\tif ($apiurl = getenv('APIURL')) {\n\t\t$config_array['APIURL'] = $apiurl;\n\t}\n\n\tif ($sendmail = getenv('SEND_MAIL')) {\n\t\t$config_array['SEND_MAIL'] = $sendmail;\n\t}\n\n\tif ($mailrec = getenv('MAIL_RECIPIENT')) {\n\t\t$config_array['MAIL_RECIPIENT'] = $mailrec;\n\t}\n\n\tif ($sleepinsec = getenv('SLEEP_INTERVAL_SEC')) {\n\t\t$config_array['SLEEP_INTERVAL_SEC'] = $sleepinsec;\n\t}\n}", "function switchToBeta(){ $_ENV['CURRENT_ENVIRONMENT'] = ENVIRONMENT_BETA; }", "function pkg_env($extra_env = array()) {\n\tglobal $g;\n\n\t$user_agent = g_get('product_label') . '/' . g_get('product_version');\n\tif (!config_path_enabled('system','do_not_send_uniqueid')) {\n\t\t$user_agent .= ':' . system_get_uniqueid();\n\t}\n\n\t$pkg_env_vars = array(\n\t\t\"LANG\" => \"C\",\n\t\t\"HTTP_USER_AGENT\" => $user_agent,\n\t\t\"ASSUME_ALWAYS_YES\" => \"true\",\n\t\t\"FETCH_TIMEOUT\" => 5,\n\t\t\"FETCH_RETRY\" => 2\n\t);\n\n\t$http_proxy = config_get_path('system/proxyurl');\n\t$http_proxyport = config_get_path('system/proxyport');\n\tif (!empty($http_proxy)) {\n\t\tif (!empty($http_proxyport)) {\n\t\t\t$http_proxy .= ':' . $http_proxyport;\n\t\t}\n\t\t$pkg_env_vars['HTTP_PROXY'] = $http_proxy;\n\n\t\t$proxyuser = config_get_path('system/proxyuser');\n\t\t$proxypass = config_get_path('system/proxypass');\n\t\tif (!empty($proxyuser) && !empty($proxypass)) {\n\t\t\t$pkg_env_vars['HTTP_PROXY_AUTH'] = \"basic:*:\" .\n\t\t\t $proxyuser . \":\" . $proxypass;\n\t\t}\n\t}\n\n#\tif (config_path_enabled('system','use_mfs_tmpvar') &&\n#\t !file_exists(\"/conf/ram_disks_failed\")) {\n#\t\t$pkg_env_vars['PKG_DBDIR'] = '/root/var/db/pkg';\n#\t\t$pkg_env_vars['PKG_CACHEDIR'] = '/root/var/cache/pkg';\n#\t}\n\n\tforeach ($extra_env as $key => $value) {\n\t\t$pkg_env_vars[$key] = $value;\n\t}\n\n\treturn $pkg_env_vars;\n}", "public function setEnvironment();", "public static function setEnvironment($prm_env)\n\t{\n global $application_is_published;\n \n switch ($prm_env) {\n case 'development':\n //Set environment for development;\n error_reporting(E_ALL);\n $application_is_published = false;\n break;\n\t\t\t\t\n case 'publish':\n //set environment for publish;\n error_reporting(0);\n $application_is_published = true;\n break;\n\n case 'default':\n //do not set;\n break;\n\t\t\t\t\n\n default:\n //Set environment for development;\n break;\n }\n\t}", "private function initEnvironment() {\n\t\t$env = getenv('APP_ENV');\n\n\t\t$this->_env = ($env !== FALSE) ? $env : 'development';\n\t}", "public function setEnv($variables);", "function switchToDev(){ $_ENV['CURRENT_ENVIRONMENT'] = ENVIRONMENT_DEV; }", "protected function getEnvironmentVariablesThatICareAbout()\n {\n return array(\n 'shell',\n 'tmpdir',\n 'user',\n 'pwd',\n 'lang',\n 'editor',\n 'home',\n );\n }", "private function settingEnvironmentVariables()\r\n {\r\n \t$this->Queue->engineOut(\"Q install directory located at \" . getcwd());\r\n \t$this->Queue->engineOut(\"Q Engine Service starting\");\r\n \t$this->Queue->engineOut(\"Timezone set to $this->tz\");\r\n\r\n putenv(\"VL_ENGINE_SERVICE_PID=$this->pid\");\r\n putenv(\"VL_ENGINE_VERBOSE=\".$this->engineProperties['engineVerbose']);\r\n putenv(\"VL_SESSION_KEY=$this->sessionKey\");\r\n\r\n $this->Queue->engineOut(\"Engine session key: $this->sessionKey\");\r\n $this->Queue->engineOut(\"System configured for \".$this->engineProperties['engineCount'].\" concurrent engine processes.\");\r\n $this->Queue->engineOut(\"Job scan interval configured for \".$this->engineProperties['engineTickSec'].\" seconds.\");\r\n }", "function env($str){\n\treturn (getenv($str))?:$_SERVER[$str]; // generate library path:\n}", "protected function phpunitEnvironmentVariables()\n {\n if ($this->option('custom-argument')) {\n return array_merge(\n parent::phpunitEnvironmentVariables(),\n [\n 'CUSTOM_ENV_VARIABLE' => 1,\n 'CUSTOM_ENV_VARIABLE_FOR_PHPUNIT' => 1,\n ],\n );\n }\n\n return parent::phpunitEnvironmentVariables();\n }", "public function overrideGlobals() {\n throw new Exception(\"Overriding the GLOBALS in a hprose environment is not permitted.\");\n }", "public function setUp()\n {\n putenv(\"{$this->name}={$this->value}\");\n \n return;\n }", "private function fixLocaleEnvironment( array &$env ) {\n\t\tif ( PHP_OS_FAMILY === 'Windows' ) {\n\t\t\t// Probably OK?\n\t\t\treturn;\n\t\t}\n\t\tforeach ( [ 'LC_CTYPE', 'LC_ALL', 'LANG' ] as $name ) {\n\t\t\tif ( isset( $env[$name] )\n\t\t\t\t&& preg_match( '/\\.(gb\\w*)/i', $env[$name] )\n\t\t\t) {\n\t\t\t\t$this->logger->warning( \"Filtering out unsafe environment variable \" .\n\t\t\t\t\t\"$name={$env[$name]}\" );\n\t\t\t\tunset( $env[$name] );\n\t\t\t}\n\t\t}\n\t}", "function init_env() {\n $envs_filename = base_path().DIRECTORY_SEPARATOR.'.env';\n $envs = $envs_array = [];\n \n if ($ressources = fopen($envs_filename, 'r')) {\n while (!feof($ressources)) {\n $element = fgets($ressources);\n\n if (!empty(trim($element))) {\n $element_array = explode('=', $element);\n $envs_array[$element_array[0]] = $element_array[1];\n }\n\n $envs[] = $element;\n }\n\n fclose($ressources);\n }\n\n $_ENV = array_merge($envs_array, $_ENV);\n }", "public function setEnvironment($environmentVars);", "protected static function loadEnv()\n {\n global $argv;\n /* Unset the first item (file name) */\n unset($argv[0]);\n\n $name_map = self::$environment_arguments_map;\n\n $tmp = [];\n foreach ($argv as $index => $value) {\n if (StringHelper::contains('=', $value)) {\n /* explode the key value pair */\n $value_array = explode('=', $value);\n /* Strip the quotes from the value */\n $tmp[$value_array[0]] = ltrim(rtrim($value_array[1], '\"'), '\"');\n } elseif (StringHelper::startsWith('--', $value) || StringHelper::startsWith('-', $value)) {\n $tmp[str_replace('--', '', $value)] = true;\n } else {\n /* Check if we have names left */\n if (!empty($name_map)) {\n /* add the first name to this value */\n $tmp[array_shift($name_map)] = $value;\n } else {\n /* Otherwise, don't mind */\n $tmp[] = $value;\n }\n }\n }\n /* Store it in $env */\n Console::$env = $tmp;\n }", "private function getEnvironmentVariables()\n {\n return array(\n 'GIT_TERMINAL_PROMPT' => '0',\n 'GIT_ASKPASS' => 'echo',\n );\n }", "public function overload()\n {\n $this->checkForSpecificEnvironmentFile();\n $dotEnv = Dotenv::createImmutable($this->getEnvironmentPath(),$this->getEnvironmentFile());\n //$dotEnv = new Dotenv($this->getEnvironmentPath(), $this->getEnvironmentFile());\n $dotEnv->load();\n\n $this->validateEnvironmentFile($dotEnv);\n }", "public function patch()\n\t{\n\t\t$env_override_file = __DIR__ . '/../../.env';\n\n\t\tif ( file_exists($env_override_file) ) {\n\t\t\t$env_override_vars = parse_ini_file($env_override_file);\n\n\t\t\tforeach ( $env_override_vars as $var_name => $var_value ) {\n\t\t\t\t$_SERVER[$var_name] = $var_value;\n\t\t\t}\n\t\t}\n\t}", "function envvalue($name, $default)\n{\n $value = getenv($name);\n return $value == false ? $default : $value;\n}", "private function set_env(){\n ini_set(\"memory_limit\", \"256M\");\n ini_set(\"max_execution_time\", 3000);\n }", "function env($key, $default = null)\n {\n if(isset($_ENV[$key]))\n return $_ENV[$key];\n\n return $default;\n }", "public function testResolveEnvironment()\n {\n $this->assertEquals('testing', EnvSecurity::resolveEnvironment());\n\n EnvSecurity::resolveEnvironmentUsing(function() {\n return \"heya\";\n });\n\n $this->assertEquals('heya', EnvSecurity::resolveEnvironment());\n\n EnvSecurity::setEnvironment(\"override\");\n\n $this->assertEquals('override', EnvSecurity::resolveEnvironment());\n }", "private function checkEnvironmentVariables()\n {\n $this->checkEnvironmentVariable(\"DB_HOST\", self::$db_host, \"localhost\");\n $this->checkEnvironmentVariable(\"DB_DATABASE\", self::$db_database, \"tracker\");\n $this->checkEnvironmentVariable(\"DB_USERNAME\", self::$db_username, \"tracker\");\n $this->checkEnvironmentVariable(\"DB_PASSWORD\", self::$db_password, \"tracker\");\n }", "public function getEnv($name);", "private function loadReleaseFromEnv()\n {\n $this->release['version'] = getenv('SHOPWARE_VERSION') === false ? self::VERSION : getenv('SHOPWARE_VERSION');\n $this->release['revision'] = getenv('SHOPWARE_REVISION') === false ? self::REVISION : getenv('SHOPWARE_REVISION');\n $this->release['version_text'] = getenv('SHOPWARE_VERSION_TEXT') === false ? self::VERSION_TEXT : getenv('SHOPWARE_VERSION_TEXT');\n }", "private function loadEnvironment () : void {\n $env = new Dotenv(__DIR__);\n if (file_exists(__DIR__ . '/.env')) {\n $env->load();\n }\n $env->required('SERVERS_LOG_FILE');\n }", "protected function setupEnvironment()\n {\n Dotenv::create(project_root())->load();\n\n if (!in_array($_SERVER['APP_ENV'], [self::ENV_DEV, self::ENV_PRODUCTION, self::ENV_STAGING, self::ENV_TEST])) {\n throw new RuntimeException(\"Unrecognized application environment\");\n }\n\n $this->debug = (bool) (\n $_SERVER['APP_DEBUG']\n ?? $_SERVER['APP_ENV'] == self::ENV_DEV\n );\n }", "function isDevOrBeta(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_DEV || $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_BETA; }", "function env(string $name, mixed $default = null, bool $server = true): mixed\n{\n return System::envGet($name, $default, $server);\n}", "function env($key, $default = NULL)\n\t{\n\t\treturn Env::get($key, $default);\n\t}", "protected function defineEnvironmentConstants()\n {\n /** Environment name for development. */\n define('ENVIRONMENT_DEV', 'dev');\n /** Environment name for development. */\n define('ENVIRONMENT_TEST', 'test');\n /** Environment name for staging. */\n define('ENVIRONMENT_STAGING', 'staging');\n /** Environment name for production. */\n define('ENVIRONMENT_PRODUCTION', 'production');\n }", "protected function setUp () : void {\n\n $_ENV['foo'] = \"bar\";\n $_SERVER['foo'] = \"baz\";\n\n $_ENV['bar'] = \"lorem\";\n $_SERVER['baz'] = \"ipsum\";\n\n // And quux isn't defined.\n }", "function getEnvVar(string $name, string $fallback = null, array $valid_values = null) {\n $value = getenv($name);\n $required = $fallback === null;\n\n if ($value === false && $required) {\n print(\"⚠️ Required environment variable '$name' is not set!\" . PHP_EOL);\n exit(1);\n }\n\n if (!$value && $fallback !== null) {\n $value = $fallback;\n print(\"ℹ️ Environment variable '$name' is not set, using fallback '$fallback'\" . PHP_EOL);\n }\n\n if ($valid_values != null && !in_array($value, $valid_values)) {\n print(\"⚠️ Environment variable '$name' has invalid value\");\n exit(1);\n }\n\n return $value;\n}", "public function env($key = null);", "protected function _after()\n {\n putenv('APM_ACTIVE');\n putenv('APM_APPNAME');\n putenv('APM_APPVERSION');\n putenv('APM_ENVIRONMENT');\n putenv('APM_SERVERURL');\n putenv('APM_SECRETTOKEN');\n putenv('APM_USEROUTEURI');\n putenv('APM_MAXTRACEITEMS');\n putenv('APM_BACKTRACEDEPTH');\n putenv('APM_QUERYLOG');\n putenv('APM_THRESHOLD');\n\n putenv('ELASTIC_APM_ENABLED');\n putenv('ELASTIC_APM_SERVICE_NAME');\n putenv('ELASTIC_APM_SERVER_URL');\n putenv('ELASTIC_APM_SERVICE_VERSION');\n putenv('ELASTIC_APM_SECRET_TOKEN');\n putenv('ELASTIC_APM_HOSTNAME');\n putenv('ELASTIC_APM_STACK_TRACE_LIMIT');\n putenv('ELASTIC_APM_TRANSACTION_SAMPLE_RATE');\n }", "protected function getEnvironments()\n {\n return array('dev', 'test', 'preprod');\n }", "protected function getEnvironmentMode() {}", "private function _environmentCheck()\n {\n if ( php_sapi_name() != \"cli\" )\n {\n die(\"ArrowWorker hint : only run in command line mode\".PHP_EOL);\n }\n\n if ( !function_exists('pcntl_signal_dispatch') )\n {\n declare(ticks = 10);\n }\n\n if ( !function_exists('pcntl_signal') )\n {\n die('ArrowWorker hint : php environment do not support pcntl_signal'.PHP_EOL);\n }\n\n if ( function_exists('gc_enable') )\n {\n gc_enable();\n }\n\n }", "private static function getEnvironmentForVariables($var=array(),$environment=null)\r\n {\r\n //environment variable specified by the variable is checked in the defined file\r\n //and the value is returned accordingly.\r\n return $environment[$var[0]] ?? $var[1];\r\n }", "private function _modEnvironment($VAR) {\n $keys = array_keys($VAR);\n $sKeys = array_keys($_SESSION['_ENV']);\n for($sCount = 0; $sCount < count($sKeys); $sCount++) {\n for($count = 0; $count < count($keys); $count++) {#\n if($sKeys[$sCount] == $keys[$count]) {\n $_SESSION['_ENV'][$sKeys[$sCount]] = $VAR[$keys[$count]];\n }\n }\n }\n $target = _BASEDIR_.DS.\"environment.ini.\" . date('Ymd');\n if(file_exists(_BASEDIR_.DS.\"environment.ini.\" . date('Ymd'))) {\n $fileCount=1;\n while(file_exists(_BASEDIR_.DS.\"environment.ini.\" . date('Ymd') . \"_\" . $fileCount)) {\n $fileCount++;\n }\n $target .= \"_\".$fileCount;\n }\n rename(_BASEDIR_.DS.\"environment.ini\", $target);\n $fp = fopen(_BASEDIR_.DS.\"environment.ini\", \"w+\");\n if($fp != null) {\n $keys = array_keys($_SESSION['_ENV']);\n for($count = 0; $count < count($keys); $count++) {\n if(strlen(trim($keys[$count])) > 0) {\n fwrite($fp, $keys[$count].\"=\".$_SESSION['_ENV'][$keys[$count]].\"\\n\");\n }\n }\n fclose($fp);\n }\n }", "public function setUp()\n\t{\n\t\t$environments = $this->getEnvironmentAsArray($this->envFile);\n\n\t\tforeach ($environments as $env) {\n\t\t\tif (!$this->isComment($env) && $this->isEquals($env) !== false){\n\t\t\t\t$part = implode(' ', array_map('nl2br', explode(' ', $env)));\n\t\t\t\t$key = substr($part, 0, -strlen($value = strrchr($part, '=')));\n\t\t\t\t$value = substr($value, 1, strlen($part));\n\t\t\t\t$this->setEnvironmentVariable($key, $value);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "function get_environment(): string {\n return getenv('APP_ENV') ?\n getenv('APP_ENV') : 'default';\n}", "function getEnvValue($name)\n{\n return $_ENV[$name] ?? getenv($name);\n}", "function switchToLive(){ $_ENV['CURRENT_ENVIRONMENT'] = ENVIRONMENT_LIVE; }", "function wmfLabsOverrideSettings() {\n\tglobal $wmfConfigDir, $wgConf;\n\n\t// Override (or add) settings that we need within the labs environment,\n\t// but not in production.\n\t$betaSettings = wmfLabsSettings();\n\n\t// Set configuration string placeholder 'variant' to 'beta-hhvm'\n\t// or 'beta' depending on the the runtime executing the code.\n\t// This is to ensure that *.beta-hhvm.wmflabs.org wikis use\n\t// loginwiki.wikimedia.beta-hhvm.wmflabs.org as their loginwiki.\n\t$wgConf->siteParamsCallback = function( $conf, $wiki ) {\n\t\t$variant = 'beta';\n\t\treturn array( 'params' => array( 'variant' => $variant ) );\n\t};\n\n\tforeach ( $betaSettings as $key => $value ) {\n\t\tif ( substr( $key, 0, 1 ) == '-' ) {\n\t\t\t// Settings prefixed with - are completely overriden\n\t\t\t$wgConf->settings[substr( $key, 1 )] = $value;\n\t\t} elseif ( isset( $wgConf->settings[$key] ) ) {\n\t\t\t$wgConf->settings[$key] = array_merge( $wgConf->settings[$key], $value );\n\t\t} else {\n\t\t\t$wgConf->settings[$key] = $value;\n\t\t}\n\t}\n}", "public function checkCurrentEnv() {\n $currentEnv = $this->getCurrentEnv();\n if (!in_array($currentEnv, $this->defaultEnvs)) {\n $this->log( 'ENV must be set to a value within ('.implode(', ', $this->defaultEnvs).')'.\"\\n\" ,'ERROR');\n }\n }", "function my_getenv($key)\n {\n\t $return = array();\n\t \n\t if ( is_array( $_SERVER ) AND count( $_SERVER ) )\n\t {\n\t\t if( isset( $_SERVER[$key] ) )\n\t\t {\n\t\t\t $return = $_SERVER[$key];\n\t\t }\n\t }\n\t \n\t if ( ! $return )\n\t {\n\t\t $return = getenv($key);\n\t }\n\t \n\t return $return;\n }", "private function parseSettingsForEnvVariables()\n {\n foreach ($this->settings as $key => $value)\n {\n $this->settings[ $key ] = craft()->config->parseEnvironmentString($value);\n }\n }", "protected static function overrideEnvironment(array &$env)\n {\n $get = &$env['QUERY'];\n\n // Check to override the method.\n if (isset($get['x-method'])) {\n $method = strtoupper($get['x-method']);\n\n $getMethods = [self::METHOD_GET, self::METHOD_HEAD, self::METHOD_OPTIONS];\n\n // Don't allow get style methods to be overridden to post style methods.\n if (!in_array($env['REQUEST_METHOD'], $getMethods) || in_array($method, $getMethods)) {\n static::replaceEnv($env, 'REQUEST_METHOD', $method);\n } else {\n $env['X_METHOD_BLOCKED'] = true;\n }\n unset($get['x-method']);\n }\n\n // Force the path and extension to lowercase.\n $path = strtolower($env['PATH_INFO']);\n if ($path !== $env['PATH_INFO']) {\n static::replaceEnv($env, 'PATH_INFO', $path);\n }\n\n $ext = strtolower($env['EXT']);\n if ($ext !== $env['EXT']) {\n static::replaceEnv($env, 'EXT', $ext);\n }\n\n // Check to override the accepts header.\n if (isset(self::$knownExtensions[$ext]) && $env['HTTP_ACCEPT'] !== 'application/internal') {\n static::replaceEnv($env, 'HTTP_ACCEPT', self::$knownExtensions[$ext]);\n }\n }", "private function getParentEnvironment() {\n\t\tif ( PHP_SAPI === 'cli' ) {\n\t\t\treturn getenv();\n\t\t} elseif ( isset( $_ENV['PATH'] ) ) {\n\t\t\treturn [ 'PATH' => $_ENV['PATH'] ];\n\t\t} else {\n\t\t\treturn [];\n\t\t}\n\t}", "function env();", "public function testEnvVar() {\n putenv('LING_ENV=dev');\n $this->assertSame(env('env.LING_ENV'), 'dev');\n }", "function merge_env($file, &$config) {\n\t$file = \"env_\" . basename($file);\n\n\t$file = APPPATH.\"config/\".ENVIRONMENT.\"/\" . $file;\n\n\tif (file_exists($file)) {\n\t\trequire ($file);\n\t}\n}", "function getEnvironment(){ return $_ENV['CURRENT_ENVIRONMENT']; }", "protected function loadEnvironmentVariables()\n {\n (new Dotenv())->load($this->basePath.'/.env');\n }", "public function siteEnvLookupParameters()\n {\n return [\n\n // Site not specified on commandline\n // Command takes site_env and variable arguments\n // TERMINUS_SITE and TERMINUS_ENV set in configuration\n [\n ['command: example:op', 'site_env: site-from-config.dev', 'list: [a, b]'],\n ['program', 'example:op', 'a', 'b'],\n $this->siteEnvVarArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Like the previous test, but a different site is specified on the commandline\n [\n ['command: example:op', 'site_env: othersite.test', 'list: [a, b]'],\n ['program', 'example:op', 'othersite.test', 'a', 'b'],\n $this->siteEnvVarArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Site not specified on commandline, and nothing provided in configuration\n [\n ['command: example:op', 'site_env: a', 'list: [b]'],\n ['program', 'example:op', 'a', 'b'],\n $this->siteEnvVarArgsDef(),\n [],\n ],\n\n // Site not speicifed on commandline\n // Command takes site_env and one other required argument\n // TERMINUS_SITE and TERMINUS_ENV set in configuration\n [\n ['command: example:op', 'site_env: site-from-config.dev', 'item: a'],\n ['program', 'example:op', 'a'],\n $this->siteEnvRequiredArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Like the previous test, but a different site is specified on the commandline\n [\n ['command: example:op', 'site_env: othersite.test', 'item: a'],\n ['program', 'example:op', 'othersite.test', 'a'],\n $this->siteEnvRequiredArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Site not specified on commandline, and nothing provided in configuration\n [\n ['command: example:op', 'site_env: a', 'item: EMPTY'],\n ['program', 'example:op', 'a'],\n $this->siteEnvRequiredArgsDef(),\n [],\n ],\n\n // Site not speicifed on commandline\n // Command takes site and one other required argument\n // TERMINUS_SITE and TERMINUS_ENV set in configuration\n [\n ['command: example:op', 'site: site-from-config', 'item: a'],\n ['program', 'example:op', 'a'],\n $this->siteRequiredArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Like the previous test, but a different site is specified on the commandline\n [\n ['command: example:op', 'site: othersite', 'item: a'],\n ['program', 'example:op', 'othersite', 'a'],\n $this->siteRequiredArgsDef(),\n $this->terminusSiteWithTerminusEnv(),\n ],\n\n // Site not specified on commandline, and nothing provided in configuration\n [\n ['command: example:op', 'site: EMPTY', 'item: a'],\n ['program', 'example:op', 'a'],\n $this->siteRequiredArgsDef(),\n [],\n ],\n\n ];\n }", "protected function terminusSiteWithTerminusEnv()\n {\n return [\n 'site' => 'site-from-config',\n 'env' => 'dev',\n ];\n }", "protected function replaceWithEnvironmentVariables($string) {\n\t\t$matches = array();\n\t\tpreg_match_all('/###ENV:([^#]*)###/', $string, $matches, PREG_PATTERN_ORDER);\n\t\tif (!is_array($matches) || !is_array($matches[0])) {\n\t\t\treturn $string;\n\t\t}\n\t\tforeach ($matches[0] as $index => $completeMatch) {\n\t\t\tif (getenv($matches[1][$index]) == FALSE) {\n\t\t\t\tthrow new \\Exception('Expect an environment variable ' . $matches[1][$index]);\n\t\t\t}\n\t\t\t$string = str_replace($completeMatch, getenv($matches[1][$index]), $string);\n\t\t}\n\t\treturn $string;\n\t}", "protected static function loadEnv()\n\t{\n\t\tif (! getenv('APP_ENV')) {\n\t\t\t// Load Dotenv if in a dev environment (no environment vars loaded)\n\t\t\t(new Dotenv(__DIR__ . '/../'))->load();\n\t\t}\n\t}", "private static function loadEnvSettings()\n {\n require_once self::$envPath;\n return $env;\n }", "protected function verifyEnvironment()\n {\n $environment = null;\n if (strstr(__DIR__, '/media/sf_code/')) {\n $environment = ENVIRONMENT_DEV;\n } elseif (getenv('IS_TEST_ENVIRONMENT')) {\n $environment = ENVIRONMENT_TEST;\n } else {\n $environment = ENVIRONMENT_PRODUCTION;\n }\n\n define('ENVIRONMENT', $environment);\n }", "function env(?string $key = null, $default = null)\n{\n return array_get($_SERVER, $key, $default);\n}", "protected function setEnvironmentOptions():void\n {\n //Checks env status and sets cache and debug attributes for instance of Twig Environment\n if($this->env == self::PRODUCTION_ENV)\n {\n $twigEnvironmentOptions = [\n 'cache' => $GLOBALS['cacheDirectory'],\n 'debug' => false,\n 'charset' => $GLOBALS['charset']\n ];\n }\n\n else\n {\n $twigEnvironmentOptions = [\n 'cache' => false,\n 'debug' => true,\n 'charset' => $GLOBALS['charset']\n ];\n }\n\n $this->environmentOptions = $twigEnvironmentOptions;\n }", "public function testEnvSettingTest()\n {\n /** @var Kernel $kernel */\n $kernel = Injector::inst()->get(Kernel::class);\n $kernel->setEnvironment('test');\n\n $this->assertTrue(Director::isTest());\n\n $checker = Injector::inst()->get(EnvTypeCheck::class);\n $result = $checker->check();\n\n $this->assertSame($result[0], EnvironmentCheck::ERROR);\n }", "function isBeta(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_BETA; }", "function mapPlatformShEnvironment() : void\n{\n // If this env var is not set then we're not on a Platform.sh\n // environment or in the build hook, so don't try to do anything.\n if (!getenv('PLATFORM_APPLICATION')) {\n return;\n }\n\n // Set the application secret if it's not already set.\n if (!isset($_SERVER['APP_SECRET']) && getenv('PLATFORM_PROJECT_ENTROPY')) {\n $_SERVER['APP_SECRET'] = getenv('PLATFORM_PROJECT_ENTROPY');\n }\n\n // Default to production. You can override this value by setting\n // `env:APP_ENV` as a project variable, or by adding it to the\n // .platform.app.yaml variables block.\n $_SERVER['APP_ENV'] = $_SERVER['APP_ENV'] ?? (getenv('APP_ENV') ?: null) ?? 'prod';\n\n if (!isset($_SERVER['DATABASE_URL'])) {\n mapPlatformShDatabase();\n }\n}", "function env( string $key, $default = '' ) { // phpcs:ignore NeutronStandard.Functions.TypeHint.NoArgumentType, NeutronStandard.Functions.TypeHint.NoReturnType, Universal.NamingConventions.NoReservedKeywordParameterNames.defaultFound\n\t$value = $_ENV[ $key ] ?? $default;\n\n\t// Return bool value for 'true' or 'false'.\n\tswitch ( $value ) {\n\t\tcase 'true':\n\t\t\treturn true;\n\t\tcase 'false':\n\t\t\treturn false;\n\t}\n\n\treturn $value;\n}", "private function mergeDefaultEnv(string $environment): void\n {\n $selectedEnv = &$this->envConfig[$environment];\n foreach($this->envConfig['env'] as $keyword => $value) { // copy config from default environment if it does not exist\n if (!isset($selectedEnv[$keyword])) {\n $selectedEnv[$keyword] = $value;\n }\n }\n\n if (isset($selectedEnv['build_flags'])) { // get all preprocessor defines\n\n $line = $this->resolveVariables($selectedEnv['build_flags']);\n\n // TODO there might be quoted strings with space\n $token = strtok($line, \"\\t \");\n while($token) {\n if ($token === '-D') {\n $token = strtok(\"\\t \");\n if (!$token) {\n break;\n }\n @list($name, $value) = explode('=', $token, 2);\n $this->defines[$name] = $value;\n }\n $token = strtok(\"\\t \");\n }\n }\n }", "public function add_app_env_to_context( array $context ) {\n\t\t$context['APP_ENV'] = getenv( 'APP_ENV' );\n\t\treturn $context;\n\t}", "public static function environment() {\n\t\treturn env('HORIZON_MODE');\n\t}", "public static function setup()\n {\n try {\n $env = \\Dotenv\\Dotenv::create(__DIR__ . '/../../private/');\n $env->load();\n $env->required([\n 'ENVIRONMENT',\n ]);\n } catch (\\Exception $e) {\n echo $e;\n }\n }", "function env($key = null)\n{\n if (!isset($GLOBALS['configs']))\n $GLOBALS['configs'] = json_decode(file_get_contents($GLOBALS['config_path'] . DIRECTORY_SEPARATOR . 'env.json'));\n\n if (!is_null($key) && isset($GLOBALS['configs']->$key))\n return $GLOBALS['configs']->$key;\n elseif (is_null($key) && isset($GLOBALS['configs']))\n return $GLOBALS['configs'];\n else\n Throw new \\Atom\\Environment\\EnvironmentException(\"Environment variable \" . $key . \" not found.\");\n}", "protected function deriveEnvironment()\n {\n $confDir = $this->getAppConfigDir();\n\n if (file_exists($confDir . 'development.php')) {\n return 'development';\n } elseif (file_exists($confDir . 'testing.php')) {\n return 'testing';\n } elseif (file_exists($confDir . 'production.php')) {\n return 'production';\n } else {\n throw new \\RuntimeException(\n 'Environment Not Specified And Unable To Derive',\n 500\n );\n }\n }", "public static function setEnv()\n {\n // We are on bluemix\n if (self::onBluemix()) {\n // Copy Env values\n self::copyEnv();\n\n // Set services credentials\n self::setServiceCredentials();\n }\n }", "function OPTIONAL_SETTING($name, $value) {\r\n define($name, $value, true);\r\n}", "protected function prepareEnvironment()\n {\n if ($this -> debug) {\n error_reporting(-1);\n ini_set('display_errors', 1);\n } else {\n error_reporting(0);\n ini_set('display_errors', 0);\n }\n \n mb_internal_encoding('UTF-8');\n \n if ($locale = $this -> config -> get('locale')) {\n setlocale(LC_ALL, $locale);\n }\n \n date_default_timezone_set($this -> config -> get('timezone', 'Europe/London'));\n }", "public static function envVarKey($var = null)\n {\n // Value not set. Return the .htaccess environment var\n if (is_null($var)) {\n return self::$htaccess_env;\n }\n\n // Value set. If it is not empty, set it. Otherwise, skip it\n if (!empty($var)) {\n self::$htaccess_env = $var;\n }\n\n return self::$htaccess_env;\n }", "function env() {\n if (defined('WP_ENV')) {\n return WP_ENV;\n } else {\n define('WP_ENV', getenv('WP_ENV') ?? 'production');\n }\n return WP_ENV;\n}", "function env(string $key, $default = null)\n{\n return Env::get($key, $default);\n}", "public function setenv($key, $value) {\n\t\t\t$this->envopts[$key] = $value;\n\t\t}", "function env($envString, $defaultVariable = \"\") {\n\tif (! getenv($envString)) {\n\t\treturn $defaultVariable;\n\t}\n\treturn getenv($envString);\n}", "public static function loadEvironmentVariables($_file=null) {\n // If no file is specified, try to find .env file.\n if($_file === null) {\n $_file = LoadEnvironment::findEnvFile();\n }\n // Throw exception if file is not found.\n if ( !file_exists($_file) ) {\n print(\"<strong>Fatal Error:</strong> Environment Variable file \\\".env\\\" was not found. Check it is defined and populated according to the \\\"env.example.txt\\\" file and in an appropriate location.\");\n exit();\n }\n\n // Opening file.\n try {\n // Read in the file.\n $envFile = fopen($_file, \"r\");\n //Throw exception if file not opened.\n if ( !$envFile ) {\n throw new Exception('Environment Variable File failed to open.');\n }\n\n // Loop through each line of the file, parsing each line to a new environment variable.\n while( !feof($envFile) ) {\n // Get new line and parse.\n $envLine = fgets($envFile);\n LoadEnvironment::parseEnvVar($envLine);\n }\n // Close the file.\n fclose($envFile);\n\n }catch( Exception $e ) {\n throw $e;\n exit();\n }\n\n }", "protected function applyEnvironmentContext(): void\n {\n if (! $context = ($_SERVER['APP_ENV'] ?? null)) {\n return;\n }\n\n $this->setEnvironmentFile(\n $this->environment, $context\n );\n }", "function env( string $name, $default = null, bool $strtolower = false )\n {\n if ( ! isset( $_ENV[ $name ] ) ) {\n return $default;\n }\n\n if ( is_int_val( $_ENV[ $name ] ) ) {\n return (int) $_ENV[ $name ];\n }\n\n if ( \\in_array( $_ENV[ $name ], [ 'True', 'true', 'TRUE' ], true ) ) {\n return true;\n }\n if ( \\in_array( $_ENV[ $name ], [ 'False', 'false', 'FALSE' ], true ) ) {\n return false;\n }\n if ( \\in_array( $_ENV[ $name ], [ 'Null', 'null', 'NULL' ], true ) ) {\n return '';\n }\n\n if ( $strtolower ) {\n return strtolower( $_ENV[ $name ] );\n }\n\n return $_ENV[ $name ];\n }", "function env($key, $default = '')\n {\n static $variables;\n\n //TODO: Changes flag in env to reload its value.\n\n if ($variables === null) {\n $variables = Dotenv::createImmutable(base_directory());\n $variables->safeLoad();\n }\n\n return (!empty(getenv($key)) && getenv($key) != '') ? getenv($key) : $default;\n }", "public function env($key, $default = false)\n {\n if (isset($_ENV[$key])) {\n return $_ENV[$key];\n }\n return $default;\n }", "protected function checkEnv()\n {\n $requireVars = [\n 'SOA_MAILER_SEND',\n 'SOA_MAILER_CLIENT_ALIAS',\n 'SOA_MAILER_CLIENT_SECRET',\n 'SOA_MAILER_TEMPLATE_ALIAS',\n ];\n\n foreach ($requireVars as $var) {\n if (!getenv($var)) {\n throw new \\LogicException(\"[Mailer] Required variable $var not set in .env\");\n }\n }\n }", "public function getAllEnvironmentVariables()\n {\n return include $_SERVER['DOCUMENT_ROOT'] . '/env.php';\n }", "function gocardless_env($key = '')\n {\n $config = config('gocardless');\n $env = config('gocardless.environment');\n if (empty($env) && empty($config['environments'][$env])) {\n return null;\n }\n if (empty($key) && ! empty($config['environments'][$env])) {\n return $config['environments'][$env];\n }\n if (array_key_exists($env, $config['environments'])) {\n return $config['environments'][$env][$key];\n }\n return null;\n }", "function env(string $key, $default = null)\n {\n switch (true) {\n case isset($_SERVER[$key]):\n $value = $_SERVER[$key];\n break;\n case isset($_ENV[$key]):\n $value = $_ENV[$key];\n break;\n case (function_exists('apache_getenv') && apache_getenv($key) !== false):\n $value = apache_getenv($key);\n break;\n default:\n $value = getenv($key);\n break;\n }\n if ($value === false) {\n return $default;\n }\n return value($value);\n }", "private function getEnvironmentMode() {\n return $this->config->get('api.mode') === 'live' ? 'prod' : 'dev';\n }", "public function getEnv() {\n\t\treturn APPLICATION_ENV;\n\t}" ]
[ "0.6446064", "0.63381577", "0.6332615", "0.63169616", "0.6309473", "0.62992597", "0.62803286", "0.6188701", "0.6170047", "0.6166518", "0.6152993", "0.6069307", "0.6005989", "0.5962708", "0.5951506", "0.5927225", "0.59139544", "0.5908165", "0.5903127", "0.5843926", "0.58379847", "0.5831876", "0.5813974", "0.5806957", "0.57891524", "0.57431746", "0.5674377", "0.5648399", "0.5647038", "0.56359154", "0.5606525", "0.55780065", "0.557328", "0.55598027", "0.5548539", "0.5534765", "0.55336964", "0.5516657", "0.5507611", "0.55028373", "0.5491157", "0.5471652", "0.5468476", "0.54647535", "0.54598504", "0.5458837", "0.5436935", "0.5424681", "0.54238474", "0.54227614", "0.54222125", "0.54184705", "0.54114896", "0.5409661", "0.5407741", "0.53954685", "0.5391501", "0.53855234", "0.53839046", "0.53758067", "0.53738004", "0.5349165", "0.5340606", "0.5337374", "0.5332089", "0.5329293", "0.5328825", "0.5327888", "0.53267145", "0.5323723", "0.53099334", "0.53098553", "0.5302373", "0.52925754", "0.5291086", "0.5284198", "0.52804196", "0.5277305", "0.5272", "0.5250421", "0.52424693", "0.5234156", "0.52338845", "0.5228571", "0.52267855", "0.5225956", "0.52236474", "0.52051884", "0.5203601", "0.51990145", "0.51966393", "0.5194725", "0.51900494", "0.51892227", "0.5187869", "0.518748", "0.5181794", "0.5181646", "0.5175367", "0.5173398", "0.51702243" ]
0.0
-1
replace non letter or digits by
private function getRewrite($text, $limit = 75) { $text = preg_replace('/~[^\\pL\d]+~u/i', '-', $text); // trim $text = trim($text, '-'); // lowercase $text = strtolower($text); // remove unwanted characters $text = preg_replace('~[^-\w]+~', '', $text); if (strlen($text) > $limit) { $text = substr($text, 0, 70); } if (empty($text)) { //return 'n-a'; return time(); } return $text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filter_alphanum($input) {\n return preg_replace(\"/[^a-zA-Z0-9]+/\", \"\", $input);\n}", "function doMkAlpha ($string)\n{\n return preg_replace ('/[^a-z0-9]/i', '', $string);\n}", "function justAlphanumeric($var)\n{\n return preg_replace('/[^0-9A-Za-z]/', '', $var);\n}", "function sanitizeAlphaNum($var)\n{\n return preg_replace('/[^a-zA-Z0-9]/', '', $var);\n}", "function removeNonAlphabets($character){\n return (ctype_alpha($character));\n}", "static function alphaNum( $st_data )\r\n {\r\n $st_data = preg_replace(\"([[:punct:]]| )\",'',$st_data);\r\n return $st_data;\r\n }", "protected function filterAlphanum($value) {\n return preg_replace(\"/[^a-z0-9]/i\", \"\", $value);\n }", "function alphaNumeric($string) {\n\treturn preg_replace(\"/[^a-zA-Z0-9]+/\", \"\", $string);\n}", "function fAlfaNum($string) {\r\n $s = preg_replace(\"[^a-zA-Z0-9_]\", \"\", strtr($string, \"áàãâéêíóôõúüçÁÀÃÂÉÊÍÓÔÕÚÜÇ \", \"aaaaeeiooouucAAAAEEIOOOUUC_\"));\r\n $s = strtr($s, \"_\", \"\");\r\n return $s;\r\n }", "function remove_nonalphanum( $data ) {\n\t$text = trim( $data, ' ' );\n\t$text = str_replace( ' ', '-', $text );\n\t$text = preg_replace( '/[^A-Za-z0-9-]/', '', $text );\n\treturn strtolower( $text );\n}", "function vAlphanumeric( $string )\r\n\t\t{\r\n\t\t\treturn ctype_alnum ( $string );\r\n\t\t\t\t\r\n\t\t}", "function sAlphanumeric( $string )\r\n\t\t{\r\n\t\t\t\treturn preg_replace( '/[^a-zA-Z0-9]/', '', $string );\r\n\t\t\t\t\r\n\t\t}", "function soNumero($str) {\r\nreturn preg_replace(\"/[^0-9]/\", \"\", $str);\r\n\r\n}", "public static function AlphaNumeric($Mixed) {\n if (!is_string($Mixed))\n return self::To($Mixed, 'ForAlphaNumeric');\n else\n return preg_replace('/([^\\w\\d_-])/', '', $Mixed);\n }", "function replace($text){\n\t\treturn preg_replace('/[^a-z A-Z]/','',strtolower(czech::autoCzech($text,'asc')));\n\t}", "function april_sanitize_alphanumeric ( $s ) {\n\treturn preg_replace(\"/[^a-zA-Z0-9\\\\-]+/\", \"\", $s);\n}", "public static function onlyAlphaNum($value)\n {\n return preg_replace('#[^[:alnum:]]#', '', $value);\n }", "static function ExtractAlphanumeric($string) {\n return @eregi_replace('[^0-9A-Za-z]', '', $string);\n }", "function scrub($str) {\n\t$str = preg_replace('/[^A-Za-z0-9]/','',$str);\n\treturn $str;\n}", "public function getAsciiReplace();", "public static function numberLetter($String) {\n\t\t\treturn preg_replace(\"/[^a-zA-Z0-9]+/\", '', $String);\n\n\t\t\t}", "private function process_alphanum($value)\n {\n return ! preg_match('/[^a-zA-Z0-9]/', $value);\n }", "function Strip_Bad_chars($input)\n{\n //$output = preg_replace(\"/[^a-zA-Z0-9_-]/\", \"\", $input);\n $output = preg_replace(\"/[^0-9]/\", \"\", $input);\n return $output;\n}", "function removeSpecialChars($oldText)\r\n{\r\n // Se corrige os acentos com iso, taca iso\r\n if ( strlen($oldText) > strlen(utf8_decode($oldText)) )\r\n {\r\n $oldText = utf8_decode($oldText);\r\n }\r\n\r\n /*\r\n * A função \"strtr\" substitui os caracteres acentuados pelos não acentuados.\r\n * A função \"ereg_replace\" utiliza uma expressão regular que remove todos os\r\n * caracteres que não são letras, números e são diferentes de \"_\" (underscore).\r\n */\r\n $newText = preg_replace('[^a-zA-Z0-9_-.]', '', strtr($oldText, 'áàãâéêíóôõúüçÁÀÃÂÉÊÍÓÔÕÚÜÇ ', 'aaaaeeiooouucAAAAEEIOOOUUC_'));\r\n\r\n if ( !(strlen($newText) > 0) )\r\n {\r\n $newText = 'nome_invalido-'.getRandomNumbers().getRandomNumbers();\r\n }\r\n\r\n return $newText;\r\n}", "function filter_chars($str) {\n\treturn preg_replace(\"/[^A-Za-z0-9_]*/\", \"\", $str);\n}", "public static function GetAlphaNumericCharacters()\n {\n $ascii = self::GetCharacters();\n\n return preg_replace('/[^A-Z0-9]*/i', '', $ascii);\n }", "function format($line) {\n return preg_replace(\"/[^A-Za-z0-9]/\", '', $line);\n}", "function justNumbers($var)\n{\n return preg_replace('/[^0-9]/', '', $var);\n}", "function lwreplace($lwchar){\n return(str_replace(' ','',$lwchar));\n}", "function remove_numbers($string) {\n $vowels = array(\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"0\", \" \");\n $string = str_replace($vowels, ' ', $string);\n return $string;\n}", "function filteralpha($s){\n return preg_replace(\"/[^: ()_\\-a-zA-Z0-9+]/\",\"\", $s);\n}", "function simpleWhite_id_safe($string) { //change mytheme to your theme name\n if (is_numeric($string{0})) {\n // If the first character is numeric, add 'n' in front\n $string = 'n'. $string;\n }\n return strtolower(preg_replace('/[^a-zA-Z0-9-]+/', '-', $string));\n}", "function fixPostalCode($str = \"\") {\n\t$str = strtoupper($str);\n\t// Remove anything but uppercase letters and numbers.\n\t$str = preg_replace(\"/[^A-Z\\d]/\", \"\", $str);\n\t// Format: A9A 9A9\n\t// Leaves non-postal-code content alone.\n\t$str = preg_replace(\"/([A-Z]\\d[A-Z])(\\d[A-Z]\\d)/\", \"$1 $2\", $str);\n\treturn($str);\n//fixPostalCode\n}", "function cleanName($name) {\n \t$search_array=array('Р Т‘','Р”','С†','Р В¦','РЎРЉ','Р В¬','&auml;','&Auml;','&ouml;','&Ouml;','&uuml;','&Uuml;');\n \t$replace_array=array('ae','Ae','oe','Oe','ue','Ue','ae','Ae','oe','Oe','ue','Ue');\n \t$name=str_replace($search_array,$replace_array,$name); \t\n \t\n $replace_param='/[^a-zA-Z0-9]/';\n $name=preg_replace($replace_param,'-',$name); \n return $name;\n }", "function unmaskString($val)\n {\n return preg_replace(\"/[^a-zA-Z 0-9]+/\", \"\", $val);\n }", "function clean_postcode ($postcode) {\n\n\t\t$postcode = str_replace(' ','',$postcode);\n\t\t$postcode = strtoupper($postcode);\n\t\t$postcode = trim($postcode);\n\t\t$postcode = preg_replace('/(\\d[A-Z]{2})/', ' $1', $postcode);\n\t\n\t\treturn $postcode;\n\n\t}", "function make_clean($value) {\n\t\t$legal_chars = \"%[^0-9a-zA-Z������� ]%\"; //allow letters, numbers & space\n\t\t$new_value = preg_replace($legal_chars,\"\",$value); //replace with \"\"\n\t\treturn $new_value;\n\t}", "public function letter_num_validation($input){\n\t\tif(!preg_match('/^[a-zA-Z0-9]*$/',$input)){ \n\t\t\treturn true;\n \t}\n }", "function lower_alpha_numeric( $str )\n\t{\n\t\treturn ( preg_match(\"([^a-z0-9])\", $str)) ? FALSE : TRUE;\n\t}", "function replace_chars($content)\n\t{\n\t\t//convert all characters to lower case\n\t\t$content = mb_strtolower($content);\n\t\t//$content = mb_strtolower($content, \"UTF-8\");\n\t\t$content = strip_tags($content);\n\n //updated in v0.3, 24 May 2009\n\t\t$punctuations = array(',', ')', '(', '.', \"'\", '\"',\n\t\t'<', '>', '!', '?', '/', '-',\n\t\t'_', '[', ']', ':', '+', '=', '#',\n\t\t'$', '&quot;', '&copy;', '&gt;', '&lt;', \n\t\t'&nbsp;', '&trade;', '&reg;', ';', \n\t\tchr(10), chr(13), chr(9));\n\n\t\t$content = str_replace($punctuations, \" \", $content);\n\t\t// replace multiple gaps\n\t\t$content = preg_replace('/ {2,}/si', \" \", $content);\n\n\t\treturn $content;\n\t}", "function change_hunchar($text)\n{\n\t\n\t$text = htmlentities($text);\n\t\n\t$mit = array(\"í\", \"é\", \"á\", \"ú\", \"ő\", \"ü\", \"ö\", \"ű\", \"ó\", \"Í\", \"É\", \"Á\", \"Ú\", \"Ó\", \"Ü\", \"Ö\", \"Ű\", \"Ő\", \" \", \",\");\n\t$mire = array(\"i\", \"e\", \"a\", \"u\", \"o\", \"u\", \"o\", \"u\", \"o\", \"i\", \"e\", \"a\", \"u\", \"o\", \"u\", \"o\", \"u\", \"o\", \"_\", \"\");\n\t$szoveg = str_replace($mit, $mire, strtolower($text));\n\t\n\n\treturn $szoveg;\n}", "protected static function _alphaNumeric(){\n if (self::$_ruleValue) {\n $str = trim(self::$_elementValue);\n if (!preg_match('/[a-zA-z0-9]/', $str)) {\n self:: setErrorMessage(\"Alphanumeric only\");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }", "function LetterChanges($str) {\n\n // make str lowercase\n $str = strtolower($str);\n\n // array of alphabet and what values to change to\n $alphabet = array ('a'=>'b','b'=>'c','c'=>'d','d'=>'E','e'=>'f','f'=>'g','g'=>'h',\n 'h'=>'I','i'=>'j','j'=>'k','k'=>'l','l'=>'m','m'=>'n','n'=>'O',\n 'o'=>'p','p'=>'q','q'=>'r','r'=>'s','s'=>'t','t'=>'U','u'=>'v',\n 'v'=>'y','w'=>'x','x'=>'y','y'=>'z','z'=>'A');\n \n // change chars in string to corresponding alphabet value\n $str = strtr($str, $alphabet);\n\n // return result!\n return $str;\n\n}", "static function numeric( $st_data )\r\n {\r\n $st_data = preg_replace(\"([[:punct:]]|[[:alpha:]]| )\",'',$st_data);\r\n return $st_data; \r\n }", "function replace($str){\n\t$temp = preg_replace('#([^a-z0-9]+)#i',' ',$str);\n\t$tab = explode(' ',$temp);\n\t$val = null;\n\tfor($i=0; $i<count($tab);$i++){\n\t\tif($i != 0){\n\t\t\t$val .= ucfirst($tab[$i]);\n\t\t}\n\t\telse{\n\t\t\t$val .= $tab[$i];\n\t\t}\n\t}\n\treturn $val;\n}", "function char_filter($ojb)\n {\n $badchars='Ý`~!@$%^()+-_=[]{}\\'\\\\:\"|,/<>? '; # Nhung ky tu khong cho phep duoc len danh sach tai day\n for ($i=0;$i<strlen($badchars);$i++){\n $ojb=str_replace($badchars[$i],\"\",$ojb);\n\n }\n\n return $ojb;\n }", "function format_phone_plain($number) {\n return preg_replace('/[^0-9]/', '', $number);\n}", "public function cleanToName($name){\n // Remove empty space\n $name = str_replace(' ', '', $name);\n // Remove special character\n $name = preg_replace('/[^A-Za-z0-9\\-]/', '', $name);\n // Return without numbers\n return preg_replace('/[0-9]+/', '', $name);\n \n }", "function filter($word)\r\n{\r\n $word = trim($word);\r\n $word = preg_replace('/[^A-Za-z0-9\\-]/','', $word);\r\n return strtolower($word);\r\n}", "function replace($x) {\n\t$k1=array(' - ','ß','ä','ö','ü','Ä','Ö','Ü',' ',':','&','?','!','\"',',','.',\"\\'\",\"/\");\n\t$k2=array('-','ss','ae','oe','ue','ae','oe','ue','-','-','und','','','','','',\"\",\"-\");\n\tfor ($i='0';$i<count($k1);$i++) {$x = str_replace($k1[$i],$k2[$i],$x);}\n\treturn $x;\n}", "public static function alphaNumeric($string)\n {\n return preg_replace('~[^a-z0-9]+~i', '', $string);\n }", "protected function replaceSpecialChars($value)\r\n\t{\r\n//\t\techo \"$value: \" . preg_replace('/[-]/', '_', $value) . \"\\n\";\r\n\t\treturn preg_replace('/[-]/', '_', $value); //Convert non-word characters, hyphens and dots to underscores\r\n\t}", "function htmlRemoveSpecialCharacters($input){\n\t\tfor($i=0; $i<strlen($input); $i++){\n\n\t\t\t$value = ord($input[$i]);\n\t\t\tif($value >= 48 && $value <= 57);\n\t\t\telseif ($value >= 65 && $value <= 90) ;\n\t\t\telseif ($value >= 97 && $value <= 122) ;\n\t\t\telseif ($value == 32) ;\n\t\t\telse{\n\t\t\t\t$input = substr($input, 0, $i) . '\\\\' . substr($input, $i);\n\t\t\t}\n\t\t}\n\t\techo $input;\n\t\treturn $input;\n\t}", "function getNumbersForAlphabets($refineBySearchText) {\n $ReplacementPattern = array(\n 'a' => '2',\n 'b' => '2',\n 'c' => '2',\n 'd' => '3',\n 'e' => '3',\n 'f' => '3',\n 'g' => '4',\n 'h' => '4',\n 'i' => '4',\n 'j' => '5',\n 'k' => '5',\n 'l' => '5',\n 'm' => '6',\n 'n' => '6',\n 'o' => '6',\n 'p' => '7',\n 'q' => '7',\n 'r' => '7',\n 's' => '7',\n 't' => '8',\n 'u' => '8',\n 'v' => '8',\n 'w' => '9',\n 'x' => '9',\n 'y' => '9',\n 'z' => '9',\n '+' => '00',\n ' ' => '',\n );\n return str_ireplace(array_keys($ReplacementPattern), array_values($ReplacementPattern), $refineBySearchText);\n\n}", "public static function alphaNumChars()\n {\n return self::oneOf(\n self::choose(48, 57),\n self::choose(65, 90),\n self::choose(97, 122)\n )->fmap('chr');\n }", "private function process_alpha($value)\n {\n return ! preg_match('/[^a-zA-Z]/', $value);\n }", "public static function numberLetterSpace($String) {\n\t\t\treturn preg_replace('/[^a-zA-Z0-9]+/', ' ', $String);\n\n\t\t\t}", "function doMkCharacter ($string)\n{\n return preg_replace ('/[^a-zA-Z0-9\\-_:\\.=;]/i', '', trim (substr ($string, 0, 35)));\n}", "function validate_alphanumeric() {\n # Check Value is Alphanumeric\n if (ctype_alnum($this->cur_val)) {\n # Remove any existing error message\n $this->error_message = \"\";\n\n # Return Value\n return $this->cur_val;\n }\n else {\n # Set Error Message\n $this->set_error(\"Validation for alphanumeric ({$this->cur_val}) failed. This is type \" . gettype($this->cur_val));\n\n # Return AlphaNumeric version of value.\n return preg_replace(\"#[^a-zA-Z0-9_]#i\", \"\", $this->cur_val);\n }\n }", "function sanitize($str){\n $find = array( 'á', 'é', 'í', 'ó', 'ú', 'Á', 'É', 'Í', 'Ó', 'Ú', 'ñ', 'Ñ' );\n $replace = array( 'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U', 'n', 'N' );\n return strtolower(preg_replace('/[^a-zA-Z0-9 ]/s', '',str_ireplace($find, $replace, preg_replace('/[^\\w ]/', '', $str))));\n\n }", "function onlyAlphaNum( $myString )\n{\n $myReturn = eregi( '[^a-zA-Z0-9]', $myString ) ;\n if ( $myReturn )\n { return FALSE ; }\n else\n { return TRUE ; }\n}", "function ctypeAlpha($text){ \n $response = preg_match(\"/[A-Za-z]/\",$text);\n return $response;\n}", "function strip_bad_chars( $input ) {\n $output = preg_replace( \"/[^a-zA-Z0-9_-]/\", \"\", $input );\n return $output;\n }", "private function _removeNonAlphaCharacters($string)\n\t{\n\t\treturn preg_replace(\"/(\\W*)/i\", \"\", $string);\n\t}", "function normalize_special_characters($str, $unwanted=false) {\n \n\t# Quotes cleanup\n\t$str = str_replace(chr(ord(\"`\")), \"'\", $str);\n\t$str = str_replace(chr(ord(\"´\")), \"'\", $str);\n\t$str = str_replace(chr(ord(\"„\")), \",\", $str);\n\t$str = str_replace(chr(ord(\"`\")), \"'\", $str);\n\t$str = str_replace(chr(ord(\"´\")), \"'\", $str);\n\t$str = str_replace(chr(ord(\"“\")), \"\\\"\", $str);\n\t$str = str_replace(chr(ord(\"”\")), \"\\\"\", $str);\n\t$str = str_replace(chr(ord(\"´\")), \"'\", $str);\n\n\t$unwanted_array = array('Š'=>'S', 'š'=>'s', 'Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss', 'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y');\n\tif($unwanted)\n \t$str = strtr($str, $unwanted_array);\n\n\t# Bullets, dashes, and trademarks\n\t$str = str_replace(chr(149), \"&#8226;\", $str);\t# bullet •\n\t$str = str_replace(chr(150), \"&ndash;\", $str);\t# en dash\n\t$str = str_replace(chr(151), \"&mdash;\", $str);\t# em dash\n\t$str = str_replace(chr(153), \"&#8482;\", $str);\t# trademark\n\t$str = str_replace(chr(169), \"&copy;\", $str);\t# copyright mark\n\t$str = str_replace(chr(174), \"&reg;\", $str);\t# registration mark\n\n\treturn $str;\n}", "protected function replace_umlauts($input){\r\n\t\t$input = preg_replace( '@\\x{00c4}@u' , \"Ae\", $input );\r\n\t\t$input = preg_replace( '@\\x{00d6}@u' , \"Oe\", $input );\r\n\t\t$input = preg_replace( '@\\x{00dc}@u' , \"Ue\", $input );\r\n\t\t$input = preg_replace( '@\\x{00e4}@u' , \"ae\", $input );\r\n\t\t$input = preg_replace( '@\\x{00f6}@u' , \"oe\", $input );\r\n\t\t$input = preg_replace( '@\\x{00fc}@u' , \"ue\", $input );\r\n\t\t$input = preg_replace( '@\\x{00df}@u' , \"ss\", $input );\r\n\r\n\t\treturn $input;\r\n\t}", "static function isAlnum($str) {\n return ctype_alnum($str);\n }", "function num2alpha($n)\n{\n $r = '';\n\n while($n > 0)\n {\n $r = chr(($n % 26) + 0x41) . $r;\n $n = intval($n / 26);\n }\n\n return $r;\n}", "function replace_specials_characters($s) {\r\n\t\t\t//$s = mb_convert_encoding($s, 'UTF-8','');\r\n\t\t\t$s = preg_replace(\"/á|à|â|ã|ª/\",\"a\",$s);\r\n\t\t\t$s = preg_replace(\"/Á|À|Â|Ã/\",\"A\",$s);\r\n\t\t\t$s = preg_replace(\"/é|è|ê/\",\"e\",$s);\r\n\t\t\t$s = preg_replace(\"/É|È|Ê/\",\"E\",$s);\r\n\t\t\t$s = preg_replace(\"/í|ì|î/\",\"i\",$s);\r\n\t\t\t$s = preg_replace(\"/Í|Ì|Î/\",\"I\",$s);\r\n\t\t\t$s = preg_replace(\"/ó|ò|ô|õ|º/\",\"o\",$s);\r\n\t\t\t$s = preg_replace(\"/Ó|Ò|Ô|Õ/\",\"O\",$s);\r\n\t\t\t$s = preg_replace(\"/ú|ù|û/\",\"u\",$s);\r\n\t\t\t$s = preg_replace(\"/Ú|Ù|Û/\",\"U\",$s);\r\n\t\t\t$s = str_replace(array(\"ñ\", \"Ñ\"), array(\"n\", \"N\"), $s);\r\n\t\t\t$s = str_replace(array('ç', 'Ç'), array('c', 'C'), $s);\r\n\r\n\t\t\t//$s = str_replace(\" \",\"_\",$s);\r\n\t\t\t//$s = preg_replace('/[^a-zA-Z0-9_\\.-]/', '', $s);\r\n\t\t\treturn $s;\r\n\t\t}", "function removeSpecialCharacter($name) {\n $lowerName = strtolower($name);\n $what = array( 'ä','ã','à','á','â','ê','ë','è','é','ï','ì','í','ö','õ','ò','ó','ô','ü','ù','ú','û','À','Á','É','Í','Ó','Ú','ñ','Ñ','ç','Ç',' ','-','(',')',',',';',':','|','!','\"','#','$','%','&','/','=','?','~','^','>','<','ª','º', \"'\" );\n $by = array( 'a','a','a','a','a','e','e','e','e','i','i','i','o','o','o','o','o','u','u','u','u','A','A','E','I','O','U','n','n','c','C','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-', '-');\n\n return str_replace($what, $by, $lowerName);\n }", "function changeA($v1)\n{\n//WARNING! DO NOT USE FOR EMAILS ! Function removes the @ sign and the fullstop!\n\n//\t$Cust_Addr = strtr($Cust_Addr, array_flip(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES))); //this baby does the trick!!!\n//\t$Cust_Addr = preg_replace('/\\s/u', '_', $Cust_Addr);//this baby also does the trick!!!\n\n//$html_reg = '/<+\\s*\\/*\\s*([A-Z][A-Z0-9]*)\\b[^>]*\\/*\\s*>+/i';\n//$v1 = htmlentities( preg_replace( $html_reg, '', $v1 ) );\n//echo \"<br>after htmlent:\".$v1.\"<br><br><br>\";\n$v1 = preg_replace(\"/'/\",\"_\",$v1);\n$v1 = preg_replace(\"/‘/\",\"_\",$v1);\n$v1 = preg_replace(\"/’/\",\"_\",$v1);\n$v1 = preg_replace(\"/&/\",\"and\",$v1);\n$v1 = preg_replace(\"/,/\",\"+\",$v1);\n$v1 = preg_replace(\"/…/\",\".\",$v1);\n$v1 = preg_replace(\"/…/\", '_', $v1);\n$v1 = str_replace(' ', '_', $v1);\n\n$v1 = preg_replace(\"/&nbsp;/\",\"_\",$v1);\n$v1 = preg_replace(\"/ /\",\"_\",$v1);\n\n//$v1 = strtr($v1, array_flip(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES))); //this baby does the trick!!!\n\n$v1 = str_replace(\" \",\"_\",$v1);\n$v1 = str_replace(\"&nbsp;\",\"_\",$v1);\n\n//echo \"<br>afterstreplacec:\".$v1.\"<br><br><br>\";\n\n/*\n$old_pattern = array(\"/[^a-zA-Z0-9]/\", \"/_+/\", \"/_$/\");\n$new_pattern = array(\"_\", \"_\", \"\");\n$v2 = preg_replace($old_pattern, $new_pattern , $v1);\n//All characters but a to z, A to z and 0 to 9 are replaced by an underscore. Multiple connected underscores are reduced to a single underscore and trailing underscores are removed.\n*/\n$v2 = $v1;\nreturn $v2;\n}", "function MCW_make_name_acceptable($name) {\n \n $name = strtr($name,\" \",\"_\");\n $name=preg_replace(\"/[^a-zA-Z0-9_äöüÄÖÜ]/\" , \"\" , $name);\n return $name;\n }", "function clean_special_character_from_string($string) {\n $string = str_replace(' ', '-', $string); \n // Removes special chars.\n return preg_replace('/[^A-Za-z0-9\\-]/', '', $string);\n}", "public static function unicodeAlphaNumeric($string)\n {\n $clean = preg_replace(\"/[^\\p{L}|\\p{N}]+/u\", \" \", $string);\n $clean = preg_replace(\"/[\\p{Z}]{2,}/u\", \" \", $clean);\n\n return $clean;\n }", "protected static final function unmung($thing) {\n\t\treturn lcfirst(preg_replace_callback('/_([a-z])/', function ($m) { return strtoupper($m[1]); }, $thing));\n\t}", "function clean_number($phone_number){\n\treturn preg_replace(\"/[^0-9]/\", \"\", $phone_number);\n}", "function isAlpha($string){\n\tif(preg_match(\"/\\d/\", $string)){\n\t\treturn false;\n\t}\n\treturn true;\n}", "function a_mayusculas($cadena)\n{\n $cadena = strtr(strtoupper($cadena), 'àèìòùáéíóúçñäëïöü', 'ÀÈÌÒÙÁÉÍÓÚÇÑÄËÏÖÜ');\n\n return $cadena;\n}", "function clean_id($text) {\n $text = strtolower($text);\n $text = str_replace('/', '-', $text);\n $text = preg_replace('/[^0-9a-zA-Z-_]/', '', $text);\n return $text;\n}", "function atwork_id_safe($string) {\n // Replace with dashes anything that isn't A-Z, numbers, dashes, or underscores.\n $string = strtolower(preg_replace('/[^a-zA-Z0-9_-]+/', '-', $string));\n // If the first character is not a-z, add 'n' in front.\n if (!ctype_lower($string{0})) { // Don't use ctype_alpha since its locale aware.\n $string = 'id'. $string;\n }\n return $string;\n}", "function slugify2($text){\r\n\r\n $text = preg_replace('~[^\\pL\\d]+~u', '-', $text);\r\n\r\n\r\n\r\n // transliterate\r\n\r\n $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);\r\n\r\n\r\n\r\n // remove unwanted characters\r\n\r\n $text = preg_replace('~[^-\\w]+~', '', $text);\r\n\r\n\r\n\r\n // trim\r\n\r\n $text = trim($text, '-');\r\n\r\n\r\n\r\n // remove duplicated - symbols\r\n\r\n $text = preg_replace('~-+~', '-', $text);\r\n\r\n\r\n\r\n // lowercase\r\n\r\n $text = strtolower($text);\r\n\r\n\r\n\r\n if (empty($text)) {\r\n\r\n return 'n-a';\r\n\r\n }\r\n\r\n\r\n\r\n return $text;\r\n\r\n}", "function remove_special_chars($string) {\n\t return preg_replace ('/[^a-zA-Z0-9]/', '', $string);\n\t}", "function catalogue_format_tel($value) {\n\t$value_array = str_split($value);\n\t$value = '';\n\n\tforeach ($value_array as $char) {\n\t\tif (is_numeric($char) || $char == '+' || $char == '(' || $char == ')') {\n\t\t\t$value .= $char;\n\t\t}\n\t}\n\n\treturn $value;\n}", "function numberToLetter($num){\n switch ($num){\n case 1:\n return 'A';\n case 2:\n return 'B';\n case 3:\n return 'C';\n case 4:\n return 'D';\n case 5:\n return 'E';\n case 6:\n return 'F';\n case 7:\n return 'G';\n case 8:\n return 'H';\n case 9:\n return 'I';\n case 10:\n return 'J';\n case 11:\n return 'K';\n case 12:\n return 'L';\n case 13:\n return 'M';\n case 14:\n return 'N';\n case 15:\n return 'O';\n case 16:\n return 'P';\n case 17:\n return 'R';\n case 18:\n return 'S';\n case 19:\n return 'T';\n case 20:\n return 'U';\n case 21:\n return 'W';\n case 22:\n return 'X';\n case 23:\n return 'Q';\n case 24:\n return 'V';\n case 25:\n return 'Y';\n case 26:\n return 'Z';\n default:\n return '';\n }\n \n}", "function filter_ige($ige) {\r\n if (substr($ige, -2) === 'ik') {\r\n $ige = str_replace('ik','',$ige);\r\n }\r\n if (substr($ige,-2) === 'sz') {\r\n $ige = str_replace('z','',$a);\r\n }\r\n return $ige; \r\n }", "function _fixName($field_or_value_name) {\r\n if ($field_or_value_name == \"\")\r\n return \"\";\r\n // convert space into underscore\r\n $result = preg_replace(\"/ /\", \"_\", strtolower($field_or_value_name));\r\n // strip all non alphanumeric chars\r\n $result = preg_replace(\"/\\W/\", \"\", $result);\r\n return $result;\r\n }", "function txt_alphanumerical_clean( $t, $additional_tags=\"\" )\n\t{\n\t\tif ( $additional_tags )\n\t\t{\n\t\t\t$additional_tags = preg_quote( $additional_tags, \"/\" );\n\t\t}\n\t\t\n\t\treturn preg_replace( \"/[^a-zA-Z0-9\\-\\_\".$additional_tags.\"]/\", \"\" , $t );\n }", "function noAscii($string) {\n $string = str_replace(\"+\", \" \", $string);\n $string = str_replace(\"%21\", \"!\", $string);\n $string = str_replace(\"%22\", '\"', $string);\n $string = str_replace(\"%23\", \"#\", $string);\n $string = str_replace(\"%24\", \"$\", $string);\n $string = str_replace(\"%25\", \"%\", $string);\n $string = str_replace(\"%26\", \"&\", $string);\n $string = str_replace(\"%27\", \"'\", $string);\n $string = str_replace(\"%28\", \"(\", $string);\n $string = str_replace(\"%29\", \")\", $string);\n $string = str_replace(\"%2A\", \"*\", $string);\n $string = str_replace(\"%2B\", \"+\", $string);\n $string = str_replace(\"%2C\", \",\", $string);\n $string = str_replace(\"%2D\", \"-\", $string);\n $string = str_replace(\"%2E\", \".\", $string);\n $string = str_replace(\"%2F\", \"/\", $string);\n $string = str_replace(\"%3A\", \":\", $string);\n $string = str_replace(\"%3B\", \";\", $string);\n $string = str_replace(\"%3C\", \"<\", $string);\n $string = str_replace(\"%3D\", \"=\", $string);\n $string = str_replace(\"%3E\", \">\", $string);\n $string = str_replace(\"%3F\", \"?\", $string);\n $string = str_replace(\"%40\", \"@\", $string);\n $string = str_replace(\"%5B\", \"[\", $string);\n $string = str_replace(\"%5C\", \"\\\\\", $string);\n $string = str_replace(\"%5D\", \"]\", $string);\n $string = str_replace(\"%5E\", \"^\", $string);\n $string = str_replace(\"%5F\", \"_\", $string);\n $string = str_replace(\"%60\", \"`\", $string);\n $string = str_replace(\"%7B\", \"{\", $string);\n $string = str_replace(\"%7C\", \"|\", $string);\n $string = str_replace(\"%7D\", \"}\", $string);\n $string = str_replace(\"%7E\", \"~\", $string);\n $string = str_replace(\"%7F\", \"\", $string);\n return $string;\n}", "function correctIdentifier($identifier) {\n $search = array(' ', ':', '.', '/');\n $replace = array('_', '_', '_', '-');\n return str_replace($search, $replace, $identifier);\n}", "function slugging($text = '')\n {\n $text = preg_replace('~[^\\\\pL\\d]+~u', '-', $text);\n \n // trim\n $text = trim($text, '-');\n \n // transliterate\n $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);\n \n // lowercase\n $text = strtolower($text);\n \n // remove unwanted characters\n $text = preg_replace('~[^-\\w]+~', '', $text);\n \n if (empty($text))\n {\n return 'n-a';\n }\n \n return $text;\n }", "function buildValidIDFrom($text)\n{\n $text = preg_replace('/^[^a-zA-Z0-9\\.-]/','p',$text);\n $text = preg_replace('/[^a-zA-Z0-9\\.-]/','-',$text);\n return $text;\n}", "function sanitize(){\r\n\t\t $outar = Array();\r\n \t $arg_list = func_get_args();\r\n\t\t foreach($arg_list[0] as $key => $value){\r\n\t\t\t\t $data = $value;\r\n\t\t\t\t $data = PREG_REPLACE(\"/[^0-9a-zA-Z]/i\", '', $data);\r\n\t\t\t\t array_push($outar,$data);\r\n\t\t }\r\n\t\treturn $outar;\r\n\t }", "function removerMascaraCpf($valor)\n{\n return preg_replace([\"/\\\\D+/\"], [''], $valor);\n}", "function limpiar($cadena){\n\t\t$cadena=str_replace(\"_\",\" \",$cadena);//alt + 15\n\t\t$cadena=str_replace(\"|\",\"=\",$cadena);//alt + 10\n\t\treturn $cadena=str_replace(\"*\",\"'\",$cadena);//alt + 16\n\t}", "private function removeSpecialCharacters(string $table): string\n {\n return (string) preg_replace('/[^a-zA-Z0-9_]/', '_', $table);\n }", "function f($t){\n\t$specialChars = array(\t'(r)'\t=> '&reg;',\n\t\t\t\t\t\t\t'(R)'\t=> '&reg;',\n\t\t\t\t\t\t\t'(c)'\t=> '&copy;',\n\t\t\t\t\t\t\t'(C)'\t=> '&copy;',\n\t\t\t\t\t\t\t'(tm)'\t=> '&trade;',\n\t\t\t\t\t\t\t'(TM)'\t=> '&trade;',\n\t\t\t\t\t\t\t'(&gt;)'\t=> '&rsaquo;',\n\t\t\t\t\t\t\t'(&gt;&gt;)'\t=> '&raquo;');\n\tforeach($specialChars AS $key => $val) $t = str_replace($key,$val,stripslashes($t));\n\treturn $t;\n}", "function slugify($text)\r\n{\r\n // replace non letter or digits by -\r\n $text = preg_replace('~[^\\pL\\d]+~u', '-', $text);\r\n\r\n // transliterate\r\n $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);\r\n\r\n // remove unwanted characters\r\n $text = preg_replace('~[^-\\w]+~', '', $text);\r\n\r\n // trim\r\n $text = trim($text, '-');\r\n\r\n // remove duplicate -\r\n $text = preg_replace('~-+~', '-', $text);\r\n\r\n // lowercase\r\n $text = strtolower($text);\r\n\r\n if (empty($text)) {\r\n return 'n-a';\r\n }\r\n\r\n return $text;\r\n}", "function cardNumberClean($number)\n {\n return preg_replace(\"/[^0-9]/\", \"\", $number);\n }", "function acucAdjustLetter( $arrayPasscode )\r\n{\r\n\t$arrayReturnPasscode = $arrayPasscode;\r\n\t\r\n\t$arrayReplacement = array(\"O\", \"l\");\r\n\tfor($rIdx = 0; $rIdx < 2; $rIdx++)\r\n\t{\r\n\t\t$arrayKeys = array_keys($arrayReturnPasscode, 0x30 + $rIdx);\r\n\t\tfor($kIdx = 0; $kIdx < count($arrayKeys); $kIdx++)\r\n\t\t{\r\n\t\t\t$arrayReturnPasscode[ $arrayKeys[ $kIdx ] ] = ord( $arrayReplacement[ $rIdx ] );\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $arrayReturnPasscode;\r\n}", "function convert_chars($content, $deprecated = '')\n {\n }", "function my_filter($string, $regex_chars)\n{\n for ($i=0; $i<strlen($regex_chars); $i++)\n {\n $char = substr($regex_chars, $i, 1);\n $string = str_replace($char, '', $string);\n// echo $string . '<br>';\n }\n return $string;\n}" ]
[ "0.7106634", "0.7039931", "0.70295006", "0.6957319", "0.6880171", "0.67487717", "0.6607642", "0.65846974", "0.65801954", "0.65528286", "0.65431625", "0.65157133", "0.64260733", "0.6413073", "0.63880396", "0.6225351", "0.62044257", "0.61709744", "0.6161432", "0.613514", "0.6079182", "0.60697216", "0.60454834", "0.60352397", "0.60302407", "0.6012484", "0.59900033", "0.5902748", "0.5899435", "0.585452", "0.5852138", "0.5829348", "0.58281916", "0.5825875", "0.58100355", "0.5783641", "0.5768583", "0.5751286", "0.57499063", "0.5747063", "0.5732331", "0.57257915", "0.5704877", "0.5666553", "0.56601834", "0.5651801", "0.5650856", "0.56497514", "0.5649584", "0.56494606", "0.564838", "0.56482923", "0.5645934", "0.5642139", "0.5638556", "0.5627623", "0.5614444", "0.5603092", "0.5584008", "0.557711", "0.55715525", "0.55627626", "0.55581313", "0.5557322", "0.5551119", "0.5548314", "0.5539345", "0.5538336", "0.5534702", "0.5533525", "0.55307597", "0.552237", "0.5512032", "0.5510718", "0.54933876", "0.54902345", "0.5488085", "0.5457347", "0.54554754", "0.5444967", "0.54428744", "0.5438241", "0.5435847", "0.5426369", "0.54256475", "0.54177314", "0.54103816", "0.54077524", "0.5401679", "0.5396876", "0.53928375", "0.5379063", "0.5378801", "0.53755766", "0.53735447", "0.5365308", "0.5362256", "0.53584146", "0.5358058", "0.53559893", "0.53527" ]
0.0
-1
The toggle for this layer in HTML.
public function toggle_as_html () { if ($this->context->dhtml_allowed ()) { if ($this->visible) { $icon = $this->context->resolve_icon_as_html ('{icons}tree/collapse', '', '[-]', 'inline-icon', "{$this->name}_image"); } else { $icon = $this->context->resolve_icon_as_html ('{icons}tree/expand', '', '[+]', 'vertical-align: middle', "{$this->name}_image"); } return '<a href="#" onclick="toggle_visibility(\'' . $this->name . '\'); return false;">' . $icon . '</a>'; } return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function draw_toggle ()\n {\n echo $this->toggle_as_html ();\n }", "private function renderToggleButton(): string\n {\n return\n Html::beginTag('a', $this->toggleOptions) .\n $this->renderToggleIcon() .\n\n Html::endTag('a');\n }", "protected function renderToggleButton()\n {\n return Button::widget($this->toggleButtonOptions);\n }", "protected function _renderToggleButton()\n\t{\n\t\tif( $toggleButton = $this->toggleButton ) {\n\t\t\t\n\t\t\tif( is_array( $toggleButton ) ) {\n\t\t\t\t\n\t\t\t\t$tag = ArrayHelper::remove( $toggleButton, 'tag', 'button' );\n\t\t\t\t$label = ArrayHelper::remove( $toggleButton, 'label', 'Show' );\n\t\t\t\t\n\t\t\t\tif( $tag === 'button' && !isset( $toggleButton['type'] ) ) {\n\t\t\t\t\t$toggleButton['type'] = 'button';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn Html::tag( $tag, $label, $toggleButton );\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\n\t\t\t\treturn $toggleButton;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public function getToggleNoView() {}", "function tz_toggle( $atts, $content = null ) {\n\t\n extract(shortcode_atts(array(\n\t\t'title' \t => 'Title goes here',\n\t\t'state'\t\t => 'open'\n ), $atts));\n\n\t$out = '';\n\t\n\t$out .= \"<div data-id='\".$state.\"' class=\\\"toggle\\\"><h4>\".$title.\"</h4><div class=\\\"toggle-inner\\\">\".do_shortcode($content).\"</div></div>\";\n\t\n return $out;\n\t\n}", "protected function renderSwitch()\n {\n $value = ArrayHelper::getValue($this->inputOptions, 'value', null);\n\n if ($this->hasModel()) {\n $attributeValue = Html::getAttributeValue($this->model, $this->attribute);\n $this->checked = \"{$value}\" === \"{$attributeValue}\";\n }\n\n $name = ArrayHelper::remove($this->inputOptions, 'name', null);\n\n return implode(\"\\n\", [\n Html::beginTag('label'),\n $this->renderLabel('off'),\n Html::checkbox($name, $this->checked, $this->inputOptions),\n Html::tag('span', '', ['class' => 'lever']),\n $this->renderLabel('on'),\n Html::endTag('label'),\n ]);\n }", "function pixelgrade_get_comments_toggle_checked_attribute() {\n\t\treturn apply_filters( 'pixelgrade_get_comments_toggle_checked_attribute', 'checked=\"checked\"' );\n\t}", "function cyon_toggle( $atts, $content = null ) {\n\t$atts = shortcode_atts(\n\t\tarray(\n\t\t\t'title' \t\t=> __( 'Title Here' , 'cyon' ),\n\t\t\t'icon'\t\t\t=> '',\n\t\t\t'active'\t\t=> false\n\t\t), $atts);\n\t\t\n\t$icon = '';\n\tif($atts['icon']){\n\t\t$icon = '<span class=\"icon-'.$atts['icon'].'\"></span>';\n\t}\n\t$active = '';\n\tif($atts['active']) {\n\t\t$active = ' toggle-active';\n\t}\n\t$toggle_content .= '<div class=\"toggle'.$active.'\"><h3 class=\"toggle-title\">' . $icon . $atts['title'] . '</h3><div class=\"toggle-wrapper\"><div class=\"toggle-content clearfix\">'. do_shortcode( $content ) . '</div></div></div>';\n\treturn $toggle_content;\n}", "public function Render() {\r\n\t\t\treturn $this->RenderOnOff();\r\n\t\t}", "public function render() {\n\t\t\t$cb_enabled = '';\n\t\t\t$cb_disabled = '';\n\n\t\t\t// Get selected.\n\t\t\tif ( 1 === (int) $this->value ) {\n\t\t\t\t$cb_enabled = ' selected';\n\t\t\t} else {\n\t\t\t\t$cb_disabled = ' selected';\n\t\t\t}\n\n\t\t\t// Label ON.\n\t\t\t$this->field['on'] = isset( $this->field['on'] ) ? $this->field['on'] : esc_html__( 'On', 'redux-framework' );\n\n\t\t\t// Label OFF.\n\t\t\t$this->field['off'] = isset( $this->field['off'] ) ? $this->field['off'] : esc_html__( 'Off', 'redux-framework' );\n\n\t\t\techo '<div class=\"switch-options\">';\n\t\t\techo '<label class=\"cb-enable' . esc_attr( $cb_enabled ) . '\" data-id=\"' . esc_attr( $this->field['id'] ) . '\"><span>' . esc_html( $this->field['on'] ) . '</span></label>';\n\t\t\techo '<label class=\"cb-disable' . esc_attr( $cb_disabled ) . '\" data-id=\"' . esc_attr( $this->field['id'] ) . '\"><span>' . esc_html( $this->field['off'] ) . '</span></label>';\n\t\t\techo '<input type=\"hidden\" class=\"checkbox checkbox-input ' . esc_attr( $this->field['class'] ) . '\" id=\"' . esc_attr( $this->field['id'] ) . '\" name=\"' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '\" value=\"' . esc_attr( $this->value ) . '\" />';\n\t\t\techo '</div>';\n\t\t}", "function pixelgrade_comments_toggle_checked_attribute() {\n\t\t// If the outcome is not falsy, output the attribute.\n\t\tif ( pixelgrade_get_comments_toggle_checked_attribute() ) {\n\t\t\techo 'checked=\"checked\"';\n\t\t}\n\t}", "protected function getToggleId()\n {\n $unique = md5(uniqid());\n return \"sidenav_$unique\";\n }", "protected function getInput()\n {\n // register necessary style sheets\n JHtml::_( 'stylesheet', 'com_events/css-toggle-switch/toggle-switch.css', array(), true );\n JHtml::_( 'stylesheet', 'com_events/com_events/com_events.css', array(), true );\n \n $markup = <<<TOGGLE_MARKUP\n<div class=\"{$this->_getContainerCssClass()}\">\n {$this->_getInputOptions()}\n <span class=\"slide-button\"></span>\n</div> \nTOGGLE_MARKUP;\n \n return $markup;\n }", "public function render_content() {\n\t\t\t?>\n\t\t\t<div class=\"toggle-switch-control\">\n\t\t\t\t<div class=\"toggle-switch\">\n\t\t\t\t\t<input type=\"checkbox\" id=\"<?php echo esc_attr( $this->id ); ?>\" name=\"<?php echo esc_attr( $this->id ); ?>\" class=\"toggle-switch-checkbox\" value=\"<?php echo esc_attr( $this->value() ); ?>\"\n\t\t\t\t\t<?php\n\t\t\t\t\t$this->link();\n\t\t\t\t\tchecked( $this->value() );\n\t\t\t\t\t?>\n\t\t\t\t\t>\n\t\t\t\t\t<label class=\"toggle-switch-label\" for=\"<?php echo esc_attr( $this->id ); ?>\">\n\t\t\t\t\t\t<span class=\"toggle-switch-inner\"></span>\n\t\t\t\t\t\t<span class=\"toggle-switch-switch\"></span>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-description\"><?php echo esc_html( $this->description ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "public function toggle()\n {\n if ($this->isLiked()) {\n return $this->unlike();\n }\n\n return $this->like();\n }", "public function getClickable()\n {\n return '.' . $this->id . '-' . $this->clickable;\n }", "function echotheme_toggle( $atts, $content = null ) {\n extract(shortcode_atts(array(\n\t 'title' => '',\n ), $atts));\n\n $html = '<h4 class=\"slide_toggle\"><a href=\"#\">' .$title. '</a></h4>';\n $html .= '<div class=\"slide_toggle_content\" style=\"display: none;\">'.wpautop(do_shortcode($content)).'</div>';\n \n\treturn $html;\n}", "function getOnClick() {return $this->readOnClick();}", "public function getOpac_hide()\n {\n return $this->opac_hide;\n }", "function sp_framework_toggle_content_sc( $atts, $content = null ) {\n\n\t\textract( shortcode_atts( array(\n\t\t\t'title' => ''\n\t\t), $atts ) );\n\t\t\n\t\t$output = '<div class=\"toggle-wrap\">';\n\t\t$output .= '<span class=\"trigger\"><a href=\"#\">' . esc_attr( $title ) . '</a></span><div class=\"toggle-container\">';\n\t\t$output .= $content; \n\t\t$output .= '</div></div>';\n\n\t\treturn $output;\n\t\n\t}", "public function toggleCell($value = false) {\n\t\tif ($value) {\n\t\t\treturn $this->Html->tag('span', '✔', array('class' => 'cell-boolean cell-boolean-true'));\n\t\t} \n\t\treturn $this->Html->tag('span', '✖', array('class' => 'cell-boolean cell-boolean-false'));\n\t}", "public function Render()\n {\n return \"<span class='\".$this->Icone.\"' title='\".$this->Title.\"' onclick=\".$this->OnClick.\" >&nbsp;&nbsp;</span>\";\n }", "function cardMenu($name)\n\t\t{\n\t\t\techo \"\n\t\t\t<div class=menu onclick=this.parentNode.classList.toggle('folded')>\n\t\t\t\t<button></button>\n\t\t\t\t$name\n\t\t\t</div>\n\t\t\t\";\n\t\t}", "function toggle_icon($notify) {\n\n if ($notify == TRUE) {\n return '_on';\n } elseif ($notify == FALSE) {\n return '_off';\n }\n}", "public function render_content()\n {\n CustomizerAddon::view( 'controls.switch', ['control' => &$this] );\n }", "public function getHrefSubToggleOverride()\n {\n return $this->hrefSubToggleOverride;\n }", "public function checkbox()\n {\n $this->getElement()->addAttribute('data-toggle', 'buttons-checkbox');\n\n return $this;\n }", "public function getShowIcon()\n {\n if ($parent = $this->Parent()) {\n return (boolean) $parent->ShowIcons;\n }\n }", "public function getControlHtml()\n {\n if ( isset( $this->_arrProperties['value'] ) \n && $this->_arrProperties['value'] == 1 ) {\n $this->arrAttributes['checked'] = 'checked';\n }\n \n $this->arrAttributes['type'] = 'checkbox';\n \n return parent::getControlHtml();\n }", "public function getToggleButton($row, $href, $label, $title, $icon, $attributes)\n\t{\n\t\t$href .= '&amp;tid='.$row['id'].'&amp;state='.($row['published'] ? '' : 1);\n\n\t\tif(!$row['published'])\n\t\t{\n\t\t\t$icon = 'invisible.'.(version_compare(VERSION, '4.4','>=') ? 'svg' : 'gif');\n\t\t}\n\t\t\n\t\tif(\\Input::get('tid') != '')\n\t\t{\n\t\t\t\\Database::getInstance()->prepare(\"UPDATE tl_pct_customelement_ratings %s WHERE id=?\")->set( array('published' => ($row['published'] ? 0 : 1)) )->execute( \\Input::get('tid') );\n\t\t}\n\t\t\n\t\treturn '<a href=\"'.$this->addToUrl($href).'\" title=\"'.specialchars($title).'\"'.$attributes.'>'.\\Image::getHtml($icon, $label, 'data-state=\"' . (!$row['published'] ? 0 : 1) . '\"').'</a> ';\n\t}", "public function getToPlainButtonHtml()\n {\n return $this->getChildHtml('to_plain_button');\n }", "function getIsLayer() {return $this->readIsLayer();}", "public static function toggle()\n {\n if ( empty($_REQUEST['mgb_rating_id']) || empty($_REQUEST['mgb_rating_state']) ) return;\n $state = ($_REQUEST['mgb_rating_state'] === 'true') ? 'false' : 'true';\n $id = (int) $_REQUEST['mgb_rating_id'];\n\n Database::query(\n \"UPDATE ?\n SET state=${state}\n WHERE id=${id}\"\n );\n }", "function start_received_or_sent_proposals_div($toggle){ ?>\n <div class= \"proposals-container-title\">\n <h1><?php echo ($toggle) ? \"Received Proposals Status\" : \"Sent Proposals Status\";?> <span class=\"material-icons-round\"><?php echo ($toggle) ? \"call_received\" : \"call_made\";?></span></h1>\n </div>\n <div class=\"<?php echo ($toggle) ? 'received' : 'sent';?>-proposals-container\">\n\n<?php }", "function getOnClick() {return $this->_onclick;}", "function getOnClick() {return $this->_onclick;}", "public function getStoreSwitcherHtml()\n {\n return $this->getChildHtml('store_switcher');\n }", "public function getStyle(): string\n {\n return 'display:none';\n }", "public function display()\n\t{\n\t\t$elements = parent::getElements();\n\n\t\tif (count($elements) != 2)\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\tlist($yes, $no) = $elements;\n\n\t\t$checked = '';\n\t\tif (!empty($yes->checked))\n\t\t{\n\t\t\t$checked = 'checked=\"checked\"';\n\t\t}\n\n\t\t$onchange = '';\n\t\tif (!empty($yes->htmlAttr) || !empty($no->htmlAttr))\n\t\t{\n\t\t\t$onchange = 'onchange=\"jQuery(this).is(\\':checked\\') ? function(){'.$yes->htmlAttr.'}() : function(){'.$no->htmlAttr.'}()\"';\n\t\t}\n\n\t\t$html = '<span class=\"switch-ios\">\n\t\t\t<input type=\"checkbox\" name=\"'.parent::getName().'\" value=\"'.$yes->value.'\" id=\"'.$yes->id.'\" class=\"ios-toggle ios-toggle-round\" '.$checked.' '.$onchange.'/>\n\t\t\t<label for=\"'.$yes->id.'\"></label>\n\t\t</span>';\n\n\t\treturn $html;\n\t}", "public function _toHtml() {\n if ($this->getStoreConfig('clearcode_addshoppers/settings/enabled')) {\n return $this->_getButtonsCode();\n }\n }", "function getjsOnClick () { return $this->readjsOnClick(); }", "function getjsOnClick () { return $this->readjsOnClick(); }", "function getjsOnClick () { return $this->readjsOnClick(); }", "function getjsOnClick () { return $this->readjsOnClick(); }", "function simple_set_toggle( $pFeature, $pPackageName = NULL ) {\n\t// make function compatible with {html_checkboxes}\n\tif( isset( $_REQUEST[$pFeature][0] ) ) {\n\t\t$_REQUEST[$pFeature] = $_REQUEST[$pFeature][0];\n\t}\n\ttoggle_preference( $pFeature, ( isset( $_REQUEST[$pFeature] ) ? $_REQUEST[$pFeature] : NULL ), $pPackageName );\n}", "abstract public function getAdminToggle($count);", "public function getClick()\n {\n return $this->Click;\n }", "public function getToHtmlButtonHtml()\n {\n return $this->getChildHtml('to_html_button');\n }", "public function getShowElement() {}", "function _field_toggle($fval) \n {\n // most of this is to avoid E_NOTICEs\n $has_check = (!empty($fval) && \n ($fval != '0000-00-00') &&\n (\n $fval == $this->opts || \n (is_array($this->opts) && isset($this->opts[1]) && $fval == $this->opts[1]) ||\n (empty($this->opts) && $fval == 1)\n )\n );\n\n return sprintf(\"<input type=\\\"checkbox\\\" name=\\\"%s\\\" id=\\\"%s\\\" %s class=\\\"%s\\\" %s %s />&nbsp;<span class=\\\"%s\\\">%s</span>\",\n $this->fname,\n $this->fname,\n ($this->opts)? 'value=\"' . $this->opts . '\"' : '',\n (isset($this->attribs['class']))? $this->attribs['class'] : $this->element_class,\n ($has_check)? \"checked\" : \"\",\n $this->extra_attribs,\n (isset($this->attribs['class']))? $this->attribs['class'] : $this->element_class,\n (isset($this->attribs['after_text']))? $this->attribs['after_text'] : '(Check for yes)' \n );\n }", "public function enabledToggleFullTime()\n\t{\n\t\treturn $this->toggle_fulltime;\n\t}", "function __toString() {\n\t\tif($this->Enabled == false) $enabled = 'DISABLED';\n$dbind = 'data-bind=\"checked: '.$this->Value->propertyName.'() == \\''.$this->OnValue.'\\'\"';\n\t\treturn \"<input $dbind type='checkbox' name='$this->ElementName' id='$this->ElementId' $enabled/>\\r\\n$this->Validators\\r\\n\";\n\t}", "public function layerName() {\n return $this->_layer;\n }", "function CreateSliderButton($setting, $isChecked, $onClick) {\n\t\t $checked = ($isChecked ? 'checked' : '');\n\t\t $onClick = (($onClick === '') ? '' : ' onClick=\"'.$onClick.'\"');\n\n\t\t $content =\n\t\t\t \"<div id='{$setting}_div' class='onoffswitch-block'>\" .\n\t\t\t \"<span class='onoffswitch-pretext'>{$this->addon->options['label_for_map_toggle']}</span>\" .\n\t\t\t \"<div class='onoffswitch'>\" .\n\t\t\t \"<input type='checkbox' name='onoffswitch' class='onoffswitch-checkbox' id='{$setting}-checkbox' $checked>\" .\n\t\t\t \"<label class='onoffswitch-label' for='{$setting}-checkbox' $onClick>\" .\n\t\t\t '<div class=\"onoffswitch-inner\"></div>'.\n\t\t\t \"<div class='onoffswitch-switch'></div>\".\n\t\t\t '</label>'.\n\t\t\t '</div>' .\n\t\t\t '</div>';\n\t\t return $content;\n\t }", "public function gm_Mode(){\n\t\t\t echo '<br><form class=\"gmModeSwitch\">\n\t\t\t\t<label class=\"switch\">\n\t\t\t\t <input class=\"gmCheckbox\" type=\"checkbox\">\n\t\t\t\t <span class=\"slider round\"></span>\n\t\t\t\t</label>&nbsp;SL Modus\n\t\t\t\t\n\t\t\t\t<div class=\"infobox\">&nbsp;<i class=\"fas fa-info\" aria-hidden=\"true\"></i>\n\t\t\t\t\t<div class=\"infoboxInner\">\n\t\t\t\t\t<h3 style=\"margin-bottom:0;\">Spielleiter-Modus</h3>\n\t\t\t\t\t<p class=\"text\">Würfe sind nicht für andere Spieler sichtbar<br><br>Mit Strg + Click auf eine Talentprobe können Würfe öffentlich gewürfelt werden<br><br>Charaktere können im Spielleiter Modus weiterhin gewechselt werden</p>\n\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t</form>';\n\t\t }", "function Toggle ( $status = 1 ) {\n // toggle debug status to what is passed (on if you forget)\n // this allows to temporarily suspend debugging.\n $this->debug_status = $status;\n }", "public function toggleClosed()\n {\n $this->timestamps = false;\n\n return $this->update([\n 'is_closed' => (1 - $this->is_closed)\n ]);\n }", "function rt_button_boolean($target,$title = 'enable')\n{\n return rt_ui_button($title, $target, 'check');\n}", "protected function _toHtml()\n {\n if (!$this->_canBeShown()) {\n return '';\n }\n\n return parent::_toHtml();\n }", "public function getControl()\r\n {\r\n return $this->_checkBoxTreeRender($this->_getTree());\r\n }", "public function getHoverExpandEffect(): ?bool;", "public function toggleSave() : void\n {\n }", "protected function toggleDisableAction() {}", "function checkbox()\n {\n ?>\n <input type=\"hidden\" <?php $this->name_tag(); ?> value=\"0\" />\n <input type=\"checkbox\" <?php $this->name_tag(); ?> value=\"1\" class=\"inferno-setting\" <?php $this->id_tag('inferno-concrete-setting-'); if($this->setting_value) echo ' checked'; ?> />\n <label <?php $this->for_tag('inferno-concrete-setting-'); ?> data-true=\"<?php _e('On'); ?>\" data-false=\"<?php _e('Off'); ?>\"><?php if($this->setting_value) _e('On'); else _e('Off'); ?></label>\n <?php \n }", "public function col_toggle(\\stdClass $series) {\n global $OUTPUT;\n\n if ($series->finished) {\n $icon = 't/show';\n $text = get_string('enable');\n } else {\n $icon = 't/hide';\n $text = get_string('disable');\n }\n\n $attributes = array('class' => 'action-series', 'data-series' => json_encode(['id' => $series->id, 'finished' => $series->finished]));\n\n return $OUTPUT->action_icon('#', new \\pix_icon($icon, $text, 'moodle'), null, $attributes);\n }", "protected function _toHtml()\n {\n if ($this->_isEnabled()) {\n return parent::_toHtml();\n }\n return '';\n }", "protected function _toHtml()\n {\n if ($this->_isEnabled()) {\n return parent::_toHtml();\n }\n return '';\n }", "public function getShowPackagesButton()\n {\n return $this->getLayout()->createBlock(\n \\Magento\\Backend\\Block\\Widget\\Button::class\n )->setData(\n ['label' => __('Show Packages'), 'onclick' => 'showPackedWindow();']\n )->toHtml();\n }", "function getActiveLayer() {return $this->_activelayer;}", "function getjsOnClick() {return $this->readjsOnClick();}", "public function add_activate_switch()\n {\n if (OptinCampaignsRepository::is_split_test_variant($this->optin_campaign_id)) return;\n\n $input_value = OptinCampaignsRepository::is_activated($this->optin_campaign_id) ? 'yes' : 'no';\n $checked = ($input_value == 'yes') ? 'checked=\"checked\"' : null;\n $tooltip = __('Toggle to activate and deactivate optin.', 'mailoptin');\n\n $switch = sprintf(\n '<input id=\"mo-optin-activate-switch\" type=\"checkbox\" class=\"tgl tgl-light\" value=\"%s\" %s />',\n $input_value,\n $checked\n );\n\n $switch .= '<label id=\"mo-optin-active-switch\" for=\"mo-optin-activate-switch\" class=\"tgl-btn\"></label>';\n $switch .= '<span title=\"' . $tooltip . '\" class=\"mo-tooltipster dashicons dashicons-editor-help\" style=\"margin: 9px 5px;font-size: 18px;cursor: pointer;\"></span>';\n ?>\n <script type=\"text/javascript\">\n jQuery(function () {\n jQuery('#customize-header-actions').prepend(jQuery('<?php echo $switch; ?>'));\n });\n </script>\n <?php\n }", "public function toggle()\n {\n $this->isDone = !$this->isDone;\n }", "function readOnClick() {return $this->_onclick;}", "function make_a_switch($name,$value,$label_text,$label_width,$on_text,$off_text,$on_color,$off_color,$switch_checked = NULL){\r\n echo '<input type=\"checkbox\" \r\n name=\"'.$name.'\" \r\n value=\"'.$value.'\" \r\n\r\n data-label-text=\"'.$label_text.'\" \r\n data-label-width=\"'.$label_width.'\"\r\n\r\n data-on-text=\"'.$on_text.'\" \r\n data-off-text=\"'.$off_text.'\" \r\n\r\n data-on-color=\"'.$on_color.'\" \r\n data-off-color=\"'.$off_color.'\" \r\n \r\n data-size=\"mini\" ';\r\n \r\n if($switch_checked == '1'){\r\n \techo 'checked ';\r\n }elseif ($switch_checked == '0') {\r\n \techo '';\r\n }else{\r\n \techo 'checked ';\r\n }\r\n\r\n echo '>';\r\n\r\n}", "public function onToggleTreeNode()\n {\n $this->putSession('tree_node_status_' . post('node_id'), post('status') ? 0 : 1);\n return $this->onRefresh();\n }", "public function click() {\r\n\t\tswitch($this->current) {\r\n\t\t\tdefault:\r\n\t\t\t\t$this->current = self::SEA;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase self::ISLAND:\r\n\t\t\t\t$this->current = self::NONE;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase self::SEA:\r\n\t\t\t\t$this->current = self::ISLAND;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}", "function render_element_hidden() {\n\t\t\t$inputString = '<INPUT ';\n\t\t\t$inputString .= 'TYPE=\"hidden\" ';\n\t\t\t$inputString .= 'NAME=\"' . $this->name . '\" ';\n\t\t\t$inputString .= 'VALUE=\"' . $this->currentValue . '\" ';\n\t\t\t$inputString .= $this->internalExtra;\n\t\t\t$inputString .= '>';\n\t\t\t\n\t\t\treturn $this->returnSwitch($inputString);\n\t\t}", "public function Flip()\n {\n return $this->setOption('flip', true);\n }", "public function getIsLabelHidden(): bool;", "public function getIsClickable(): bool\n {\n return $this->isClickable;\n }", "public function __toString()\r\n {\r\n return $this->buildEffect();\r\n }", "public static function renderCheckbox();", "public function getMode() : string\n {\n return $this->getRequest()->getParam($this->getBlockViewModeParameter(), \"grid\");\n }", "function getEnabled() {return $this->_enabled;}", "public function render()\n {\n return (new Button($this->attributes, [\n new Italic(['class' => 'icon ' . $this->icon]),\n $this->content,\n ]))->render();\n }", "public function checkboxSwitch($fieldName, $options = array())\n {\n $on = $this->_extractOption('on', $options, 'On');\n $off = $this->_extractOption('off', $options, 'Off');\n $label = $this->_extractOption('label', $options, null);\n $switch = $this->_extractOption('switch', $options, array());\n $lever = '<span class=\"lever\"></span>';\n\n $out = $off . parent::checkbox($fieldName, $options) . $lever . $on;\n\n $out = $this->Html->tag('label', $out, $label);\n\n $switch = $this->addClass($switch, 'switch');\n $out = $this->Html->tag('div', $out, $switch);\n\n return $out;\n }", "public function getInvisibleFlag() {}", "public function render()\n {\n Admin::script($this->script());\n\n $setting = trans('admin.setting');\n\n return <<<EOT\n \n<div class=\"pull-right\">\n<a href=\"{$this->grid->resource()}/setting\" class=\"btn btn-sm btn-success grid-setting\" title=\"$setting\"><i class=\"fa fa-gear\"></i><span class=\"hidden-xs\"> $setting</span></a>\n</div>\nEOT;\n }", "public function toggleEditor()\n {\n $content = $this->_rootElement->find($this->contentForm, Locator::SELECTOR_CSS);\n $toggleButton = $this->_rootElement->find($this->toggleButton, Locator::SELECTOR_CSS);\n if (!$content->isVisible()) {\n $toggleButton->click();\n }\n }", "protected function _toHtml()\n {\n if (! $this->canShow()) {\n return '';\n }\n\n return parent::_toHtml();\n }", "public static final function switchHTML () {\r\n switch (self::$objContainerHTML->toInt () == 0) {\r\n case TRUE:\r\n // Switch showing of HTML container;\r\n self::$objContainerHTML->setInt (1);\r\n self::$objHTWriteIt->setInt (1);\r\n self::$objRequestIsPHP->setInt (1);\r\n return new B (TRUE);\r\n break;\r\n\r\n case FALSE:\r\n // Switch showing of HTML container;\r\n self::$objContainerHTML->setInt (0);\r\n self::$objHTWriteIt->setInt (0);\r\n self::$objRequestIsPHP->setInt (0);\r\n return new B (TRUE);\r\n break;\r\n }\r\n }", "public function wishlist_toggle()\n\t{\n\t\t// no return needed as page is reloaded\n\t\t$this->EE->job_wishlists->wishlist_toggle();\t\t\n\t}", "public function toHtml() {\n\t\techo '<mark '.$this->getAttributes().'>'.$this->renderChildren().'</mark>';\n\t}", "public function getHiddenFlag() {}", "public function toggle_tweet(){\n //Get id from view\n $twid = Input::get(\"twid\");\n \n //Define response array\n $response = array(\n \"success\" => false,\n \"message\" => \"\",\n \"data\"=>array()\n );\n \n $tweet = Tweet::find($twid);\n \n //Checking if tweet exist in database\n if( !$tweet instanceof Tweet){\n $response[\"message\"] =trans(\"app.tweet_no_exist\");\n return Response::json($response);\n }\n \n if( Auth::user()->id != $tweet->user_id ){\n $response[\"message\"] = trans(\"app.no_owner_tweet\");\n return Response::json($response);\n }\n \n //toggle flag hidden\n if( $tweet->is_hidden ){\n $tweet->is_hidden = 0;\n $response[\"message\"] = trans(\"app.tweet_show\");\n }else{\n $tweet->is_hidden = 1;\n $response[\"message\"] = trans(\"app.tweet_hide\");\n }\n $tweet->save();\n \n //Set and return object\n \n $response[\"success\"] = true;\n $response[\"data\"] = $tweet->toArray();\n return Response::json($response);\n }", "public function getMode()\n {\n return $this->base.($this->plus ? '+' : '').$this->flag;\n }", "public function getName()\n {\n return \"raspi_switch\";\n }", "protected function _toHtml()\n {\n return $this->_canShowPayPalButton() ? parent::_toHtml() : '';\n }", "function twenty_twenty_one_add_sub_menu_toggle( $output, $item, $depth, $args ) {\n\tif ( 0 === $depth && in_array( 'menu-item-has-children', $item->classes, true ) ) {\n\n\t\t// Add toggle button.\n\t\t$output .= '<button class=\"sub-menu-toggle\" aria-expanded=\"false\" onClick=\"twentytwentyoneExpandSubMenu(this)\">';\n\t\t$output .= '<span class=\"icon-plus\">' . twenty_twenty_one_get_icon_svg( 'ui', 'plus', 18 ) . '</span>';\n\t\t$output .= '<span class=\"icon-minus\">' . twenty_twenty_one_get_icon_svg( 'ui', 'minus', 18 ) . '</span>';\n\t\t$output .= '<span class=\"screen-reader-text\">' . esc_html__( 'Open menu', 'twentytwentyone' ) . '</span>';\n\t\t$output .= '</button>';\n\t}\n\treturn $output;\n}" ]
[ "0.7799865", "0.701386", "0.6736401", "0.63979524", "0.61496985", "0.59494877", "0.581592", "0.56546515", "0.5612806", "0.5563398", "0.5487965", "0.546014", "0.5458506", "0.5439127", "0.535185", "0.5339095", "0.52415764", "0.52250385", "0.52193403", "0.519983", "0.51991874", "0.51875746", "0.5170834", "0.5160757", "0.51315635", "0.51034504", "0.50988716", "0.50910354", "0.5087057", "0.5057776", "0.5053154", "0.5041851", "0.5031677", "0.5029956", "0.50125855", "0.49893185", "0.49893185", "0.49857062", "0.49774078", "0.49762413", "0.49603388", "0.49500155", "0.49500155", "0.49500155", "0.49500155", "0.49486408", "0.49481517", "0.49427694", "0.49420443", "0.4933747", "0.49185058", "0.49177942", "0.49066338", "0.4901803", "0.48904106", "0.48834902", "0.48384526", "0.48369855", "0.48366266", "0.48345405", "0.4833565", "0.4831271", "0.48270902", "0.4825657", "0.48246175", "0.4823797", "0.48226082", "0.48226082", "0.48161778", "0.48143262", "0.48137316", "0.481186", "0.47953412", "0.47953117", "0.47951436", "0.4785232", "0.47552755", "0.4754635", "0.474194", "0.4727544", "0.4725838", "0.47190553", "0.4715107", "0.4696006", "0.46939236", "0.46927005", "0.46921766", "0.46917623", "0.46747527", "0.46709564", "0.4667986", "0.466718", "0.46617457", "0.46562967", "0.46546254", "0.46526524", "0.46525183", "0.4651888", "0.46508878", "0.46477845" ]
0.6839889
2
Draw a control to show/hide this layer.
public function draw_toggle () { echo $this->toggle_as_html (); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw_control($buffer, $ct)\r\n{\r\n\tcall_user_func(\"draw_\" . strtolower($ct->cclass), $buffer, $ct->caption, $ct->left, $ct->top, $ct->width, $ct->height, $ct->style, $ct->value);\r\n}", "public function draw() {\r\n $g = $this->chart->getGraphics3D();\r\n $e = $g->getGraphics();\r\n\r\n $r = new Rectangle($this->x0,$this->y0,$this->x1-$this->x0,$this->y1-$this->y0);\r\n\r\n if($this->chart->getParent()!=null) {\r\n if ($this->bBrush != null && $this->bBrush->getVisible()) {\r\n $brushXOR = -1 ^ $this->bBrush->getColor()->getRGB();\r\n $e->setXORMode($this->Color->fromArgb($brushXOR));\r\n $e->fillRect($this->x0, $this->y0, $this->x1 - $this->x0, $this->y1 - $this->y0);\r\n\r\n if ($this->pen!= null && $this->pen->getVisible()) {\r\n $penXOR = -1 ^ $this->pen->getColor()->getRGB();\r\n $e->setXORMode($this->Color->fromArgb($penXOR));\r\n $e->drawRect($this->x0-1,$this->y0-1,$this->x1+1-$this->x0,$this->y1+1-$this->y0);\r\n }\r\n }\r\n else if($this->pen!= null && $this->pen->getVisible()) {\r\n $this->chart->invalidate();\r\n $g->setPen($this->getPen());\r\n $g->getBrush()->setVisible(false);\r\n $g->rectangle($r);\r\n $g->getBrush()->setVisible(true);\r\n }\r\n else {\r\n $this->chart->invalidate();\r\n $tmpColor = new Color();\r\n $tmpLineCap = new LineCap();\r\n $tmpDashStyle = new DashStyle();\r\n $g->setPen(new ChartPen($this->chart, $tmpColor->BLACK, true, 1, $tmpLineCap->BEVEL, $tmpDashStyle->DASH));\r\n $g->getBrush()->setVisible(false);\r\n $g->rectangle($r);\r\n $g->getBrush()->setVisible(true);\r\n }\r\n }\r\n }", "protected function _draw_control_panel($extra_break = false)\n {\n $this->drawControlPanel($extra_break);\n }", "protected function _drawStyle($style) {}", "function drawStyle()\r\n\t{\r\n\t}", "public function draw()\n {\n echo \"画一个 {$this->color->run()} 的正方形\";\n }", "public function draw() {}", "public function draw() {}", "public function draw();", "protected function buildControl()\n\t\t{\n\t\t\tswitch($this->getDisplayMode())\n\t\t\t{\n\t\t\t\tcase self::DISPLAYMODE_ICONS :\n\t\t\t\t\t$this->buildIconView();\n\t\t\t\t\tbreak;\n\t\t\t\tcase self::DISPLAYMODE_LIST :\n\t\t\t\t\t$this->buildListView();\n\t\t\t\t\tbreak;\n\t\t\t\tcase self::DISPLAYMODE_DETAILS :\n\t\t\t\t\t$this->buildDetailView();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tstatic::fail(\"Unknown DisplayMode '%s'\", $this->getDisplayMode());\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "function paint()\r\n {\r\n echo \"$this->_canvas.paint();\\n\";\r\n }", "function ControlFormDraw( $sControl, $raChangeParms = array() )\r\n /**************************************************************\r\n Draw a control in a <FORM> that propagates the component's parms.\r\n You should be able to have any number of these forms on your UI, and they'll all propagate each others' state via CtrlGlobal\r\n\r\n $raChangeParms : manage which parms are excluded, altered, or added. See marshalStateParms\r\n */\r\n {\r\n $s = \"<FORM action='{$this->raCompConfig['sFormAction']}' method='{$this->raCompConfig['sFormMethod']}'\"\r\n .(empty($this->raCompConfig['sFormTarget']) ? \"\" : \" target='{$this->raCompConfig['sFormTarget']}'\")\r\n .\">\"\r\n .$sControl\r\n .$this->EncodeHiddenFormParms( $raChangeParms )\r\n .\"</FORM>\";\r\n\r\n return( $s );\r\n }", "function initControls()\n {\n\n $this->map->getControls()->getMaptype()->setDisplay((boolean) $this->showMapType);\n\n $this->map->getControls()->getMaptype()->setPosition($this->mapTypePosition);\n $this->map->getControls()->getMaptype()->setType($this->mapTypeType);\n\n $this->map->getControls()->getScale()->setDisplay((boolean) $this->showScale);\n $this->map->getControls()->getScale()->setPosition($this->scalePosition);\n\n $this->map->getControls()->getNavigation()->setDisplay((boolean) $this->showNavigation);\n\n $this->map->getControls()->getNavigation()->setPosition($this->navigationPosition);\n\n $this->map->getControls()->getNavigation()->setType($this->navigationType);\n\n\n $this->map->getControls()->getZoom()->setDisplay((boolean) $this->showZoom);\n $this->map->getControls()->getZoom()->setPosition($this->zoomPosition);\n $this->map->getControls()->getZoom()->setType($this->zoomType);\n\n $this->map->getControls()->getPan()->setDisplay((boolean) $this->showPan);\n $this->map->getControls()->getPan()->setPosition($this->panPosition);\n\n if ($this->initialMapType)\n {\n $this->map->setMaptype(new Tx_Listfeusers_Gmap_Maptype($this->initialMapType));\n }\n\n }", "public function controls($display = true)\n {\n if($display) {\n $this->attributes['controls'] = true;\n } else {\n unset($this->attributes['controls']);\n }\n\n return $this;\n }", "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 }", "public function draw()\n {\n echo 'Draw rectangle';\n }", "public function draw()\n {\n echo 'Draw circle';\n }", "function ShowBorder($exterior=true,$interior=true) {\n\t$this->pie_border = $exterior;\n\t$this->pie_interior_border = $interior;\n }", "function wp_render_widget_control($id)\n {\n }", "function _displayFormEditDraw($draw=\"\")\r\n\t{\r\n\t\t$utd =& $this->_utd;\r\n\t\t$ut =& $this->_ut;\r\n\r\n\t\t$utpage = new utPage('draws');\r\n\t\t$utpage->_page->addAction('onload', array('resize', 500, 360));\n\t\t$content =& $utpage->getPage();\r\n\t\t$form =& $content->addForm('fdraws', 'draws', KID_UPDATE);\r\n\t\t$form->setTitle('tEditDraw');\r\n\t\t$ranks = $this->_dt->getRanks();\r\n\r\n\t\tif (is_array($draw)) $infos = $draw;\r\n\t\telse\r\n\t\t{\r\n\t\t\tif ( $draw != -1) $drawId = kform::getData();\r\n\t\t\telse $drawId = $draw;\r\n\t\t\t$infos = $utd->getDrawById($drawId);\r\n\t\t\tif ($infos['draw_id'] == -1)\r\n\t\t\t{\r\n\t\t\t\t$infos['draw_serial'] = kform::getData();\r\n\t\t\t\t$infos['draw_rankdefId'] = reset(array_keys($ranks));\r\n\t\t\t\t$form->setTitle('tNewDraw');\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Display warning if exist\r\n\t\tif (isset($infos['errMsg'])) $form->addWng($infos['errMsg']);\r\n\r\n\t\t// Initialize the field\r\n\t\t$form->addHide(\"drawId\", $infos['draw_id']);\r\n\r\n\t\t$serials = $utd->getSerialsList();\r\n\t\t$form->addCombo('drawSerial', $serials, $serials[$infos['draw_serial']]);\r\n\t\tif ($infos['draw_id'] == -1)\r\n\t\t{\r\n\t\t\t$discis[WBS_MS] = $ut->getLabel(WBS_MS);\r\n\t\t\t$discis[WBS_WS] = $ut->getLabel(WBS_WS);\r\n\t\t\t$discis[WBS_MD] = $ut->getLabel(WBS_MD);\r\n\t\t\t$discis[WBS_WD] = $ut->getLabel(WBS_WD);\r\n\t\t\t$discis[WBS_XD] = $ut->getLabel(WBS_XD);\r\n\t\t\t$form->addCombo('drawDisci', $discis, $infos['draw_disci']);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$form->addHide(\"drawDisci\", $infos['draw_disci']);\r\n\t\t\t$form->addInfo('drawDisciLabel', $ut->getLabel($infos['draw_disci']));\r\n\t\t\t$form->addInfo('drawPairs', $infos['draw_nbPairs']);\r\n\t\t}\r\n\r\n\t\tfor($i=WBS_CATAGE_POU; $i<=WBS_CATAGE_VET; $i++)\r\n\t\t$catages[$i] = $ut->getLabel($i);\r\n\t\t$kcombo =& $form->addCombo('drawCatage',\r\n\t\t$catages, $catages[$infos['draw_catage']]);\n\t\t$actions = array( 1 => array('changeCatage'));\n\t\t$kcombo->setActions($actions);\n\t\t// Numero des categories d'age\n\t\tswitch($infos['draw_catage'])\n\t\t{\n\t\t\tcase WBS_CATAGE_POU: $max = 0; break;\n\t\t\tcase WBS_CATAGE_SEN: $max = 0; break;\n\t\t\tcase WBS_CATAGE_VET: $max = 5; break;\n\t\t\tdefault: $max = 2; break;\n\t\t}\n\t\tfor($i=0; $i<=$max; $i++) $num[$i] = $i;\n\t\t$kcombo =& $form->addCombo('drawNumcatage', $num, $infos['draw_numcatage']);\n\t\t\t\r\n\t\tif (isset($ranks[$infos['draw_rankdefId']])) $sel = $ranks[$infos['draw_rankdefId']];\r\n\t\telse $sel = reset($ranks);\r\n\t\t$kcombo =& $form->addCombo('drawRank', $ranks, $sel);\r\n\r\n\t\t$kedit =& $form->addEdit('drawName', $infos['draw_name'], 29);\r\n\t\t$kedit->setMaxLength(50);\r\n\t\t$kedit =& $form->addEdit('drawStamp', $infos['draw_stamp'], 29);\r\n\t\t$kedit->setMaxLength(10);\r\n\r\n\t\t$elts=array('drawDisciLabel', 'drawPairs', 'drawSerial', 'drawCatage', 'drawNumcatage',\r\n\t\t 'drawRank', 'drawDisci', 'drawName', 'drawStamp');\r\n\t\t$form->addBlock(\"blkOne\", $elts);\r\n\r\n\t\t$form->addDiv('break', 'blkNewPage');\r\n\t\t$form->addBtn('btnRegister', KAF_SUBMIT);\r\n\t\t$form->addBtn('btnCancel');\r\n\t\t$elts=array('btnRegister', 'btnCancel');\r\n\t\t$form->addBlock('blkBtn', $elts);\r\n\r\n\t\t//Display the form\r\n\t\t$utpage->display();\r\n\t\texit;\r\n\t}", "protected function _register_controls() {\n\n\t\t$this->start_controls_section(\n\t\t\t'section_style',\n\t\t\tarray(\n\t\t\t\t'label' => esc_html__( 'Style', 'woocommerce-builder-elementor' ),\n\t\t\t\t'tab' => \\Elementor\\Controls_Manager::TAB_STYLE,\n\t\t\t)\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'wc_style_warning',\n\t\t\t[\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::RAW_HTML,\n\t\t\t\t'raw' => esc_html__( 'This is the preview mode of the builder, this widget may not show properly you should view the result in the Product Page and The style of this widget is often affected by your theme and plugins. If you experience any such issue, try to switch to a basic theme and deactivate related plugins.', 'woocommerce-builder-elementor' ),\n\t\t\t\t'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',\n\t\t\t]\n\t\t);\n\t\t\n\n\t\t$this->end_controls_section();\n\n\t}", "protected function generateGraphic() {}", "public function draw()\n {\n return;\n }", "function controls()\n\t{\n\t}", "function draw(callable $callback)\n {\n $callback($this);\n\n return $this;\n }", "public function &draw_show_hide_button($in_tag, $in_value = false)\n {\n $text = \"\";\n\n if (!$this->isShowing($in_tag)) {\n $text .= '<TD>';\n //$text .= '<input class=\"reportico-maintain-tab-menu-but-unsel reportico-submit\" type=\"submit\" name=\"submit_'.$in_tag.\"_SHOW\".'\" value=\"'.$in_value.'\">';\n $text .= '<input size=\"1\" style=\"visibility:hidden\" class\"reportico-submit\" type=\"submit\" name=\"unshown_' . $in_tag . '\" value=\"\">';\n $text .= '</TD>';\n } else {\n $text .= '<TD>';\n //$text .= '<input class=\"reportico-maintain-tab-menu-but-sel\" type=\"submit\" name=\"submit_'.$in_tag.\"_SHOW\".'\" value=\"'.$in_value.'\">';\n $text .= '<input size=\"1\" style=\"visibility:hidden\" class\"reportico-submit\" type=\"submit\" name=\"shown_' . $in_tag . '\" value=\"\">';\n $text .= '</TD>';\n }\n return $text;\n\n }", "public function draw($canvas)\n {\n }", "public function draw($canvas)\n {\n }", "public function setControl($var)\n {\n GPBUtil::checkString($var, True);\n $this->control = $var;\n\n return $this;\n }", "public function setControl($var)\n {\n GPBUtil::checkString($var, True);\n $this->control = $var;\n\n return $this;\n }", "public function setControl($var)\n {\n GPBUtil::checkString($var, True);\n $this->control = $var;\n\n return $this;\n }", "public function draw()\n {\n if (null === $this->draw) {\n $this->draw = new Draw\\Imagick($this);\n }\n if (null === $this->draw->getImage()) {\n $this->draw->setImage($this);\n }\n return $this->draw;\n }", "function draw() {\n }", "public function controls()\n {\n }", "public function hide_arrows() {\n\t\t$this->options['controls'] = array( 'hide_arrows' );\n\t}", "private function drawAxis() : void\n\t{\n\t\timageline($this->im, 0 , $this->shiftY , $this->sizeX , $this->shiftY, $this->colorAxisX);\n\t\timageline($this->im, $this->shiftX , 0 , $this->shiftX, $this->sizeY , $this->colorAxisX);\n\t}", "public function applySkin($control);", "public function render()\n {\n return view('components.controls');\n }", "public function setHidden(){\n $this->_hidden = true;\n }", "public function renderChartControl(ModuleContext $moduleContext, IChartDisplay $chart, string $viewName) : string\n {\n return $this->template->render(\n 'dms::components.chart.chart-control',\n [\n 'structure' => $chart->getDataSource()->getStructure(),\n 'axes' => $chart->getDataSource()->getStructure()->getAxes(),\n 'table' => $chart->hasView($viewName) ? $chart->getView($viewName) : $chart->getDefaultView(),\n 'loadChartDataUrl' => $moduleContext->getUrl('chart.view.load', [$chart->getName(), $viewName]),\n ] + $this->getDateSettings($chart)\n );\n }", "function customize_controls_init()\n {\n }", "function hide()\n {\n $this->_hidden = true;\n }", "public function render() {\n\t\t\t$cb_enabled = '';\n\t\t\t$cb_disabled = '';\n\n\t\t\t// Get selected.\n\t\t\tif ( 1 === (int) $this->value ) {\n\t\t\t\t$cb_enabled = ' selected';\n\t\t\t} else {\n\t\t\t\t$cb_disabled = ' selected';\n\t\t\t}\n\n\t\t\t// Label ON.\n\t\t\t$this->field['on'] = isset( $this->field['on'] ) ? $this->field['on'] : esc_html__( 'On', 'redux-framework' );\n\n\t\t\t// Label OFF.\n\t\t\t$this->field['off'] = isset( $this->field['off'] ) ? $this->field['off'] : esc_html__( 'Off', 'redux-framework' );\n\n\t\t\techo '<div class=\"switch-options\">';\n\t\t\techo '<label class=\"cb-enable' . esc_attr( $cb_enabled ) . '\" data-id=\"' . esc_attr( $this->field['id'] ) . '\"><span>' . esc_html( $this->field['on'] ) . '</span></label>';\n\t\t\techo '<label class=\"cb-disable' . esc_attr( $cb_disabled ) . '\" data-id=\"' . esc_attr( $this->field['id'] ) . '\"><span>' . esc_html( $this->field['off'] ) . '</span></label>';\n\t\t\techo '<input type=\"hidden\" class=\"checkbox checkbox-input ' . esc_attr( $this->field['class'] ) . '\" id=\"' . esc_attr( $this->field['id'] ) . '\" name=\"' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '\" value=\"' . esc_attr( $this->value ) . '\" />';\n\t\t\techo '</div>';\n\t\t}", "protected function _register_controls() {\n\t\t$this->start_controls_section(\n\t\t\t'main_clients_settings',\n\t\t\t[\n\t\t\t\t'label' => __( 'Clients Settings', 'elementor-main-clients' ),\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t 'clients-columns',\n\t\t \t[\n\t\t \t'label' \t=> esc_html__( 'Column', 'essential-addons-elementor' ),\n\t\t \t'type' \t\t\t=> Controls_Manager::SELECT,\n\t\t \t'default' \t\t=> '2',\n\t\t \t'options' \t\t=> [\t\t\t\t\n\t\t\t\t\t'1' => esc_html__('1 Column', 'baldiyaat'),\n\t\t\t\t\t'2' => esc_html__('2 Column', 'baldiyaat'),\n\t\t\t\t\t'3' => esc_html__('3 Column', 'baldiyaat'),\n\t\t\t\t\t'4' => esc_html__('4 Column', 'baldiyaat'),\n\t\t\t\t\t'6' => esc_html__('6 Column', 'baldiyaat')\n\t\t \t],\n\t\t \t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'thumbnail-size',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Thumbnail Size', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'label_block' \t=> false,\n\t\t\t\t'default' => esc_html__( 'hide', 'essential-addons-elementor' ),\n\t\t \t'options' => wpha_get_thumbnail_list(),\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'num-fetch',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Num Fetch', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => 10,\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->end_controls_section();\n\t\t\n\t\t/**\n\t\t * Clients Text Settings\n\t\t */\n\t\t$this->start_controls_section(\n\t\t\t'main_clients_config_settings',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Clients Images', 'essential-addons-elementor' ),\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'slider',\n\t\t\t[\n\t\t\t\t'type' => Controls_Manager::REPEATER,\n\t\t\t\t'seperator' => 'before',\n\t\t\t\t'default' => [\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t],\n\t\t\t\t'fields' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'main_clients_settings_slide',\n\t\t\t\t\t\t'label' => esc_html__( 'Image', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::MEDIA,\n\t\t\t\t\t\t'default' => [\n\t\t\t\t\t\t\t'url' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'main_clients_settings_slide_title',\n\t\t\t\t\t\t'label' => esc_html__( 'Image Title', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( '', 'essential-addons-elementor' )\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'main_clients_settings_slide_caption',\n\t\t\t\t\t\t'label' => esc_html__( 'Image Caption', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( '', 'essential-addons-elementor' )\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'main_clients_settings_enable_slide_link',\n\t\t\t\t\t\t'label' => __( 'Enable Image Link', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t\t\t'default' => 'false',\n\t\t\t\t\t\t'label_on' => esc_html__( 'Yes', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'label_off' => esc_html__( 'No', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'return_value' => 'true',\n\t\t\t\t\t\t\n\t\t\t\t \t],\n\t\t\t\t \t[\n\t\t\t\t\t\t'name' => 'main_clients_settings_slide_link',\n\t\t\t\t\t\t'label' => esc_html__( 'Image Link', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::URL,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => [\n\t\t \t\t\t'url' => '#',\n\t\t \t\t\t'is_external' => '',\n\t\t \t\t\t],\n\t\t \t\t\t'show_external' => true,\n\t\t \t\t\t'condition' => [\n\t\t \t\t\t\t'main_clients_settings_enable_slide_link' => 'true'\n\t\t \t\t\t]\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t'title_field' => '{{main_clients_settings_slide_title}}',\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\t\t\n\t\t/**\n\t\t * Clients Text Settings\n\t\t */\n\t\t$this->start_controls_section(\n\t\t\t'main_clients_color_settings',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Color & Design', 'essential-addons-elementor' ),\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'main_clients_sub_title_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Image Sub Title Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#f4f4f4',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .slide-item .slide-caption .kode-sub-title' => 'color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'main_clients_title_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Image Title Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#f4f4f4',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .slide-item .slide-caption .slide-caption-title' => 'color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'main_clients_caption_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Image Caption Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#f4f4f4',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .slide-item .slide-caption .slide-caption-des' => 'color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'main_clients_button_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Image Button Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#f4f4f4',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .slide-item .slide-caption .banner_text_btn .bg-color' => 'color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'main_clients_button_bg_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Image Button BG Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#f4f4f4',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .slide-item .slide-caption .banner_text_btn .bg-color' => 'background-color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->end_controls_section();\n\t\t\n\t\t\n\t}", "function register_widget_control($name, $control_callback, $width = '', $height = '', ...$params)\n {\n }", "public function drawEndHeaderPanel()\r\n {\r\n echo '</div>';\r\n }", "public function build_controls()\n\t{\n\t\t$this->add_control( 'title', [\n\t\t\t'label' => __( 'Title' )\n\t\t] );\n\t\t$this->add_control( 'content', [\n\t\t\t'label' => __( 'Content' ),\n\t\t\t'type' => 'textarea'\n\t\t] );\n\t\t$this->add_control( 'link_url', [\n\t\t\t'label' => __( 'URL' )\n\t\t] );\n\t\t$this->add_control( 'link_text', [\n\t\t\t'label' => __( 'Link Text' )\n\t\t] );\n\t\t$this->add_control( 'link_target', [\n\t\t\t'label' => __( 'Open link in a new window/tab' ),\n\t\t\t'type' => 'checkbox',\n\t\t\t'value' => '1'\n\t\t] );\n\t}", "function pb_hideshow_comment_js () { ?>\r\n<script type=\"text/javascript\"> \r\nvar currLayerId = \"show\"; \r\nfunction togLayer(id) { if(currLayerId) setDisplay(currLayerId, \"none\"); if(id)setDisplay(id, \"block\"); currLayerId = id; }\r\nfunction setDisplay(id,value) { var elm = document.getElementById(id); elm.style.display = value; }\r\n</script>\r\n<?php\r\n}", "public function drawContent()\n\t\t{\n\t\t}", "function RenderChildren() {\n if ($this->HasControls()) {\n foreach($this->Controls as $control) {\n $control->Render();\n }\n }\n }", "protected function register_controls() {\n $this->start_controls_section(\n 'developer_tools',\n [\n 'label' => esc_html__( 'Developer Tools', 'bridge-core' ),\n 'tab' => \\Elementor\\Controls_Manager::TAB_CONTENT,\n ]\n );\n\n $this->add_control(\n 'shortcode_snippet',\n [\n 'label' => esc_html__( 'Show Shortcode Snippet', 'bridge-core' ),\n 'type' => \\Elementor\\Controls_Manager::SELECT,\n 'default' => 'no',\n 'options' => array(\n 'no' => esc_html__( 'No', 'bridge-core' ),\n 'yes' => esc_html__( 'Yes', 'bridge-core' ),\n ),\n ]\n );\n\n $this->end_controls_section();\n }", "public function draw(){\r\n\t\treturn $this->module_draw($this->config);\r\n\t}", "public function control_close()\n\t{\n\t\t$this->controls_opened = $this->line_opened = false;\n\t\treturn \"</div>\\n</div>\"; // close .controls div\n\t}", "public function getDraw()\n {\n return $this->draw;\n }", "function drawOptionsDisplay() {\r\n global $saveShowWbs, $saveShowClosed, $saveShowResource,$planningType, $showListFilter,$showClosedPlanningVersion;?>\r\n <table width=\"100%\">\r\n <?php if ($planningType!='contract' and $planningType!='version') {?>\r\n <tr class=\"checkboxLabel\">\r\n <td><?php echo ucfirst(i18n(\"labelShowWbs\".((isNewGui())?'':'Short')));?></td>\r\n <td width=\"35px\">\r\n <div title=\"<?php echo ucfirst(i18n('showWbs'));?>\" dojoType=\"dijit.form.CheckBox\" \r\n class=\"whiteCheck\" type=\"checkbox\" id=\"showWBS\" name=\"showWBS\"\r\n <?php if ($saveShowWbs=='1') { echo ' checked=\"checked\" '; }?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n saveUserParameter('planningShowWbs',((this.checked)?'1':'0'));\r\n refreshJsonPlanning();\r\n </script>\r\n </div>&nbsp;\r\n </td>\r\n </tr>\r\n <?php }?>\r\n <tr class=\"checkboxLabel\" <?php echo ($planningType=='version')?'style=\"height:25px\"':''?>>\r\n <td><?php echo ucfirst(i18n(\"labelShowIdle\".((isNewGui() or $planningType=='version')?'':'Short')));?></td>\r\n <td style=\"width: 30px;\">\r\n <?php if ($planningType=='version') {?>\r\n <div title=\"<?php echo i18n('labelShowIdle')?>\" dojoType=\"dijit.form.CheckBox\" \r\n class=\"whiteCheck\" type=\"checkbox\" id=\"showClosedPlanningVersion\" name=\"showClosedPlanningVersion\"\r\n <?php if ($showClosedPlanningVersion=='1') { echo ' checked=\"checked\" '; }?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n saveUserParameter('planningVersionShowClosed',((this.checked)?'1':'0'));\r\n refreshJsonPlanning();\r\n </script>\r\n </div>&nbsp;\r\n <?php } else {?>\r\n <div title=\"<?php echo ucfirst(i18n('showIdleElements'));?>\" dojoType=\"dijit.form.CheckBox\" \r\n class=\"whiteCheck\" type=\"checkbox\" id=\"listShowIdle\" name=\"listShowIdle\"\r\n <?php if ($saveShowClosed=='1') { echo ' checked=\"checked\" '; }?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n saveUserParameter('planningShowClosed',((this.checked)?'1':'0'));\r\n refreshJsonPlanning();\r\n </script>\r\n </div>&nbsp;\r\n <?php }?>\r\n </td>\r\n </tr>\r\n <?php \r\n if (strtoupper(Parameter::getUserParameter('displayResourcePlan'))!='NO' and ($planningType=='planning' or $planningType=='global' or $planningType=='contract' or $planningType=='version') ) {?>\r\n <tr class=\"checkboxLabel\" <?php echo ($planningType=='version')?'style=\"height:25px\"':''?>>\r\n <td>\r\n <?php if ($planningType=='version') {?><div id=\"displayRessource\" style=\"visibility:<?php echo ($showListFilter=='true')?'visible':'hidden';?>;\"><?php }?>\r\n <?php echo ucfirst(i18n(\"labelShowResource\".((isNewGui() or $planningType=='version')?'':'Short')));?>\r\n <?php if ($planningType=='version') {?></div><?php }?>\r\n </td>\r\n <td style=\"width: 30px;\">\r\n <?php if ($planningType=='version') {?><div id=\"displayRessourceCheck\" style=\"visibility:<?php echo ($showListFilter=='true')?'visible':'hidden';?>!important;\"><?php }?>\r\n <div title=\"<?php echo ucfirst(i18n('showResources'));?>\" dojoType=\"dijit.form.CheckBox\" \r\n class=\"whiteCheck\" type=\"checkbox\" \r\n <?php if ($planningType=='version') {?>id=\"showRessourceComponentVersion\" name=\"showRessourceComponentVersion\"<?php } else { ?>id=\"listShowResource\" name=\"listShowResource\"<?php }?> \r\n <?php if ($saveShowResource=='1') { echo ' checked=\"checked\" '; }?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n saveUserParameter('planningShowResource',((this.checked)?'1':'0'));\r\n refreshJsonPlanning();\r\n </script>\r\n </div>&nbsp;\r\n <?php if ($planningType=='version') {?></div><?php }?>\r\n </td>\r\n </tr>\r\n <?php \r\n }?>\r\n </table>\r\n<?php \r\n}", "protected function _register_controls() {\n \t\t$this->start_controls_section(\n \t\t\t'eael_section_google_map_settings',\n \t\t\t[\n \t\t\t\t'label' => esc_html__( 'General Settings', 'essential-addons-elementor' )\n \t\t\t]\n \t\t);\n \t\t$this->add_control(\n\t\t 'eael_google_map_type',\n\t\t \t[\n\t\t \t\t'label' \t=> esc_html__( 'Google Map Type', 'essential-addons-elementor' ),\n\t\t \t'type' \t\t\t=> Controls_Manager::SELECT,\n\t\t \t'default' \t\t=> 'basic',\n\t\t \t'label_block' \t=> false,\n\t\t \t'options' \t\t=> [\n\t\t \t\t'basic' \t=> esc_html__( 'Basic', 'essential-addons-elementor' ),\n\t\t \t\t'marker' \t=> esc_html__( 'Multiple Marker', 'essential-addons-elementor' ),\n\t\t \t\t'static' \t=> esc_html__( 'Static', 'essential-addons-elementor' ),\n\t\t \t\t'polyline' => esc_html__( 'Polyline', 'essential-addons-elementor' ),\n\t\t \t\t'polygon' \t=> esc_html__( 'Polygon', 'essential-addons-elementor' ),\n\t\t \t\t'overlay' \t=> esc_html__( 'Overlay', 'essential-addons-elementor' ),\n\t\t \t\t'routes' \t=> esc_html__( 'With Routes', 'essential-addons-elementor' ),\n\t\t \t\t'panorama' => esc_html__( 'Panorama', 'essential-addons-elementor' ),\n\t\t \t]\n\t\t \t]\n\t\t);\n\t\t$this->add_control(\n 'eael_google_map_address_type',\n [\n 'label' => __( 'Address Type', 'essential-addons-elementor' ),\n 'type' => Controls_Manager::CHOOSE,\n 'options' => [\n\t\t\t\t\t'address' => [\n\t\t\t\t\t\t'title' => __( 'Address', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-map',\n\t\t\t\t\t],\n\t\t\t\t\t'coordinates' => [\n\t\t\t\t\t\t'title' => __( 'Coordinates', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-map-marker',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'default' => 'address',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['basic']\n\t\t\t\t]\n ]\n );\n $this->add_control(\n\t\t\t'eael_google_map_addr',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Geo Address', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => true,\n\t\t\t\t'default' => esc_html__( 'Marina Bay, Singapore', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_address_type' => ['address'],\n\t\t\t\t\t'eael_google_map_type' => ['basic']\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_lat',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Latitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '1.2925005', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type!' => ['routes'],\n\t\t\t\t\t'eael_google_map_address_type' => ['coordinates']\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_lng',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Longitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '103.8665551', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type!' => ['routes'],\n\t\t\t\t\t'eael_google_map_address_type' => ['coordinates']\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t// Only for static\n\t\t$this->add_control(\n\t\t\t'eael_google_map_static_lat',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Latitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '1.2925005', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['static'],\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_static_lng',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Longitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '103.8665551', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['static'],\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_resolution_title',\n\t\t\t[\n\t\t\t\t'label' => __( 'Map Image Resolution', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::HEADING,\n\t\t\t\t'separator' => 'before',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => 'static'\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_static_width',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Static Image Width', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => 610\n\t\t\t\t],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'max' => 1400,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => 'static'\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_static_height',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Static Image Height', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => 300\n\t\t\t\t],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'max' => 700,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => 'static'\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t// Only for Overlay\n\t\t$this->add_control(\n\t\t\t'eael_google_map_overlay_lat',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Latitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '1.2925005', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['overlay'],\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_overlay_lng',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Longitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '103.8665551', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['overlay'],\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t// Only for panorama\n\t\t$this->add_control(\n\t\t\t'eael_google_map_panorama_lat',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Latitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '1.2925005', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['panorama'],\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_panorama_lng',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Longitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '103.8665551', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['panorama'],\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_overlay_content',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Overlay Content', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXTAREA,\n\t\t\t\t'label_block' => True,\n\t\t\t\t'default' => esc_html__( 'Add your content here', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => 'overlay'\n\t\t\t\t]\n\t\t\t]\n\t\t);\n \t\t$this->end_controls_section();\n \t\t/**\n \t\t * Map Settings (With Marker only for Basic)\n \t\t */\n \t\t$this->start_controls_section(\n \t\t\t'eael_section_google_map_basic_marker_settings',\n \t\t\t[\n \t\t\t\t'label' => esc_html__( 'Map Marker Settings', 'essential-addons-elementor' ),\n \t\t\t\t'condition' => [\n \t\t\t\t\t'eael_google_map_type' => ['basic']\n \t\t\t\t]\n \t\t\t]\n \t\t);\n \t\t$this->add_control(\n\t\t\t'eael_google_map_basic_marker_title',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Title', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => true,\n\t\t\t\t'default' => esc_html__( 'Google Map Title', 'essential-addons-elementor' )\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_basic_marker_content',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Content', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXTAREA,\n\t\t\t\t'label_block' => true,\n\t\t\t\t'default' => esc_html__( 'Google map content', 'essential-addons-elementor' )\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_basic_marker_icon_enable',\n\t\t\t[\n\t\t\t\t'label' => __( 'Custom Marker Icon', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'default' => 'no',\n\t\t\t\t'label_on' => __( 'Yes', 'essential-addons-elementor' ),\n\t\t\t\t'label_off' => __( 'No', 'essential-addons-elementor' ),\n\t\t\t\t'return_value' => 'yes',\n\t\t\t]\n\t\t);\n \t\t$this->add_control(\n\t\t\t'eael_google_map_basic_marker_icon',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Marker Icon', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::MEDIA,\n\t\t\t\t'default' => [\n\t\t\t\t\t// 'url' => Utils::get_placeholder_image_src(),\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_basic_marker_icon_enable' => 'yes'\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_basic_marker_icon_width',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Marker Width', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => 32\n\t\t\t\t],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'max' => 150,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_basic_marker_icon_enable' => 'yes'\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_basic_marker_icon_height',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Marker Height', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => 32\n\t\t\t\t],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'max' => 150,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_basic_marker_icon_enable' => 'yes'\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->end_controls_section();\n \t\t/**\n \t\t * Map Settings (With Marker)\n \t\t */\n \t\t$this->start_controls_section(\n \t\t\t'eael_section_google_map_marker_settings',\n \t\t\t[\n \t\t\t\t'label' => esc_html__( 'Map Marker Settings', 'essential-addons-elementor' ),\n \t\t\t\t'condition' => [\n \t\t\t\t\t'eael_google_map_type' => ['marker', 'polyline', 'routes', 'static']\n \t\t\t\t]\n \t\t\t]\n \t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_markers',\n\t\t\t[\n\t\t\t\t'type' => Controls_Manager::REPEATER,\n\t\t\t\t'seperator' => 'before',\n\t\t\t\t'default' => [\n\t\t\t\t\t[ 'eael_google_map_marker_title' => esc_html__( 'Map Marker 1', 'essential-addons-elementor' ) ],\n\t\t\t\t],\n\t\t\t\t'fields' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_marker_lat',\n\t\t\t\t\t\t'label' => esc_html__( 'Latitude', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( '1.2925005', 'essential-addons-elementor' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_marker_lng',\n\t\t\t\t\t\t'label' => esc_html__( 'Longitude', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( '103.8665551', 'essential-addons-elementor' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_marker_title',\n\t\t\t\t\t\t'label' => esc_html__( 'Title', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( 'Marker Title', 'essential-addons-elementor' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_marker_content',\n\t\t\t\t\t\t'label' => esc_html__( 'Content', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXTAREA,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( 'Marker Content. You can put html here.', 'essential-addons-elementor' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_marker_icon_color',\n\t\t\t\t\t\t'label' => esc_html__( 'Default Icon Color', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'description' => esc_html__( '(Works only on Static mode)', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t\t\t'default' => '#e23a47',\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_marker_icon_enable',\n\t\t\t\t\t\t'label' => __( 'Use Custom Icon', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t\t'label_on' => __( 'Yes', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'label_off' => __( 'No', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'return_value' => 'yes',\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_marker_icon',\n\t\t\t\t\t\t'label' => esc_html__( 'Custom Icon', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::MEDIA,\n\t\t\t\t\t\t'default' => [\n\t\t\t\t\t\t\t// 'url' => Utils::get_placeholder_image_src(),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'condition' => [\n\t\t\t\t\t\t\t'eael_google_map_marker_icon_enable' => 'yes'\n\t\t\t\t\t\t]\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_marker_icon_width',\n\t\t\t\t\t\t'label' => esc_html__( 'Icon Width', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::NUMBER,\n\t\t\t\t\t\t'default' => esc_html__( '32', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'condition' => [\n\t\t\t\t\t\t\t'eael_google_map_marker_icon_enable' => 'yes'\n\t\t\t\t\t\t]\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_marker_icon_height',\n\t\t\t\t\t\t'label' => esc_html__( 'Icon Height', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::NUMBER,\n\t\t\t\t\t\t'default' => esc_html__( '32', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'condition' => [\n\t\t\t\t\t\t\t'eael_google_map_marker_icon_enable' => 'yes'\n\t\t\t\t\t\t]\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t'title_field' => '{{eael_google_map_marker_title}}',\n\t\t\t]\n\t\t);\n\t\t$this->end_controls_section();\n\n\n \t\t/**\n \t\t * Polyline Coordinates Settings (Polyline)\n \t\t */\n \t\t$this->start_controls_section(\n \t\t\t'eael_section_google_map_polyline_settings',\n \t\t\t[\n \t\t\t\t'label' => esc_html__( 'Coordinate Settings', 'essential-addons-elementor' ),\n \t\t\t\t'condition' => [\n \t\t\t\t\t'eael_google_map_type' => ['polyline', 'polygon']\n \t\t\t\t]\n \t\t\t]\n \t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_polylines',\n\t\t\t[\n\t\t\t\t'type' => Controls_Manager::REPEATER,\n\t\t\t\t'seperator' => 'before',\n\t\t\t\t'default' => [\n\t\t\t\t\t[ 'eael_google_map_polyline_title' => esc_html__( '#1', 'essential-addons-elementor' ) ],\n\t\t\t\t],\n\t\t\t\t'fields' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_polyline_title',\n\t\t\t\t\t\t'label' => esc_html__( 'Title', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( '#', 'essential-addons-elementor' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_polyline_lat',\n\t\t\t\t\t\t'label' => esc_html__( 'Latitude', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( '1.2925005', 'essential-addons-elementor' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'eael_google_map_polyline_lng',\n\t\t\t\t\t\t'label' => esc_html__( 'Longitude', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( '103.8665551', 'essential-addons-elementor' ),\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'title_field' => '{{eael_google_map_polyline_title}}',\n\t\t\t]\n\t\t);\n \t\t$this->end_controls_section();\n\n \t\t/**\n \t\t * Routes Coordinates Settings (Routes)\n \t\t */\n \t\t$this->start_controls_section(\n \t\t\t'eael_section_google_map_routes_settings',\n \t\t\t[\n \t\t\t\t'label' => esc_html__( 'Routes Coordinate Settings', 'essential-addons-elementor' ),\n \t\t\t\t'condition' => [\n \t\t\t\t\t'eael_google_map_type' => ['routes']\n \t\t\t\t]\n \t\t\t]\n \t\t);\n \t\t$this->add_control(\n\t\t\t'eael_google_map_routes_origin',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Origin', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::HEADING,\n\t\t\t\t'separator' => 'after',\n\t\t\t]\n\t\t);\n \t\t$this->add_control(\n\t\t\t'eael_google_map_routes_origin_lat',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Latitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '1.2925005', 'essential-addons-elementor' ),\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_routes_origin_lng',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Longitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '103.8665551', 'essential-addons-elementor' ),\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_routes_dest',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Destination', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::HEADING,\n\t\t\t\t'separator' => 'after',\n\t\t\t]\n\t\t);\n \t\t$this->add_control(\n\t\t\t'eael_google_map_routes_dest_lat',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Latitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '1.2833808', 'essential-addons-elementor' ),\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_routes_dest_lng',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Longitude', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '103.8585377', 'essential-addons-elementor' ),\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t \t'eael_google_map_routes_travel_mode',\n\t\t \t[\n\t\t \t\t'label' \t=> esc_html__( 'Travel Mode', 'essential-addons-elementor' ),\n\t\t \t'type' \t\t\t=> Controls_Manager::SELECT,\n\t\t \t'default' \t\t=> 'walking',\n\t\t \t'label_block' \t=> false,\n\t\t \t'options' \t\t=> [\n\t\t \t\t'walking' \t=> esc_html__( 'Walking', 'essential-addons-elementor' ),\n\t\t \t\t'bicycling' => esc_html__( 'Bicycling', 'essential-addons-elementor' ),\n\t\t \t\t'driving' \t=> esc_html__( 'Driving', 'essential-addons-elementor' ),\n\t\t \t]\n\t\t \t]\n\t\t);\n \t\t$this->end_controls_section();\n\n\t\t$this->start_controls_section(\n\t\t\t'section_map_controls',\n\t\t\t[\n\t\t\t\t'label'\t=> esc_html__( 'Map Controls', 'essential-addons-elementor' )\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_zoom',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Zoom Level', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::NUMBER,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => esc_html__( '14', 'essential-addons-elementor' ),\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_map_streeview_control',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Street View Controls', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n 'default' => 'true',\n 'label_on' => __( 'On', 'essential-addons-elementor' ),\n 'label_off' => __( 'Off', 'essential-addons-elementor' ),\n 'return_value' => 'true',\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_map_type_control',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Map Type Control', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n 'default' => 'yes',\n 'label_on' => __( 'On', 'essential-addons-elementor' ),\n 'label_off' => __( 'Off', 'essential-addons-elementor' ),\n 'return_value' => 'yes',\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_map_zoom_control',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Zoom Control', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n 'default' => 'yes',\n 'label_on' => __( 'On', 'essential-addons-elementor' ),\n 'label_off' => __( 'Off', 'essential-addons-elementor' ),\n 'return_value' => 'yes',\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_map_fullscreen_control',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Fullscreen Control', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n 'default' => 'yes',\n 'label_on' => __( 'On', 'essential-addons-elementor' ),\n 'label_off' => __( 'Off', 'essential-addons-elementor' ),\n 'return_value' => 'yes',\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_map_scroll_zoom',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Scroll Wheel Zoom', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n 'default' => 'yes',\n 'label_on' => __( 'On', 'essential-addons-elementor' ),\n 'label_off' => __( 'Off', 'essential-addons-elementor' ),\n 'return_value' => 'yes',\n\t\t\t]\n\t\t);\n\t\t$this->end_controls_section();\n\t\t \n\t\t/**\n \t\t * Map Theme Settings\n \t\t */\n \t\t$this->start_controls_section(\n\t\t\t'eael_section_google_map_theme_settings',\n\t\t\t[\n\t\t\t\t'label'\t\t=> esc_html__( 'Map Theme', 'essential-addons-elementor' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type!'\t=> ['static', 'panorama']\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n 'eael_google_map_theme_source',\n [\n 'label'\t\t=> __( 'Theme Source', 'essential-addons-elementor' ),\n\t\t\t\t'type'\t\t=> Controls_Manager::CHOOSE,\n 'options' => [\n\t\t\t\t\t'gstandard' => [\n\t\t\t\t\t\t'title' => __( 'Google Standard', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-map',\n\t\t\t\t\t],\n\t\t\t\t\t'snazzymaps' => [\n\t\t\t\t\t\t'title' => __( 'Snazzy Maps', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-map-marker',\n\t\t\t\t\t],\n\t\t\t\t\t'custom' => [\n\t\t\t\t\t\t'title' => __( 'Custom', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-edit',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'default'\t=> 'gstandard'\n ]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_gstandards',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Google Themes', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'default' => 'standard',\n\t\t\t\t'options' => [\n\t\t\t\t\t'standard' => __( 'Standard', 'essential-addons-elementor' ),\n\t\t\t\t\t'silver' => __( 'Silver', 'essential-addons-elementor' ),\n\t\t\t\t\t'retro' => __( 'Retro', 'essential-addons-elementor' ),\n\t\t\t\t\t'dark' => __( 'Dark', 'essential-addons-elementor' ),\n\t\t\t\t\t'night' => __( 'Night', 'essential-addons-elementor' ),\n\t\t\t\t\t'aubergine' => __( 'Aubergine', 'essential-addons-elementor' )\n\t\t\t\t],\n\t\t\t\t'description' => sprintf( '<a href=\"https://mapstyle.withgoogle.com/\" target=\"_blank\">%1$s</a> %2$s',__( 'Click here', 'essential-addons-elementor' ), __( 'to generate your own theme and use JSON within Custom style field.', 'essential-addons-elementor' ) ),\n\t\t\t\t'condition'\t=> [\n\t\t\t\t\t'eael_google_map_theme_source'\t=> 'gstandard'\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_snazzymaps',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'SnazzyMaps Themes', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'label_block'\t\t\t=> true,\n\t\t\t\t'default' => 'colorful',\n\t\t\t\t'options' => [\n\t\t\t\t\t'default'\t\t=> __( 'Default', 'essential-addons-elementor' ),\n\t\t\t\t\t'simple'\t\t=> __( 'Simple', 'essential-addons-elementor' ),\n\t\t\t\t\t'colorful'\t\t=> __( 'Colorful', 'essential-addons-elementor' ),\n\t\t\t\t\t'complex'\t\t=> __( 'Complex', 'essential-addons-elementor' ),\n\t\t\t\t\t'dark'\t\t\t=> __( 'Dark', 'essential-addons-elementor' ),\n\t\t\t\t\t'greyscale'\t\t=> __( 'Greyscale', 'essential-addons-elementor' ),\n\t\t\t\t\t'light'\t\t\t=> __( 'Light', 'essential-addons-elementor' ),\n\t\t\t\t\t'monochrome'\t=> __( 'Monochrome', 'essential-addons-elementor' ),\n\t\t\t\t\t'nolabels'\t\t=> __( 'No Labels', 'essential-addons-elementor' ),\n\t\t\t\t\t'twotone'\t\t=> __( 'Two Tone', 'essential-addons-elementor' )\n\t\t\t\t],\n\t\t\t\t'description' => sprintf( '<a href=\"https://snazzymaps.com/explore\" target=\"_blank\">%1$s</a> %2$s',__( 'Click here', 'essential-addons-elementor' ), __( 'to explore more themes and use JSON within custom style field.', 'essential-addons-elementor' ) ),\n\t\t\t\t'condition'\t=> [\n\t\t\t\t\t'eael_google_map_theme_source'\t=> 'snazzymaps'\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_custom_style',\n\t\t\t[\n\t\t\t\t'label' => __( 'Custom Style', 'essential-addons-elementor' ),\n\t\t\t\t'description' => sprintf( '<a href=\"https://mapstyle.withgoogle.com/\" target=\"_blank\">%1$s</a> %2$s',__( 'Click here', 'essential-addons-elementor' ), __( 'to get JSON style code to style your map', 'essential-addons-elementor' ) ),\n\t\t\t\t'type' => Controls_Manager::TEXTAREA,\n 'condition' => [\n 'eael_google_map_theme_source' => 'custom',\n ],\n\t\t\t]\n\t\t);\n\t\t$this->end_controls_section(); \n \t\t/**\n\t\t * -------------------------------------------\n\t\t * Tab Style Google Map Style\n\t\t * -------------------------------------------\n\t\t */\n\t\t$this->start_controls_section(\n\t\t\t'eael_section_google_map_style_settings',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'General Style', 'essential-addons-elementor' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_STYLE,\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'eael_google_map_max_width',\n\t\t\t[\n\t\t\t\t'label' => __( 'Max Width', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => 1140,\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 1400,\n\t\t\t\t\t\t'step' => 10,\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-google-map' => 'max-width: {{SIZE}}{{UNIT}};',\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'eael_google_map_max_height',\n\t\t\t[\n\t\t\t\t'label' => __( 'Max Height', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => 400,\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 1400,\n\t\t\t\t\t\t'step' => 10,\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-google-map' => 'height: {{SIZE}}{{UNIT}};',\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'eael_google_map_margin',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Margin', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => [ 'px', 'em', '%' ],\n\t\t\t\t'selectors' => [\n\t \t\t\t\t\t'{{WRAPPER}} .eael-google-map' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t \t\t\t],\n\t\t\t]\n\t\t);\n\n \t\t$this->end_controls_section();\n\n \t\t/**\n\t\t * -------------------------------------------\n\t\t * Tab Style Google Map Style\n\t\t * -------------------------------------------\n\t\t */\n\t\t$this->start_controls_section(\n\t\t\t'eael_section_google_map_overlay_style_settings',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Overlay Style', 'essential-addons-elementor' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_STYLE,\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['overlay']\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'eael_google_map_overlay_width',\n\t\t\t[\n\t\t\t\t'label' => __( 'Width', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => 200,\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 1100,\n\t\t\t\t\t\t'step' => 10,\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-gmap-overlay' => 'width: {{SIZE}}{{UNIT}};',\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_overlay_bg_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Background Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#fff',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-gmap-overlay' => 'background-color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'eael_google_mapoverlay_padding',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Padding', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => [ 'px', 'em', '%' ],\n\t\t\t\t'selectors' => [\n\t \t\t\t\t\t'{{WRAPPER}} .eael-gmap-overlay' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t \t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'eael_google_map_overlay_margin',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Margin', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => [ 'px', 'em', '%' ],\n\t\t\t\t'selectors' => [\n\t \t\t\t\t\t'{{WRAPPER}} .eael-gmap-overlay' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t \t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Border::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'eael_google_map_overlay_border',\n\t\t\t\t'label' => esc_html__( 'Border', 'essential-addons-elementor' ),\n\t\t\t\t'selector' => '{{WRAPPER}} .eael-gmap-overlay',\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'eael_google_map_overlay_border_radius',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Border Radius', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => [ 'px', 'em', '%' ],\n\t\t\t\t'selectors' => [\n\t \t\t\t\t\t'{{WRAPPER}} .eael-gmap-overlay' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t \t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Box_Shadow::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'eael_google_map_overlay_box_shadow',\n\t\t\t\t'selector' => '{{WRAPPER}} .eael-gmap-overlay',\n\t\t\t]\n\t\t);\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Typography::get_type(),\n\t\t\t[\n \t'name' => 'eael_google_map_overlay_typography',\n\t\t\t\t'selector' => '{{WRAPPER}} .eael-gmap-overlay',\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_overlay_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#222',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-gmap-overlay' => 'color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->end_controls_section();\n\n\t\t/**\n\t\t * -------------------------------------------\n\t\t * Tab Style Google Map Stroke Style\n\t\t * -------------------------------------------\n\t\t */\n\t\t$this->start_controls_section(\n\t\t\t'eael_section_google_map_stroke_style_settings',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Stroke Style', 'essential-addons-elementor' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_STYLE,\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['polyline', 'polygon', 'routes']\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_stroke_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#e23a47',\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'eael_google_map_stroke_opacity',\n\t\t\t[\n\t\t\t\t'label' => __( 'Opacity', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => 0.8,\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0.2,\n\t\t\t\t\t\t'max' => 1,\n\t\t\t\t\t\t'step' => 0.1,\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'eael_google_map_stroke_weight',\n\t\t\t[\n\t\t\t\t'label' => __( 'Weight', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => 4,\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 1,\n\t\t\t\t\t\t'max' => 10,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t$this->add_control(\n\t\t\t'eael_google_map_stroke_fill_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Fill Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#e23a47',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['polygon']\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'eael_google_map_stroke_fill_opacity',\n\t\t\t[\n\t\t\t\t'label' => __( 'Fill Opacity', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => 0.4,\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0.2,\n\t\t\t\t\t\t'max' => 1,\n\t\t\t\t\t\t'step' => 0.1,\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'eael_google_map_type' => ['polygon']\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\t\t$this->end_controls_section();\n\t}", "private function buildControls(){\n\n\t\t//create key - label pairs for this dropdown:\n\n\t\t$name = '_column_type_'.$this->fullId;\n\t\t$types = $this->getTypes();\n\n\t\tif( $this->referenceMode )\n\t\t\t$name = 'reference_'.$this->fullId;\n\n\n\t\tif( sizeof( $types ) > 1 ){\n\t\t\t\n\t\t\t$typeSelector = Field::select(\n\t\t\t\t$name,\n\t\t\t\t'',\n\t\t\t\t$types,\n\t\t\t\tarray(\n\t\t\t\t\t'defaultValue' => $this->type\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\t$class = 'column-controls column-choices-available';\n\n\t\t}else{\n\t\t\t$class = 'column-controls';\n\t\t\t$key = array_keys( $types );\n\t\t\t$typeSelector = Field::hidden( \n\t\t\t\t$name, \n\t\t\t\t[ \n\t\t\t\t\t'defaultValue' => $this->type, \n\t\t\t\t\t'class' => 'type-select'\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\techo '<div class=\"'.$class.'\">';\n\n\t\t\t//render the dropdown:\n\t\t\t$typeSelector->render();\n\t\t\techo '<h3 class=\"column-type\">'.$types[ $this->type ].'</h3>';\n\n\t\t\t//sorter\n\t\t\techo '<span class=\"sort dashicons dashicons-leftright\"></span>';\n\n\t\techo '</div>';\n\n\t}", "function & _displayHeadDraw($draw, $select, $act)\r\n\t{\r\n\t\t$utd =& $this->_utd;\r\n\t\t$dt =& $this->_dt;\r\n\t\t$ut =& $this->_utd;\r\n\t\t$utr = new utround();\n\r\n\t\t// Creation de la page\r\n\t\t$this->_utpage = new utPage_A('draws', true, 'itDraws');\r\n\t\t$content =& $this->_utpage->getContentDiv();\r\n\t\t$drawId = $draw['draw_id'];\r\n\n\t\t// Bouton d'ajout\n\t\t$form =& $content->addForm('formPlus');\n\t\t$form->addBtn('btnNewDraw', KAF_NEWWIN, 'draws', DRAW_SERIAL_NEW, 0, 500, 250);\n\t\t$form->addBtn('itDeleteDraw', KAF_NEWWIN, 'draws', KID_CONFIRM, $drawId, 350, 150);\r\n\t\t$form->addBtn('btnAllDraws', KAF_UPLOAD, 'draws', DRAW_LIST);\n\n\t\t// Liste des tableaux\r\n\t\t$sort = array(5,4);\r\n\t\t$draws = $utd->getDraws($sort);\r\n\t\tforeach($draws as $theDraw)\r\n\t\t$list[$theDraw['draw_id']] = $theDraw['draw_name'];\r\n\t\t$kcombo=& $form->addCombo('selectList', $list, $list[$drawId]);\r\n\t\t$acts[1] = array(KAF_UPLOAD, 'draws', $act);\r\n\t\t$kcombo->setActions($acts);\n\n\t\t// Liste des groupes du tableau\n\t\t$oGroup = new objgroup();\n\t\t$groups = $oGroup->getListGroups($drawId);\n\t\t$utr = new utround();\n\t\t$list = array();\n\t\t$groupname = empty($draw['groupname'])?'':$draw['groupname'];\n\t\tforeach($groups as $group)\n\t\t{\n\t\t\t$url = urlencode($drawId . ';' . $group);\n\t\t\t$list[$url] = $group;\n\t\t\tif (empty($groupname)) $groupname = $group;\n\t\t}\n\t\tif (count($list) > 1)\n\t\t{\n\t\t\t$kcombo=& $form->addCombo('roundList', $list, urlencode($drawId . ';' . $groupname));\n\t\t\t$acts[1] = array(KAF_UPLOAD, 'draws', DRAW_GROUPS_DISPLAY);\n\t\t\t$kcombo->setActions($acts);\n\t\t}\n\n\t\t// Lien de redirection vers tous les tableaux\n\t\t$form->addBtn('itNewPlayer', KAF_NEWWIN, 'regi', REGI_SEARCH, 0, 650, 450);\n\t\tif($draw['draw_discipline'] == WBS_SINGLE) $form->addBtn('itPlayers', KAF_UPLOAD, 'draws',\tDRAW_DISPLAY, $drawId);\n\t\telse $form->addBtn('itPairs', KAF_UPLOAD, 'draws',\tDRAW_DISPLAY, $drawId);\n\t\t$isSquash = $this->_ut->getParam('issquash', false);\n\t\tif($isSquash) $form->addBtn('itClasse', KAF_NEWWIN, 'live', LIVE_CLASSE, 0, 500, 400);\n\t\telse $form->addBtn('itPalma', KAF_NEWWIN, 'live', LIVE_PALMARES, 0, 500, 400);\n\r\n\t\t// Menu de gestion des groupes\r\n\t\t$itemSel = $select;\n\t\t//$items['itDefinition'] = array(KAF_UPLOAD, 'draws', DRAW_DEFINITION, $drawId);\n\t\t$items['itNewGroup'] = array(KAF_NEWWIN, 'draws', DRAW_GROUP_NEW, $drawId, 350, 460);\n\t\t$rounds = $utr->getRounds($drawId, null, null, $groupname);\n\t\tif(count($rounds))\n\t\t{\n\t\t\t$items['itDeleteGroup'] = array(KAF_NEWWIN, 'draws', DRAW_GROUP_CONFIRM, urlencode($drawId .';' . $groupname), 300, 100);\n\t\t\t$items['itModifGroup'] = array(KAF_NEWWIN, 'draws', DRAW_GROUP_EDIT, urlencode($drawId. ';' . $groupname));\n\t\t}\n\t\t$rounds = $utr->getRounds($drawId, WBS_ROUND_GROUP, null, $groupname);\n\t\tif (!empty($rounds) )\n\t\t{\n\t\t\t$items['itGroup'] = array(KAF_UPLOAD, 'draws', DRAW_GROUPS_DISPLAY, urlencode($drawId. ';' . $groupname));\n\t\t}\n\t\t$rounds = $utr->getRounds($drawId, WBS_ROUND_MAINDRAW, null, $groupname);\n\t\tif ( !empty($rounds) )\n\t\t{\n\t\t\t$items['itMainDraw'] = array(KAF_UPLOAD, 'draws', DRAW_KO_DISPLAY, $rounds[0]['rund_id']);\n\t\t}\n\t\t$items['itCalendar'] = array(KAF_UPLOAD,'draws', DRAW_CALENDAR, $drawId);\n\r\n\t\t$kdiv =& $content->addDiv('choix', 'onglet3');\r\n\t\t$kdiv->addMenu(\"menuDiv\", $items, $itemSel);\r\n\t\t$kdiv =& $content->addDiv('contDiv', 'cont3');\r\n\r\n\t\treturn $kdiv;\r\n\t}", "public function draw()\n {\n echo 'Draw square';\n }", "protected function _drawBorderAndBackground(\\SetaPDF_Core_Canvas $canvas, $x, $y) {}", "protected function _register_controls()\n {\n\n /**\n * Style tab\n */\n\n $this->start_controls_section(\n 'general',\n [\n 'label' => __('Content', 'akash-hp'),\n 'tab' => Controls_Manager::TAB_CONTENT,\n ]\n );\n\n $this->add_control(\n\t\t\t'menu_style',\n\t\t\t[\n\t\t\t\t'label' => __( 'Border Style', 'akash-hp' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'default' => 'inline',\n\t\t\t\t'options' => [\n\t\t\t\t\t'inline' => __( 'Inline', 'akash-hp' ),\n\t\t\t\t\t'flyout' => __( 'Flyout', 'akash-hp' ),\n\t\t\t\t],\n\t\t\t]\n );\n \n $this->add_control(\n\t\t\t'trigger_label',\n\t\t\t[\n\t\t\t\t'label' => __( 'Trigger Label', 'akash-hp' ),\n 'type' => Controls_Manager::TEXT,\n\t\t\t]\n );\n \n $this->add_control(\n\t\t\t'trigger_open_icon',\n\t\t\t[\n\t\t\t\t'label' => __( 'Trigger Icon', 'text-domain' ),\n\t\t\t\t'type' => Controls_Manager::ICONS,\n\t\t\t\t'default' => [\n\t\t\t\t\t'value' => 'fa fa-align-justify',\n\t\t\t\t\t'library' => 'solid',\n ],\n \n\t\t\t]\n );\n \n $this->add_control(\n\t\t\t'trigger_close_icon',\n\t\t\t[\n\t\t\t\t'label' => __( 'Trigger Close Icon', 'text-domain' ),\n\t\t\t\t'type' => Controls_Manager::ICONS,\n\t\t\t\t'default' => [\n\t\t\t\t\t'value' => 'far fa-window-close',\n\t\t\t\t\t'library' => 'solid',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n $this->add_responsive_control(\n 'menu_align',\n [\n 'label' => __('Align', 'akash-hp'),\n 'type' => Controls_Manager::CHOOSE,\n 'options' => [\n 'start' => [\n 'title' => __('Left', 'akash-hp'),\n 'icon' => 'fa fa-align-left',\n ],\n 'center' => [\n 'title' => __('top', 'akash-hp'),\n 'icon' => 'fa fa-align-center',\n ],\n 'flex-end' => [\n 'title' => __('Right', 'akash-hp'),\n 'icon' => 'fa fa-align-right',\n ],\n ],\n 'default' => 'left',\n\t\t\t\t'toggle' => true,\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .akash-main-menu-wrap.navbar' => 'justify-content: {{VALUE}}'\n\t\t\t\t\t] \n ]\n );\n $this->end_controls_section();\n $this->start_controls_section(\n\t\t\t'header_infos_section',\n\t\t\t[\n\t\t\t\t'label' => __( 'Header Info', 'akash-hp' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_CONTENT,\n\t\t\t]\n );\n \n $this->add_control(\n\t\t\t'show_infos',\n\t\t\t[\n\t\t\t\t'label' => __( 'Show Title', 'akash-hp' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'Show', 'akash-hp' ),\n\t\t\t\t'label_off' => __( 'Hide', 'akash-hp' ),\n\t\t\t\t'return_value' => 'yes',\n\t\t\t\t'default' => 'no',\n\t\t\t]\n\t\t);\n\n\t\t$repeater = new Repeater();\n\n\t\t$repeater->add_control(\n\t\t\t'info_title', [\n\t\t\t\t'label' => __( 'Title', 'akash-hp' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'default' => __( 'info Title' , 'akash-hp' ),\n\t\t\t\t'label_block' => true,\n\t\t\t]\n\t\t);\n\n\t\t$repeater->add_control(\n\t\t\t'info_content', [\n\t\t\t\t'label' => __( 'Content', 'akash-hp' ),\n\t\t\t\t'type' => Controls_Manager::WYSIWYG,\n\t\t\t\t'default' => __( 'info Content' , 'akash-hp' ),\n\t\t\t\t'show_label' => false,\n\t\t\t]\n );\n \n $repeater->add_control(\n\t\t\t'info_url',\n\t\t\t[\n\t\t\t\t'label' => __( 'Link', 'akash-hp' ),\n\t\t\t\t'type' => Controls_Manager::URL,\n\t\t\t\t'placeholder' => __( 'https://your-link.com', 'akash-hp' ),\n\t\t\t\t'show_external' => true,\n\t\t\t]\n );\n \n\t\t$this->add_control(\n\t\t\t'header_infos',\n\t\t\t[\n\t\t\t\t'label' => __( 'Repeater info', 'akash-hp' ),\n\t\t\t\t'type' => Controls_Manager::REPEATER,\n\t\t\t\t'fields' => $repeater->get_controls(),\n\t\t\t\t'default' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'info_title' => __( 'Call us:', 'akash-hp' ),\n\t\t\t\t\t\t'info_content' => __( '(234) 567 8901', 'akash-hp' ),\n\t\t\t\t\t],\n\t\t\t\t],\n 'title_field' => '{{{ info_title }}}',\n 'condition' => [\n 'show_infos' => 'yes',\n ]\n\t\t\t]\n\t\t);\n\n $this->end_controls_section();\n\n $this->start_controls_section(\n 'section_menu_style',\n [\n 'label' => __('Menu Style', 'akash-hp'),\n 'tab' => Controls_Manager::TAB_STYLE,\n 'condition' => [\n 'menu_style' => 'inline',\n ]\n ]\n );\n\n\n\n\t\t$this->start_controls_tabs(\n\t\t\t'menu_items_tabs'\n );\n \n\t\t$this->start_controls_tab(\n\t\t\t'menu_normal_tab',\n\t\t\t[\n\t\t\t\t'label' => __( 'Normal', 'akash-hp' ),\n\t\t\t]\n );\n \n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' => 'menu_typography',\n 'label' => __('Menu Typography', 'akash-hp'),\n 'selector' => '{{WRAPPER}} .main-navigation ul.navbar-nav>li>a',\n ]\n );\n\n $this->add_control(\n 'menu_color',\n [\n 'label' => __('Item Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-inline.navbar:not(.active) .main-navigation ul.navbar-nav>li>a, \n {{WRAPPER}} .menu-style-inline.navbar:not(.active) .main-navigation ul.navbar-nav > .menu-item-has-children > a .dropdownToggle' => 'color: {{VALUE}}',\n\n '{{WRAPPER}} .menu-style-inline.navbar:not(.active) .main-navigation ul.navbar-nav > .menu-item-has-children > a .dropdownToggle' => 'color: {{VALUE}}',\n \n ],\n ]\n );\n\n $this->add_control(\n 'menu_bg_color',\n [\n 'label' => __('Item Background Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-inline.navbar:not(.active) .main-navigation ul.navbar-nav>li>a' => 'background-color: {{VALUE}}',\n ],\n ]\n );\n\n \n $this->add_responsive_control(\n 'item_gap',\n [\n 'label' => __('Menu Gap', 'akash-hp'),\n 'type' => Controls_Manager::SLIDER,\n 'range' => [\n 'px' => [\n 'min' => 0,\n 'max' => 100,\n ],\n ],\n 'devices' => ['desktop', 'tablet', 'mobile'],\n 'selectors' => [\n 'body:not(.rtl) {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav>li>a' => 'margin-left: {{SIZE}}{{UNIT}};margin-right: {{SIZE}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav>li>a' => 'margin-right: {{SIZE}}{{UNIT}};margin-right: {{SIZE}}{{UNIT}};',\n ],\n\n ]\n );\n\n $this->add_responsive_control(\n 'item_padding',\n [\n 'label' => __('Item Padding', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n 'body:not(.rtl) {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav>li>a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body:not(.rtl) {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav>.menu-item-has-children>a' => 'padding: {{TOP}}{{UNIT}} calc({{RIGHT}}{{UNIT}} + 20px) {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n \n 'body.rtl {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav>li>a' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav>.menu-item-has-children>a' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} calc({{RIGHT}}{{UNIT}} + 20px);',\n ],\n\n ]\n );\n\n $this->add_responsive_control(\n 'item_readius',\n [\n 'label' => __('Item Radius', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n 'body:not(.rtl) {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav>li>a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav>li>a' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n ],\n\n ]\n );\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab(\n\t\t\t'menu_hover_tab',\n\t\t\t[\n\t\t\t\t'label' => __( 'Hover', 'akash-hp' ),\n\t\t\t]\n\t\t);\n\n $this->add_control(\n 'menu_hover_color',\n [\n 'label' => __('Menu Hover Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-inline.navbar:not(.active) .main-navigation ul.navbar-nav>li>a:hover, \n {{WRAPPER}} .menu-style-inline.navbar:not(.active) .main-navigation ul.navbar-nav > .menu-item-has-children > a:hover .dropdownToggle,\n {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav li.current-menu-item>a' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'menu_bg_hover_color',\n [\n 'label' => __('Item Background Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-inline.navbar:not(.active) .main-navigation ul.navbar-nav>li:hover>a' => 'background-color: {{VALUE}}',\n ],\n ]\n );\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->end_controls_tabs();\n\n $this->end_controls_section();\n\n $this->start_controls_section(\n 'dropdown_style',\n [\n 'label' => __('Dropdown Style', 'akash-hp'),\n 'tab' => Controls_Manager::TAB_STYLE,\n 'condition' => [\n 'menu_style' => 'inline',\n ]\n ]\n );\n\n\t\t$this->start_controls_tabs(\n\t\t\t'dropdown_items_tabs'\n\t\t);\n\t\t$this->start_controls_tab(\n\t\t\t'dropdown_normal_tab',\n\t\t\t[\n\t\t\t\t'label' => __( 'Normal', 'akash-hp' ),\n\t\t\t]\n );\n \n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' => 'dripdown_typography',\n 'label' => __('Menu Typography', 'akash-hp'),\n 'selector' => '{{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav>li .sub-menu a',\n ]\n );\n \n $this->add_control(\n 'dropdown_item_color',\n [\n 'label' => __('Item Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a,\n {{WRAPPER}} .menu-style-inline.navbar:not(.active) .main-navigation ul.navbar-nav .menu-item-has-children > a .dropdownToggle' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'dropdown_item_bg_color',\n [\n 'label' => __('Item Background Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a' => 'background-color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'ddown_menu_border_color',\n [\n 'label' => __('Menu Border Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu' => 'border-color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_responsive_control(\n 'dropdown_item_radius',\n [\n 'label' => __('Menu radius', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n 'body:not(.rtl) {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n ],\n\n ]\n );\n\n $this->add_responsive_control(\n 'dropdown_item_padding',\n [\n 'label' => __('Item Padding', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n 'body:not(.rtl) {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n ],\n\n ]\n );\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab(\n\t\t\t'dropdown_hover_tab',\n\t\t\t[\n\t\t\t\t'label' => __( 'Hover', 'akash-hp' ),\n\t\t\t]\n\t\t);\n\n $this->add_control(\n 'dropdown_item_hover_color',\n [\n 'label' => __('Item Hover Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a:hover,\n {{WRAPPER}} .menu-style-inline.navbar:not(.active) .main-navigation ul.navbar-nav .sub-menu .menu-item-has-children > a:hover .dropdownToggle' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'dropdown_item_bg_hover_color',\n [\n 'label' => __('Item Background Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-inline .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a:hover' => 'background-color: {{VALUE}}',\n ],\n ]\n );\n\n $this->end_controls_tab();\n \n $this->end_controls_tabs();\n\n $this->end_controls_section();\n\n $this->start_controls_section(\n 'section_flyout_style',\n [\n 'label' => __('Flyout/Mobile Menu Style', 'akash-hp'),\n 'tab' => Controls_Manager::TAB_STYLE,\n ]\n );\n\n\n\t\t$this->start_controls_tabs(\n\t\t\t'flyout_items_tabs'\n );\n \n\t\t$this->start_controls_tab(\n\t\t\t'flyout_menu_normal_tab',\n\t\t\t[\n\t\t\t\t'label' => __( 'Normal', 'akash-hp' ),\n\t\t\t]\n );\n\n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' => 'flyout_menu_typography',\n 'label' => __('Item Typography', 'akash-hp'),\n 'selector' => '{{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav>li>a',\n ]\n );\n\n $this->add_control(\n 'flyout_menu_color',\n [\n 'label' => __('Item Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav>li>a, \n {{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav > .menu-item-has-children > a .dropdownToggle' => 'color: {{VALUE}}',\n\n '{{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav > .menu-item-has-children > a .dropdownToggle' => 'color: {{VALUE}}',\n ],\n ]\n );\n $this->add_responsive_control(\n 'flyout_item_padding',\n [\n 'label' => __('Item Padding', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n 'body:not(.rtl) {{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav>li>a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body:not(.rtl) {{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav>.menu-item-has-children>a' => 'padding: {{TOP}}{{UNIT}} calc({{RIGHT}}{{UNIT}} + 20px) {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n \n 'body.rtl {{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav>li>a' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav>.menu-item-has-children>a' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} calc({{RIGHT}}{{UNIT}} + 20px);',\n ],\n\n ]\n );\n\n $this->add_responsive_control(\n 'flyout_menu_padding',\n [\n 'label' => __('Menu Padding', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n 'body:not(.rtl) {{WRAPPER}} .menu-style-flyout .main-navigation' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\n 'body.rtl {{WRAPPER}} .menu-style-flyout .main-navigation' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n \n ],\n\n ]\n );\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab(\n\t\t\t'flyout_menu_hover_tab',\n\t\t\t[\n\t\t\t\t'label' => __( 'Hover', 'akash-hp' ),\n\t\t\t]\n\t\t);\n\n $this->add_control(\n 'flyout_menu_hover_color',\n [\n 'label' => __('Menu Hover Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .menu-style-flyout .main-navigation ul.navbar-nav>li>a:hover, \n {{WRAPPER}} .menu-style-flyout .menu-style-flyout .main-navigation ul.navbar-nav > .menu-item-has-children > a:hover .dropdownToggle,\n {{WRAPPER}} .menu-style-flyout .menu-style-flyout .main-navigation ul.navbar-nav li.current-menu-item>a' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n\n\t\t$this->end_controls_tab();\n\n $this->end_controls_tabs();\n \n $this->end_controls_section();\n\n $this->start_controls_section(\n 'flyout_dropdown_style',\n [\n 'label' => __('Flyout/Mobile Dropdown Style', 'akash-hp'),\n 'tab' => Controls_Manager::TAB_STYLE,\n ]\n );\n\n\t\t$this->start_controls_tabs(\n\t\t\t'flyout_dropdown_items_tabs'\n\t\t);\n\t\t$this->start_controls_tab(\n\t\t\t'flyout_dropdown_normal_tab',\n\t\t\t[\n\t\t\t\t'label' => __( 'Normal', 'akash-hp' ),\n\t\t\t]\n\t\t);\n \n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' => 'flyout_dripdown_typography',\n 'label' => __('Dropdown Typography', 'akash-hp'),\n 'selector' => '{{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav>li .sub-menu a',\n ]\n );\n\n $this->add_control(\n 'flyout_dropdown_item_color',\n [\n 'label' => __('Item Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a,\n {{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav .menu-item-has-children > a .dropdownToggle' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'flyout_dropdown_item_bg_color',\n [\n 'label' => __('Item Background Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a' => 'background-color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_responsive_control(\n 'flyout_dropdown_item_padding',\n [\n 'label' => __('Item Padding', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n 'body:not(.rtl) {{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n ],\n\n ]\n );\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab(\n\t\t\t'flyout_dropdown_hover_tab',\n\t\t\t[\n\t\t\t\t'label' => __( 'Hover', 'akash-hp' ),\n\t\t\t]\n\t\t);\n\n $this->add_control(\n 'flyout_dropdown_item_hover_color',\n [\n 'label' => __('Item Hover Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a:hover,\n {{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav .sub-menu .menu-item-has-children > a:hover .dropdownToggle' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'flyout_dropdown_item_bg_hover_color',\n [\n 'label' => __('Item Background Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .main-navigation ul.navbar-nav .menu-item-has-children .sub-menu a:hover' => 'background-color: {{VALUE}}',\n ],\n ]\n );\n\n\t\t$this->end_controls_tab();\n $this->end_controls_tabs();\n\n $this->end_controls_section();\n\n\n $this->start_controls_section(\n 'trigger_style',\n [\n 'label' => __('Trigger Style', 'akash-hp'),\n 'tab' => Controls_Manager::TAB_STYLE,\n ]\n );\n\n\n $this->start_controls_tabs(\n 'trigger_style_tabs'\n );\n \n $this->start_controls_tab(\n 'trigger_style_normal_tab',\n [\n 'label' => __('Normal', 'akash-hp'),\n ]\n );\n \n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' => 'trigger_typography',\n 'label' => __('Trigger Typography', 'akash-hp'),\n 'scheme' => Scheme_Typography::TYPOGRAPHY_1,\n 'selector' => '{{WRAPPER}} .navbar-toggler.open-menu',\n ]\n );\n\n $this->add_control(\n 'trigger_color',\n [\n 'label' => __('Trigger Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .navbar-toggler.open-menu' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'trigger_background',\n [\n 'label' => __('Background Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .navbar-toggler.open-menu' => 'background-color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_group_control(\n Group_Control_Border::get_type(),\n [\n 'name' => 'trigger_border',\n 'label' => __('Border', 'akash-hp'),\n 'selector' => '{{WRAPPER}} .navbar-toggler.open-menu',\n ]\n );\n\n $this->add_control(\n\t\t\t'trigger_icon_size',\n\t\t\t[\n\t\t\t\t'label' => __( 'Icon size', 'plugin-domain' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => [ 'px', '%' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .navbar-toggler.open-menu .navbar-toggler-icon svg' => 'width: {{SIZE}}{{UNIT}};',\n\t\t\t\t\t'{{WRAPPER}} .navbar-toggler.open-menu .navbar-toggler-icon i' => 'font-size: {{SIZE}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n $this->add_control(\n\t\t\t'trigger_icon_gap',\n\t\t\t[\n\t\t\t\t'label' => __( 'Icon Gap', 'plugin-domain' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => [ 'px', '%' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .navbar-toggler.open-menu .navbar-toggler-icon' => 'margin-right: {{SIZE}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n $this->add_responsive_control(\n 'trigger_radius',\n [\n 'label' => __('Border Radius', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n '{{WRAPPER}} .navbar-toggler.open-menu' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .navbar-toggler.open-menu' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}}\n ;',\n ],\n ]\n );\n\n $this->add_responsive_control(\n 'trigger_padding',\n [\n 'label' => __('Button Padding', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n '{{WRAPPER}} .navbar-toggler.open-menu' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .navbar-toggler.open-menu' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n ],\n ]\n );\n $this->end_controls_tab();\n\n $this->start_controls_tab(\n 'trigger_style_hover_tab',\n [\n 'label' => __('Hover', 'akash-hp'),\n ]\n );\n \n\n $this->add_control(\n 'trigger_hover_color',\n [\n 'label' => __('Trigger Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .navbar-toggler.open-menu:hover' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'trigger_hover_background',\n [\n 'label' => __('Background Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .navbar-toggler.open-menu:hover' => 'background-color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_group_control(\n Group_Control_Border::get_type(),\n [\n 'name' => 'trigger_hover_border',\n 'label' => __('Border', 'akash-hp'),\n 'selector' => '{{WRAPPER}} .navbar-toggler.open-menu:hover',\n ]\n );\n\n $this->add_control(\n 'trigger_hover_animation',\n [\n 'label' => __('Hover Animation', 'akash-hp'),\n 'type' => Controls_Manager::HOVER_ANIMATION,\n ]\n );\n\n $this->add_responsive_control(\n 'trigger_hover_radius',\n [\n 'label' => __('Border Radius', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n '{{WRAPPER}} .navbar-toggler.open-menu:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .navbar-toggler.open-menu:hover' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}}\n ;',\n ],\n ]\n );\n \n $this->end_controls_tab();\n \n $this->end_controls_tabs();\n\n $this->end_controls_section();\n \n $this->start_controls_section(\n 'infos_style_section',\n [\n 'label' => __('Info Style', 'akash-hp'),\n 'tab' => Controls_Manager::TAB_STYLE,\n 'condition' => [\n 'show_infos' => 'yes',\n ]\n ]\n );\n\n $this->start_controls_tabs(\n 'info_style_tabs'\n );\n \n $this->start_controls_tab(\n 'info_style_normal_tab',\n [\n 'label' => __('Normal', 'akash-hp'),\n ]\n );\n\n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' => 'info_title_typography',\n 'label' => __('Title Typography', 'akash-hp'),\n 'scheme' => Scheme_Typography::TYPOGRAPHY_1,\n 'selector' => '{{WRAPPER}} .header-info span',\n ]\n );\n\n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' => 'info_typography',\n 'label' => __('Info Typography', 'akash-hp'),\n 'scheme' => Scheme_Typography::TYPOGRAPHY_1,\n 'selector' => '{{WRAPPER}} .header-info h3 ',\n ]\n );\n\n $this->add_control(\n 'info_title_color',\n [\n 'label' => __('Info Title Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .header-info span' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'info_color',\n [\n 'label' => __('Info Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .header-info h3' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_group_control(\n Group_Control_Border::get_type(),\n [\n 'name' => 'info_box_border',\n 'label' => __('Box Border', 'akash-hp'),\n 'selector' => '{{WRAPPER}} .akash-header-infos',\n ]\n );\n\n $this->add_control(\n\t\t\t'info_title_gap',\n\t\t\t[\n\t\t\t\t'label' => __( 'Info Title Gap', 'plugin-domain' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => [ 'px', '%' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .header-info span' => 'margin-bottom: {{SIZE}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n $this->add_responsive_control(\n 'ifno_item_padding',\n [\n 'label' => __('Info item Padding', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n '{{WRAPPER}} .header-info' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\n 'body.rtl {{WRAPPER}} .header-info' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n ],\n ]\n );\n\n $this->end_controls_tab();\n\n $this->start_controls_tab(\n 'info_style_hover_tab',\n [\n 'label' => __('Hover', 'akash-hp'),\n ]\n );\n \n $this->add_control(\n 'info_title_color_hover',\n [\n 'label' => __('Info Title Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .header-info:hover span' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'info_color_hover',\n [\n 'label' => __('Info Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .header-info:hover h3' => 'color: {{VALUE}}',\n ],\n ]\n );\n \n \n $this->end_controls_tab();\n \n $this->end_controls_tabs();\n\n $this->end_controls_section();\n $this->start_controls_section(\n 'panel_style',\n [\n 'label' => __('Panel Style', 'akash-hp'),\n 'tab' => Controls_Manager::TAB_STYLE,\n ]\n );\n\n $this->add_group_control(\n Group_Control_Typography::get_type(),\n [\n 'name' => 'panel_label_typography',\n 'label' => __('Label Typography', 'akash-hp'),\n 'scheme' => Scheme_Typography::TYPOGRAPHY_1,\n 'selector' => '{{WRAPPER}} .menu-style-flyout .navbar-inner .navbar-toggler',\n ]\n );\n\n \n $this->add_control(\n 'panel_label_color',\n [\n 'label' => __('Label Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .navbar-inner .navbar-toggler' => 'color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'close_trigger_color',\n [\n 'label' => __('Close Trigger Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .navbar-inner .navbar-toggler i' => 'color: {{VALUE}}',\n '{{WRAPPER}} .menu-style-flyout .navbar-inner .navbar-toggler svg path' => 'stroke: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'close_trigger_fill_color',\n [\n 'label' => __('Close Trigger Fill Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .navbar-inner .navbar-toggler svg path' => 'fill: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n 'close_label_background',\n [\n 'label' => __('Label Background Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .navbar-toggler.close-menu' => 'background-color: {{VALUE}}',\n ],\n ]\n );\n \n $this->add_control(\n 'panel_background',\n [\n 'label' => __('Panel Color', 'akash-hp'),\n 'type' => Controls_Manager::COLOR,\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .navbar-inner' => 'background-color: {{VALUE}}',\n ],\n ]\n );\n\n $this->add_control(\n\t\t\t'trigger_cloxe_icon_size',\n\t\t\t[\n\t\t\t\t'label' => __( 'Close Icon size', 'plugin-domain' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => [ 'px', '%' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .menu-style-flyout .navbar-toggler.close-menu .navbar-toggler-icon svg' => 'width: {{SIZE}}{{UNIT}};',\n\t\t\t\t\t'{{WRAPPER}} .menu-style-flyout .navbar-toggler.close-menu .navbar-toggler-icon i' => 'font-size: {{SIZE}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n \n $this->add_group_control(\n Group_Control_Box_Shadow::get_type(),\n [\n 'name' => 'panel_shadow',\n 'label' => __('Panel Shadow', 'akash-hp'),\n 'selector' => '{{WRAPPER}} .navbar-inner',\n ]\n );\n\n $this->add_responsive_control(\n 'close_label_padding',\n [\n 'label' => __('Label Padding', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .navbar-toggler.close-menu' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .navbar-toggler.close-menu' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n ],\n ]\n );\n \n $this->add_responsive_control(\n 'panel_padding',\n [\n 'label' => __('Panel Padding', 'akash-hp'),\n 'type' => Controls_Manager::DIMENSIONS,\n 'size_units' => ['px', 'em', '%'],\n 'selectors' => [\n '{{WRAPPER}} .menu-style-flyout .navbar-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n 'body.rtl {{WRAPPER}} .menu-style-flyout .navbar-inner' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',\n ],\n ]\n );\n\n\n $this->end_controls_section();\n }", "protected function buildBottomControls(){\n\t\techo '<div class=\"btn-row\">';\n\n\t\t\t$class = 'edit-btn section-btn';\n\t\t\tif( !$this->hasLightbox )\n\t\t\t\t$class .= ' no-lightbox';\n\n\t\t\techo '<button class=\"'.esc_attr( $class ).'\" id=\"lightbox-btn\">';\n\t\t\t\techo '<span class=\"dashicons dashicons-edit\"></span>';\n\t\t\t\t_e( 'Edit', 'chefsections' );\n\t\t\techo '</button>';\n\n\t\t\t$this->buildTemplateSnitch();\n\n\t\techo '</div>';\n\t}", "protected function _drawRenderingMode(\\SetaPDF_Core_Canvas $canvas) {}", "function theme_views_slideshow_thumbnailhover_controls($vss_id, $view, $options) {\n $classes = array(\n 'views_slideshow_thumbnailhover_controls',\n 'views_slideshow_controls',\n );\n\n $attributes['class'] = implode(' ', $classes);\n\n $attributes['id'] = \"views_slideshow_thumbnailhover_controls_\" . $vss_id;\n $attributes = drupal_attributes($attributes);\n\n $output = \"<div$attributes>\";\n $output .= theme('views_slideshow_thumbnailhover_control_previous', $vss_id, $view, $options);\n if ($options['views_slideshow_thumbnailhover']['timeout']) {\n $output .= theme('views_slideshow_thumbnailhover_control_pause', $vss_id, $view, $options);\n }\n $output .= theme('views_slideshow_thumbnailhover_control_next', $vss_id, $view, $options);\n $output .= \"</div>\\n\";\n return $output;\n}", "public function actionControlPanel()\n {\n $this->render('controlPanel');\n }", "public function draw()\n {\n echo \"Shape: Rectangle\";\n }", "function dumpRELLayout($exclude=array())\r\n {\r\n if ($this->_control!=null)\r\n {\r\n reset($this->_control->controls->items);\r\n $shift = 0;\r\n\r\n $arrayOfControls = $this->_control->controls->items;\r\n usort($arrayOfControls, array(&$this, \"cmp_obj\"));\r\n\r\n while (list($k,$v)=each($arrayOfControls))\r\n {\r\n if (!empty($exclude))\r\n {\r\n if (in_array($v->classname(),$exclude))\r\n {\r\n continue;\r\n }\r\n }\r\n $dump=false;\r\n if( $v->Visible && !$v->IsLayer )\r\n {\r\n if( $this->_control->methodExists('getActiveLayer') )\r\n {\r\n $dump = ( (string)$v->Layer == (string)$this->_control->Activelayer );\r\n }\r\n else\r\n {\r\n $dump = true;\r\n }\r\n }\r\n\r\n if ($dump)\r\n {\r\n $left=$v->Left;\r\n $top=$v->Top;\r\n $aw=$v->Width;\r\n $ah=$v->Height;\r\n $top = $top - $shift;\r\n $shift= $shift + $v->Height;\r\n\r\n $style=\"Z-INDEX: $k; LEFT: \".$left.\"px; WIDTH: \".$aw.\"px; POSITION: relative; TOP: \".$top.\"px; HEIGHT: \".$ah.\"px\";\r\n\r\n echo \"<div id=\\\"\".$v->_name.\"_outer\\\" style=\\\"$style\\\">\\n\";\r\n $v->show();\r\n echo \"\\n</div>\\n\";\r\n }\r\n }\r\n }\r\n }", "protected function register_controls() {\n\t\t$this->start_controls_section(\n\t\t\t'_section_style',\n\t\t\t[\n\t\t\t\t'label' => __( 'Advanced', 'elementor' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_ADVANCED,\n\t\t\t]\n\t\t);\n\n\t\t// Element Name for the Navigator\n\t\t$this->add_control(\n\t\t\t'_title',\n\t\t\t[\n\t\t\t\t'label' => __( 'Title', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::HIDDEN,\n\t\t\t\t'render_type' => 'none',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_margin',\n\t\t\t[\n\t\t\t\t'label' => __( 'Margin', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => [ 'px', 'em', '%', 'rem' ],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} > .elementor-widget-container' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_padding',\n\t\t\t[\n\t\t\t\t'label' => __( 'Padding', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => [ 'px', 'em', '%', 'rem' ],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} > .elementor-widget-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_z_index',\n\t\t\t[\n\t\t\t\t'label' => __( 'Z-Index', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::NUMBER,\n\t\t\t\t'min' => 0,\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}}' => 'z-index: {{VALUE}};',\n\t\t\t\t],\n\t\t\t\t'separator' => 'before',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'_element_id',\n\t\t\t[\n\t\t\t\t'label' => __( 'CSS ID', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'dynamic' => [\n\t\t\t\t\t'active' => true,\n\t\t\t\t],\n\t\t\t\t'default' => '',\n\t\t\t\t'title' => __( 'Add your custom id WITHOUT the Pound key. e.g: my-id', 'elementor' ),\n\t\t\t\t'style_transfer' => false,\n\t\t\t\t'classes' => 'elementor-control-direction-ltr',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'_css_classes',\n\t\t\t[\n\t\t\t\t'label' => __( 'CSS Classes', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'dynamic' => [\n\t\t\t\t\t'active' => true,\n\t\t\t\t],\n\t\t\t\t'prefix_class' => '',\n\t\t\t\t'title' => __( 'Add your custom class WITHOUT the dot. e.g: my-class', 'elementor' ),\n\t\t\t\t'classes' => 'elementor-control-direction-ltr',\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\n\t\t$this->start_controls_section(\n\t\t\t'section_effects',\n\t\t\t[\n\t\t\t\t'label' => __( 'Motion Effects', 'elementor' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_ADVANCED,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_animation',\n\t\t\t[\n\t\t\t\t'label' => __( 'Entrance Animation', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::ANIMATION,\n\t\t\t\t'frontend_available' => true,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'animation_duration',\n\t\t\t[\n\t\t\t\t'label' => __( 'Animation Duration', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'default' => '',\n\t\t\t\t'options' => [\n\t\t\t\t\t'slow' => __( 'Slow', 'elementor' ),\n\t\t\t\t\t'' => __( 'Normal', 'elementor' ),\n\t\t\t\t\t'fast' => __( 'Fast', 'elementor' ),\n\t\t\t\t],\n\t\t\t\t'prefix_class' => 'animated-',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_animation!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'_animation_delay',\n\t\t\t[\n\t\t\t\t'label' => __( 'Animation Delay', 'elementor' ) . ' (ms)',\n\t\t\t\t'type' => Controls_Manager::NUMBER,\n\t\t\t\t'default' => '',\n\t\t\t\t'min' => 0,\n\t\t\t\t'step' => 100,\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_animation!' => '',\n\t\t\t\t],\n\t\t\t\t'render_type' => 'none',\n\t\t\t\t'frontend_available' => true,\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\n\t\t$this->start_controls_section(\n\t\t\t'_section_background',\n\t\t\t[\n\t\t\t\t'label' => __( 'Background', 'elementor' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_ADVANCED,\n\t\t\t]\n\t\t);\n\n\t\t$this->start_controls_tabs( '_tabs_background' );\n\n\t\t$this->start_controls_tab(\n\t\t\t'_tab_background_normal',\n\t\t\t[\n\t\t\t\t'label' => __( 'Normal', 'elementor' ),\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Background::get_type(),\n\t\t\t[\n\t\t\t\t'name' => '_background',\n\t\t\t\t'selector' => '{{WRAPPER}} > .elementor-widget-container',\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab(\n\t\t\t'_tab_background_hover',\n\t\t\t[\n\t\t\t\t'label' => __( 'Hover', 'elementor' ),\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Background::get_type(),\n\t\t\t[\n\t\t\t\t'name' => '_background_hover',\n\t\t\t\t'selector' => '{{WRAPPER}}:hover .elementor-widget-container',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'_background_hover_transition',\n\t\t\t[\n\t\t\t\t'label' => __( 'Transition Duration', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'max' => 3,\n\t\t\t\t\t\t'step' => 0.1,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'render_type' => 'ui',\n\t\t\t\t'separator' => 'before',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} > .elementor-widget-container' => 'transition: background {{SIZE}}s',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->end_controls_tabs();\n\n\t\t$this->end_controls_section();\n\n\t\t$this->start_controls_section(\n\t\t\t'_section_border',\n\t\t\t[\n\t\t\t\t'label' => __( 'Border', 'elementor' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_ADVANCED,\n\t\t\t]\n\t\t);\n\n\t\t$this->start_controls_tabs( '_tabs_border' );\n\n\t\t$this->start_controls_tab(\n\t\t\t'_tab_border_normal',\n\t\t\t[\n\t\t\t\t'label' => __( 'Normal', 'elementor' ),\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Border::get_type(),\n\t\t\t[\n\t\t\t\t'name' => '_border',\n\t\t\t\t'selector' => '{{WRAPPER}} > .elementor-widget-container',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_border_radius',\n\t\t\t[\n\t\t\t\t'label' => __( 'Border Radius', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => [ 'px', '%' ],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} > .elementor-widget-container' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Box_Shadow::get_type(),\n\t\t\t[\n\t\t\t\t'name' => '_box_shadow',\n\t\t\t\t'selector' => '{{WRAPPER}} > .elementor-widget-container',\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab(\n\t\t\t'_tab_border_hover',\n\t\t\t[\n\t\t\t\t'label' => __( 'Hover', 'elementor' ),\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Border::get_type(),\n\t\t\t[\n\t\t\t\t'name' => '_border_hover',\n\t\t\t\t'selector' => '{{WRAPPER}}:hover .elementor-widget-container',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_border_radius_hover',\n\t\t\t[\n\t\t\t\t'label' => __( 'Border Radius', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => [ 'px', '%' ],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}}:hover > .elementor-widget-container' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Box_Shadow::get_type(),\n\t\t\t[\n\t\t\t\t'name' => '_box_shadow_hover',\n\t\t\t\t'selector' => '{{WRAPPER}}:hover .elementor-widget-container',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'_border_hover_transition',\n\t\t\t[\n\t\t\t\t'label' => __( 'Transition Duration', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'separator' => 'before',\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'max' => 3,\n\t\t\t\t\t\t'step' => 0.1,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .elementor-widget-container' => 'transition: background {{_background_hover_transition.SIZE}}s, border {{SIZE}}s, border-radius {{SIZE}}s, box-shadow {{SIZE}}s',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->end_controls_tabs();\n\n\t\t$this->end_controls_section();\n\n\t\t$this->start_controls_section(\n\t\t\t'_section_masking',\n\t\t\t[\n\t\t\t\t'label' => __( 'Mask', 'elementor' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_ADVANCED,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'_mask_switch',\n\t\t\t[\n\t\t\t\t'label' => __( 'Mask', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'On', 'elementor' ),\n\t\t\t\t'label_off' => __( 'Off', 'elementor' ),\n\t\t\t\t'default' => '',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control( '_mask_shape', [\n\t\t\t'label' => __( 'Shape', 'elementor' ),\n\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t'options' => $this->get_shapes(),\n\t\t\t'default' => 'circle',\n\t\t\t'selectors' => $this->get_mask_selectors( '-webkit-mask-image: url( ' . ELEMENTOR_ASSETS_URL . '/mask-shapes/{{VALUE}}.svg );' ),\n\t\t\t'condition' => [\n\t\t\t\t'_mask_switch!' => '',\n\t\t\t],\n\t\t] );\n\n\t\t$this->add_control(\n\t\t\t'_mask_image',\n\t\t\t[\n\t\t\t\t'label' => __( 'Image', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::MEDIA,\n\t\t\t\t'media_type' => 'image',\n\t\t\t\t'should_include_svg_inline_option' => true,\n\t\t\t\t'library_type' => 'image/svg+xml',\n\t\t\t\t'dynamic' => [\n\t\t\t\t\t'active' => true,\n\t\t\t\t],\n\t\t\t\t'selectors' => $this->get_mask_selectors( '-webkit-mask-image: url( {{URL}} );' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_mask_switch!' => '',\n\t\t\t\t\t'_mask_shape' => 'custom',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'_mask_notice',\n\t\t\t[\n\t\t\t\t'type' => Controls_Manager::HIDDEN,\n\t\t\t\t'raw' => __( 'Need More Shapes?', 'elementor' ) . '<br>' . sprintf( __( 'Explore additional Premium Shape packs and use them in your site. <a target=\"_blank\" href=\"%s\">Learn More</a>', 'elementor' ), 'https://go.elementor.com/mask-control' ),\n\t\t\t\t'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_mask_switch!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_mask_size',\n\t\t\t[\n\t\t\t\t'label' => __( 'Size', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'options' => [\n\t\t\t\t\t'contain' => __( 'Fit', 'elementor' ),\n\t\t\t\t\t'cover' => __( 'Fill', 'elementor' ),\n\t\t\t\t\t'custom' => __( 'Custom', 'elementor' ),\n\t\t\t\t],\n\t\t\t\t'default' => 'contain',\n\t\t\t\t'selectors' => $this->get_mask_selectors( '-webkit-mask-size: {{VALUE}};' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_mask_switch!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_mask_size_scale',\n\t\t\t[\n\t\t\t\t'label' => __( 'Scale', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => [ 'px', 'em', '%', 'vw' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 500,\n\t\t\t\t\t],\n\t\t\t\t\t'em' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t\t'vw' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'default' => [\n\t\t\t\t\t'unit' => '%',\n\t\t\t\t\t'size' => 100,\n\t\t\t\t],\n\t\t\t\t'selectors' => $this->get_mask_selectors( '-webkit-mask-size: {{SIZE}}{{UNIT}};' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_mask_switch!' => '',\n\t\t\t\t\t'_mask_size' => 'custom',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_mask_position',\n\t\t\t[\n\t\t\t\t'label' => __( 'Position', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'options' => [\n\t\t\t\t\t'center center' => __( 'Center Center', 'elementor' ),\n\t\t\t\t\t'center left' => __( 'Center Left', 'elementor' ),\n\t\t\t\t\t'center right' => __( 'Center Right', 'elementor' ),\n\t\t\t\t\t'top center' => __( 'Top Center', 'elementor' ),\n\t\t\t\t\t'top left' => __( 'Top Left', 'elementor' ),\n\t\t\t\t\t'top right' => __( 'Top Right', 'elementor' ),\n\t\t\t\t\t'bottom center' => __( 'Bottom Center', 'elementor' ),\n\t\t\t\t\t'bottom left' => __( 'Bottom Left', 'elementor' ),\n\t\t\t\t\t'bottom right' => __( 'Bottom Right', 'elementor' ),\n\t\t\t\t\t'custom' => __( 'Custom', 'elementor' ),\n\t\t\t\t],\n\t\t\t\t'default' => 'center center',\n\t\t\t\t'selectors' => $this->get_mask_selectors( '-webkit-mask-position: {{VALUE}};' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_mask_switch!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_mask_position_x',\n\t\t\t[\n\t\t\t\t'label' => __( 'X Position', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => [ 'px', 'em', '%', 'vw' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => -500,\n\t\t\t\t\t\t'max' => 500,\n\t\t\t\t\t],\n\t\t\t\t\t'em' => [\n\t\t\t\t\t\t'min' => -100,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => -100,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t\t'vw' => [\n\t\t\t\t\t\t'min' => -100,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'default' => [\n\t\t\t\t\t'unit' => '%',\n\t\t\t\t\t'size' => 0,\n\t\t\t\t],\n\t\t\t\t'selectors' => $this->get_mask_selectors( '-webkit-mask-position-x: {{SIZE}}{{UNIT}};' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_mask_switch!' => '',\n\t\t\t\t\t'_mask_position' => 'custom',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_mask_position_y',\n\t\t\t[\n\t\t\t\t'label' => __( 'Y Position', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'size_units' => [ 'px', 'em', '%', 'vw' ],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => -500,\n\t\t\t\t\t\t'max' => 500,\n\t\t\t\t\t],\n\t\t\t\t\t'em' => [\n\t\t\t\t\t\t'min' => -100,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => -100,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t\t'vw' => [\n\t\t\t\t\t\t'min' => -100,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'default' => [\n\t\t\t\t\t'unit' => '%',\n\t\t\t\t\t'size' => 0,\n\t\t\t\t],\n\t\t\t\t'selectors' => $this->get_mask_selectors( '-webkit-mask-position-y: {{SIZE}}{{UNIT}};' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_mask_switch!' => '',\n\t\t\t\t\t'_mask_position' => 'custom',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_mask_repeat',\n\t\t\t[\n\t\t\t\t'label' => __( 'Repeat', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'options' => [\n\t\t\t\t\t'no-repeat' => __( 'No-Repeat', 'elementor' ),\n\t\t\t\t\t'repeat' => __( 'Repeat', 'elementor' ),\n\t\t\t\t\t'repeat-x' => __( 'Repeat-X', 'elementor' ),\n\t\t\t\t\t'repeat-Y' => __( 'Repeat-Y', 'elementor' ),\n\t\t\t\t\t'round' => __( 'Round', 'elementor' ),\n\t\t\t\t\t'space' => __( 'Space', 'elementor' ),\n\t\t\t\t],\n\t\t\t\t'default' => 'no-repeat',\n\t\t\t\t'selectors' => $this->get_mask_selectors( '-webkit-mask-repeat: {{VALUE}};' ),\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_mask_switch!' => '',\n\t\t\t\t\t'_mask_size!' => 'cover',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\n\t\t$this->start_controls_section(\n\t\t\t'_section_position',\n\t\t\t[\n\t\t\t\t'label' => __( 'Positioning', 'elementor' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_ADVANCED,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_element_width',\n\t\t\t[\n\t\t\t\t'label' => __( 'Width', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'default' => '',\n\t\t\t\t'options' => [\n\t\t\t\t\t'' => __( 'Default', 'elementor' ),\n\t\t\t\t\t'inherit' => __( 'Full Width', 'elementor' ) . ' (100%)',\n\t\t\t\t\t'auto' => __( 'Inline', 'elementor' ) . ' (auto)',\n\t\t\t\t\t'initial' => __( 'Custom', 'elementor' ),\n\t\t\t\t],\n\t\t\t\t'selectors_dictionary' => [\n\t\t\t\t\t'inherit' => '100%',\n\t\t\t\t],\n\t\t\t\t'prefix_class' => 'elementor-widget%s__width-',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}}' => 'width: {{VALUE}}; max-width: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_element_custom_width',\n\t\t\t[\n\t\t\t\t'label' => __( 'Custom Width', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_element_width' => 'initial',\n\t\t\t\t],\n\t\t\t\t'device_args' => [\n\t\t\t\t\tControls_Stack::RESPONSIVE_TABLET => [\n\t\t\t\t\t\t'condition' => [\n\t\t\t\t\t\t\t'_element_width_tablet' => [ 'initial' ],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t\tControls_Stack::RESPONSIVE_MOBILE => [\n\t\t\t\t\t\t'condition' => [\n\t\t\t\t\t\t\t'_element_width_mobile' => [ 'initial' ],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px', '%', 'vw' ],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}}' => 'width: {{SIZE}}{{UNIT}}; max-width: {{SIZE}}{{UNIT}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_element_vertical_align',\n\t\t\t[\n\t\t\t\t'label' => __( 'Vertical Align', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::CHOOSE,\n\t\t\t\t'options' => [\n\t\t\t\t\t'flex-start' => [\n\t\t\t\t\t\t'title' => __( 'Start', 'elementor' ),\n\t\t\t\t\t\t'icon' => 'eicon-v-align-top',\n\t\t\t\t\t],\n\t\t\t\t\t'center' => [\n\t\t\t\t\t\t'title' => __( 'Center', 'elementor' ),\n\t\t\t\t\t\t'icon' => 'eicon-v-align-middle',\n\t\t\t\t\t],\n\t\t\t\t\t'flex-end' => [\n\t\t\t\t\t\t'title' => __( 'End', 'elementor' ),\n\t\t\t\t\t\t'icon' => 'eicon-v-align-bottom',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_element_width!' => '',\n\t\t\t\t\t'_position' => '',\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}}' => 'align-self: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'_position_description',\n\t\t\t[\n\t\t\t\t'raw' => '<strong>' . __( 'Please note!', 'elementor' ) . '</strong> ' . __( 'Custom positioning is not considered best practice for responsive web design and should not be used too frequently.', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::RAW_HTML,\n\t\t\t\t'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',\n\t\t\t\t'render_type' => 'ui',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_position!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'_position',\n\t\t\t[\n\t\t\t\t'label' => __( 'Position', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'default' => '',\n\t\t\t\t'options' => [\n\t\t\t\t\t'' => __( 'Default', 'elementor' ),\n\t\t\t\t\t'absolute' => __( 'Absolute', 'elementor' ),\n\t\t\t\t\t'fixed' => __( 'Fixed', 'elementor' ),\n\t\t\t\t],\n\t\t\t\t'prefix_class' => 'elementor-',\n\t\t\t\t'frontend_available' => true,\n\t\t\t]\n\t\t);\n\n\t\t$start = is_rtl() ? __( 'Right', 'elementor' ) : __( 'Left', 'elementor' );\n\t\t$end = ! is_rtl() ? __( 'Right', 'elementor' ) : __( 'Left', 'elementor' );\n\n\t\t$this->add_control(\n\t\t\t'_offset_orientation_h',\n\t\t\t[\n\t\t\t\t'label' => __( 'Horizontal Orientation', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::CHOOSE,\n\t\t\t\t'toggle' => false,\n\t\t\t\t'default' => 'start',\n\t\t\t\t'options' => [\n\t\t\t\t\t'start' => [\n\t\t\t\t\t\t'title' => $start,\n\t\t\t\t\t\t'icon' => 'eicon-h-align-left',\n\t\t\t\t\t],\n\t\t\t\t\t'end' => [\n\t\t\t\t\t\t'title' => $end,\n\t\t\t\t\t\t'icon' => 'eicon-h-align-right',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'classes' => 'elementor-control-start-end',\n\t\t\t\t'render_type' => 'ui',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_position!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_offset_x',\n\t\t\t[\n\t\t\t\t'label' => __( 'Offset', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => -1000,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t\t'vw' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t\t'vh' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => '0',\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px', '%', 'vw', 'vh' ],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'body:not(.rtl) {{WRAPPER}}' => 'left: {{SIZE}}{{UNIT}}',\n\t\t\t\t\t'body.rtl {{WRAPPER}}' => 'right: {{SIZE}}{{UNIT}}',\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_offset_orientation_h!' => 'end',\n\t\t\t\t\t'_position!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_offset_x_end',\n\t\t\t[\n\t\t\t\t'label' => __( 'Offset', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => -1000,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t\t'step' => 0.1,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t\t'vw' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t\t'vh' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => '0',\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px', '%', 'vw', 'vh' ],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'body:not(.rtl) {{WRAPPER}}' => 'right: {{SIZE}}{{UNIT}}',\n\t\t\t\t\t'body.rtl {{WRAPPER}}' => 'left: {{SIZE}}{{UNIT}}',\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_offset_orientation_h' => 'end',\n\t\t\t\t\t'_position!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'_offset_orientation_v',\n\t\t\t[\n\t\t\t\t'label' => __( 'Vertical Orientation', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::CHOOSE,\n\t\t\t\t'toggle' => false,\n\t\t\t\t'default' => 'start',\n\t\t\t\t'options' => [\n\t\t\t\t\t'start' => [\n\t\t\t\t\t\t'title' => __( 'Top', 'elementor' ),\n\t\t\t\t\t\t'icon' => 'eicon-v-align-top',\n\t\t\t\t\t],\n\t\t\t\t\t'end' => [\n\t\t\t\t\t\t'title' => __( 'Bottom', 'elementor' ),\n\t\t\t\t\t\t'icon' => 'eicon-v-align-bottom',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'render_type' => 'ui',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_position!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_offset_y',\n\t\t\t[\n\t\t\t\t'label' => __( 'Offset', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => -1000,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t\t'vh' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t\t'vw' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px', '%', 'vh', 'vw' ],\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => '0',\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}}' => 'top: {{SIZE}}{{UNIT}}',\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_offset_orientation_v!' => 'end',\n\t\t\t\t\t'_position!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'_offset_y_end',\n\t\t\t[\n\t\t\t\t'label' => __( 'Offset', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => -1000,\n\t\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t\t'step' => 1,\n\t\t\t\t\t],\n\t\t\t\t\t'%' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t\t'vh' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t\t'vw' => [\n\t\t\t\t\t\t'min' => -200,\n\t\t\t\t\t\t'max' => 200,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'size_units' => [ 'px', '%', 'vh', 'vw' ],\n\t\t\t\t'default' => [\n\t\t\t\t\t'size' => '0',\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}}' => 'bottom: {{SIZE}}{{UNIT}}',\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'_offset_orientation_v' => 'end',\n\t\t\t\t\t'_position!' => '',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\n\t\t$this->start_controls_section(\n\t\t\t'_section_responsive',\n\t\t\t[\n\t\t\t\t'label' => __( 'Responsive', 'elementor' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_ADVANCED,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'responsive_description',\n\t\t\t[\n\t\t\t\t'raw' => __( 'Responsive visibility will take effect only on preview or live page, and not while editing in Elementor.', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::RAW_HTML,\n\t\t\t\t'content_classes' => 'elementor-descriptor',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'hide_desktop',\n\t\t\t[\n\t\t\t\t'label' => __( 'Hide On Desktop', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'default' => '',\n\t\t\t\t'prefix_class' => 'elementor-',\n\t\t\t\t'label_on' => 'Hide',\n\t\t\t\t'label_off' => 'Show',\n\t\t\t\t'return_value' => 'hidden-desktop',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'hide_tablet',\n\t\t\t[\n\t\t\t\t'label' => __( 'Hide On Tablet', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'default' => '',\n\t\t\t\t'prefix_class' => 'elementor-',\n\t\t\t\t'label_on' => 'Hide',\n\t\t\t\t'label_off' => 'Show',\n\t\t\t\t'return_value' => 'hidden-tablet',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'hide_mobile',\n\t\t\t[\n\t\t\t\t'label' => __( 'Hide On Mobile', 'elementor' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'default' => '',\n\t\t\t\t'prefix_class' => 'elementor-',\n\t\t\t\t'label_on' => 'Hide',\n\t\t\t\t'label_off' => 'Show',\n\t\t\t\t'return_value' => 'hidden-phone',\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\n\t\tPlugin::$instance->controls_manager->add_custom_attributes_controls( $this );\n\n\t\tPlugin::$instance->controls_manager->add_custom_css_controls( $this );\n\t}", "public function customize_controls_init()\n {\n }", "function AddControls($controls)\r\n {\r\n $this->Controls = $controls;\r\n }", "public function setVisible($value) {\r\n $this->bVisible = $this->setBooleanProperty($this->bVisible, $value);\r\n }", "public function display() {\n \t\n \tif($this->userCanVisualize()){\n \t\t\n \t\t$e = $this->buildGraph();\n \t\tif($e){\n\t \techo $e->graph->GetHTMLImageMap(\"map\".$this->getId());\n\t \t$this->displayImgTag();\n \t\t}\n \t}\n }", "public function &draw_show_hide_vtab_button($in_tag, $in_value = false,\n $in_moveup = false, $in_movedown = false, $in_delete = true) {\n $text = \"\";\n if (!$this->isShowing($in_tag)) {\n $text .= '<LI class=\"reportico-maintain-verttab-menu-cell-unsel\">';\n $text .= '<a class=\"\" name=\"submit_' . $in_tag . \"_SHOW\" . '\" >';\n $text .= '<input class=\"reportico-maintain-verttab-menu-but-unsel reportico-submit\" type=\"submit\" name=\"submit_' . $in_tag . \"_SHOW\" . '\" value=\"' . $in_value . '\">';\n if ($in_delete) {\n $text .= $this->draw_delete_button($in_tag);\n }\n\n if ($in_moveup) {\n $text .= $this->draw_moveup_button($in_tag);\n }\n\n if ($in_movedown) {\n $text .= $this->draw_movedown_button($in_tag);\n }\n\n $text .= '</a>';\n $text .= '</LI>';\n } else {\n $text .= '<LI class=\"active reportico-maintain-verttab-menu-cell-sel\">';\n $text .= '<a class=\"\" name=\"submit_' . $in_tag . \"_SHOW\" . '\" >';\n $text .= '<input class=\"reportico-maintain-verttab-menu-but-sel reportico-submit\" type=\"submit\" name=\"submit_' . $in_tag . \"_SHOW\" . '\" value=\"' . $in_value . '\">';\n if ($in_delete) {\n $text .= $this->draw_delete_button($in_tag);\n }\n\n if ($in_moveup) {\n $text .= $this->draw_moveup_button($in_tag);\n }\n\n if ($in_movedown) {\n $text .= $this->draw_movedown_button($in_tag);\n }\n\n $text .= '</a>';\n $text .= '</LI>';\n }\n return $text;\n\n }", "public function draw()\n {\n //Skip calculations; dummy result after calculating points\n $points = [\n [\"x\" => '0', \"y\" => '0'],\n [\"x\" => '10', \"y\" => '0'],\n [\"x\" => '0', \"y\" => '10'],\n [\"x\" => '10', \"y\" => '10']\n ];\n\n if ($this->format instanceof \\GraphicEditor\\Formats\\Points) {\n $this->format->addPoints($points);\n }\n }", "protected function renderToggleButton()\n {\n return Button::widget($this->toggleButtonOptions);\n }", "public function addControl(IControl $control): IControl;", "public function Render() {\r\n\t\t\treturn $this->RenderOnOff();\r\n\t\t}", "private function _addBorder()\n {\n if ($this->_isResize() && array_key_exists('border', $this->options) && ($this->options['border'] == 1 || $this->options['border'] == 'true')) {\n $outline_layer = ms_newLayerObj($this->map_obj);\n $outline_layer->set(\"name\", \"outline\");\n $outline_layer->set(\"type\", MS_LAYER_POLYGON);\n $outline_layer->set(\"status\", MS_ON);\n $outline_layer->set(\"transform\", MS_FALSE);\n $outline_layer->set(\"sizeunits\", MS_PIXELS);\n\n // Add new class to new layer\n $outline_class = ms_newClassObj($outline_layer);\n\n // Add new style to new class\n $outline_style = ms_newStyleObj($outline_class);\n $outline_style->outlinecolor->setRGB(0, 0, 0);\n $outline_style->set(\"width\", 3);\n\n $polygon = ms_newShapeObj(MS_SHAPE_POLYGON);\n\n $polyLine = ms_newLineObj();\n $polyLine->addXY(0, 0);\n $polyLine->addXY($this->map_obj->width, 0);\n $polyLine->addXY($this->map_obj->width, $this->map_obj->height);\n $polyLine->addXY(0, $this->map_obj->height);\n $polyLine->addXY(0, 0);\n\n $polygon->add($polyLine);\n $outline_layer->addFeature($polygon);\n }\n }", "protected function register_controls() {\n\n\t\t$this->render_team_member_content_control();\n\t\t$this->register_content_separator();\n\t\t$this->register_content_social_icons_controls();\n\t\t$this->register_helpful_information();\n\n\t\t/* Style */\n\t\t$this->register_style_team_member_image();\n\t\t$this->register_style_team_member_name();\n\t\t$this->register_style_team_member_designation();\n\t\t$this->register_style_team_member_desc();\n\t\t$this->register_style_team_member_icon();\n\t\t$this->register_content_spacing_control();\n\t}", "public function draw($calcPosAxis) {\r\n if ($this->axisDraw==null) {\r\n $this->axisDraw = new AxisDraw($this);\r\n }\r\n\r\n $this->axisDraw->draw($calcPosAxis);\r\n }", "public function setVisible(bool $visible)\n {\n $this->visible = $visible;\n }", "function hidden()\n{\n if(last(request()->segments()) === 'show')\n {\n // if yes, add the style to hide the control\n return \"style=\\\"display:none\\\"\";\n }\n}", "public function register_controls()\n {\n }", "public function lblActive_Create($strControlId = null) {\n\t\t\t$this->lblActive = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblActive->Name = QApplication::Translate('Active');\n\t\t\t$this->lblActive->PreferredRenderMethod = 'RenderWithName';\n\t\t\t$this->lblActive->LinkedNode = QQN::Seccion()->Active;\n\t\t\t$this->lblActive->Text = $this->objSeccion->Active;\n\t\t\treturn $this->lblActive;\n\t\t}", "function LayoverGenerator($id)\r\n\t{\r\n\t\t$this->ID=$id;\r\n\t\t$this->BackgroundColor=\"white\";\r\n\t\t$this->ShowCloseLink=TRUE;\r\n\t}", "public function build_controls()\n {\n $this->add_control( 'id', [\n 'label' => __( 'Post', 'customize-static-layout' ),\n 'type' => 'object_selector',\n 'post_query_vars' => static::get_post_query_vars(),\n 'select2_options' => [\n 'allowClear' => true,\n 'placeholder' => __( '&mdash; Select &mdash;', 'customize-static-layout' ),\n ],\n ], 'CustomizeObjectSelector\\Control' );\n }", "protected function prepend_controls($out = '')\n\t{\n\t\t// Check if we are in 'line' context and if the control div has been added\n\t\tif ($this->line_opened === true && $this->controls_opened === false)\n\t\t{\n\t\t\t$out = '<div class=\"controls\">'.\"\\n\".$out;\n\t\t\t$this->controls_opened = true;\n\t\t}\n\t\treturn $out;\n\t}", "public function setVisibility() {}", "abstract public function openControl($label, $class = '', $attr = '');", "public function draw()\n {\n glBindVertexArray($this->VAO);\n glDrawArrays($this->drawingMode, 0, $this->triangleCount);\n }", "public function getControl()\n\t{\n\t\t$control = parent::getControl();\n\t\t$control->addAttributes(array(\n\t\t\t'id' => $this->getHtmlId(),\n\t\t));\n\t\treturn $control;\n\t}", "public function &draw_show_hide_tab_button($in_tag, $in_value = false)\n {\n\n $text = \"\";\n $in_value = ReporticoLang::templateXlate($in_value);\n\n // Only draw horizontal tab buttons if not mini maintain or they are relevant to tag\n if ($partialMaintain = ReporticoUtility::getRequestItem(\"partialMaintain\", false)) {\n if (preg_match(\"/_ANY$/\", $partialMaintain)) {\n $match1 = preg_replace(\"/_ANY/\", \"\", $partialMaintain);\n $match2 = substr($in_tag, 0, strlen($match1));\n if ($match1 != $match2 || $match1 == $in_tag ) {\n return $text;\n }\n\n } else {\n return $text;\n }\n\n }\n\n if (!$this->isShowing($in_tag)) {\n $text .= '<LI class=\"reportico-maintain-tab-menu-cell-unsel\">';\n $text .= '<a class=\"reportico-maintain-tab-menu-bu1t-unsel reportico-submit\" name=\"submit_' . $in_tag . \"_SHOW\" . '\" >';\n $text .= '<input class=\"reportico-maintain-tab-menu-but-unsel reportico-submit\" type=\"submit\" name=\"submit_' . $in_tag . \"_SHOW\" . '\" value=\"' . $in_value . '\">';\n $text .= '</a>';\n $text .= '</LI>';\n } else {\n $text .= '<LI class=\"active reportico-maintain-tab-menu-cell-sel\">';\n $text .= '<a class=\"reportico-maintain-tab-menu-bu1t-unsel reportico-submit\" name=\"submit_' . $in_tag . \"_SHOW\" . '\" >';\n $text .= '<input class=\"reportico-maintain-tab-menu-but-sel reportico-submit\" type=\"submit\" name=\"submit_' . $in_tag . \"_SHOW\" . '\" value=\"' . $in_value . '\">';\n $text .= '</a>';\n $text .= '</LI>';\n }\n return $text;\n\n }", "function drawButtonPlan() {?>\r\n <button id=\"planButton\" dojoType=\"dijit.form.Button\" showlabel=\"false\"\r\n title=\"<?php echo i18n('buttonPlan');?>\" class=\"buttonIconNewGui detailButton\"\r\n iconClass=\"dijitIcon iconPlanStopped\" >\r\n <script type=\"dojo/connect\" event=\"onClick\" args=\"evt\">\r\n showPlanParam();\r\n return false;\r\n </script>\r\n </button>\r\n<?php \r\n}", "public function display() {\r\n\r\n\t\t$this->echoOptionHeader();\r\n\r\n\t\tprintf( '<input class=\"tf-colorpicker\" type=\"text\" name=\"%s\" id=\"%s\" value=\"%s\" data-default-color=\"%s\" data-custom-width=\"0\" %s/>',\r\n\t\t\tesc_attr( $this->getID() ),\r\n\t\t\tesc_attr( $this->getID() ),\r\n\t\t\tesc_attr( $this->getValue() ),\r\n\t\t\tesc_attr( $this->getValue() ),\r\n\t\t\t! empty( $this->settings['alpha'] ) ? \"data-alpha='true'\" : '' // Used by wp-color-picker-alpha\r\n\t\t);\r\n\r\n\t\t$this->echoOptionFooter();\r\n\t}", "function dumpABSLayout($exclude=array())\r\n {\r\n if ($this->_control!=null)\r\n {\r\n reset($this->_control->controls->items);\r\n while (list($k,$v)=each($this->_control->controls->items))\r\n {\r\n if (!empty($exclude))\r\n {\r\n if (in_array($v->classname(),$exclude))\r\n {\r\n continue;\r\n }\r\n }\r\n $dump=false;\r\n if( $v->Visible && !$v->IsLayer )\r\n {\r\n if( $this->_control->methodExists('getActiveLayer') )\r\n {\r\n $dump = ( (string)$v->Layer == (string)$this->_control->Activelayer );\r\n }\r\n else\r\n {\r\n $dump = true;\r\n }\r\n }\r\n\r\n if ($dump)\r\n {\r\n $left=$v->Left;\r\n $top=$v->Top;\r\n $aw=$v->Width;\r\n $ah=$v->Height;\r\n\r\n $style=\"Z-INDEX: $k; LEFT: \".$left.\"px; WIDTH: \".$aw.\"px; POSITION: absolute; TOP: \".$top.\"px; HEIGHT: \".$ah.\"px\";\r\n\r\n echo \"<div id=\\\"\".$v->_name.\"_outer\\\" style=\\\"$style\\\">\\n\";\r\n $v->show();\r\n echo \"\\n</div>\\n\";\r\n }\r\n }\r\n }\r\n }", "public function showNewClientButton()\n {\n $this->_showNewClientButton = true;\n }", "function _updateDraw()\r\n\t{\r\n\t\t$ut = $this->_ut;\r\n\t\t$dt = $this->_dt;\r\n\r\n\t\t// Get the informations\r\n\t\t$infos = array('draw_id' => kform::getInput(\"drawId\"),\r\n\t\t \t\t'draw_name' => kform::getInput(\"drawName\"),\r\n\t\t \t\t'draw_serial'=> kform::getInput(\"drawSerial\"),\r\n\t\t \t\t'draw_stamp' => kform::getInput(\"drawStamp\"),\r\n 'draw_type' => kform::getInput(\"drawType\"),\r\n 'draw_catage'=> kform::getInput(\"drawCatage\"),\r\n 'draw_numcatage'=> kform::getInput(\"drawNumcatage\"),\n \t\t\t\t'draw_rankdefId' => kform::getInput(\"drawRank\"),\r\n 'draw_disci' => kform::getInput(\"drawDisci\"),\r\n\t\t);\r\n\r\n\t\t// Control the informations\r\n\t\tif ($infos['draw_name'] == \"\")\r\n\t\t{\r\n\t\t\t$infos['errMsg'] = 'draw_name';\r\n\t\t\t$this->_displayFormEditDraw($infos);\r\n\t\t}\n\r\n\t\t// Mise a jour de la definition du tabldeau\r\n\t\t$res = $dt->updateDraw($infos);\r\n\t\tif (is_array($res))\r\n\t\t{\r\n\t\t\t$infos['errMsg'] = $res['errMsg'];\r\n\t\t\t$this->_displayFormEditDraw($infos);\r\n\t\t}\r\n\t\t$page = new utPage('none');\r\n\t\t$page->close();\r\n\t\texit();\r\n\t}", "public function graphicState() {}", "public function lblActive_Create($strControlId = null) {\n\t\t\t$this->lblActive = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblActive->Name = QApplication::Translate('Active');\n\t\t\t$this->lblActive->PreferredRenderMethod = 'RenderWithName';\n\t\t\t$this->lblActive->LinkedNode = QQN::ListaCurso()->Active;\n\t\t\t$this->lblActive->Text = $this->objListaCurso->Active;\n\t\t\treturn $this->lblActive;\n\t\t}", "public function draw(\\SetaPDF_Core_WriteInterface $writer, $stroking = true) {}" ]
[ "0.5348689", "0.5283098", "0.5161275", "0.49148992", "0.47804546", "0.4765552", "0.47641298", "0.47641298", "0.47612262", "0.4706103", "0.46131423", "0.4598237", "0.44832623", "0.44379333", "0.44325125", "0.4385947", "0.43674254", "0.43544593", "0.43535206", "0.43508768", "0.43448323", "0.43281296", "0.42934117", "0.4271563", "0.42692703", "0.42358303", "0.4225929", "0.4225929", "0.42253032", "0.42253032", "0.42253032", "0.4211618", "0.4209682", "0.4180906", "0.41715163", "0.413612", "0.41360995", "0.410024", "0.40990824", "0.40958226", "0.40884814", "0.40727618", "0.4069633", "0.4060063", "0.40503147", "0.40459034", "0.40393543", "0.40386415", "0.40338758", "0.40237096", "0.40203407", "0.4011573", "0.40072948", "0.3989525", "0.3988577", "0.39876908", "0.3976528", "0.3975932", "0.39741305", "0.39702436", "0.39624754", "0.39623204", "0.39606488", "0.395353", "0.39535207", "0.39500564", "0.394447", "0.39444578", "0.39380488", "0.39346868", "0.39320633", "0.3925357", "0.3920896", "0.3914834", "0.39108193", "0.39086235", "0.3908103", "0.38970238", "0.38754132", "0.38731247", "0.38668892", "0.38624686", "0.38570487", "0.38565433", "0.385624", "0.38518572", "0.38451248", "0.38449976", "0.38431096", "0.38418072", "0.38412017", "0.3840616", "0.3839828", "0.3831292", "0.38168502", "0.3815495", "0.38130575", "0.3810208", "0.3808978", "0.38039213" ]
0.5656325
0
Set MySQL system variables for PDO.
public function assign(array $values) { return $values ? $this->withEmulatedStatement(Grammar::assignmentStatement($values), $values) : $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setConn() {\n try {\n // Connect and create the PDO object\n self::$conn = new PDO(\"mysql:host=\".DBHOST.\"; dbname=\".DBNAME, DBUSER, DBPASS);\n\n // Sets to handle the errors in the ERRMODE_EXCEPTION mode\n self::$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n self::$conn->exec('SET character_set_client=\"utf8\",character_set_connection=\"utf8\",character_set_results=\"utf8\";'); // Sets encoding UTF-8\n \n }\n catch(PDOException $e) {\n $this->eror = 'Unable to connect to MySQL: '. $e->getMessage();\n }\n }", "static function set_pdo () {\n\t\tself::$pdo = new PDO(APP_DATABASE_DRIVER.':host='.APP_DATABASE_HOST.';port='.APP_DATABASE_PORT.';dbname='.APP_DATABASE_NAME, APP_DATABASE_USERNAME, APP_DATABASE_PASSWORD);\n\t\tself::$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\tself::$pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);\n\t}", "private function setConnection() {\n if( $this->_connection ) { # prevent creation of additional connection\n $this->_connection;\n }\n $db_dsn = \"mysql:host=\".$this->db_host.\";port=\".$this->db_port.\";dbname=\".$this->db_name.\";charset=\".$this->db_char;\n $this->_connection = new PDO($db_dsn,$this->db_user,$this->db_pass,$this->db_opts);\n }", "private function __construct()\n {\n try {\n $this->_pdo = new PDO(\"mysql:host=\" . HOST . \";dbname=\" . DB, USER, PASS);\n $this->_pdo->exec(\"set names \" . CHARSET);\n } catch(PDOException $e) {\n die($e->getMessage());\n }\n }", "private function setConnection(){\n try {\n $this->connection = new PDO('mysql:host='.self::HOST.';dbname='.self::NAME.';', self::USER, self::PASS);\n $this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch (PDOException $e) {\n die('ERROR: '.$e->getMessage());\n }\n }", "static private function init()\n {\n\t\tself::$_mysqlErrorInfo = NULL;\n\t\t\n try\n {\n self::$_dbh = new PDO('mysql:host='.DBHOST.';dbname='.DBNAME, DBUSERNAME, DBPASSWORD);\n }\n catch( PDOException $e )\n {\n throw new PDOException(\"Database::init() error: \" . $e);\n }\n }", "private function configure()\n {\n\n $QryStr = \"SELECT SENDER, PORT,HOST, USER_ID,PASSWRD, EMAIL FROM SYSSETTINGS\";\n try {\n $stmt = $this->dbh->dbConn->prepare($QryStr);\n $stmt->execute();\n\n $result = $stmt->fetch(\\PDO::FETCH_OBJ);\n\n $this->sender = $result->sender;\n $this->port = $result->port;\n $this->host = $result->host;\n $this->user_id = $result->user_id;\n $this->password = $result->password;\n $this->sender_mail = $result->email;\n } catch (\\PDOException $ex) {\n $ex->getMessage();\n }\n }", "protected function setConnection () : void\n {\n $this->connection = new PDO(\"mysql:host=\" . $this->db_host, $this->db_user, $this->db_password , self::PDO_OPTIONS);\n }", "private function __construct()\n { \n $host = getenv('DB_HOST');\n $port = getenv('DB_PORT');\n $db = getenv('DB_DATABASE');\n $user = getenv('DB_USERNAME');\n $pass = getenv('DB_PASSWORD');\n\n try {\n $this->_pdo = new \\PDO(\n \"mysql:host=$host;port=$port;charset=utf8mb4;dbname=$db\",\n $user,\n $pass\n );\n // $this->_pdo->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n // $this->_pdo->setAttribute(\\PDO::ATTR_EMULATE_PREPARES, false);\n } catch (\\PDOException $e) {\n exit($e->getMessage());\n die();\n\n }\n\n\n }", "public function setDatabaseConfig()\n {\n $this->_databaseConfig = Core_Model_Config_Json::getModulesDatabaseConfig();\n\n $this->_type = $this->_databaseConfig['type'];\n $this->_host = $this->_databaseConfig['host'];\n $this->_name = $this->_databaseConfig['name'];\n $this->_user = $this->_databaseConfig['user'];\n $this->_pass = $this->_databaseConfig['pass'];\n }", "function __construct() {\n $this->db = new PDO('mysql:host='. getenv('IP') . ';dbname=blog', getenv('C9_USER'), ''); \n }", "public function setDatabaseConfiguration()\n\t{\n\t\tglobal $wpdb;\n $this->app['config']->set([\n 'database.connections.mysql' => [\n \t\t\t'driver' => 'mysql',\n \t\t\t'host' => DB_HOST,\n \t\t\t'database' => DB_NAME,\n \t\t\t'username' => DB_USER,\n \t\t\t'password' => DB_PASSWORD,\n \t\t\t'charset' => $wpdb->charset,\n \t\t\t'collation' => $wpdb->collate,\n \t\t\t'prefix' => $wpdb->prefix,\n \t\t\t'timezone' => '+00:00',\n \t\t\t'strict' => false,\n \t\t]\n ]);\n\t}", "protected function setupDatabaseConnection()\n {\n $db = DBConnection::getInstance($this->config);\n\n $enc = property_exists($this->config, 'dbEncoding') ? $this->config->dbEncoding : 'utf8';\n $tz = property_exists($this->config, 'dbTimezone') ? $this->config->dbTimezone : '00:00';\n\n $db->query(\n sprintf('SET NAMES \"%s\"', $enc)\n );\n\n $db->query(\n sprintf('SET time_zone = \"%s\"', $tz)\n );\n }", "static function initMySQL()\n {\n require_once \"system/3d-party/DBSimple/Generic.php\" ;\n self::$sql = DbSimple_Generic::connect('mysql://'.self::$config['db']['user'].':'.self::$config['db']['password'].'@'.self::$config['db']['server'].'/'.self::$config['db']['database']);\n self::$sql->setIdentPrefix(self::$config['db']['table_prefix'].\"_\");\n self::$sql->setErrorHandler(array('Core', 'databaseErrorHandler'));\n\n mysql_set_charset(\"utf8\") or trigger_error(\"An error occurred when specifying the encoding for MySQL\", E_USER_WARNING);\n define('TABLE_PREFIX', self::$config['db']['table_prefix'].\"_\");\n }", "protected function setupPdoQueries()\n {\n $this->conf['select-user'] = sprintf('\n\t\t\tSELECT username as user, name, email as mail, password as hash, id as uid\n\t\t\tFROM %s WHERE username = :user',\n $this->getTableName('users'));\n\n $this->conf['select-user-groups'] = sprintf('\n\t\t\tSELECT title as `group` FROM %s as groups\n\t\t\tLEFT JOIN %s as groupmap ON groups.id = groupmap.group_id\n\t\t\tLEFT JOIN %s as user ON groupmap.user_id = user.id\n\t\t\tWHERE user.username = :user OR user.id = :uid ',\n $this->getTableName('usergroups'),\n $this->getTableName('user_usergroup_map'),\n $this->getTableName('users'));\n\n $this->conf['select-groups'] = sprintf('\n\t\t\tSELECT title as `group`, id as gid FROM %s',\n $this->getTableName('usergroups'));\n }", "function setDBHost($host,$user,$dbpwd)\n {\n $this->dbhost = $host;\n $this->dbuser = $user;\n $this->dbpwd = $dbpwd;\n }", "function dbSetVars() {\n\n foreach ($this->fields() as $f) {\n if ($this->$f === false) continue;\n $this->db->set($f,$this->$f);\n }\n\n }", "private function __construct(){\r\n\t\ttry{\r\n\t\t\t//self::$dbh = new PDO(\"mysql:host=\".Config::HOST_DB.\";dbname=\".Config::NAME_DB.\";charset=utf8;\", Config::LOGIN_DB, Config::PASS_DB);\r\n\t\t\tself::$dbh = new PDO(\"mysql:unix_socket=/var/lib/mysql/mysql.sock;dbname=\".Config::NAME_DB.\";charset=utf8;\", Config::LOGIN_DB, Config::PASS_DB);\r\n\t\t\tif(Constant::CURRENT_MODE == Constant::DEBUG_MODE){\r\n\t\t\t\tself::$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t\t\t}\r\n\t\t}catch(\\PDOException $e){\r\n\t\t\t//self::$dbh = new PDO(\"mysql:host=\".Config::HOST_DB.\";dbname=\".Config::NAME_DB.\";charset=utf8;\", Config::LOGIN_DB, Config::PASS_DB);\r\n\t\t\tself::$dbh = new PDO(\"mysql:unix_socket=/var/lib/mysql/mysql.sock;dbname=\".Config::NAME_DB.\";charset=utf8;\", Config::LOGIN_DB, Config::PASS_DB);\r\n\t\t\tif(Constant::CURRENT_MODE == Constant::DEBUG_MODE){\r\n\t\t\t\tself::$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t}", "protected function setupPdoConfig()\n {\n require_once $this->joinPaths($this->joomlaPath, 'configuration.php');\n\n $this->joomlaConfig = new JConfig;\n $this->joomlaConfig->dbtype = str_replace('mysqli', 'mysql', $this->joomlaConfig->dbtype);\n $this->conf['dsn'] = sprintf('%s:dbname=%s;host=%s', $this->joomlaConfig->dbtype, $this->joomlaConfig->db, $this->joomlaConfig->host);\n $this->conf['user'] = $this->joomlaConfig->user;\n $this->conf['pass'] = $this->joomlaConfig->password;\n\n $this->setupPdoQueries();\n }", "function __construct() {\n\t\t$this->dsn = \"mysql:host=\". DB_SERVER . \";dbname=\" . DB_NAME . \";charset=\" . DB_CHAR;\n\t\n\t $this->opt = [\n\t PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,\n\t PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,\n\t PDO::ATTR_EMULATE_PREPARES => false,\n\t ];\n\t\t$this->openConnection();\n\t}", "protected function set_db_users(): void\n {\n $this->Root = $this->connexion('root', '');\n }", "function __construct()\n {\n //$this->log->debug(\"Core: Loading...\");\n $this->dsn = \"mysql:host=\".getenv('dbHost').\";dbname=\".getenv('dbDatabase').\";charset=utf8\";\n $opt = [\n \\PDO::ATTR_ERRMODE => \\PDO::ERRMODE_EXCEPTION,\n \\PDO::ATTR_DEFAULT_FETCH_MODE => \\PDO::FETCH_ASSOC,\n \\PDO::ATTR_EMULATE_PREPARES => false,\n ];\n $this->pdo = new \\PDO($this->dsn, getenv('dbUser'), getenv('dbPass'), $opt);\n var_dump($this->pdo->exec(\"SELECT VERSION();\"));\n }", "public function connect() {\n// Only one init command can be issued (see http://bugs.php.net/bug.php?id=48859)\n $this->_driver_options[\\PDO::MYSQL_ATTR_INIT_COMMAND] = 'set session sql_mode=\"STRICT_ALL_TABLES\"';\n\n parent::connect();\n }", "protected function CustomVariables ()\r\n\t{\r\n\t\t// Overwrite variables if you want them custom\r\n\t\t$this->Set ('autoload', true);\r\n\t\t$this->Set ('enable_query_strings', false);\r\n\t\t\r\n\t\t// Add your own variables\r\n\t\t$this->Set ('database_host', 'localhost');\r\n\t\t$this->Set ('database_user', 'database_username');\r\n\t\t$this->Set ('database_pass', 'database_password');\r\n\t\t$this->Set ('database_name', 'database_name');\r\n\t\t$this->Set ('database_prefix', 'database_prefix');\r\n\t}", "function db_init(){\n\t\t$SOURCE = $GLOBALS['SOURCE'];\n\t\ttry {\n\t\t\t$pdo = new PDO('mysql:host=' . \n\t\t\t\t$SOURCE['host'] . ';dbname=' .\n\t\t\t\t$SOURCE['dbname'],\n\t\t\t\t$SOURCE['username'] ,\n\t\t\t\t$SOURCE['password']\n\t\t\t\t);\n\n\n\t\t\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t\t$pdo->exec('SET NAMES \"utf8\"');\n\n\t\t\treturn $pdo;\n\n\t\t} catch (PDOException $e){\n\t\t\tlogging($_SERVER['PHP_SELF'] . \", 138\" . \", \" . $e->getMessage() . \", \" . date(\"Y-m-d\") . \" \" . date(\"h:i:sa\"));\n\t\t\treturn;\n\t\t}\n\t}", "function pdoe_mysql_test_db_credentials() {\n\treturn array( \n\t\t'user' => 'pdoe', \n\t\t'password' => 'moomoo', \n\t\t'host' => 'localhost', \n\t\t'database' => 'pdoe_test'\n\t);\n}", "private function setup_db_variables() {\n\t\tglobal $wpdb;\n\t\t$this::$dbtable = $wpdb->prefix . self::DBTABLE;\n\t\t$this::$dbtable_contexts = $wpdb->prefix . self::DBTABLE_CONTEXTS;\n\n\t\t/**\n\t\t * Filter db table used for simple history events\n\t\t *\n\t\t * @since 2.0\n\t\t *\n\t\t * @param string $db_table\n\t\t */\n\t\t$this::$dbtable = apply_filters( 'simple_history/db_table', $this::$dbtable );\n\n\t\t/**\n\t\t * Filter table name for contexts.\n\t\t *\n\t\t * @since 2.0\n\t\t *\n\t\t * @param string $db_table_contexts\n\t\t */\n\t\t$this::$dbtable_contexts = apply_filters(\n\t\t\t'simple_history/logger_db_table_contexts',\n\t\t\t$this::$dbtable_contexts\n\t\t);\n\t}", "private function setupDatabasePort()\n\t{\n\t\t$db_hostname = $this->userdata['db_hostname'];\n\n\t\tif (strpos($db_hostname, ':') !== FALSE)\n\t\t{\n\t\t\tlist($hostname, $port) = explode(':', $db_hostname);\n\n\t\t\t$this->userdata['db_hostname'] = $hostname;\n\t\t\t$this->userdata['db_port'] = $port;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->userdata['db_port'] = NULL;\n\t\t}\n\t}", "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}", "private function __construct(){\n try{\n $this->_pdo=new PDO(\"mysql:host=\".config::get(\"mysql/host\").\";dbname=\".config::get(\"mysql/db\"),config::get(\"mysql/username\"),config::get(\"mysql/password\"));\n\n\n\n } catch(PDOException $e){\n echo $e->getMessage();\n die();\n }\n\n\n }", "function setConnectionInfo( $connString, $user, $password ) {\n $pdo = new PDO($connString,$user,$password);\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n return $pdo;\n}", "function set_db(){\r\n\t\t$this->db=$this->db;\r\n\t}", "private function __construct()\n\t{\n\t $this->DBH = new PDO(\"mysql:host=\".HOSTNAME.\";dbname=\".DBNAME, USERNAME, PASSWORD);\n\t}", "protected function setUp()\n\t{\n\t\t$this->username = getenv('DBUSER') ? getenv('DBUSER') : NULL;\n\t\t$this->password = getenv('DBPASS') ? getenv('DBPASS') : NULL;\n\t\tparent::setUp();\n\t}", "private function setDatabase()\n {\n $parentVars = get_class_vars(get_class($this));\n\n if (isset($parentVars['database']) && !empty($parentVars['database'])) {\n $this->database = $parentVars['database'];\n }\n }", "private function __construct() {\n \t$this->user = getenv('MYSQL_ROOT_USER');\n \t$this->dbname = getenv('MYSQL_DATABASE');\n \t$this->password = getenv('MYSQL_ROOT_PASSWORD');\n \t$this->dsn = \"mysql:dbname={$this->dbname};host=docker_db_1\";\n\n try {\n $this->dbh = new PDO($this->dsn, $this->user, $this->password);\n } catch (PDOException $e) {\n echo 'Connection failed: ' . $e->getMessage();\n }\n }", "private function __construct()\n {\n $dsn = 'mysql:host=' . Config::read('db.host') .\n ';dbname=' . Config::read('db.basename') .\n ';charset=utf8';\n\n $user \t\t= Config::read('db.user');\n $password \t= Config::read('db.password');\n\n $this->dbh \t= new PDO($dsn, $user, $password);\n }", "function pdo_connect_mysql() {\n $DATABASE_HOST = 'localhost';\n $DATABASE_USER = 'debian-sys-maint';\n $DATABASE_PASS = 'eFNR3NF0agmjziwT';\n $DATABASE_NAME = 'vote';\n try {\n \treturn new PDO('mysql:host=' . $DATABASE_HOST . ';dbname=' . $DATABASE_NAME . ';charset=utf8', $DATABASE_USER, $DATABASE_PASS);\n } catch (PDOException $exception) {\n \t// If there is an error with the connection, stop the script and display the error.\n \tdie ('Failed to connect to database!');\n }\n}", "function DbInit(&$Host, &$Database, &$User, &$Password)\n\t{\n \t\t$Host = \"localhost\";\t\t// Hostname of our MySQL server.\n \t\t$Database = \"phpmysqlsite\";\t\t// Logical database name on that server.\n \t\t$User = \"phpuser\";\t\t\t// User und Password for database access.\n\t\t$Password = \"phppass\";\n\t}", "function set_up_database()\r\n{\r\n\tglobal $mydb;\r\n\t$mydb = new database_derbytest();\r\n\t\r\n\t// set up the PDO object\r\n\tglobal $myPDO;\r\n\t$myPDO = new PDO(\"mysql:dbname=\" . DATABASE_NAME . \";host=\" . DATABASE_HOST, DATABASE_USERNAME, DATABASE_PASSWORD);\r\n\r\n}", "private function initConnection() {\n\t\ttry {\n\t\t\t$this->m_Connection = new PDO(\"mysql:host=\".$this->m_DbHost.\";dbname=\".$this->m_DbName, $this->m_DbUserName, $this->m_DbPassword);\n\t\t\t$this->m_Connection-> exec(\"SET NAMES 'utf8';\");\n\t\t\t$this->m_Connection-> setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);\n\t\t\t$this->m_Connection-> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t\t$this->m_Connection-> setAttribute(PDO::ATTR_EMULATE_PREPARES, 1);\n\t\t\t$this->m_Connection-> setAttribute(PDO::ATTR_FETCH_TABLE_NAMES, true);\n\t\t\t\n\t\t} catch(PDOException $e) {\n\t\t\t$this->m_Response->SetMsg(\"ERROR, Could not connect to DB: \".$e->getMessage());\n\t\t\t$this->m_Response->SetFlag(false);\n\t\t\t$this->m_Response->SetData($e);\n\t\t\texit();\n\t\t}\t\t\n\t}", "private function init($host, $database, $userName, $password) {\n try {\n $this->connection = new PDO(\"mysql:host=$host;dbname=$database\", $userName, $password, array(PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES utf8\"));\n \n $this->prepareStatements();\n } catch(PDOException $e) {\n echo \"Connection failed: \" . $e->getMessage();\n }\n }", "function setDatabase() {\n $db = new PDO(\"mysql:dbname=hw7;host=localhost;charset=utf8\", \"root\", \"\");\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n return ($db);\n }", "private function __construct()\n {\n $this->conn = new PDO(\"mysql:host={$this->host};\n dbname={$this->name}\", $this->user,$this->pass, $this->opt);\n }", "protected function _readDbConfig()\n {\n $this->_host = Config::DB_HOST;\n $this->_user = Config::DB_USER;\n $this->_password = Config::DB_PASS;\n $this->_dbName = Config::DB_NAME;\n }", "function sql_connect($options = array()) {\n\t\n\tif( ($sql = var_get('sql/dbConnection')) !== null ){\n\t\treturn $sql;\n\t}\n\n\n\t$options = array_merge(array(\n\t\t'host' => '127.0.0.1',\n\t\t'db' => '',\n\t\t'user' => 'root',\n\t\t'pass' => '',\n\t\t'charset' => 'utf8'\n\t), $options);\n\n\t\n\ttry {\n\t\t$sql = new PDO('mysql:host='.$options['host'].';dbname='.$options['db'], $options['user'], $options['pass']);\n\t}catch (Exception $e){\n\t\treturn false;\n\t}\n\n\tvar_set('sql/options', $options);\n\tvar_set('sql/dbConnection', $sql);\n\t\n\tif( $options['charset'] == 'utf8'){\n\t\tsql_dump($query = 'SET NAMES ' . $options['charset'] . ';');\n\t\t$sql->exec($query);\n\t}\n\n\tsql_dump($query = 'SET CHARACTER SET ' . $options['charset'] . ';');\n\t$sql->exec($query);\n\n\tsql_dump($query = 'USE ' . $options['db'] . ';');\n\t$sql->exec($query);\n\n\t$sql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t$sql->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);\t\n\t$sql->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);\n\n\treturn $sql;\n}", "public static function setSsl() {\n $attr = conf::getMainIni('mysql_attr');\n if (isset($attr['mysql_attr'])) {\n self::$dbh->setAttribute(PDO::MYSQL_ATTR_SSL_KEY, $attr['ssl_key']);\n self::$dbh->setAttribute(PDO::MYSQL_ATTR_SSL_CERT, $attr['ssl_cert']);\n self::$dbh->setAttribute(PDO::MYSQL_ATTR_SSL_CA, $attr['ssl_ca']);\n }\n }", "public function __construct() {\n// $this->dbconn = new PDO($dbURI, $_ENV['USER'], $_ENV['PASS']);\n\n $dbURI = 'mysql:host=' . 'localhost'.';port=3307;dbname=' . 'proj2';\n $this->dbconn = new PDO($dbURI, 'root', '');\n $this->dbconn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n }", "public function __construct()\n {\n $this->pdo = new PDO('mysql:host=' . HOST_NAME . ';dbname=' . DB_NAME, USER_NAME, DB_PASSWORD);\n }", "public function __construct() {\n// $this->dbconn = new PDO($dbURI, $_ENV['USER'], $_ENV['PASS']);\n\n $dbURI = 'mysql:host=' . 'localhost'.';port=3307;dbname=' . 'proj2';\n $this->dbconn = new PDO($dbURI, 'root', '');\n $this->dbconn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n }", "public function __construct() {\n// $this->dbconn = new PDO($dbURI, $_ENV['USER'], $_ENV['PASS']);\n\n $dbURI = 'mysql:host=' . 'localhost'.';port=3307;dbname=' . 'proj2';\n $this->dbconn = new PDO($dbURI, 'root', '');\n $this->dbconn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n }", "function myDBConnect() {\r\n define(\"DB_HOST\", \"localhost\");\r\n define(\"DB_USERNAME\", \"mysqluser\");\r\n define(\"DB_PASSWORD\", \"mysqlpassword\");\r\n define(\"DB\", \"ISGB24\");\r\n\r\n return new PDO(\r\n 'mysql:host=' . DB_HOST . ';dbname=' . DB,\r\n DB_USERNAME,\r\n DB_PASSWORD,\r\n array(\r\n PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,\r\n PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,\r\n PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES 'utf8'\"\r\n )\r\n );\r\n}", "public function setMySqlCredentials($host, $user, $pass, $db) {\n $this->host = $host;\n $this->user = $user;\n $this->pass = $pass;\n $this->db = $db;\n }", "private function __construct() {\n try {\n $this->_pdo = new PDO(Config::get('mysql/dsn'), Config::get('mysql/user'), Config::get('mysql/pass'), Config::get('mysql/opt')); \n } catch(PODExeception $e) {\n die($e->getMessage());\n }\n }", "function mysql () {\n\t/* public: connection parameters */\n\t\t$this->connect();\n\t}", "function db_setup()\n\t{\n\t\t$connection=mysql_pconnect(\"localhost\",\"xdf\",\"xdf379\");\n\t\tmysql_select_db(\"xdf\",$connection);\n\t\treturn $connection;\n\t}", "function DBConfiguraion()\n\t{\n\t\tglobal $dbhost,$dbmain,$dbuser,$dbpwd;//these variables comes from \"mainconfig.php\" which is in www folder\n\t\t//print\"$dbmain,$dbuser,$dbpwd\";\n\t\t//initialize the database_server\n\t\t$this->database_server = $dbhost;\n\t\t//initialize the database_password \n\t\t$this->database_password = $dbpwd;\n\t\t//initialize the database_user \n\t\t$this->database_user = $dbuser;\n\t\t//initialize the database_name \n\t\t$this->database_name = $dbmain;\n\t}", "private function init(){\n //initialize the connection\n try {\n $this->CONNECTION = new \\PDO(\"mysql:host=$this->ADDRESS;dbname=$this->DATABASE\", $this->USER, $this->PASSWORD);\n if($this->DEBUG)\n $this->CONNECTION->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n else\n $this->CONNECTION->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_SILENT);\n } catch(\\PDOException $e) {\n \\bmca\\exception\\Handler::fatalException('ERROR: ' . $e->getMessage());\n }\n\n $this->initialized = true;\n }", "public function setPdo($dsn, $user = null, $password = null, array $options = array()) {\r\n\t\t$this->setDsn($dsn);\r\n\t\t$this->setUser($user);\r\n\t\t$this->setPassword($password);\r\n\t\t$this->setOptions($options);\r\n\r\n\t\t$this->pdo = new NativePdo($dsn, $user, $password, $options);\r\n\r\n\t\t//always throw exception\r\n\t\t$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\r\n\t\t//use custom pdo statement class\r\n\t\t$this->pdo->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('\\k\\db\\PdoStatement', array($this)));\r\n\t}", "function setDBMS($dbms)\r\n\t{\r\n\t\tif ($this->state == self::CONNECTION_CLOSED || $this->state== self::UNPREPARED)\r\n\t\t{\r\n\t\t\t//se houver caracteres inválidos: retorna erro\r\n\t\t\tif (strlen($dbms) != strcspn($dbms,$this->wrongChars))\r\n\t\t\t{\r\n\t\t\t\ttrigger_error (\"Error: invalid char in setDbms() parameter\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t$dbms = strtolower($dbms);\r\n\r\n\t\t\tswitch ($dbms)\r\n\t\t\t{\r\n\t\t\t\tcase 'mysql':\r\n\t\t\t\tcase 'mysqli':\r\n\t\t\t\t\t$this->dbms = \"MySQL\";\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'pgsql':\r\n\t\t\t\tcase 'postgree':\r\n\t\t\t\tcase 'postgres':\r\n\t\t\t\tcase 'postgre':\r\n\t\t\t\tcase 'postgresql':\r\n\t\t\t\t\t\t$this->dbms = \"PgSQL\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'mssql':\r\n\t\t\t\tcase 'sqlserver':\r\n\t\t\t\t\t\t$this->dbms = \"MSSQL\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\ttrigger_error(\"Error: Not compatible DataBaze in ConnectionString parameter.\\nPlease use MYSQLI, POSTGRES or MSSQL DataBaze\", E_USER_ERROR);\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t$nameDriver = $this->dbms.\"Driver\";\r\n\t\t\t$this->dbDriver = new $nameDriver();\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\ttrigger_error (\"Error: it has an open connection\");\r\n\t\treturn false;\r\n\t}", "private function initDB(){\n $sql = \"\n CREATE SCHEMA IF NOT EXISTS `\".$this->_database.\"` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;\n USE `\".$this->_database.\"` ;\n \";\n try {\n $dbh = new PDO(\"mysql:host=$this->_host\", $this->_username, $this->_password,array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));\n $dbh->exec($sql)\n or die(print_r($dbh->errorInfo(), true));\n } catch (PDOException $e) {\n $err_data = array('stmt'=>'on init');\n Helper_Error::setError( Helper_Error::ERROR_TYPE_DB , $e->getMessage() , $err_data , $e->getCode() );\n die(\"DB init ERROR: \". $e->getMessage());\n }\n }", "function __construct()\n {\n $this->_dbh = new PDO(\"mysql:host=hostname;dbname=your_database_name\", \"username\", \"password\");\n }", "private static function initDatabase() {\n\t\t\tif (self::Config('use_db')) {\n\t\t\t\t$host = self::Config('mysql_host');\n\t\t\t\t$user = self::Config('mysql_user');\n\t\t\t\t$pass = self::Config('mysql_password');\n\t\t\t\t$name = self::Config('mysql_dbname');\n\t\t\t\tDBManager::init($host, $user, $pass, $name);\n\t\t\t}\n\t\t}", "function getPDO() \n\t{\n\t $host = DB_SERVER;\n\t $dbname = DB_DATABASE;\n\t $port = DB_PORT;\n\t $connStr = \"mysql:host={$host};dbname={$dbname};port={$port}\";\n\t $dbOpt = array(\n\t PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES 'utf8'\"\n );\n\n \treturn new PDO($connStr, DB_USER, DB_PASSWORD, $dbOpt);\n\t}", "static function startConnection(): void{\n\n self::$pdo = new PDO(DSN, USERNAME, PSW,[PDO::ATTR_PERSISTENT=>true]);\n self::$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n}", "private function __set_global()\n {\n $this->__db->setAsGlobal();\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 }", "function setDatabaseConnection($host,$database,$user,$pass);", "function MySQL($options=array()){\n\t\t// validate incoming parameters\n\t\tif(count($options)<1){\n trigger_error('No connection parameters were provided');\n exit();\n }\n\t\tforeach($options as $parameter=>$value){\n if(!$parameter||!$value){\n trigger_error('Invalid connection parameter');\n exit();\n }\n $this->{$parameter}=$value;\n\t\t}\n\t\t// connect to MySQL\n\t\t$this->connectDB();\n\t}", "private function connectPdo() {\r\n\t\t$this -> link = new PDO('mysql:host=' . $this -> host . ';dbname=' . $this -> base, $this -> user, $this -> pass);\r\n\t\t$this -> link -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t}", "function dbh_bind( $dbh ) {\n $GLOBALS['orm_dbh'] = $dbh;\n}", "function pdo_connect_mysql($host, $dbname, $username = null, $password = null, array $driver_options = array())\n {\n return pdo_connect(\"mysql:host={$host};dbname={$dbname}\", $username, $password, $driver_options);\n }", "public function __construct()\n {\n $this->db = new PDO(DB_INFO,DB_USER,DB_PASS);\n }", "public function DBDriver()\n\t{\n\t\t$_SESSION['queries'] = 0; // for DEBUG ONLY and to be removed or handled more priopriate way!\n\t\t$this->loadDBProperties();\n\t\t$this->connect();\n\t}", "public function set_db()\n{\n $this->_db =new PDO('mysql:host=localhost;dbname=pet_net;charset=utf8','lauhu','stagiaire '); ;\n\n return $this;\n}", "private function __construct()\r\n {\r\n $this->conn = new PDO(\r\n \"mysql:host={$this->host};\r\n dbname={$this->name}\",\r\n $this->user,\r\n $this->pass,\r\n array(PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES 'utf8'\")\r\n );\r\n $this->conn->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);\r\n $this->conn->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\r\n $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n }", "private function __construct(){\n try{\n $this->_pdo = new PDO('mysql:host='.Config::get('mysql/host').';dbname='. Config::get('mysql/db'), Config::get('mysql/username'),Config::get('mysql/password'));\n //echo 'connected';\n }catch(PDOException $e){\n die($e->getMessage());\n }\n }", "public function __construct()\n {\n\n if (is_file(\".dev\")) {\n //if.env go dev\n $ary = parse_ini_file('.dev', TRUE);\n $this->flg = \"dev\";\n\n } else {\n #live\n $ary = parse_ini_file('.live', TRUE);\n $this->flg = \"live\";\n }\n\n $dbhost = $ary['db']['dbhost'];\n $dbuser = $ary['db']['dbuser'];\n $dbpwd = $ary ['db']['dbpass'];\n $deselect = $ary ['db']['dbselect'];\n $dbconnect = \"mysql:host=\" . $dbhost . \";dbname=\" . $deselect;\n\n try {\n $this->pdo = new PDO($dbconnect, $dbuser, $dbpwd, array(PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES utf8\", PDO::MYSQL_ATTR_LOCAL_INFILE => TRUE));\n } catch (PDOException $e) {\n\n echo \"Connection failed: \" . $e->getMessage();\n }\n }", "function initDb()\n {\n global $database_host, $database_name, $database_user,$database_pass;\n\n $global=Frd::getGlobal();\n\n $db_config=array(\n 'host'=>$database_host,\n 'username'=>$database_user,\n 'password'=>$database_pass,\n 'dbname'=>$database_name\n );\n\n $db = Zend_Db::factory('pdo_mysql',$db_config);\n $db->query('set names utf8');\n Zend_Db_Table::setDefaultAdapter($db);\n $global->db=$db;\n\n $registry = Zend_Registry::getInstance();\n $registry->set(\"db_default\",$global->db);\n }", "public function __construct(){\n $this->dbh = new PDO('mysql:dbname=test;host=localhost','root','admin');\n\n }", "protected function init()\n {\n $pdoConfig = $this->config->get('pdo.pdo');\n try {\n $pdo = new \\PDO(\n $pdoConfig['dns'],\n $pdoConfig['username'],\n $pdoConfig['password'],\n $pdoConfig['options']\n );\n if (ENV === ApplicationInterface::APPLICATION_ENV_DEV) {\n $pdo->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n }\n else {\n $pdo->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_WARNING);\n }\n\n $pdo->query('set character set cp1251');\n $pdo->query('set character_set_client=\\'cp1251\\'');\n $pdo->query('set names cp1251');\n }\n catch (\\PDOException $e) {\n throw new PdoStorageException('Unable to connect to pdo database', 0, $e);\n }\n\n $queryBuilder = new \\FluentPDO($pdo);\n if (ENV === ApplicationInterface::APPLICATION_ENV_DEV) {\n $queryBuilder->debug = array($this, 'dispatchQueryEvent');\n }\n $this->queryBuilder = $queryBuilder;\n }", "function DB() {\r\n \t\t$this->dbh = new Mysql_db;\r\n\t}", "protected function setUp() {\n\t\t$dsn = 'mysql:dbname=test;host=127.0.0.1';\n\t\t$user = 'root';\n\t\t$pass = '';\n\n\t\t$this->pdo = new PDO($dsn,$user,$pass);\n\t\t$this->profiler = new Profiler($this->pdo, 0, 0);\n\t}", "function __construct() {\n $this->data['driver'] = 'mysql';\n $this->data['host'] = \"localhost\";\n $this->data['dbname'] = 'mydb';\n $this->data['username'] = 'root';\n $this->data['password'] = '';\n }", "private function mysqlConnect($dbname){\n\t\ttry { \n\t \t$this->dbh = new \\PDO(\n\t \t\t'mysql:host=' . $this->config[$dbname]['host'] . ';dbname=' . $this->config[$dbname]['db'],\n\t \t\t $this->config[$dbname]['user'], \n\t \t\t $this->config[$dbname]['pass']\n\t \t); \n\t } \n\t catch(\\PDOException $e) { \n\t echo $e->getMessage(); \n\t }\n\t}", "static function setConnection($pdo) {\n\t\t\tself::$pdo = $pdo;\n\t\t}", "protected static function setupDb()\n\t{\n\t\tif (is_object(self::$db)) {\n\t\t\treturn self::$db;\n\t\t}\n\n\t\t$config = Config::getInstance();\n\t\t$driver = $config->getDatabaseDriver();\n\t\t$host = $config->getDatabaseHostname();\n\t\t$user = $config->getDatabaseUsername();\n\t\t$pass = $config->getDatabasePassword();\n\t\t$dbname = $config->getDatabaseName();\n\t\t$file = $config->getDatabaseFile();\n\n\t\ttry {\n\t\t\tswitch ($driver) {\n\t\t\t\tcase 'sqlite':\n\t\t\t\t\tself::$db = new PDO('sqlite:'.$file);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\tcase 'mysql':\n\t\t\t\t\tself::$db = new PDO($driver.':dbname='.$dbname.';host='.$host,\n\t\t\t\t\t $user, $pass,array(PDO::ATTR_PERSISTENT => true));\n\t\t\t}\n\t\t\tself::$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t} catch (PDOException $e) {\n\t\t\tthrow new Exception(\"Kunde inte etablera anslutning till databasen. (\".\n\t\t\t $e->getMessage().')');\n\t\t}\n\t}", "private function setupDatabase()\n {\n try {\n $db = new PDO(sprintf('mysql:host=%s;dbname=%s', $this->host, $this->dbName), $this->userName, $this->password);\n\n } catch (PDOException $e) {\n\n if (false != strpos($e->getMessage(), 'Unknown database')) {\n $db = new PDO(sprintf('mysql:host=%s', $this->host), $this->userName, $this->password);\n $db->exec(\"CREATE DATABASE IF NOT EXISTS `$this->dbName` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;\") or die(print_r($db->errorInfo(), true));\n\n } else {\n die('DB ERROR: ' . $e->getMessage());\n }\n\n $db = new PDO(sprintf('mysql:host=%s;dbname=%s', $this->host, $this->dbName), $this->userName, $this->password);\n }\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n return $db;\n }", "public function __construct(){\n\t\t$dsn = 'mysql:host=' . $this->host . ';dbname=' . $this->dbname;\n\t\t\n\t\t//Set options\n\t\t$options = array(\n\t\t\tPDO::ATTR_PERSISTENT => true,\n\t\t\tPDO::ATTR_ERRMODE\t => PDO::ERRMODE_EXCEPTION\n\t\t);\n\t\t\n\t\t//Create a new PDO instance\n\t\ttry {\n\t\t\t$this->dbh = new PDO($dsn, $this->user, $this->pass, $options);\n\t\t}\n\t\t//Catch any errors\n\t\tcatch(\\PDOException $e){\n\t\t\t$this->error = $e->getMessage();\n\t\t}\n\t\t\n\t}", "public function getConfigConnection(){\n \n set_time_limit(3600);\n \n $this->conn = null;\n \n try{\n $this->conn = new PDO(\"mysql:host=\" . $this->host . \";dbname=\" . $this->db_name, $this->username, $this->password);\n //$this->conn->setAttribute(PDO:ATTR_ERR)\n $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $this->conn->exec(\"set names utf8\");\n }catch(PDOException $exception){\n echo \"Connection error: \" . $exception->getMessage();\n $this->log->error($exception->getMessage());\n }\n \n return $this->conn;\n }", "public static function pdo()\n {\n return new \\PDO(\"mysql:host={$_ENV['DB_HOST']};dbname={$_ENV['DB_NAME']}\", $_ENV['DB_USER'], $_ENV['DB_PASS']);\n }", "function connect()\n {\n $this->db = new PDO($this->dns,$this->user,$this->pass,$this->option);\n $this->db->setAttribute(PDO::ATTR_ERRMODE , PDO::ERRMODE_EXCEPTION);\n\n }", "function dbInit($dsn, $db_name = null, $db_username = null, $db_password = null) {\n\t\t\n\t\t// Remove all whitespace, tabs and newlines\n\t\t$dsn = preg_replace( '|\\s+|', '', $dsn );\n\t\n\t\ttry {\n\t\t\t$db = new PDO($dsn, $db_username, $db_password, [\n\t\t\t\tPDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,\n\t\t\t\tPDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC\n\t\t\t]);\n\t\t\t\n\t\t\t$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n\t\t\t\n\t\t\tif ( !empty($db_name) ) dbSelect($db, $db_name);\n\t\t\t\n\t\t\t// Make sure the `set names utf8` is executed even if the DB name is not passed as an argument,\n\t\t\t// however it should only be executed on MySQL servers. Executing it on a MSSQL server returns an error.\n\t\t\telse try {$db->exec('set names utf8');} catch(PDOException $nothing) {}\n\t\t\t\n\t\t}\n\n\t\tcatch( PDOException $e ) {\n\t\t\t$db = null;\n\t\t\t\n\t\t\t$code = $e->getCode();\n\t\t\techo 'Line ' . $e->getLine() . ': ' . $e->getMessage();\n\t\t}\n\t\n\t\t// Return Database handle\n\t\treturn $db;\n\t}", "private function __connect() {\n $this->handle = mysql_connect($this->server, $this->user, $this->password) \n or die('<pre style=\"margin:auto;background:rgba(0,0,0,.1)\">'.mysql_error().'</pre>');\n mysql_select_db($this->dataBase, $this->handle) \n or die('<pre style=\"margin:auto;background:rgba(0,0,0,.1)\">'.mysql_error().'</pre>');\n @mysql_query(\"SET NAMES 'utf8'\");\n }", "public function settaDB()\n {\n include \"MySqlClass.php\";\n // istanza della classe\n $this->database = new MysqlClass();\n }", "function pdo_connect_mysql() {\r\n try {\r\n // Connect to the MySQL database using PDO...\r\n \treturn new PDO('mysql:host=' . db_host . ';dbname=' . db_name . ';charset=utf8', db_user, db_pass);\r\n } catch (PDOException $exception) {\r\n \t// Could not connect to the MySQL database, if this error occurs make sure you check your db settings are correct!\r\n \texit('Failed to connect to database!');\r\n }\r\n}", "protected function mysqlSetup($query){\n \treturn $this->mysqlBool($query);\n }", "function __construct(){\n $this->PDO = new \\PDO('mysql:host=localhost;dbname=u871927708_bsidb', 'u871927708_bsius', '@Admn642531'); //Conexão\n $this->PDO->setAttribute( \\PDO::ATTR_ERRMODE,\\PDO::ERRMODE_EXCEPTION ); //habilitando erros do PDO\n }", "static function createMysqlPDO($host, $database, $username, $password) {\n\t\t$pdo = new PDO('mysql:host=' . $host . ';dbname=' . $database, $username, $password);\n\t\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t$pdo->query('set names utf8');\n\t\treturn $pdo;\n\t}", "public function connect()\n {\n $dsn = sprintf(\"mysql:host=%s;port=%s;dbname=%s\", $this->configuration['host'], $this->configuration['port'], $this->configuration['database']);\n $this->pdo = new PDO($dsn, $this->configuration['username'], $this->configuration['password']);\n }", "protected function registerDatabaseBindingsConfig()\n {\n if(file_exists($this->basePath(\"config.php\"))){\n $mysql = require_once $this->basePath(\"config.php\");\n $this->make('config')->set(\"database.connections.mysql\",$mysql);\n \n }\n }" ]
[ "0.6339185", "0.62660956", "0.61411184", "0.61064327", "0.6074038", "0.6069871", "0.605351", "0.60397893", "0.6036598", "0.6008178", "0.600707", "0.5962889", "0.59206903", "0.5898009", "0.5880606", "0.5869525", "0.5850233", "0.58329177", "0.58129895", "0.58055055", "0.5785754", "0.5772004", "0.57678586", "0.5751333", "0.5740105", "0.5738067", "0.5737198", "0.57284254", "0.5720487", "0.5714603", "0.5697041", "0.56650364", "0.56532276", "0.5645357", "0.5632324", "0.563188", "0.5596221", "0.55870223", "0.5584108", "0.55839175", "0.5583298", "0.5569492", "0.5560477", "0.55588466", "0.5558165", "0.5556535", "0.5519411", "0.5517561", "0.5516364", "0.5503659", "0.5503659", "0.54994273", "0.54913205", "0.5484346", "0.54797614", "0.5478301", "0.5476539", "0.54705626", "0.54700774", "0.5465168", "0.5464999", "0.54642075", "0.5462149", "0.54497755", "0.5447322", "0.5443183", "0.54398066", "0.5434103", "0.5418784", "0.54120547", "0.541037", "0.5406016", "0.54025036", "0.5398391", "0.5395134", "0.53909457", "0.5382695", "0.5382224", "0.53801364", "0.5374147", "0.53687376", "0.53685224", "0.5358702", "0.53523517", "0.53503865", "0.53435695", "0.53397834", "0.5336766", "0.5326105", "0.53240633", "0.53239405", "0.532388", "0.53122836", "0.53064173", "0.5304108", "0.5299904", "0.5297624", "0.52951515", "0.5294111", "0.52921176", "0.52862716" ]
0.0
-1
Configure PDO using query and parameters temporarily enabling PDO::ATTR_EMULATE_PREPARES.
protected function withEmulatedStatement(string $query, array $values = []) { foreach ($this->pdos as &$pdo) { $pdo = ValueEffector::withCallback( $pdo, Closure::fromCallable([$this, 'withEmulatedStatementFor']), $query, $values ); } unset($pdo); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prepareAndExecute (PDO $connection, string $query, array $params = []);", "protected function setupPdoQueries()\n {\n $this->conf['select-user'] = sprintf('\n\t\t\tSELECT username as user, name, email as mail, password as hash, id as uid\n\t\t\tFROM %s WHERE username = :user',\n $this->getTableName('users'));\n\n $this->conf['select-user-groups'] = sprintf('\n\t\t\tSELECT title as `group` FROM %s as groups\n\t\t\tLEFT JOIN %s as groupmap ON groups.id = groupmap.group_id\n\t\t\tLEFT JOIN %s as user ON groupmap.user_id = user.id\n\t\t\tWHERE user.username = :user OR user.id = :uid ',\n $this->getTableName('usergroups'),\n $this->getTableName('user_usergroup_map'),\n $this->getTableName('users'));\n\n $this->conf['select-groups'] = sprintf('\n\t\t\tSELECT title as `group`, id as gid FROM %s',\n $this->getTableName('usergroups'));\n }", "public function prepare()\n\t{\n\t\tif ($this->pdoStatement == null) {\n\t\t\t$sql = $this->getSql();\n\t\t\ttry {\n\t\t\t\t$this->pdoStatement = $this->connection->pdo->prepare($sql);\n\t\t\t\t$this->_paramLog = array();\n\t\t\t}\n\t\t\tcatch(\\Exception $e) {\n\t\t\t\t\\Yii::error(\"Failed to prepare SQL ($sql): \" . $e->getMessage(), __CLASS__);\n $errorInfo = $e instanceof \\PDOException ? $e->errorInfo : null;\n\t\t\t\t$message = YII_DEBUG ? 'Failed to prepare SQL: ' . $e->getMessage() : 'Failed to prepare SQL.';\n\t\t\t\tthrow new Exception($message, (int)$e->getCode(), $errorInfo);\n\t\t\t}\n\t\t}\n\t}", "private function _prepareQuery() \n\t{\n\t\t\t// Establish connection to the database if not already connected\n\t\tif (! $this->_connection || empty($this->_connection)) {\n\t\t\t\n\t\t\t // retrieve the database configuration from the registry\n\t\t\t$config = Registry::getSetting('dbConfig');\n\t\t\t\n\t\t\t$this->_newConnection(\n\t\t\t\t\t$config['host'], \n\t\t\t\t\t$config['database'], \n\t\t\t\t\t$config['user'], \n\t\t\t\t\t$config['password']);\n\t\t}\n\t\t\n\t\tif (! $stmt = $this->_connection->prepare ( $this->_query )) {\n\t\t\ttrigger_error ( 'Problem preparing query', E_USER_ERROR );\n\t\t}\n\t\t$this->_stmt = $stmt;\n\t}", "public function prepare($sql, $params);", "private function prepare ($sql) {\n $this->query = $this->connection->prepare($sql);\n }", "public function prepare() {\n\t\tif ($this->_statement == null) \n\t\t{\n\t\t\ttry {\n\t\t\t\t$this->_statement = $this->_connection->getPdoInstance()->prepare($this->getText());\n\t\t\t\t$this->_paramLog = array();\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\t$errorInfo = $e instanceof PDOException ? $e->errorInfo : null;\n\t\t\t\tthrow new \\GO\\Base\\Exception\\Database('DbCommand failed to prepare the SQL statement: '. $e->getMessage(), $e->getCode(), $errorInfo);\n\t\t\t}\n\t\t}\n\t}", "public function prepare($query)\n {\n }", "public function prepare( $sql ){\n $this->stmt = $this->pdo->prepare( $sql );\n }", "protected function prepareQuery($query) {}", "private function PrepStatement()\n\t{\n\t\t$this->stmt = $this->prepare($this->query->statement);\n\t\tif($this->query->parameters !==NULL && $this->query->paramtype !==NULL\n\t\t\t&& count($this->query->parameters) == count($this->query->paramtype))\n\t\t{\n\t\t\tforeach ($this->query->parameters as $parameter => $value)\n\t\t\t{\n\t\t\t\t$this->stmt->bindValue($parameter, $value, $this->query->paramtype[$parameter]);\n\t\t\t}\n\t\t}\n\t\telseif ($this->query->parameters!==NULL)\n\t\t{\n\t\t\tforeach ($this->query->parameters as $parameter => $value)\n\t\t\t{\n\t\t\t\t$this->stmt->bindValue($parameter, $value, pdo::PARAM_STR);\n\t\t\t}\n\t\t}\n\t}", "public function prepare($sql);", "function pdo_query($sql, $link=NULL, $params=NULL) {\r\n\r\n // separate params from $sql and $link \r\n $params = func_get_args();\r\n $sql = TRIM( array_shift($params) );\r\n $flags = array();\r\n $direct = false;\r\n \r\n\r\n // find pdo $link \r\n if (count($params)) {\r\n // $link can be the first element\r\n if (is_object(reset($params))) {\r\n $link = array_shift($params);\r\n }\r\n // or the last\r\n elseif (is_object(end($params))) {\r\n $link = array_pop($params);\r\n }\r\n }\r\n // or we use the default $pdo\r\n $link = pdo_handle($link);\r\n \r\n // is $params a list to pdo_query(), or just one array with :key=>value pairs?\r\n if (count($params)==1 && is_array($params[0])) {\r\n $params = array_shift($params);\r\n }\r\n\r\n\r\n // add PDO_MySQL driver flag / workaround for specific query types\r\n switch (strtoupper(substr($sql, 0, strspn(strtoupper($sql), \"SELECT,USE,CREATE\")))) {\r\n\r\n // ought to make ->rowCount() work\r\n case \"SELECT\":\r\n $flags[PDO::MYSQL_ATTR_FOUND_ROWS] = true;\r\n break;\r\n\r\n // temporarily disable prepared statement mode for unbindable directives\r\n case \"USE\":\r\n $direct = true;\r\n $link->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);\r\n break;\r\n\r\n default:\r\n }\r\n\r\n\r\n // unparameterized query()\r\n if ($direct) {\r\n $stmt = $link->query($sql);\r\n $link->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\r\n }\r\n // or prepare() and execute()\r\n else {\r\n if ($stmt = $link->prepare($sql, $flags)) { // no try-catch in _WARNING mode\r\n $stmt->execute($params);\r\n }\r\n }\r\n \r\n // result\r\n if (!$stmt and PDO_HELPFUL) {\r\n pdo_trigger_error(\"pdo_query() SQL query failed, see pdo_error()\", E_USER_WARNING);\r\n }\r\n elseif (PDO_SEEKABLE & !$direct) {\r\n return new PDOStatement_Seekable($stmt, $params);\r\n }\r\n else {\r\n return $stmt;\r\n }\r\n }", "public function prepare(string $statement, array $driver_options = []): PDOStatement\n {\n return parent::prepare($statement, $driver_options);\n }", "final public function setToPrepared()\n {\n $this->prepared = true;\n }", "function prepare($pquery){\n if ( ! $this->initDB() ) return false; \n return $this->dbh->prepare($pquery);\n }", "public function prepareQuery($query)\n {\n $this->statement = $this->db_handler->prepare($query);\n }", "final public function prepare($statement = NULL, $offset = 0, $limit = 0, $prefix='') {\n\n //Sets the query to be executed;\n\n $cfg = Config::getParamSection('database');\n\n\n $this->offset = (int) $offset;\n $this->limit = (int) $limit;\n $this->prefix = (!isset($prefix) && !empty($prefix)) ? $prefix : $cfg['prefix'];\n $this->query = $this->replacePrefix($statement);\n\n //Get the Result Statement class;\n $options = array(\n \"dbo\" => $this,\n \"driver\" => $this->driver\n );\n\n $RESULT = \\Library\\Database\\Results::getInstance($options);\n\n //$this->resetRun();\n //Driver Statements, handle the execute\n return $RESULT;\n }", "function runQueryWithParams ($q, $p) {\r\n $dbSettings = getDBsettings();\r\n $db = \"mysql:host=\" . $dbSettings['DBserver'] . \";dbname=\" . $dbSettings['DBname'] . \";port=\" . $dbSettings['DBport'];\r\n $pdo = new PDO($db, $dbSettings['DBuser'], $dbSettings['DBpass']);\r\n //prepare the SQL string\r\n $stmt = $pdo->prepare($q);\r\n //execute the SQL\r\n $stmt->execute(array($p));\r\n //close the conention\r\n $pdo = null;\r\n //return the result\r\n return $stmt;\r\n}", "function query_prepared($query, $param=null)\n { \n $stmt = $this->dbh->prepare($query);\n foreach ($param as $index => $val) {\n // indexing start from 1 in Sqlite3 statement\n if (is_array($val)) {\n $ok = $stmt->bindParam($index + 1, $val);\n } else {\n $ok = $stmt->bindValue($index + 1, $val, $this->getArgType($val));\n }\n \n if (!$ok) {\n $type_error = \"Unable to bind param: $val\";\n $this->register_error($type_error);\n $this->show_errors ? trigger_error($type_error,E_USER_WARNING) : null;\n return false;\n }\n }\n \n return $stmt->execute();\n }", "protected function initOptions(PDO $pdo)\n {\n // set time zone\n if (isset($this->config['timezone']))\n {\n $pdo->prepare('set time_zone=\"' . $this->config['timezone'] . '\"')->execute();\n }\n\n //set charset\n if (isset($this->config['charset']))\n {\n $pdo->prepare('set names \"' . $this->config['charset'] . '\"')->execute();\n }\n\n // set strict mode\n if (isset($this->config['strict']) && $this->config['strict'])\n {\n $pdo->prepare(\"set session sql_mode='STRICT_ALL_TABLES'\")->execute();\n }\n\n return $pdo;\n }", "public function prepare(/*# string */ $sql)/*# : bool */;", "public function _prepare() {\n if( !DBwrite::connected() ) {\n DBwrite::connect();\n }\n\n $query = $this->query;\n foreach( $this->key_value_map as $key => $value ) {\n $query = str_replace(\n '#'.$key, \n $this->sanitizeValue( $key, $value ),\n $query\n );\n }\n \n $this->real_query = $query;\n return $this->real_query;\n }", "function __construct() {\n\t\t$this->dsn = \"mysql:host=\". DB_SERVER . \";dbname=\" . DB_NAME . \";charset=\" . DB_CHAR;\n\t\n\t $this->opt = [\n\t PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,\n\t PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,\n\t PDO::ATTR_EMULATE_PREPARES => false,\n\t ];\n\t\t$this->openConnection();\n\t}", "public function prepare($sql, array $parameters = array())\n {\n $this->statement = $this->connection->prepare($sql, $parameters);\n $this->statement->setFetchMode($this->fetchMode, $this->mappedModelClass->getName());\n }", "function pdo_preparedStmt($pdo,$query,$parmList,$parmData){\n$sql = $pdo->prepare($query);\nfor ($i=0; $i < count($parmList); $i++) { \n $sql->bindParam($parmList[$i], $parmData[$i]);\n}\n\nreturn $sql->execute();\n}", "public function prepareQuery($query)\n {\n $query = (string)$query;\n try {\n //if not successful returns either false or PDOException depending on error handling method. We use PDOException\n //if successful returns PDOStatement\n $this->stmt = $this->PDO->prepare($query);\n } catch (PDOException $e) {\n MyErrorHandler::exceptionLogger($e, fileName);\n }\n }", "public function prepare()\n {\n // Define column parameters\n $columns = func_get_args();\n if (!empty($columns)){\n\n // clear current parameters\n unset($this->parameters);\n $this->parameters = array();\n foreach ($columns as $column) {\n $this->parameters[$column] = null;\n } \n }\n\n // build query\n parent::prepare(); \n return $this;\n }", "protected function init()\n {\n $pdoConfig = $this->config->get('pdo.pdo');\n try {\n $pdo = new \\PDO(\n $pdoConfig['dns'],\n $pdoConfig['username'],\n $pdoConfig['password'],\n $pdoConfig['options']\n );\n if (ENV === ApplicationInterface::APPLICATION_ENV_DEV) {\n $pdo->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n }\n else {\n $pdo->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_WARNING);\n }\n\n $pdo->query('set character set cp1251');\n $pdo->query('set character_set_client=\\'cp1251\\'');\n $pdo->query('set names cp1251');\n }\n catch (\\PDOException $e) {\n throw new PdoStorageException('Unable to connect to pdo database', 0, $e);\n }\n\n $queryBuilder = new \\FluentPDO($pdo);\n if (ENV === ApplicationInterface::APPLICATION_ENV_DEV) {\n $queryBuilder->debug = array($this, 'dispatchQueryEvent');\n }\n $this->queryBuilder = $queryBuilder;\n }", "public function prepare($query, $params = NULL) {\n\t\t$this->_connection or $this->connect();\n\n\t\t$stmt = sqlsrv_prepare($this->_connection, $query, $params, array('Scrollable' => SQLSRV_CURSOR_KEYSET));\n\t\treturn $stmt;\n\t}", "static function set_pdo () {\n\t\tself::$pdo = new PDO(APP_DATABASE_DRIVER.':host='.APP_DATABASE_HOST.';port='.APP_DATABASE_PORT.';dbname='.APP_DATABASE_NAME, APP_DATABASE_USERNAME, APP_DATABASE_PASSWORD);\n\t\tself::$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\tself::$pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);\n\t}", "public function prepare();", "public function prepare();", "abstract public function prepare($params=array());", "public function prepare ($sql) {\n $this->query = $this->conn->prepare($sql);\n return $this->query;\n }", "public function prepare($query, $cacheStatement = false)\n\t{\n\t\tif($cacheStatement) {\n\t\t\t$this->currentStatement = $this->db->prepare($query);\n\t\t} else {\n\t\t\t$this->currentStatement = $this->setCachedStatement($query);\n\t\t}\n\t}", "public function testPrepareParse()\n {\n \t$qs = $this->conn->prepare(\"SELECT * FROM test WHERE status=?\");\n \t$this->assertType('Q\\DB_Statement', $qs);\n \t\n \t$result = $qs->execute('ACTIVE');\n\t\t$this->assertType('Q\\DB_Result', $result);\n\t\t$this->assertEquals('SELECT * FROM test WHERE status=\"ACTIVE\"', $result->getStatement());\n\t\t\n \t$this->assertEquals(array(1, 'one', 'first row', 'ACTIVE'), $result->fetchOrdered());\n \t$this->assertEquals(array(2, 'two', 'next row', 'ACTIVE'), $result->fetchOrdered());\n \t$this->assertNull($result->fetchOrdered());\n \t\n \t$result = $this->conn->query($qs, 'PASSIVE');\n\t\t$this->assertType('Q\\DB_Result', $result);\n \t$this->assertEquals(array(3, 'three', 'another row', 'PASSIVE'), $result->fetchOrdered(), 'Using conn->query(prepared statement)');\n }", "public function prepare_query()\n {\n }", "public function prepare($statement, $driver_options = array())\n {\n $this->last_query = new MockPDOStatement($statement);\n\n return $this->last_query;\n }", "private function prepareStatement()\n {\n $columns = '';\n $fields = '';\n foreach ($this->fields as $key => $f) {\n if ($key == 0) {\n $columns .= \"$f\";\n $fields .= \":$f\";\n continue;\n }\n\n $columns .= \", $f\";\n $fields .= \", :$f\";\n }\n\n $this->statement = $this->pdo->prepare(\n 'INSERT INTO `' . $this->table . '` (' . $columns . ') VALUES (' . $fields . ')'\n );\n }", "private function execute() {\n $this->statement = $this->pdo->prepare($this->queryString);\n\n foreach ($this->params as $boundParam) {\n $this->statement->bindValue($boundParam->name, $boundParam->value, $boundParam->type);\n }\n\n $this->statement->execute();\n }", "public function query()\n {\n $bindings = func_get_args();\n $sql = array_shift($bindings);\n\n if (count($bindings) == 1 and is_array($bindings[0])){\n $bindings = $bindings[0];\n }\n\n try{\n $query = $this->connection()->prepare($sql);\n\n foreach ($bindings as $key => $value){\n $query->bindValue($key + 1 , _e($value));\n }\n $query->execute();\n\n return $query;\n }\n catch (PDOException $e){\n echo $sql;\n pre($this->bindings);\n die($e->getMessage());\n }\n\n }", "function pdo_query(PDO $pdo, $query_string, $query_inputs = null)\n {\n $query_inputs = is_array($query_inputs) ? $query_inputs : array_slice(func_get_args(), 2);\n $prep = $pdo->prepare($query_string);\n $prep->execute((array) $query_inputs);\n return $prep;\n }", "private function prepare($sql, $params, $type) {\n\t\t$connection = $this->getConnection($type);\n\n\t\t//$sql_monitor = new SQLMonitor($sql);\n\t\t//$sql_monitor->start();\n\n\t\t$sth = $connection->prepare($sql, array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => FALSE));\n\t\tforeach ($params AS $key => $value) {\n\t\t\tif (strpos($key, '_') === 0) {\n\t\t\t\t$sth->bindValue(\":{$key}\", $value, PDO::PARAM_INT);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$sth->bindValue(\":{$key}\", $value, PDO::PARAM_STR);\n\t\t\t}\n\t\t}\n\t\t$sth->execute();\n\n\t\t//$sql_monitor->finish($sth);\n\n\t\treturn $sth;\n\t}", "public function prepare() {}", "public function prepare() {}", "function prepare($query, $param, $fetch=false)\n\t\t{\n\t\t\tif(empty($this->pdo))\n\t\t {\n\t\t\t\t$this->start_engine($type=\"pdo\");\n\t\t }\n\t\t\t//Attempt to start executing the query making sure all query is executed \n\t\t\ttry\n\t\t\t{\n\t\t\t\t$db = $this->pdo;\n\t\t\t\t$db->beginTransaction();\n\t\t\t $sth = $db->prepare($query);\n\t\t\t\t$sth->execute($param);\n\t\t\t\t\n\t\t\t //it means we want the result of this query so fetch it.\n\t\t\t if($fetch==true)\n\t\t\t {\n\t\t\t\t\t$result = $sth->fetchall();\n\t\t\t\t $db->commit();\n\t\t\t\t\t//var_dump($result);exit;\n\t\t\t\t return $result;\n\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t //At this junction our query was successful so we just return control to the script/page.\n\t\t\t\t //No return value is sent here.\n\t\t\t $db->commit();\n\t\t\t return;\n\t\t\t\t }\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//At this point the query wasn't executed correctly so we roll back everything.\n\t\t\tcatch (Exception $e) \n\t\t\t{\n\t\t\t\t$db->rollBack();\n\t\t\t\t\n\t\t\t\t$utility = new Utility();\n //$utility->ajax(json_encode($db->errorInfo()));\n\t\t\t\t$utility->ajax($this->error_msg);\n\t\t\t\t$_SESSION[\"error\"] = $this->error_msg;// $db->errorInfo();\n\t\t\t\tif(isset($_SERVER[\"HTTP_REFERER\"]))\n\t\t\t\t{\n\t\t\t\t\theader(\"Location: \".$_SERVER[\"HTTP_REFERER\"].\"\");\n\t\t\t }\n\t\t\t else\n\t\t\t\t{\n\t\t\t\t\theader(\"Location: /\");\n }\n\t\t }\n\t\t}", "public function &prepare($q)\n {\n self::$db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);\n $st = self::$db->prepare($q);\n $st->setFetchMode(PDO::FETCH_CLASS, 'stdClass');\n //$st->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n return $st;\n }", "protected function prepareQuery()\n {\n if (false === $this->isQueryPrepared) {\n $options = array(\n SelectorSourceInterface::RESULT => SelectorSourceInterface::RESULT_IDENTIFIERS,\n SelectorSourceInterface::LIMIT => $this->limit,\n SelectorSourceInterface::OFFSET => $this->offset,\n SelectorSourceInterface::ORDERBY => $this->orderBy,\n SelectorSourceInterface::GROUPBY => $this->groupBy,\n );\n $this->setIdsArray(\n $this->source->loadIds(\n $this->criterias,\n array_merge($this->options, $options)\n ),\n array_merge($this->options, $options)\n );\n $this->isQueryPrepared = true;\n }\n\n return $this;\n }", "protected function prepareSelectStatement() {}", "public function prepareQuery()\n {\n //prepare where conditions\n foreach ($this->where as $where) {\n $this->prepareWhereCondition($where);\n }\n\n //prepare where not conditions\n foreach ($this->whereNot as $whereNot) {\n $this->prepareWhereNotCondition($whereNot);\n }\n\n // Add a basic range clause to the query\n foreach ($this->inRange as $inRange) {\n $this->prepareInRangeCondition($inRange);\n }\n\n // Add a basic not in range clause to the query\n foreach ($this->notInRange as $notInRange) {\n $this->prepareNotInRangeCondition($notInRange);\n }\n\n // add Terms to main query\n foreach ($this->whereTerms as $term) {\n $this->prepareWhereTermsCondition($term);\n }\n\n // add exists constrains to the query\n foreach ($this->exist as $exist) {\n $this->prepareExistCondition($exist);\n }\n\n // add matcher queries\n foreach ($this->match as $match) {\n $this->prepareMatchQueries($match);\n }\n\n $this->query->addFilter($this->filter);\n\n return $this->query;\n }", "static function startConnection(): void{\n\n self::$pdo = new PDO(DSN, USERNAME, PSW,[PDO::ATTR_PERSISTENT=>true]);\n self::$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n}", "private function initializeStatement( $clear = false )\r\n {\r\n if ( isset( $this->stmt ) && $this->stmt instanceof PDOStatement && !$clear ) {\r\n return;\r\n }\r\n $sql = $this->sql . \" LIMIT ? OFFSET ?\";\r\n $this->logger->log ( $sql );\r\n $this->stmt = $this->conn->prepare( $sql );\r\n $nextIndex = 1;\r\n if ( $this->mode == self::MODE_PARAMETERIZED ) {\r\n for ( $i = 0; $i < count( $this->values); $i++) {\r\n if ( is_bool( $this->values[$i] ) ) {\r\n $this->stmt->bindValue( $i+1, $this->values[$i], PDO::PARAM_BOOL );\r\n } else {\r\n $this->stmt->bindValue( $i+1, $this->values[$i] );\r\n }\r\n }\r\n $nextIndex = ++$i;\r\n }\r\n $this->index['max'] = $nextIndex++;\r\n $this->index['start'] = $nextIndex++;\r\n }", "function query($pdo,$query,$data=[]) {\n\t$query = $pdo->prepare($query);\n\t$query->execute($data);\n\treturn $query;\n}", "public function prepare(string $query, array $pdoParams = []): PreparedStatement\n\t{\n\t\treturn new PreparedStatement($this->connection, $query, $pdoParams);\n\t}", "public function prepare($statement, $driverOpts = Array()) {\n return $this->_pdo->prepare($statement, $driverOpts);\n }", "public function prepare($sql) {\n return $this->conn->prepare($sql);\n }", "public function prepare(string $statement, array $driverOptions = []): Statement;", "function prepareAndExecute($pdo, $str){// need to pass in the pdo instance, doesn't have access to it otherwise\n $query = $pdo->prepare($str);\n $query->execute(); //having the return statement here caused error\n return $query;\n}", "public function setPdo($dsn, $user = null, $password = null, array $options = array()) {\r\n\t\t$this->setDsn($dsn);\r\n\t\t$this->setUser($user);\r\n\t\t$this->setPassword($password);\r\n\t\t$this->setOptions($options);\r\n\r\n\t\t$this->pdo = new NativePdo($dsn, $user, $password, $options);\r\n\r\n\t\t//always throw exception\r\n\t\t$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\r\n\t\t//use custom pdo statement class\r\n\t\t$this->pdo->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('\\k\\db\\PdoStatement', array($this)));\r\n\t}", "public function query($rawQuery, $param = array()){\n \n $stmt = $this->conn->prepare($rawQuery);\n \n $this->setParams($stmt, $param);\n \n $stmt->execute();\n \n return $stmt;\n \n}", "public function prepare($statement, array $driver_options=[]) {\n $this->queries[] = $statement;\n if (count($driver_options)) {\n return parent::prepare($statement, $driver_options);\n } else {\n return parent::prepare($statement);\n }\n }", "public function runQuery($sql){\n $stmt = $this->pdo->prepare($sql);\n return $stmt;\n }", "public function prepare($query)\n {\n $prefix = $this->getTablePrefix();\n\n $query = preg_replace_callback('#\\{(.*?)\\}#', function ($matches) use ($prefix)\n {\n list ($table, $field) = array_pad(explode('.', $matches[1], 2), 2, null);\n\n $result = $this->wrap($prefix .$table);\n\n if (! is_null($field)) {\n $result .= '.' . $this->wrap($field);\n }\n\n return $result;\n\n }, $query);\n\n return $this->getPdo()->prepare($query);\n }", "public static function prepare($sql) {\n return self::getInstancia()->prepare($sql);\n }", "public static function prepare( $stmt )\n {\n $_options = array();\n if ( self::$CURSOR_MODE ):\n switch ( self::$CURSOR_MODE ):\n case 'fw':\n $_options[\\PDO::ATTR_CURSOR] = \\PDO::CURSOR_FWDONLY;\n break;\n case 'scroll':\n $_options[\\PDO::ATTR_CURSOR] = \\PDO::CURSOR_SCROLL;\n break;\n endswitch;\n\n // has type?\n if ( self::$CURSOR_TYPE ):\n //SQL_SRV \n if ( bcDB::resource( 'RDBMS' ) === 'sqlsrv' ):\n switch ( self::$CURSOR_TYPE ):\n case 'static':\n $_options[\\PDO::SQLSRV_ATTR_CURSOR_SCROLL_TYPE] = \\PDO::SQLSRV_CURSOR_STATIC;\n break;\n case 'dynamic':\n $_options[\\PDO::SQLSRV_ATTR_CURSOR_SCROLL_TYPE] = \\PDO::SQLSRV_CURSOR_DYNAMIC;\n break;\n case 'keyset':\n $_options[\\PDO::SQLSRV_ATTR_CURSOR_SCROLL_TYPE] = \\PDO::SQLSRV_CURSOR_KEYSET_DRIVEN;\n break;\n case 'buffered':\n $_options[\\PDO::SQLSRV_ATTR_CURSOR_SCROLL_TYPE] = \\PDO::SQLSRV_CURSOR_BUFFERED;\n break;\n endswitch;\n endif;\n //todo other drivers if any\n endif;\n endif;\n\n self::$stmt = bcDB::resource( 'CONNECTION' )->prepare( $stmt, $_options );\n }", "public function __construct(){\n \n try { \n $this->con = new PDO(\"mysql:host=$this->host;dbname=$this->db\", $this->user, $this->pwd); \n $this->con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); \n $this->con->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n } \n catch(PDOException $e) { \n echo $e->getMessage();\n }\n \n }", "public function prepare($sql) {\n return $this->connection->prepare($sql);\n }", "public function prepare(string $query)\n {\n return $this->db->prepare($query);\n }", "protected function setupPdoConfig()\n {\n require_once $this->joinPaths($this->joomlaPath, 'configuration.php');\n\n $this->joomlaConfig = new JConfig;\n $this->joomlaConfig->dbtype = str_replace('mysqli', 'mysql', $this->joomlaConfig->dbtype);\n $this->conf['dsn'] = sprintf('%s:dbname=%s;host=%s', $this->joomlaConfig->dbtype, $this->joomlaConfig->db, $this->joomlaConfig->host);\n $this->conf['user'] = $this->joomlaConfig->user;\n $this->conf['pass'] = $this->joomlaConfig->password;\n\n $this->setupPdoQueries();\n }", "public function prepare(IStatement $stmt, $driver_options=[]) {\n return $this->pdo->prepare($this->render($stmt), $driver_options);\n }", "function dbh_query_bind( $sql ) {\n if ( isset( $GLOBALS['orm_dbh'] ) ) $use_dbh = $GLOBALS['orm_dbh'];\n if ( ORM_SQL_PROFILE ) START_TIMER('dbh_query_bind');\n $bind_params = array_slice( func_get_args(), 1 );\n ### Allow params passed in an array or as args\n if ( is_a( $bind_params[ count($bind_params) - 1 ], 'PDO' ) || is_a( $bind_params[ count($bind_params) - 1 ], 'PhoneyPDO' ) ) $use_dbh = array_pop($bind_params);\n if ( ! isset( $GLOBALS['orm_dbh'] ) ) $GLOBALS['orm_dbh'] = $use_dbh; # steal their DBH for global use, hehehe\n if ( count( $bind_params ) == 1 && is_array(array_shift(array_values($bind_params))) ) { $bind_params = array_shift(array_values($bind_params)); };\n# if (ORM_SQL_DEBUG) trace_dump();\n reverse_t_bools($bind_params);\n if (ORM_SQL_DEBUG) bug($sql, $bind_params);\n try { \n $sth = $use_dbh->prepare($sql);\n $rv = $sth->execute($bind_params);\n } catch (PDOException $e) {\n trace_dump();\n $err_msg = 'There was an error running a SQL statement, ['. $sql .'] with ('. join(',',$bind_params) .'): '. $e->getMessage() .' in ' . trace_blame_line();\n if ( strlen($err_msg) > 1024 ) {\n bug($err_msg,$sql,$bind_params,$e->getMessage());\n $sql = substr($sql,0,1020 + strlen($sql) - strlen($err_msg) ).'...';\n }\n trigger_error( 'There was an error running a SQL statement, ['. $sql .'] with ('. join(',',$bind_params) .'): '. $e->getMessage() .' in ' . trace_blame_line(), E_USER_ERROR);\n return false;\n }\n if ( ORM_SQL_PROFILE ) END_TIMER('dbh_query_bind');\n return $sth;\n }", "public static function getPDO() : PDO;", "public function prepare($query, ...$args)\n {\n }", "public function __construct(\\PDO $pdo)\n\t{\n\t // Set prepared statement emulation depending on server version\n\t $version = $pdo->getAttribute(\\PDO::ATTR_SERVER_VERSION);\n\n\t $pdo->setAttribute(\n\t \t\\PDO::ATTR_EMULATE_PREPARES,\n\t \tversion_compare($version, '5.1.17', '<')\n\t );\n\n\t\t$this->c = $pdo;\n\t\t$this->driver = $pdo->getAttribute(\\PDO::ATTR_DRIVER_NAME);\n\n\t\tswitch($this->driver)\n\t\t{\n\t\t\tcase 'pgsql':\n\t\t\tcase 'sqlsrv':\n\t\t\tcase 'dblib':\n\t\t\tcase 'mssql':\n\t\t\tcase 'sybase':\n\t\t\t\t$this->i = '\"';\n\t\t\t\tbreak;\n\t\t\tcase 'mysql':\n\t\t\tcase 'sqlite':\n\t\t\tcase 'sqlite2':\n\t\t\tdefault:\n\t\t\t\t$this->i = '`';\n\t\t}\n\t}", "public function getPDO(): PDO;", "public function prepare($sql, array $values = array(), $assoc = true){\n\n\t\t$result = false;\n\n\t\tif (!is_null($this->_client)){\n\t\t\t$statement = $this->_client->prepare($sql);\n\t\t\t$hasError = $this->changeLastError();\n\t\t\t$result = $hasError ? $hasError : $statement;\n\n\t\t\tif (!$hasError && !empty($values)){\n\t\t\t\tforeach ($values as $key => $value){\n\t\t\t\t\tif (is_array($value)){\n\t\t\t\t\t\t$bound = $statement->bindValue(\":$key\", $value['value'], $value['type']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$bound = $statement->bindValue(\":$key\", $value);\n\t\t\t\t\t}\n\t\t\t\t\tif (!$bound){\n\t\t\t\t\t\t$hasError = $this->changeLastError();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!$hasError){\n\t\t\t\t\t$dbResult = $statement->execute();\n\t\t\t\t\t$result = $this->parseResults($sql, $dbResult, $assoc);\n\t\t\t\t\t$statement->close();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\n\t}", "abstract public function prepareSelect();", "function sql_connect($options = array()) {\n\t\n\tif( ($sql = var_get('sql/dbConnection')) !== null ){\n\t\treturn $sql;\n\t}\n\n\n\t$options = array_merge(array(\n\t\t'host' => '127.0.0.1',\n\t\t'db' => '',\n\t\t'user' => 'root',\n\t\t'pass' => '',\n\t\t'charset' => 'utf8'\n\t), $options);\n\n\t\n\ttry {\n\t\t$sql = new PDO('mysql:host='.$options['host'].';dbname='.$options['db'], $options['user'], $options['pass']);\n\t}catch (Exception $e){\n\t\treturn false;\n\t}\n\n\tvar_set('sql/options', $options);\n\tvar_set('sql/dbConnection', $sql);\n\t\n\tif( $options['charset'] == 'utf8'){\n\t\tsql_dump($query = 'SET NAMES ' . $options['charset'] . ';');\n\t\t$sql->exec($query);\n\t}\n\n\tsql_dump($query = 'SET CHARACTER SET ' . $options['charset'] . ';');\n\t$sql->exec($query);\n\n\tsql_dump($query = 'USE ' . $options['db'] . ';');\n\t$sql->exec($query);\n\n\t$sql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t$sql->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);\t\n\t$sql->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);\n\n\treturn $sql;\n}", "protected function _prepare()\n\t{\n\t\tFactory::getLog()->debug(__CLASS__ . \" :: Processing parameters\");\n\n\t\t$options = null;\n\n\t\t// Get the DB connection parameters\n\t\tif (is_array($this->_parametersArray))\n\t\t{\n\t\t\t$driver = array_key_exists('driver', $this->_parametersArray) ? $this->_parametersArray['driver'] : 'mysql';\n\t\t\t$host = array_key_exists('host', $this->_parametersArray) ? $this->_parametersArray['host'] : '';\n\t\t\t$port = array_key_exists('port', $this->_parametersArray) ? $this->_parametersArray['port'] : '';\n\t\t\t$username = array_key_exists('username', $this->_parametersArray) ? $this->_parametersArray['username'] : '';\n\t\t\t$username = array_key_exists('user', $this->_parametersArray) ? $this->_parametersArray['user'] : $username;\n\t\t\t$password = array_key_exists('password', $this->_parametersArray) ? $this->_parametersArray['password'] : '';\n\t\t\t$database = array_key_exists('database', $this->_parametersArray) ? $this->_parametersArray['database'] : '';\n\t\t\t$prefix = array_key_exists('prefix', $this->_parametersArray) ? $this->_parametersArray['prefix'] : '';\n\n\t\t\tif (($driver == 'mysql') && !function_exists('mysql_connect'))\n\t\t\t{\n\t\t\t\t$driver = 'mysqli';\n\t\t\t}\n\n\t\t\t$options = [\n\t\t\t\t'driver' => $driver,\n\t\t\t\t'host' => $host . ($port != '' ? ':' . $port : ''),\n\t\t\t\t'user' => $username,\n\t\t\t\t'password' => $password,\n\t\t\t\t'database' => $database,\n\t\t\t\t'prefix' => is_null($prefix) ? '' : $prefix,\n\t\t\t];\n\t\t}\n\n\t\t$db = Factory::getDatabase($options);\n\n\t\tif ($db->getErrorNum() > 0)\n\t\t{\n\t\t\t$error = $db->getErrorMsg();\n\n\t\t\tthrow new RuntimeException(__CLASS__ . ' :: Database Error: ' . $error);\n\t\t}\n\n\t\t$driverType = $db->getDriverType();\n\t\t$className = '\\\\Akeeba\\\\Engine\\\\Dump\\\\Native\\\\' . ucfirst($driverType);\n\n\t\t// Check if we have a native dump driver\n\t\tif (!class_exists($className, true))\n\t\t{\n\t\t\t$this->setState(self::STATE_ERROR);\n\n\t\t\tthrow new ErrorException('Akeeba Engine does not have a native dump engine for ' . $driverType . ' databases');\n\t\t}\n\n\t\tFactory::getLog()->debug(__CLASS__ . \" :: Instanciating new native database dump engine $className\");\n\n\t\t$this->_engine = new $className;\n\n\t\t$this->_engine->setup($this->_parametersArray);\n\n\t\t$this->_engine->callStage('_prepare');\n\t\t$this->setState($this->_engine->getState());\n\t}", "public function testFetchWithParameters()\n {\n $this->mockPdoStatement->shouldReceive('execute')->once()->withNoArgs();\n $this->mockPdoStatement->shouldReceive('setFetchMode')->once()->with('parameters', 'value')->andReturnSelf();\n $this->mockPdoStatement->shouldReceive('fetch')->once()->withNoArgs()->andReturn('fetched');\n $this->mockPdo->shouldReceive('prepare')->once()->with('SQL')->andReturn($this->mockPdoStatement);\n\n\n $query = (new Select($this->mockConnection));\n $query->query('SQL', []);\n $this->assertEquals('fetched', $query->fetch('parameters', 'value'));\n }", "function ExecutePreparedQuery($sql, $vars)\n\t{\n\t\tif(empty($pdo))\n\t\t{\n\t\t\t$connectDb = \"mysql:host=\" . $dbServer . \";dbname=\" . $dbName;\n\t\t\t$pdo = new pdo($connectDb, $dbUser, $dbPass);\n\t\t\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t}\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$query = $pdo->prepare($sql);\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\techo(\"<b><font color=\\\"red\\\">Error executing sql query:</font><br><br>\");\n\t\t\tprint_r($e->getMessage());\n\t\t\tdie();\n\t\t}\n\t\tif($query)\n\t\t\t$query->execute($vars);\n\t\telse\n\t\t{\n\t\t\tprint_r($pdo->errorInfo);\n\t\t\tdie();\n\t\t}\n\t\t\n\t\ttry\n\t\t{\n\t\t\treturn $query->fetchAll(PDO::FETCH_ASSOC);\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\t// An insert will throw, this is crappy and should probably be handled better\n\t\t\treturn \"\";\n\t\t}\n\t}", "public function PREPARE_STATEMENT($PREPARED_SQL)\r\n {\r\n return $this->statement = $this->Connection->prepare($PREPARED_SQL);\r\n }", "public function Prepare($statement, $driver_options=NULL)\n {\n// $this->Handle->closeCursor();\n\n $this->Handle = parent::prepare($statement,\n array(PDO::ATTR_STATEMENT_CLASS =>\n array('ExDatabaseStatement')));\n\n if (!$this->Handle instanceof PDOStatement) {\n $error_info = parent::errorInfo();\n throw new ExDatabaseException('Could not prepare query: ' . $error_info[2]);\n }\n\n return $this->Handle;\n }", "public function prepare($query)\n\t{\n\t\t$this->myQuery = $query;\n\t\t$result = parent::prepare($query);\n\n\t\tif(!$result)\n\t\t\t$this->throwError('Unable to prepare statement');\n\n\t\treturn $result;\n\t}", "public function prepareExecute($sql, $params = array())\n {\n if ($pdo = $this->getPDO()) {\n if ($statement = $pdo->prepare($sql)) {\n foreach ($params as $key => $value) {\n if (is_array($value)) {\n $statement->bindValue($key, $value[0], $value[1]);\n } else {\n $statement->bindValue($key, $value);\n }\n }\n $statement->execute();\n return $statement;\n }\n }\n return false;\n }", "private function prepare(): self\n\t{\n\t\t// Or 'connection_string', or 'connection': 'connection_string' replaces all data in 'connection'.\n\t\tif (isset($this->config['connection_string']) && $this->config['connection_string'] != '')\n\t\t{\n\t\t\t$this->config['connection'] = $this->parse_connection_string($this->config['connection_string']);\n\t\t}\n\n\t\t$settings = $this->config['settings'];\n\t\t$connection = $this->config['connection'];\n\t\t$driver = $this->config['driver'];\n\n\t\t/**\n\t\t * Settings.\n\t\t */\n\t\t// Authentication status. Default: TRUE.\n\t\tif (isset($settings['auth']) && is_bool($settings['auth']))\n\t\t{\n\t\t\t$this->auth = $settings['auth'];\n\t\t}\n\n\t\t// Debug mode. Default: FALSE.\n\t\tif (isset($settings['debug']) && is_bool($settings['debug']))\n\t\t{\n\t\t\t$this->debug = $settings['debug'];\n\t\t}\n\n\t\t// Returnable type of data, when use get() and similar functions. Default: 'array'.\n\t\tif (isset($settings['return_as']) && is_string($settings['return_as']) && $settings['return_as'] != '')\n\t\t{\n\t\t\t$this->return_as = $settings['return_as'];\n\t\t}\n\n\t\t// Auto query resetting. Default: TRUE.\n\t\tif (isset($settings['auto_reset_query']) && is_bool($settings['auto_reset_query']))\n\t\t{\n\t\t\t$this->auto_reset_query = $settings['auto_reset_query'];\n\t\t}\n\n\t\t/**\n\t\t * Connection.\n\t\t */\n\t\t// Hosts (required).\n\t\tif (isset($connection['host']) && is_array($connection['host']) && !empty($connection['host']))\n\t\t{\n\t\t\t$this->hosts = $connection['host'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error('Connection host is a required parameter. Type it as string or array!');\n\t\t}\n\n\t\t// Ports.\n\t\tif (isset($connection['port']) && is_array($connection['port']) && !empty($connection['port']))\n\t\t{\n\t\t\t$this->ports = $connection['port'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// This parameter can not be empty, because config constructor \n\t\t\t// creates an association between each host and port.\n\t\t}\n\n\t\t// User name.\n\t\tif (isset($connection['user_name']) && is_string($connection['user_name']) && $connection['user_name'] != '')\n\t\t{\n\t\t\t$this->user_name = trim($connection['user_name']);\n\t\t}\n\t\telseif ($this->auth === TRUE)\n\t\t{\n\t\t\t$this->error('User name is a required parameter. Type it!');\n\t\t}\n\n\t\t// User password.\n\t\tif (isset($connection['user_password']) && is_string($connection['user_password']) && $connection['user_password'] != '')\n\t\t{\n\t\t\t$this->user_password = trim($connection['user_password']);\n\t\t}\n\t\telseif ($this->auth === TRUE)\n\t\t{\n\t\t\t$this->error('User password is a required parameter. Type it!');\n\t\t}\n\n\t\t// Database name.\n\t\tif (isset($connection['db_name']) && is_string($connection['db_name']) && $connection['db_name'] != '')\n\t\t{\n\t\t\t$this->db_name = trim($connection['db_name']);\n\t\t}\n\t\telseif ($this->auth === TRUE)\n\t\t{\n\t\t\t$this->error('Database name is a required parameter. Type it!');\n\t\t}\n\n\t\t// Database options.\n\t\tif (isset($connection['db_options']) && is_array($connection['db_options']) && !empty($connection['db_options']))\n\t\t{\n\t\t\t$this->db_options = $connection['db_options'];\n\t\t}\n\n\t\t/**\n\t\t * Driver.\n\t\t */\n\t\tif (is_array($driver) && !empty($driver))\n\t\t{\n\t\t\t$this->driver_options = $driver;\n\t\t}\n\t\n\t\treturn $this;\n\t}", "function pdo_query($pdo, $query)\n{\n $result = $pdo->query($query);\n \n return $result;\n}", "public function query($query){\r\n $args = func_get_args();\r\n array_shift($args); //first element is not an argument but the query itself, should removed\r\n\r\n $reponse = parent::prepare($query);\r\n $reponse->execute($args);\r\n return $reponse;\r\n\r\n }", "public function prepare($query)\n {\n $stmt = new Doctrine_Adapter_Statement_Oracle($this, $query, $this->executeMode);\n\n return $stmt;\n }", "public function prepareStatement($rawSql);", "static public function debugPDO($raw_sql, $parameters) {\n\n $keys = array();\n $values = $parameters;\n\n foreach ($parameters as $key => $value) {\n\n // check if named parameters (':param') or anonymous parameters ('?') are used\n if (is_string($key)) {\n $keys[] = '/' . $key . '/';\n } else {\n $keys[] = '/[?]/';\n }\n\n // bring parameter into human-readable format\n if (is_string($value)) {\n $values[$key] = \"'\" . $value . \"'\";\n } elseif (is_array($value)) {\n $values[$key] = implode(',', $value);\n } elseif (is_null($value)) {\n $values[$key] = 'NULL';\n }\n }\n\n /*\n echo \"<br> [DEBUG] Keys:<pre>\";\n print_r($keys);\n \n echo \"\\n[DEBUG] Values: \";\n print_r($values);\n echo \"</pre>\";\n */\n \n $raw_sql = preg_replace($keys, $values, $raw_sql, 1, $count);\n\n return $raw_sql;\n }", "protected function getOptions(): array\n {\n return [\n \\PDO::ATTR_ERRMODE => \\PDO::ERRMODE_EXCEPTION,\n \\PDO::ATTR_EMULATE_PREPARES => false,\n \\PDO::MYSQL_ATTR_INIT_COMMAND => sprintf(\"SET time_zone = '%s'\", date('P')),\n \\PDO::MYSQL_ATTR_FOUND_ROWS => true,\n ];\n }", "public function prepare($sql)\n {\n try {\n return new Statement($this->pdo->prepare($sql));\n } catch (PDOException $e) {\n throw new Exception\\PDO($e->getMessage(), $e->getCode(), $e);\n }\n }", "public function prepare($statement, array $driver_options = array())\n\t{\n\t\treturn new MyPDOStatement($this, $statement, $driver_options);\n\t}", "public function connect() {\n// Only one init command can be issued (see http://bugs.php.net/bug.php?id=48859)\n $this->_driver_options[\\PDO::MYSQL_ATTR_INIT_COMMAND] = 'set session sql_mode=\"STRICT_ALL_TABLES\"';\n\n parent::connect();\n }", "public function testFetchAllWithParameters()\n {\n $this->mockPdoStatement->shouldReceive('execute')->once()->withNoArgs();\n $this->mockPdoStatement->shouldReceive('setFetchMode')->once()->with('parameters', 'value')->andReturnSelf();\n $this->mockPdoStatement->shouldReceive('fetchAll')->once()->withNoArgs()->andReturn('fetched');\n $this->mockPdo->shouldReceive('prepare')->once()->with('SQL')->andReturn($this->mockPdoStatement);\n\n\n $query = (new Select($this->mockConnection));\n $query->query('SQL', []);\n $this->assertEquals('fetched', $query->fetchAll('parameters', 'value'));\n }", "static public function createPDO(array $config)\n\t{\n\t\t$classname = isset($config['class']) ? $config['class'] : 'PDO';\n\n\t\t$dbh = new $classname($config['dsn'], $config['user'], $config['password'], $config['options']);\n\n\t\tforeach ( $config['attributes'] as $key => $value ) {\n\t\t\t$dbh->setAttribute($key, $value);\n\t\t}\n\n\t\treturn $dbh;\n\t}", "protected static function prepareStatement(PDO $db, $statement) {\n\t\tif(self::isCacheStatements()) {\n\t\t\tif (in_array($statement, array(self::SQL_INSERT, self::SQL_INSERT_AUTOINCREMENT, self::SQL_UPDATE, self::SQL_SELECT_PK, self::SQL_DELETE_PK))) {\n\t\t\t\t$dbInstanceId=spl_object_hash($db);\n\t\t\t\tif (empty(self::$stmts[$statement][$dbInstanceId])) {\n\t\t\t\t\tself::$stmts[$statement][$dbInstanceId]=$db->prepare($statement);\n\t\t\t\t}\n\t\t\t\treturn self::$stmts[$statement][$dbInstanceId];\n\t\t\t}\n\t\t}\n\t\treturn $db->prepare($statement);\n\t}", "protected static function prepareStatement(PDO $db, $statement) {\n\t\tif(self::isCacheStatements()) {\n\t\t\tif (in_array($statement, array(self::SQL_INSERT, self::SQL_INSERT_AUTOINCREMENT, self::SQL_UPDATE, self::SQL_SELECT_PK, self::SQL_DELETE_PK))) {\n\t\t\t\t$dbInstanceId=spl_object_hash($db);\n\t\t\t\tif (empty(self::$stmts[$statement][$dbInstanceId])) {\n\t\t\t\t\tself::$stmts[$statement][$dbInstanceId]=$db->prepare($statement);\n\t\t\t\t}\n\t\t\t\treturn self::$stmts[$statement][$dbInstanceId];\n\t\t\t}\n\t\t}\n\t\treturn $db->prepare($statement);\n\t}", "private static function prepare($sql)\n {\n return self::$instancia->con->prepare($sql);\n }" ]
[ "0.68551886", "0.64356315", "0.60026425", "0.59926766", "0.59843546", "0.59297", "0.59137404", "0.5899574", "0.5803749", "0.5793655", "0.57882404", "0.5778093", "0.574878", "0.57376504", "0.5734955", "0.5726615", "0.5655387", "0.56238925", "0.5612174", "0.5595123", "0.5593096", "0.55866635", "0.5560628", "0.5539752", "0.55396605", "0.55388856", "0.5535658", "0.5513358", "0.55126387", "0.54892087", "0.5475639", "0.54442155", "0.54442155", "0.5442076", "0.54332167", "0.54300725", "0.54220927", "0.54216987", "0.5414915", "0.54056454", "0.53967685", "0.5394228", "0.5375232", "0.5373135", "0.53691345", "0.53685117", "0.5366818", "0.5356416", "0.53528243", "0.5347146", "0.5309947", "0.5299191", "0.52896076", "0.5284554", "0.5268113", "0.5260187", "0.524405", "0.52337736", "0.52281564", "0.5227913", "0.52228147", "0.5218469", "0.52135265", "0.5211657", "0.52005213", "0.5191526", "0.5190263", "0.51873994", "0.5169722", "0.51619595", "0.5158828", "0.5157173", "0.5156324", "0.51531196", "0.5153051", "0.5149736", "0.51387674", "0.51305693", "0.5121813", "0.51199776", "0.51188165", "0.51117915", "0.5104056", "0.5102274", "0.5100673", "0.5082982", "0.50774926", "0.50546634", "0.5054605", "0.50424623", "0.50399643", "0.5034748", "0.50337315", "0.5031496", "0.502095", "0.5019322", "0.5015926", "0.5012414", "0.5011466", "0.5011466", "0.5008692" ]
0.0
-1
Run the database seeds.
public function run() { DB::table('address')->insert([ 'address' => 'Silk St, London EC2Y ,BDS UK', 'city' => 'London', 'contact_no' => '+442076384141', 'created_at'=>\Carbon\Carbon::now() ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Check if there is no user in system before run install
private function checkinstallrequirement() { $userCount = Core_User::getUsers(array(), '', '', '', true); if($userCount > 0) return false; else return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function check_user_installed()\n {\n if ($this->uid == 0) {\n return true;\n }\n\n $exists = $this->STOR->get_folder_id_from_path('waste');\n if (empty($exists)) {\n $this->create_user();\n }\n }", "public static function isInstalled(){\n\t\treturn !empty(\\GO::config()->db_user);\n\t}", "function installCheck() {\n // Check if user table exists for check.\n $result = $this->db->exec('SELECT name FROM sqlite_master WHERE type=\"table\" AND name=\"users\"');\n if (empty($result)) {\n $this->installSetupForm();\n } else {\n echo 'The site has already been installed.';\n }\n }", "public function checkInstall()\n {\n if (($this->get('db') == '' || !file_exists($this->get('db'))) || $this->get('passwd') == '')\n {\n Misc::redirect('install.php');\n }\n }", "protected function checkInstallToolPasswordNotSet() {}", "public function hasInstall();", "public function allow_auto_install()\n\t{\n\t\treturn TRUE;\n\t}", "public function checkCLIuser() {}", "function checkUser(){\n global $OPTION;\n if ('root' == trim(`whoami`)) {\n $OPTION['isRoot'] = true;\n }else{\n echo 'You have to exec command as root, but you loged in as ' . `whoami` . PHP_EOL;\n exit;\n };\n return true;\n}", "protected function outputInstallToolNotEnabledMessageIfNeeded() {}", "protected function outputInstallToolNotEnabledMessageIfNeeded() {}", "protected static function isInstallToolSession() {}", "function is_allowed_to_install() {\n\t\t\treturn ( $this->is_premium() || ! $this->is_org_repo_compliant() );\n\t\t}", "function install_root_user() {\n $fields = array(\n 'username' => $site_config['adminUser'],\n 'password' => $site_config['adminPassword'],\n 'role' => DEFAULT_ADMIN_RID,\n 'email' => $site_config['adminEmail'],\n 'name' => $site_config['adminName'],\n 'language' => Session::get('lang'),\n 'active' => 1\n );\n $new_user = new User();\n if($new_user->create($fields)) {\n return true;\n }\n else {\n System::addMessage('error', rt('The site administrator could not be created. Please verify that your server meets the requirements for the application and that your database user has sufficient permissions ot make changes in the database'));\n }\n}", "function drush_sandwich_make_me_a_sandwich_validate() {\n if (drush_is_windows()) {\n // $name = drush_get_username();\n // TODO: implement check for elevated process using w32api\n // as sudo is not available for Windows\n // http://php.net/manual/en/book.w32api.php\n // http://social.msdn.microsoft.com/Forums/en/clr/thread/0957c58c-b30b-4972-a319-015df11b427d\n }\n else {\n $name = posix_getpwuid(posix_geteuid());\n if ($name['name'] !== 'root') {\n return drush_set_error('MAKE_IT_YOUSELF', dt('What? Make your own sandwich.'));\n }\n }\n}", "public function install()\n {\n // Install default\n if (!parent::install()) {\n return false;\n }\n\n if (!$this->registrationHook()) {\n return false;\n }\n\n if (!Configuration::updateValue('EPUL_USERNAME', '')\n || !Configuration::updateValue('EPUL_PASSWORD', '')\n ) {\n return false;\n }\n\n return true;\n }", "protected function install_mail_user() {\n $this->prompt_info(\"Creating user accounts\", false);\n if ($this->create_system_user($this->MAIL_USER, $this->MAIL_USER_GROUP, null, $this->MAIL_USER_UID)) {\n $this->prompt_done();\n return true;\n } else {\n $this->prompt_last_error();\n }\n }", "function AdminUsers_install()\n\t{\n\t}", "function noUser() {\n\t}", "private function usr(){\r\n\r\n if(defined(\"USER_ID\")){ return true;}else{return false;}\r\n\r\n }", "public static function checkInstall() {\n\t\t\t// TODO: Something awesoem\n\t\t\tif(!file_exists(\"engine/values/mysql.values.php\")){\n\t\t\t\tLayoutManager::redirect(\"INSTALL.php\");\n\t\t\t} else if(file_exists(\"INSTALL.php\")){\n\t\t\t\tFileHandler::delete(\"INSTALL.php\");\n\t\t\t\techo \"<center><img src=\\\"images/warning.png\\\" height=14px border=0/> Please delete 'INSTALL.php'. It's unsafe to have this in the root directory.</center>\";\n\t\t\t} \n\t\t}", "protected function beforeInstall(): bool\n {\n return true;\n }", "public function isValidInstall() {\n\t\treturn $this->install !== null;\n\t}", "public static function installToolEnableFileExists() {}", "public function mustbeuser()\n {\n if (!$this->hasuser())\n {\n $this->web()->noaccess();\n }\n }", "public function isSystemUser(): bool\n {\n return $this->system;\n }", "function is_initial_install() : bool {\n\t// Support for PHPUnit & direct calls to install.php.\n\t// phpcs:ignore -- Ignoring requirement for isset on $_SERVER['PHP_SELF'] and wp_unslash().\n\tif ( php_sapi_name() === 'cli' && basename( $_SERVER['PHP_SELF'] ) === 'install.php' ) {\n\t\treturn true;\n\t}\n\n\tif ( ! defined( 'WP_CLI' ) ) {\n\t\treturn false;\n\t}\n\n\t$runner = WP_CLI::get_runner();\n\n\t// Check it's the core command.\n\tif ( $runner->arguments[0] !== 'core' ) {\n\t\treturn false;\n\t}\n\n\t// If it's the is-installed command and --network is set then\n\t// allow MULTISITE to be defined.\n\tif ( $runner->arguments[1] === 'is-installed' && isset( $runner->assoc_args['network'] ) ) {\n\t\treturn false;\n\t}\n\n\t// Check it's an install related command.\n\t$commands = [ 'is-installed', 'install', 'multisite-install', 'multisite-convert' ];\n\tif ( ! in_array( $runner->arguments[1], $commands, true ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "protected function isInitialInstallationInProgress() {}", "public function needs_installing() {\n\t\t$settings = red_get_options();\n\n\t\tif ( $settings['database'] === '' && $this->get_old_version() === false ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function accountswitcher_is_installed()\n{\n\tglobal $db;\n\n\tif ($db->field_exists(\"as_uid\", \"users\") && $db->field_exists(\"as_canswitch\", \"usergroups\") && $db->field_exists(\"as_limit\", \"usergroups\"))\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "public function isInstalled(){\n return true;\n }", "function psswrdhsh_is_installed()\n{\n\tglobal $db, $settings;\n\n\tif (isset($settings['psswrd_cost'])) {\n\t\treturn true;\n\t}\n\n\tif ($db->field_exists('passwordhash', 'users')) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "public function beforeInstall()\n\t{}", "protected function _initInstallChecker()\r\n\t{\r\n\t\t$config = Tomato_Core_Config::getConfig();\r\n\t\tif (null == $config->install || null == $config->install->date) {\r\n\t\t\theader('Location: install.php');\r\n\t\t\texit;\r\n\t\t}\r\n\t}", "public function check_insta_user() {\n \n }", "function unsinstall()\n\t\t{\n\t\t}", "function requires_login()\n {\n $user = user();\n \n if ( empty( $user ) )\n {\n // no user id found, send to login\n Utility::redirect( Utility::login_url() );\n }\n }", "function havp_check_system() {\n\tglobal $havp_config;\n\n\t/* Check/create user/group accounts */\n\t$grp = exec('/usr/sbin/pw group show ' . HVDEF_GROUP);\n\tif (strpos($grp, HVDEF_GROUP) !== 0) {\n\t\texec('/usr/sbin/pw group add ' . HVDEF_GROUP);\n\t\tlog_error(\"Antivirus: Group '\" . HVDEF_GROUP . \"' was added.\");\n\t}\n\t$usr = exec('/usr/sbin/pw usershow -n ' . HVDEF_USER);\n\tif (strpos($usr, HVDEF_USER) !== 0) {\n\t\texec('/usr/sbin/pw useradd ' . HVDEF_USER . ' -g ' . HVDEF_GROUP . ' -h - -s \"/sbin/nologin\" -d \"/nonexistent\" -c \"havp daemon\"');\n\t\tlog_error(\"Antivirus: User '\" . HVDEF_USER . \"' was added.\");\n\t}\n\n\t/* Workdir permissions */\n\thavp_set_file_access(HVDEF_WORK_DIR, HVDEF_USER, '');\n\n\t/* HAVP tempdir */\n\tif (!file_exists(HVDEF_HAVPTEMP_DIR)) {\n\t\tmwexec(\"/bin/mkdir -p \" . HVDEF_HAVPTEMP_DIR);\n\t}\n\thavp_set_file_access(HVDEF_HAVPTEMP_DIR, HVDEF_USER, '');\n\n\t/* ClamAV dbdir */\n\tif (!file_exists(HVDEF_CLAM_DBDIR)) {\n\t\tmwexec(\"/bin/mkdir -p \" . HVDEF_CLAM_DBDIR);\n\t}\n\thavp_set_file_access(HVDEF_CLAM_DBDIR, HVDEF_AVUSER, '');\n\n\t/* RAM tempdir */\n\tif (!file_exists(HVDEF_RAMTEMP_DIR)) {\n\t\tmwexec(\"/bin/mkdir -p \" . HVDEF_RAMTEMP_DIR);\n\t}\n\thavp_set_file_access(HVDEF_RAMTEMP_DIR, HVDEF_USER, '');\n\n\t/* Template directory and permissions */\n\tif (!file_exists(HVDEF_TEMPLATES_EX)) {\n\t\tmwexec(\"/bin/mkdir -p \" . HVDEF_TEMPLATES_EX);\n\t}\n\thavp_set_file_access(HVDEF_TEMPLATES, HVDEF_USER, '');\n\thavp_set_file_access(HVDEF_TEMPLATES_EX, HVDEF_USER, '');\n\n\t/* HAVP log dir */\n\tif (!file_exists(HVDEF_LOG_DIR)) {\n\t\tmwexec(\"/bin/mkdir -p \" . HVDEF_LOG_DIR);\n\t}\n\thavp_set_file_access(HVDEF_LOG_DIR, HVDEF_USER, '');\n\t/* Create log files if needed */\n\tif (!file_exists(HVDEF_HAVP_ACCESSLOG)) {\n\t\tfile_put_contents(HVDEF_HAVP_ACCESSLOG, '');\n\t}\n\tif (!file_exists(HVDEF_HAVP_ERRORLOG)) {\n\t\tfile_put_contents(HVDEF_HAVP_ERRORLOG, '');\n\t}\n\t/* Log dir permissions */\n\thavp_set_file_access(HVDEF_LOG_DIR, HVDEF_USER, '0764');\n\n\t/* PID file */\n\tif (!file_exists(HVDEF_PID_FILE)) {\n\t\tfile_put_contents(HVDEF_PID_FILE, '');\n\t}\n\thavp_set_file_access(HVDEF_PID_FILE, HVDEF_USER, '0664');\n\n\t/* freshclam config permissions */\n\tif (!file_exists(HVDEF_FRESHCLAM_CONF)) {\n\t\tfile_put_contents(HVDEF_FRESHCLAM_CONF, '');\n\t}\n\thavp_set_file_access(HVDEF_FRESHCLAM_CONF, HVDEF_AVUSER, '0664');\n\n\t/* AV log dir */\n\tif (!file_exists(HVDEF_AVLOG_DIR)) {\n\t\tmwexec(\"mkdir -p \" . HVDEF_AVLOG_DIR);\n\t}\n\thavp_set_file_access(HVDEF_AVLOG_DIR, HVDEF_USER, '');\n\n\t/* Create AV log files if needed */\n\tif (!file_exists(HVDEF_CLAM_LOG)) {\n\t\tfile_put_contents(HVDEF_CLAM_LOG, '');\n\t}\n\tif (!file_exists(HVDEF_FRESHCLAM_LOG)) {\n\t\tfile_put_contents(HVDEF_FRESHCLAM_LOG, '');\n\t}\n\t/* Log dir permissions */\n\thavp_set_file_access(HVDEF_AVLOG_DIR, HVDEF_USER, '0777');\n\n\t/* ClamAV */\n\t/* Directory for pid and socket files */\n\tif (!file_exists(HVDEF_CLAM_RUNDIR)) {\n\t\tmwexec(\"mkdir -p \" . HVDEF_CLAM_RUNDIR);\n\t}\n\thavp_set_file_access(HVDEF_CLAM_RUNDIR, HVDEF_USER, '0774');\n\n\t/* AV update script */\n\tfile_put_contents(HVDEF_AVUPD_SCRIPT, havp_AVupdate_script());\n\thavp_set_file_access(HVDEF_AVUPD_SCRIPT, HVDEF_AVUSER, '0755');\n\n\t/* AV update notification script */\n\t// file_put_contents(HVDEF_ON_AVUPD_SCRIPT, havp_on_avupd_script());\n\t// havp_set_file_access(HVDEF_ON_AVUPD_SCRIPT, HVDEF_AVUSER, '0755');\n\n\t/* Startup scripts (HAVP and clamd) */\n\thavp_startup_script();\n\thv_clamd_startup_script();\n\n\t/* mount RAMDisk */\n\tmountRAMdisk(true);\n}", "function is_installed()\n{\n return has_account() && has_meta();\n}", "public function testInstaller() {\n $this->assertUrl('user/1');\n $this->assertResponse(200);\n // Confirm that we are logged-in after installation.\n $this->assertText($this->rootUser->getUsername());\n\n // @todo hmmm this message is wrong!\n // Verify that the confirmation message appears.\n require_once \\Drupal::root() . '/core/includes/install.inc';\n $this->assertRaw(t('Congratulations, you installed @drupal!', [\n '@drupal' => drupal_install_profile_distribution_name(),\n ]));\n }", "private function checkInstall($install)\n {\n if (F::has('password'))\n {\n if (!$install && empty(F::get('password')))\n {\n F::redirect('/install');\n }\n elseif ($install && !empty(F::get('password')))\n {\n F::redirect('/login');\n }\n }\n }", "function install()\n {\n $query = parent::getList( 'user_name = \\'[email protected]\\'' );\n \n if( $query->num_rows() == 0 )\n {\n $data = array(\n 'user_name' => '[email protected]',\n 'password' => sha1('rkauqkf.'),\n 'role' => 'admin',\n 'is_active' => '1',\n 'd_o_c'=>date(\"Y/m/d\"),\n );\n \n parent::add($data);\n }\n }", "public function isSystem()\n {\n return $this->getAttribute('id') == self::SYSTEM_USER_ID;\n }", "function __checkInstall() {\n\t\t$base = strpos($_SERVER['REQUEST_URI'], Dispatcher::getUrl());\n\t\t$base = substr($_SERVER['REQUEST_URI'], 0, $base);\n\t\tif (!file_exists(APP . 'config/INSTALLED') && !in_array(Dispatcher::getUrl($_SERVER['REQUEST_URI']), array('install', 'install/configure'))) {\n\t\t\theader('Location: '.$base.'install');exit;\n\t\t}\n\t}", "public function preInstall()\n {\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}", "protected function install(){ return true;}", "function check_fresh_install_sc($params) {\n\tif (empty($_SERVER['PEPPER'])) {\n\t\tset_variable('fresh_install', 'yes');\n\t} else {\n\t\tset_variable('fresh_install', 'no');\n\t}\n}", "protected function getExtraInstallment()\n {\n return false;\n }", "public function requireInstallation() {\n return is_object($this->installer);\n }", "public function is_installed() {\n\n }", "public function install(): bool;", "public function install()\n\t{\n\t\treturn true;\n\t}", "public function beforeStartingDeploy()\n {\n $remoteDeployDir = $this->getConfig(Option::deployDir);\n $this->runRemote(sprintf('sudo chown -R '.getenv('CI_TARGET_USER').':'.getenv('CI_TARGET_USER').' '.$remoteDeployDir.' 2&1>/dev/null'));\n }", "function wp_install_defaults($user_id)\n {\n }", "public function install(){\n\n return true;\n\n }", "function system_is_uname_registerd($uname)\n{\n\treturn(0);\n}", "public function onInstall() {\n\t\tglobal $conf;\n\n\t\treturn true;\n\n\t}", "function wp_installing($is_installing = \\null)\n {\n }", "protected function isInstalled(){\n\t\t$dsn = Configuration::get('dsn', '');\n\t\t//echo \"dsn = \" . $dsn . \"--\";\n\t\tif ($dsn == ''){\n\t\t\t$alreadyInstalled = false;\n\t\t}\n\t\telse{\n\t\t\t$alreadyInstalled = true;\n\t\t}\n\t\treturn $alreadyInstalled;\n\t}", "public function hasUninstall();", "protected function isFirstTimeSetup() {\n // If there are any auth providers, this isn't first time setup, even if\n // we don't have accounts.\n if (PhabricatorAuthProvider::getAllEnabledProviders()) {\n return false;\n }\n\n // Otherwise, check if there are any user accounts. If not, we're in first\n // time setup.\n $any_users = id(new PhabricatorPeopleQuery())\n ->setViewer(PhabricatorUser::getOmnipotentUser())\n ->setLimit(1)\n ->execute();\n\n return !$any_users;\n }", "public function isSystemCall() {\n\t\treturn !( $this->user instanceof User );\n\t}", "function check_capabilities() {\n\n\t\tif ( ! current_user_can( 'install_plugins' ) ) {\n\t\t\treturn;\n\t\t\t// TODO: Error message\n\t\t}\n\n\t}", "public function createUserFromRemote() {\n\t\treturn false;\n\t}", "public function isInstalled(){\n if(self::$isInstalled === true){\n return true; \n }\n \n exec('type diatheke', $output, $returnVal);\n if($returnVal === 0){\n self::$isInstalled = true;\n return true;\n }else{\n return false;\n }\n \n }", "function check_requirements()\n\t{\n\t\t$sql_obj\t\t= New sql_query;\n\t\t$sql_obj->string\t= \"SELECT id FROM users WHERE id='\". $this->id .\"'\";\n\t\t$sql_obj->execute();\n\n\t\tif (!$sql_obj->num_rows())\n\t\t{\n\t\t\tlog_write(\"error\", \"page_output\", \"The requested user (\". $this->id .\") does not exist - possibly the user has been deleted.\");\n\t\t\treturn 0;\n\t\t}\n\n\t\tunset($sql_obj);\n\n\n\t\treturn 1;\n\t}", "public static function is_needed() {\n\t\treturn is_admin() || wp_doing_cron();\n\t}", "protected function beforeUninstall(): bool\n {\n return true;\n }", "function getUser() {\r\n\t\treturn false;\r\n\t}", "public static function isInstallToolEnableFilePermanent() {}", "public function install()\n {\n // initialisation successful\n return true;\n }", "public function missing_user_errors()\n {\n $cmd = $this->artisan('user:password testuser --password=testing');\n $cmd->assertExitCode(1);\n }", "function verify_username_availability($userName){\n $exists = false;\n if(get_user($userName)){\n $exists = true;\n }\n return $exists;\n}", "function is_system_configured() {\n global $CFG;\n return (!empty($CFG->ombielalertsserverendpoint) && \n !empty($CFG->ombielalertsserversserverusername) && \n !empty($CFG->ombielalertsserverpassword) && \n !empty($CFG->ombielalertsorgcode) && \n !empty($CFG->ombielalertsorgpassword)\n );\n }", "public function checkInstalled() {\n $query = $this->db->query(sprintf('SHOW TABLES LIKE \"%s\"',\n Config::getTableName('requests')));\n $request_table_result = $query->rowCount();\n\n $query = $this->db->query(sprintf('SHOW TABLES LIKE \"%s\"',\n Config::getTableName('users')));\n $user_table_result = $query->rowCount();\n\n if ($request_table_result > 0 || $user_table_result > 0) {\n return true;\n } else {\n return false;\n }\n }", "protected function isPowerUser()\n {\n return $this->user->can('sys_properties_edit', $this->app->modules[$this->area]);\n }", "private function check_if_user_is_admin()\n {\n $user = wp_get_current_user();\n $tasks_performer = new TasksPerformer;\n if (!$tasks_performer->is_mtii_admin()) {\n exit(\"Woof Woof Woof\");\n }\n }", "public function isAlreadyInstalled() {\n\t\t// is not a unique package and can be\n\t\t// installed as many times as you want\n\t\tif ($this->packageInfo['isUnique'] == 0) {\n\t\t\treturn false;\n\t\t}\n\t\t// this package may only be installed\n\t\t// once (e. g. library package)\n\t\telse {\n\t\t\treturn (count($this->getDuplicates()) != 0);\n\t\t}\n\t}", "private function is_automatic_install( &$dependency ) {\n\t\t$is_required = $this->is_required( $dependency );\n\t\treturn ! $is_required || ( $is_required && ! self::$automatic_install_required );\n\t}", "private function isInstalled()\n\t{\n\t\tif(file_exists(ITEMDATA) && file_exists(IM_DATABASE_DIR.IM_DATABASE)){return true;}\n\t\telse return false;\n\t}", "function exportUserCount()\n {\n //pretend there are 0 users on the local install that were not found on the bridge.\n return 0;\n }", "public static function userCreationAllowed(): bool\n {\n return self::isConfigured(self::ACTION_ADD_USER);\n }", "private function checkCurrentUser(){\n return isset($_SESSION['user']);\n }", "public static function checkInstallToolEnableFile() {}", "protected function checkOperationality()\n {\n if (!function_exists('exec')) {\n throw new SystemRequirementsNotMetException('exec() is not enabled.');\n }\n }", "function isGuestLoginAvailable()\n{\n\treturn false;\n}", "function wp_not_installed()\n {\n }", "function randomUser_exists()\t{\n\t\treturn $this->recordNumber(self::RNDUSERSC_NAME) > 0;\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 }", "function cj_authorship_check()\n{\n if (get_site_option(CJ_AUTHORSHIP_VERSION_OPTION) != \\CJ_Authorship\\CJ_Authorship_Handler::VERSION) {\n cj_authorship_install();\n }\n}", "private function notExist() : void\n {\n if(!$this->user)\n {\n (new Session())->set('user','error','Désolé une erreur est survenue');\n header('Location:' . self::REDIRECT_HOME);\n die();\n }\n }", "function isPartOfMinimalUsableSystem() ;", "function ensure_portal() {\n\t\treturn $this->portal_login($_SESSION['user_name'], $_SESSION['user_hash']);\n\t}", "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 install()\n {\n if (!parent::install()\n || !$this->registerHook('displayBackOfficeHeader')\n || !$this->installModuleTab('onehopsmsservice', array(\n 1 => 'Onehop SMS Services'\n ), 0)\n || !$this->installDB()\n || !$this->registerHook('orderConfirmation')\n || !$this->registerHook('postUpdateOrderStatus')\n || !$this->registerHook('actionUpdateQuantity')\n || !$this->registerHook('actionObjectProductUpdateAfter')) {\n return false;\n }\n return true;\n }", "function install_roles() {\n $db = DB::getInstance();\n if(!$db->query(file_get_contents(CORE_INSTALLER_FILES_PATH.'/db/roles.sql'))->error()) {\n return true;\n }\n else {\n System::addMessage('error', rt('An error occurred during the creation of the default user roles'));\n }\n return false;\n}", "function crepInstallation() {\r\n\t// Check to see if it has already been installed\r\n\tif(get_option('crep-installed') != '1') {\r\n\t\tcrepInsertDefaultOptions();\r\n\t}\r\n}", "public function effectively_installed()\n {\n return isset($this->config['oxcom_phpbbch_format_only']);\n }", "public static function isInstalled (\n\t)\t\t\t// <bool> TRUE if successfully installed, FALSE if not.\n\t\n\t// $plugin->isInstalled();\n\t{\n\t\t// Make sure the newly installed tables exist\n\t\t$pass1 = DatabaseAdmin::columnsExist(\"users\", array(\"uni_id\", \"email\", \"password\", \"referred_by\"));\n\t\t$pass2 = DatabaseAdmin::columnsExist(\"invitation_codes\", array(\"uni_id\", \"invite_code\"));\n\t\t\n\t\treturn ($pass1 and $pass2);\n\t}" ]
[ "0.7581932", "0.715836", "0.7073247", "0.6882467", "0.6655213", "0.66145295", "0.64996564", "0.6467071", "0.6458869", "0.6385002", "0.63844544", "0.6367339", "0.63509744", "0.6332938", "0.6308024", "0.6225235", "0.62100196", "0.6204143", "0.6195796", "0.61802447", "0.61358196", "0.6118471", "0.6116351", "0.6080407", "0.60665", "0.60573834", "0.6051998", "0.6040345", "0.6011086", "0.60069716", "0.60008633", "0.59964114", "0.5989849", "0.5937066", "0.5888508", "0.58857346", "0.5854934", "0.5851408", "0.58461624", "0.5832985", "0.5803581", "0.5757004", "0.5755894", "0.574198", "0.5739816", "0.57330936", "0.5725618", "0.5724474", "0.56883436", "0.56838506", "0.56816596", "0.5671398", "0.56448126", "0.56268823", "0.56103754", "0.55994225", "0.55966467", "0.5592797", "0.55759674", "0.55755055", "0.5566759", "0.55576855", "0.5548991", "0.55476546", "0.553917", "0.55356205", "0.55355465", "0.5530819", "0.5528008", "0.5511645", "0.550986", "0.54832214", "0.54829174", "0.5468136", "0.5463711", "0.5459666", "0.54499805", "0.5447732", "0.5443696", "0.5441848", "0.5432941", "0.54325604", "0.5431985", "0.5423278", "0.5421081", "0.54097927", "0.54071945", "0.539652", "0.5395811", "0.53899604", "0.53892237", "0.5384811", "0.53792566", "0.53615403", "0.5361384", "0.53459334", "0.5343074", "0.533989", "0.5336514", "0.5330926" ]
0.76897407
0
Run the database seeds.
public function run() { //roles $rol_admin = Role::create([ 'name' => 'ROOT' ]); Role::create([ 'name' => 'OPER' ]); Role::create([ 'name' => 'TEACHER' ]); //admin user factory(\App\User::class)->create([ 'name' => 'admin', 'email' => '[email protected]', 'password' => bcrypt('admin'), 'id_role' => 1 ]); //docentes factory(\App\User::class, 30)->create(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
returnAbsoluteRouteString() need constValuse WROOT
static function convertStringToLinuxOrWindow_Route($str){ $route=''; if(preg_match("[/]",$str)&&(DS!='/')){ //DS是当前系统的斜杠形式 $array=explode('/',$str); $route=Tool::convertArray($array); return $route; }else if(preg_match("[\]",$str)&&(DS!='\\')){ $array=explode('\\',$str); $route=Tool::convertArray($array); return $route; }else{ return $str; } return 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRouteRootDir(): string;", "public function getFullRoute();", "public function getBaseRouteName(): string;", "function route_uri(): string\n{\n return RouteController::getCurrentRoute()['uri'] ?? '';\n}", "private function getRoute(){\n\t}", "function getCurrentUrlFromRoutes()\n {\n $input = &SGL_Registry::singleton();\n $url = $input->getCurrentUrl();\n $currUrl = $url->toString();\n $baseUrl = $url->getBaseUrl($skipProto = false, $includeFc = false);\n return str_replace($baseUrl, '', $currUrl);\n }", "public function getBaseRoutePattern(): string;", "public function getApiRoute(): string;", "function getRoute()\n{\n\t// Get the requested uri from the server exluding the domain name.\n\t$uri = strtok($_SERVER['REQUEST_URI'], '?');\n\n\t// Remove the site path from the uri so we only get the segments\n\t// that we actually want.\n\t$uri = str_replace(SITE_PATH, '', $uri);\n\n\treturn $uri;\n}", "abstract public function getRoute();", "public function getWebRoute(): string;", "protected function getRoutingPath()\n {\n $query = str_replace('/', '\\\\/', $_SERVER['QUERY_STRING']);\n $uri = preg_replace('/\\?/', '&', $_SERVER['REQUEST_URI'], 1);\n $result = preg_replace('/'.$query.'$|index.php$|&$/', '', $uri);\n return preg_replace('/\\/$/', '', $result);\n }", "public function path(): string\n {\n return str_replace('?', '', \"/{$this->route->uri()}\");\n }", "function getRouteName();", "protected function route_base() {\n\t\treturn substr( strrchr( get_class( $this ), '\\\\' ), 1 );\n\t}", "protected static function _getURI(){\n $root = str_replace('\\\\', '/', self::$_config['root']);\n $uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n $uri = $_SERVER['DOCUMENT_ROOT'].$uri;\n $uri = str_replace($root, '', $uri);\n \n return $uri;\n }", "abstract public function routeName();", "public function fullPath(){\n\t $this->path = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\treturn $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n }", "function url_for($script_path){\n\nif($script_path[0] != '/'){\n \n $script_path = \"/\" . $script_path;\n}\n\n//echo WWW_ROOT .$script_path;\n\n\nreturn WWW_ROOT . $script_path;\n\n}", "function rpath($a) {\n return str_replace(_X_ROOT, '', $a);\n }", "public function getRoutePath($onlyStaticPart = false);", "public function getRoute();", "function qa_path_to_root()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\tglobal $qa_root_url_relative;\n\treturn $qa_root_url_relative;\n}", "public function getPartialRootPath() {}", "function getAbsolutePath() ;", "protected function getRoute ($route = null)\n {\n $route_requested = $this->replaceDirectorySeparator($route);\n $route_absolute = $this->replaceDirectorySeparator(realpath($this->absolute));\n\n // If it is absolute route\n if (!preg_match(\"/^\\/{2}/\", $route_requested))\n $route_requested = preg_replace(\"/^\\/(.+)/\", $route_absolute . \"/$1\", $route_requested);\n\n // Remove last slash `/`\n $route_requested = preg_replace(\"/(.+)\\/$/\", \"$1\", $route_requested);\n\n // Return to system slash `DIRECTORY_SEPARATOR`\n $route_requested = $this->replaceDirectorySeparator($route_requested, DIRECTORY_SEPARATOR);\n\n // Return\n return $route_requested;\n }", "public function getAbsolutePath() {}", "public function getAbsolutePath() {}", "public function getUrlString() {\n $urlRequest = Mage::app()->getFrontController()->getRequest();\n $requestUri = $urlRequest->getServer('REQUEST_URI');\n if (strpos($requestUri, 'index.php') !== FALSE) {\n if (is_null($urlRequest->getServer('ORIG_PATH_INFO'))) {\n return ltrim($urlRequest->getServer('PATH_INFO'), '/');\n } else {\n return ltrim($urlRequest->getServer('ORIG_PATH_INFO'), '/');\n }\n } else {\n return ltrim($requestUri, '/');\n }\n }", "public function getConsoleRoute(): string;", "function getRootURI() {\n\t\treturn (implode('/', array_splice(explode('/', $_SERVER['SCRIPT_NAME']), 0, -1)) . '/');\n\t}", "function oz_get_resource_path ()\r\n{\r\n\t//Defaults to \"./res/\" URI path relative to the current url.\r\n\t//This may be changed to point to some other folders in case Apache mod_rewrite or\r\n\t//SEO friendly urls are used and the \"./res/\" path doesn't point to correct location.\r\n\treturn $_REQUEST['oz_res_uri'];\r\n}", "abstract public function getRoutePrefix();", "public function BasicRouting() {\n return \"<h1>HI RTC</h1>\";\n }", "public function redirectPath()\n {\n return route(home_route());\n }", "private function getURI()\r\n {\r\n\r\n if (!empty($_SERVER['REQUEST_URI'])) {\r\n $this->uri = str_replace('Hakaton/', '', $_SERVER['REQUEST_URI']);\r\n $this->uri = trim($this->uri, '/');\r\n return $this->uri;\r\n }\r\n }", "public function getAbsolutePath();", "final static function getRoute($route, array $args = NULL) {\n $abs_route = root . '/' . $route;\n if (isset($args)) {\n $abs_route .= '/' . implode('/', $args);\n }\n return $abs_route;\n }", "public function getUri($route = '') {\r\n\t\treturn $this->baseUrl.(($this->lang == $this->defLang) ? '' : ($this->lang.'/')).ltrim($route, '/');\r\n\t}", "public static function route($param = '')\n {\n return static::$URL.$param;\n }", "private function getURI(): string\n {\n if (!empty($_SERVER['REQUEST_URI'])) {\n return trim($_SERVER['REQUEST_URI'], '/');\n }\n }", "public function getRoute()\n {\n }", "public function getRoute(): string\n {\n return (string) $this->route;\n }", "function getCurrentRoute() {\n $santitizedUrl = ''; \n if (!empty($_GET['route'])) {\n $santitizedUrl = trim($_GET['route']);\n }\n \n return $this->getMatchingRoute($santitizedUrl);\n }", "public function getRouteName();", "static function obtenerUrlActual() {\n $url = Util::crearUrl($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);\n return $url;\n }", "private function getURI() : string\n {\n if (!empty($_SERVER['REQUEST_URI'])){\n return trim($_SERVER['REQUEST_URI'], '/');\n }\n }", "public function getAbsolutePath()\n {\n }", "public function getAbsolutePath()\n {\n $url = $this->http_path;\n $uri = $this->getUri();\n\n if( $uri !== 'index' )\n {\n if( substr( $url, -1 ) !== '/' ) {\n $url .= '/' . $uri;\n } else {\n $url .= $uri;\n }\n }\n\n return $url;\n }", "function root_relative_url($input) {\n preg_match('|https?://([^/]+)(/.*)|i', $input, $matches);\n if (!isset($matches[1]) || !isset($matches[2])) {\n return $input;\n } elseif (($matches[1] === $_SERVER['SERVER_NAME']) || $matches[1] === $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT']) {\n return wp_make_link_relative($input);\n } else {\n return $input;\n }\n}", "public function getFrontPath()\n {\n // we use trim() instead of empty() on string elements\n // to allow for string-zero values.\n return (empty($this->path) ? '' : $this->_pathEncode($this->path))\n . (trim($this->format) === '' ? '' : '.' . urlencode($this->format));\n }", "protected function getResourcePath()\n {\n return preg_replace('/\\?.*$/', '?kizilare_debug=1&res=', $_SERVER['REQUEST_URI']);\n }", "public function getRoute() : string\n {\n return $this->route;\n }", "public function buildFrontendUri() {}", "public function getRouteDisplay() {\n\t\treturn \"/display\";\n\t}", "abstract protected function getListRoute() : string;", "public static function getRouteAlias() {\n return implode('/', self::getRouteFragments());\n }", "public function get_route()\n {\n }", "protected abstract function getAbsolutePath(): string;", "public function getFullPath();", "function route_pattern(): string\n{\n return RouteController::getCurrentRoute()['pattern'] ?? '';\n}", "function current_route_uri()\n {\n return RouteController::getCurrentRoute()['uri'] ?? '';\n }", "function route_class()\n{\n return str_replace('.', '-', Route::currentRouteName());\n}", "static function getSsoUrlRoot(){\n $url = '';\n if( \\Audit::instance()->url(self::getEnvironmentData('CCP_SSO_URL')) ){\n $url = self::getEnvironmentData('CCP_SSO_URL');\n }else{\n $error = sprintf(self::ERROR_CCP_SSO_URL, __METHOD__);\n self::getSSOLogger()->write($error);\n \\Base::instance()->error(502, $error);\n }\n\n return $url;\n }", "private function _getContentURI(){\r\n $uri = substr($_SERVER['REQUEST_URI'], strlen(WEBROOT));\r\n if (strstr($uri, '?')) $uri = substr($uri, 0, strpos($uri, '?'));\r\n $uri = str_replace('index.php', '', $uri);\r\n $uri = trim($uri, '/');\r\n\r\n if($uri == ''){\r\n $uri = 'index';\r\n }\r\n\r\n return $uri;\r\n }", "private function getURI()\n {\n if (!empty($_SERVER['REQUEST_URI'])) {\n return trim($_SERVER['REQUEST_URI'], '/');\n }\n }", "public function GetAbsolute ();", "public function getCurrentRoute()\n {\n return substr(\n $_SERVER['REQUEST_URI'],\n (strlen($this->config->get('site.dir')) - 1)\n );\n }", "public function getPathFormat()\n\t{\n\t\tif ( $this->_pathFormat === null )\n\t\t{\n\t\t\t$routeParams= array();\n\t\t\tforeach( $this->params as $key=>$attribute )\n\t\t\t{\n\t\t\t\t$routeParams[ $key ] = $this->formatParam( $attribute );\n\t\t\t}\n\t\t\t\n\t\t\t$this->_pathFormat = Yii::app()->createAbsoluteUrl($this->route, $routeParams);\n\t\t\t\n\t\t\t// NOTE +++++++++++++\n\t\t\t// When unit testing, if you don't have a SERVER_NAME defined, the\n\t\t\t// absolute url will fail, so toggle this on instead if including that test\n\t\t\t//$this->_pathFormat = Yii::app()->createUrl($this->route, $routeParams);\t\t\t\n\t\t}\n\t\treturn $this->_pathFormat;\n\t}", "public function getRouteName()\n {\n $routeName = $this->getConfiguredRouteName();\n\n return trim($routeName, '/') . '/';\n }", "function getAbsolutePath() {\n return 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . \"{$_SERVER['HTTP_HOST']}/\";\n}", "function url($path){\n global $app;\n return $app->request->getRootUri() . '/' . trim($path,'/');\n}", "public function getWebPathname();", "function url_for($script_path){\n\n if ($script_path[0] != '/') {\n $script_path = '/' . $script_path;\n }\n \n return WWW_ROOT . $script_path;\n \n}", "private function getURI()\r\n {\r\n return trim($_SERVER['REQUEST_URI'], '/') ?? '';\r\n }", "public function getFullPath() {\n\n // check if this document is also the site root, if so return /\n try {\n if(Site::isSiteRequest()) {\n $site = Site::getCurrentSite();\n if ($site instanceof Site) {\n if ($site->getRootDocument()->getId() == $this->getId()) {\n return \"/\";\n }\n }\n }\n } catch (\\Exception $e) {\n \\Logger::error($e);\n }\n\n // @TODO please forgive me, this is the dirtiest hack I've ever made :(\n // if you got confused by this functionality drop me a line and I'll buy you some beers :)\n\n // this is for the case that a link points to a document outside of the current site\n // in this case we look for a hardlink in the current site which points to the current document\n // why this could happen: we have 2 sites, in one site there's a hardlink to the other site and on a page inside\n // the hardlink there are snippets embedded and this snippets have links pointing to a document which is also\n // inside the hardlink scope, but this is an ID link, so we cannot rewrite the link the usual way because in the\n // snippet / link we don't know anymore that whe a inside a hardlink wrapped document\n if(!\\Pimcore::inAdmin() && Site::isSiteRequest() && !FrontendTool::isDocumentInCurrentSite($this)) {\n\n $documentService = new Document\\Service();\n $parent = $this;\n while($parent) {\n if($hardlinkId = $documentService->getDocumentIdFromHardlinkInSameSite(Site::getCurrentSite(), $parent)) {\n $hardlink = Document::getById($hardlinkId);\n if(FrontendTool::isDocumentInCurrentSite($hardlink)) {\n\n $siteRootPath = Site::getCurrentSite()->getRootPath();\n $siteRootPath = preg_quote($siteRootPath);\n $hardlinkPath = preg_replace(\"@^\" . $siteRootPath . \"@\", \"\", $hardlink->getRealFullPath());\n\n return preg_replace(\"@^\" . preg_quote($parent->getRealFullPath()) . \"@\", $hardlinkPath, $this->getRealFullPath());\n break;\n }\n }\n $parent = $parent->getParent();\n }\n\n $config = \\Pimcore\\Config::getSystemConfig();\n $front = \\Zend_Controller_Front::getInstance();\n $scheme = ($front->getRequest()->isSecure() ? \"https\" : \"http\") . \"://\";\n if($site = FrontendTool::getSiteForDocument($this)) {\n if($site->getMainDomain()) {\n // check if current document is the root of the different site, if so, preg_replace below doesn't work, so just return /\n if ($site->getRootDocument()->getId() == $this->getId()) {\n return $scheme . $site->getMainDomain() . \"/\";\n }\n return $scheme . $site->getMainDomain() . preg_replace(\"@^\" . $site->getRootPath() . \"/@\", \"/\", $this->getRealFullPath());\n }\n }\n\n if ($config->general->domain) {\n return $scheme . $config->general->domain . $this->getRealFullPath();\n }\n }\n\n $path = $this->getPath() . $this->getKey();\n return $path;\n }", "function get_root_url() {\n return \"http://\" . $_SERVER['HTTP_HOST'] . '/' . ROOT_PATH;\n }", "public function fullUri()\n\t{\n\t\treturn $_SERVER['REQUEST_URI'] ? $_SERVER['REQUEST_URI'] : '/';\n\t}", "public function getURI()\t{\n\t\treturn $this->route;\n\t}", "public function toAbsolutePath () {\n return new S (DOCUMENT_ROOT . str_replace (DOCUMENT_ROOT, _NONE, $this->varContainer));\n }", "public function routePath(string $value) {\n if (null !== ($generatedPath = $this->routingHelper->getPath($value))) {\n return $generatedPath;\n }\n\n return \"\";\n }", "static function getURI() {\n return '/';\n }", "function getRootUrl($urlString){\n if( strstr($urlString,'mylsRetail') ){\n $inner = strstr($urlString,'mylsRetail');\n $newString = strstr($inner,'/');\n } else{\n $newString = $urlString;\n }\n if(strpos($newString,'/',+1)){\n return substr($newString,0,strpos($newString,'/',+1));\n }\n return $newString;\n }", "function rootSite() {\n // $dirname = preg_replace('/\\\\\\+/', '/', dirname(realpath($uri)));\n $dirname = preg_replace('/\\\\\\+/', '/', dirname($_SERVER['PHP_SELF']));\n if (substr($dirname, -1) == \"/\")\n $dirname = substr($dirname, 0, strlen($dirname) - 1); // remove / if it is there to be consistent for URL\n return $dirname;\n }", "public static function route($param)\n\t{\n\t\treturn static::$URL.$param;\n\t}", "public static function route();", "private static function getURI()\n {\n $uri = $_SERVER['REQUEST_URI']; // get URI\n\n $uri = str_replace('../', '', $uri); // security reasons\n\n if (substr($uri, strlen($uri)-1,1)=='/') // strip ending '/'\n $uri = substr($uri, 0, strlen($uri)-1);\n\n if ($uri=='') // if it's index page\n $uri = '/index';\n\n return $uri;\n }", "private function getURI()\n {\n\n if (!empty($_SERVER['REQUEST_URI'])) {\n\n $routeRule = trim($_SERVER['REQUEST_URI'], '/');\n\n // Get part of uri without GET request if it exist (ignore GET)\n if (preg_match('/\\?/', $routeRule)) {\n // get rule for router which based on request uri\n $routeRule = explode('?', $routeRule);\n $routeRule = array_shift($routeRule);\n // normalize route rule\n $routeRule = trim($routeRule, '/');\n }\n return $routeRule;\n }\n }", "public function get_matched_route()\n {\n }", "function formatCurrentUrl() ;", "function getContextPath() {\r\n\t$url = $_SERVER['REQUEST_URI']; // \"/myfolder/sub1/page.php\"\r\n\t$url = substr($url, 0, strpos($url, \".php\", 0) );\r\n\treturn substr($url, 0, strrpos($url, \"/\", 0)); // \"/myfolder/sub1\"\r\n}", "public function getFoundPath() {}", "function _url($path){\n echo getFullUrl($path);\n}", "public function getSystemRoutes();", "function url($location) {\n\techo getAbsolutePath() . $location;\n}", "static function base()\n {\n return trim(App::router()->getBase(), '/');\n }", "function ngwp_get_localized_template_directory_uri()\n\t{\n\t\t$siteurl = get_option('siteurl');\n\t\t$templateurl = get_template_directory_uri();\n\t\treturn site_url() . substr($templateurl, strpos($templateurl, $siteurl) + strlen($siteurl));\n\t}", "function getGameURL()\n{\n\tif(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') \n\t\t$link = \"https\"; \n\telse\n\t\t$link = \"http\"; \n\n\t$link .= \"://\"; \n\n\t// Append the host to URL\n\t$link .= $_SERVER['HTTP_HOST']; \n\t\n\t// Append the folder structure to URL\n\t$link .= $_SERVER['REQUEST_URI']; \n\t\t\n\t// Remove \"host\" subfolder\n\t$folder_name = \"host\";\n\t$link = substr_replace($link ,\"\", (strlen($folder_name) + 1) * -1);\n\treturn $link; \n}", "public static function getURI()\n {\n\t\tif(isset($_SERVER['PATH_INFO']))\n {\n\t\t\t$_path_info = $_SERVER['PATH_INFO'];\n\n\t\t}\n elseif(isset($_SERVER['ORIG_PATH_INFO']))\n {\n\t\t\t$_path_info = $_SERVER['ORIG_PATH_INFO'];\n \t\t}\n else\n {\n\t\t\t$_path_info = $_SERVER['REQUEST_URI'];\n\t\t}\n\n\t\tif (substr($_path_info, 0, strlen(_app_path)) == _app_path) {\n \t\t\t$_path_info = substr($_path_info, strlen(_app_path));\n\t\t}\n\n if(substr($_path_info,0,9) == \"index.php\")\n {\n $_path_info = ltrim($_path_info, \"index.php\"); // index.php might be there, drop that too\n }\n\n\t\t$uri = (!isset($_path_info) || $_path_info == \"\" || $_path_info == \"public\") ? \"\" : ltrim($_path_info,\"/\");\n\t\treturn $uri;\n\n // depending on server configuration, you might need to do this instead\n // $_path_info = preg_split(\"/\\?|\\&/\",$_path_info); // check for ? or & in url\n // return (!isset($_path_info[0]) || $_path_info[0] == \"\") ? \"\" : ltrim($_path_info[0],\"/\");\n }", "function url_to_absolute($url) {\n\treturn str_replace(__CHV_BASE_URL__, __CHV_ROOT_DIR__, $url);\n}" ]
[ "0.7007699", "0.6855958", "0.6532399", "0.6509346", "0.64936024", "0.63947684", "0.63732266", "0.6317642", "0.62871677", "0.6281022", "0.62451243", "0.62363774", "0.62305754", "0.6173212", "0.6155162", "0.6149151", "0.6096062", "0.6095663", "0.6093593", "0.6082234", "0.60725415", "0.6053942", "0.6045", "0.6025269", "0.60141397", "0.6010954", "0.5983571", "0.5983571", "0.5957252", "0.59490675", "0.5946924", "0.59458655", "0.59457314", "0.5940134", "0.5940051", "0.5924672", "0.5915282", "0.5915055", "0.5913728", "0.590146", "0.59004956", "0.5894979", "0.5891141", "0.5888987", "0.5880953", "0.5873526", "0.5872676", "0.58541465", "0.58491296", "0.5846753", "0.5839562", "0.5834815", "0.58305126", "0.58148545", "0.5814283", "0.5811018", "0.57997584", "0.5798331", "0.57945037", "0.57883984", "0.5786226", "0.5782012", "0.5773243", "0.57682204", "0.5755707", "0.57539606", "0.5750702", "0.574949", "0.5732284", "0.57198596", "0.5716866", "0.57111835", "0.57098836", "0.5708999", "0.5707465", "0.5705025", "0.5704275", "0.57040995", "0.5700167", "0.5698077", "0.56890064", "0.56794995", "0.56767035", "0.56697434", "0.5668452", "0.5660204", "0.5659566", "0.56574816", "0.5649801", "0.56486624", "0.5642845", "0.5640771", "0.5639894", "0.56368995", "0.56280184", "0.5625572", "0.56238145", "0.5620629", "0.56194234", "0.56184065" ]
0.5722843
69